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

Commit 4282889c authored by Saurabh Shah's avatar Saurabh Shah Committed by Steve Kondik
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 dd65a097
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ LOCAL_SHARED_LIBRARIES := \

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

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

#include <private/gui/ComposerService.h>

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

namespace android {

Surface::Surface(
@@ -787,8 +791,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;