Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/hwcomposer/hwcomposer_backend.cpp b/hwcomposer/hwcomposer_backend.cpp
- index 3b7864a..b46f418 100644
- --- a/hwcomposer/hwcomposer_backend.cpp
- +++ b/hwcomposer/hwcomposer_backend.cpp
- @@ -64,9 +64,8 @@ HwComposerBackend::create()
- // Some implementations insist on having the framebuffer module opened before loading
- // the hardware composer one. Therefor we rely on using the fbdev HYBRIS_EGLPLATFORM
- // here and use eglGetDisplay to initialize it.
- - if (qEnvironmentVariableIsEmpty("QT_QPA_NO_FRAMEBUFFER_FIRST")) {
- - eglGetDisplay(EGL_DEFAULT_DISPLAY);
- - }
- + if (qEnvironmentVariableIsEmpty("QT_QPA_NO_FRAMEBUFFER_FIRST"))
- + eglGetDisplay(EGL_DEFAULT_DISPLAY);
- // Open hardware composer
- HWC_PLUGIN_ASSERT_ZERO(hw_get_module(HWC_HARDWARE_MODULE_ID, (const hw_module_t **)(&hwc_module)));
- @@ -133,7 +132,7 @@ HwComposerBackend::create()
- #ifdef HWC_DEVICE_API_VERSION_1_3
- case HWC_DEVICE_API_VERSION_1_3:
- /* Do not use virtual displays */
- - return new HwComposerBackend_v11(hwc_module, hwc_device, HWC_NUM_PHYSICAL_DISPLAY_TYPES);
- + return new HwComposerBackend_v11(hwc_module, hwc_device, HWC_NUM_DISPLAY_TYPES);
- break;
- #endif /* HWC_DEVICE_API_VERSION_1_3 */
- #endif /* HWC_PLUGIN_HAVE_HWCOMPOSER1_API */
- diff --git a/hwcomposer/hwcomposer_backend_v11.cpp b/hwcomposer/hwcomposer_backend_v11.cpp
- index 6edcb02..45ebdaf 100644
- --- a/hwcomposer/hwcomposer_backend_v11.cpp
- +++ b/hwcomposer/hwcomposer_backend_v11.cpp
- @@ -88,13 +88,32 @@ void HWComposer::present(HWComposerNativeWindowBuffer *buffer)
- setFenceBufferFd(buffer, fblayer->releaseFenceFd);
- - if (oldretire != -1)
- - {
- + if (oldretire != -1) {
- sync_wait(oldretire, -1);
- close(oldretire);
- }
- }
- +void hwcv11_proc_invalidate(const struct hwc_procs* procs)
- +{
- + fprintf(stderr, "%s: procs=%x\n", __func__, procs);
- +}
- +
- +void hwcv11_proc_vsync(const struct hwc_procs* procs, int disp, int64_t timestamp)
- +{
- +}
- +
- +void hwcv11_proc_hotplug(const struct hwc_procs* procs, int disp, int connected)
- +{
- + fprintf(stderr, "%s: procs=%x, disp=%d, connected=%d\n", __func__, procs, disp, connected);
- +}
- +
- +static hwc_procs_t global_procs = {
- + hwcv11_proc_invalidate,
- + hwcv11_proc_vsync,
- + hwcv11_proc_hotplug,
- +};
- +
- HwComposerBackend_v11::HwComposerBackend_v11(hw_module_t *hwc_module, hw_device_t *hw_device, int num_displays)
- : HwComposerBackend(hwc_module)
- , hwc_device((hwc_composer_device_1_t *)hw_device)
- @@ -106,6 +125,7 @@ HwComposerBackend_v11::HwComposerBackend_v11(hw_module_t *hwc_module, hw_device_
- , oldrelease2(-1)
- , num_displays(num_displays)
- {
- + hwc_device->registerProcs(hwc_device, &global_procs);
- sleepDisplay(false);
- @@ -143,11 +163,13 @@ HwComposerBackend_v11::createWindow(int width, int height)
- HWC_PLUGIN_EXPECT_NULL(hwc_list);
- HWC_PLUGIN_EXPECT_NULL(hwc_mList);
- -
- size_t neededsize = sizeof(hwc_display_contents_1_t) + 2 * sizeof(hwc_layer_1_t);
- hwc_list = (hwc_display_contents_1_t *) malloc(neededsize);
- hwc_mList = (hwc_display_contents_1_t **) malloc(num_displays * sizeof(hwc_display_contents_1_t *));
- const hwc_rect_t r = { 0, 0, width, height };
- +#ifdef HWC_DEVICE_API_VERSION_1_3
- + const hwc_frect_t rf { 0.0f, 0.0f, width, height };
- +#endif
- for (int i = 0; i < num_displays; i++) {
- hwc_mList[i] = hwc_list;
- @@ -164,11 +186,17 @@ HwComposerBackend_v11::createWindow(int width, int height)
- layer->transform = 0;
- layer->blending = HWC_BLENDING_NONE;
- layer->sourceCrop = r;
- +#ifdef HWC_DEVICE_API_VERSION_1_3
- + layer->sourceCropf = rf;
- +#endif
- layer->displayFrame = r;
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
- layer->acquireFenceFd = -1;
- layer->releaseFenceFd = -1;
- +#ifdef HWC_DEVICE_API_VERSION_1_2
- + layer->planeAlpha = 0xff;
- +#endif
- layer = &hwc_list->hwLayers[1];
- memset(layer, 0, sizeof(hwc_layer_1_t));
- @@ -179,11 +207,17 @@ HwComposerBackend_v11::createWindow(int width, int height)
- layer->transform = 0;
- layer->blending = HWC_BLENDING_NONE;
- layer->sourceCrop = r;
- +#ifdef HWC_DEVICE_API_VERSION_1_3
- + layer->sourceCropf = rf;
- +#endif
- layer->displayFrame = r;
- layer->visibleRegionScreen.numRects = 1;
- layer->visibleRegionScreen.rects = &layer->displayFrame;
- layer->acquireFenceFd = -1;
- layer->releaseFenceFd = -1;
- +#ifdef HWC_DEVICE_API_VERSION_1_2
- + layer->planeAlpha = 0xff;
- +#endif
- hwc_list->retireFenceFd = -1;
- hwc_list->flags = HWC_GEOMETRY_CHANGED;
- @@ -208,7 +242,7 @@ HwComposerBackend_v11::swap(EGLNativeDisplayType display, EGLSurface surface)
- // TODO: Wait for vsync?
- HWC_PLUGIN_ASSERT_NOT_NULL(hwc_win);
- -
- +
- eglSwapBuffers(display, surface);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement