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

Commit b77c3b78 authored by Anjaneya Prasad Musunuri's avatar Anjaneya Prasad Musunuri Committed by Linux Build Service Account
Browse files

surfaceflinger: Exclude video encoder usage for scratch buffer

Sink and Scratch buffers in VDS are using same usage flags.
This causes video encoder flag to be set for scratch
buffers Also. Exclude video encoder flag from scratch
buffer usage flags as scratch buffers are used only as
write back input and not video encoder input.

Change-Id: I7763efd155a1ec4c550680c9a07e4a934b52dfe4
CRs-Fixed: 1008906
parent fede5ccc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -341,6 +341,13 @@ status_t VirtualDisplaySurface::dequeueBuffer(Source source,
        PixelFormat format, uint32_t usage, int* sslot, sp<Fence>* fence) {
    LOG_FATAL_IF(mDisplayId < 0, "mDisplayId=%d but should not be < 0.", mDisplayId);

    // Exclude video encoder usage flag from scratch buffer usage flags
    if (source == SOURCE_SCRATCH) {
        usage &= ~(GRALLOC_USAGE_HW_VIDEO_ENCODER);
        VDS_LOGV("dequeueBuffer(%s): updated scratch buffer usage flags=%#x",
                dbgSourceStr(source), usage);
    }

    status_t result = mSource[source]->dequeueBuffer(sslot, fence,
            mSinkBufferWidth, mSinkBufferHeight, format, usage);
    if (result < 0)