Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 366d9b4e authored by Raj Kamal's avatar Raj Kamal Committed by Linux Build Service Account
Browse files

sf: Allocate displayId based on usage flags for VD devices

Allocate hwcDisplayId for VirtualDisplayDevices based on
the usage flags set by the client.

Change-Id: I373a31e26709590301a7a83cf8b85853d8aa4c70
parent f9af0e3c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -77,6 +77,9 @@

#include "RenderEngine/RenderEngine.h"
#include <cutils/compiler.h>
#ifdef QCOM_BSP
#include <gralloc_priv.h>
#endif

#ifdef QCOM_BSP
#include <display_config.h>
@@ -1309,7 +1312,13 @@ void SurfaceFlinger::configureVirtualDisplay(int32_t &hwcDisplayId,
            // so the GLES driver can pass buffers directly to the sink.
            producer = state.surface;
        } else {
            int sinkUsage = -1;
            state.surface->query(NATIVE_WINDOW_CONSUMER_USAGE_BITS, &sinkUsage);
#ifdef QCOM_BSP
            if(sinkUsage & GRALLOC_USAGE_PRIVATE_WFD)
#endif
                hwcDisplayId = allocateHwcDisplayId(state.type);

            if (hwcDisplayId >= 0) {
                // This is for WFD virtual display scenario.
                // Read virtual display properties and create a