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

Commit 816f14a4 authored by Saurabh Shah's avatar Saurabh Shah Committed by Linux Build Service Account
Browse files

Surface: Fix gralloc flags conflicting values.

Due to some custom code, unwanted flags (HW) got added with SW flags.
Restrict the flags to custom ones.

Change-Id: I2ab1c75eef4d6d16f0dd7d43aff3c7377486801a
parent 5ee229d6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -46,6 +46,11 @@ LOCAL_SHARED_LIBRARIES := \
	libutils \
	liblog

# Executed only on QCOM BSPs
ifeq ($(TARGET_USES_QCOM_BSP),true)
    LOCAL_C_INCLUDES += hardware/qcom/display/libgralloc
    LOCAL_CFLAGS += -DQCOM_BSP
endif

LOCAL_MODULE:= libgui

+13 −2
Original line number Diff line number Diff line
@@ -36,6 +36,10 @@

#include <private/gui/ComposerService.h>

#ifdef QCOM_BSP
#include <gralloc_priv.h>
#endif

namespace android {

Surface::Surface(
@@ -824,8 +828,15 @@ status_t Surface::lock(
            return err;
        }
        // we're intending to do software rendering from this point
        setUsage(mReqUsage | GRALLOC_USAGE_SW_READ_OFTEN |
        // Do not overwrite the mReqUsage flag which was set by the client
#ifdef QCOM_BSP
        setUsage(mReqUsage & GRALLOC_USAGE_PRIVATE_EXTERNAL_ONLY |
                mReqUsage & GRALLOC_USAGE_PRIVATE_INTERNAL_ONLY |
                    GRALLOC_USAGE_SW_READ_OFTEN |
                    GRALLOC_USAGE_SW_WRITE_OFTEN);
#else
        setUsage(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
#endif
    }

    ANativeWindowBuffer* out;