Commit 54565a94 authored by Bhushan Shah's avatar Bhushan Shah 📱

[platforms/hwcomposer] Few fixes for hwcomposer platforms

Summary:
- Actually use double layered compositing, previously both layers were
of type HWC_FRAMEBUFFER, instead of 2nd layer being
HWC_FRAMEBUFFER_TARGET. Thanks to @NotKit on telegram for pointing this
out.

- Use sourceCropf instead of sourceCrop, as sourceCrop is legacy option.

Test Plan: have to test on actual device, but test_hwcomposer does have similar code.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8587
parent 7739dea3
......@@ -394,16 +394,23 @@ void HwcomposerBackend::wakeVSync()
m_vsyncMutex.unlock();
}
static void initLayer(hwc_layer_1_t *layer, const hwc_rect_t &rect)
static void initLayer(hwc_layer_1_t *layer, const hwc_rect_t &rect, int layerCompositionType)
{
memset(layer, 0, sizeof(hwc_layer_1_t));
layer->compositionType = HWC_FRAMEBUFFER;
layer->compositionType = layerCompositionType;
layer->hints = 0;
layer->flags = 0;
layer->handle = 0;
layer->transform = 0;
layer->blending = HWC_BLENDING_NONE;
#ifdef HWC_DEVICE_API_VERSION_1_3
layer->sourceCropf.top = 0.0f;
layer->sourceCropf.left = 0.0f;
layer->sourceCropf.bottom = (float) rect.bottom;
layer->sourceCropf.right = (float) rect.right;
#else
layer->sourceCrop = rect;
#endif
layer->displayFrame = rect;
layer->visibleRegionScreen.numRects = 1;
layer->visibleRegionScreen.rects = &layer->displayFrame;
......@@ -434,8 +441,8 @@ HwcomposerWindow::HwcomposerWindow(HwcomposerBackend *backend)
m_backend->size().width(),
m_backend->size().height()
};
initLayer(&list->hwLayers[0], rect);
initLayer(&list->hwLayers[1], rect);
initLayer(&list->hwLayers[0], rect, HWC_FRAMEBUFFER);
initLayer(&list->hwLayers[1], rect, HWC_FRAMEBUFFER_TARGET);
list->retireFenceFd = -1;
list->flags = HWC_GEOMETRY_CHANGED;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment