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

Commit 8bf8bf52 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty Committed by Michael Bestas
Browse files

libui: Allow extension of valid gralloc 1.0 buffer usage bits

* Change I7f4174581e24e361577640b9263514a168ed482d implemented
  validation of the buffer description info prior to creating
  the descriptor. Some of our legacy devices need to whitelist
  additional usage bits to support various functionality.

libui: Extend adb95ae5 to Gralloc3
libui: Extend adb95ae5 to Gralloc4

Change-Id: Ie369e78f78e9ac0b18ab3dfea520d4f123005d92
parent 16aef7c2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -65,8 +65,11 @@ cc_library_shared {
        "include_private",
    ],

    defaults: [
        "gralloc_10_usage_bits_defaults",
        // Uncomment the following line to enable VALIDATE_REGIONS traces
    //defaults: ["libui-validate-regions-defaults"],
        // "libui-validate-regions-defaults",
    ],

    shared_libs: [
        "android.hardware.graphics.allocator@2.0",
+7 −0
Original line number Diff line number Diff line
@@ -48,6 +48,13 @@ uint64_t getValid10UsageBits() {
        for (const auto bit : hardware::hidl_enum_range<BufferUsage>()) {
            bits = bits | bit;
        }

#ifdef ADDNL_GRALLOC_10_USAGE_BITS
        uint64_t addnl_bits = static_cast<uint64_t>(ADDNL_GRALLOC_10_USAGE_BITS);
        ALOGI("Adding additional valid usage bits: 0x%" PRIx64, addnl_bits);
        bits = bits | addnl_bits;
#endif

        return bits;
    }();
    return valid10UsageBits;
+7 −0
Original line number Diff line number Diff line
@@ -47,6 +47,13 @@ uint64_t getValidUsageBits() {
             hardware::hidl_enum_range<hardware::graphics::common::V1_2::BufferUsage>()) {
            bits = bits | bit;
        }

#ifdef ADDNL_GRALLOC_10_USAGE_BITS
        uint64_t addnl_bits = static_cast<uint64_t>(ADDNL_GRALLOC_10_USAGE_BITS);
        ALOGI("Adding additional valid usage bits: 0x%" PRIx64, addnl_bits);
        bits = bits | addnl_bits;
#endif

        return bits;
    }();
    return validUsageBits;
+7 −0
Original line number Diff line number Diff line
@@ -55,6 +55,13 @@ uint64_t getValidUsageBits() {
             hardware::hidl_enum_range<hardware::graphics::common::V1_2::BufferUsage>()) {
            bits = bits | bit;
        }

#ifdef ADDNL_GRALLOC_10_USAGE_BITS
        uint64_t addnl_bits = static_cast<uint64_t>(ADDNL_GRALLOC_10_USAGE_BITS);
        ALOGI("Adding additional valid usage bits: 0x%" PRIx64, addnl_bits);
        bits = bits | addnl_bits;
#endif

        return bits;
    }();
    return validUsageBits;