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

Commit 6c450101 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Dan Stoza
Browse files

DO NOT MERGE Cherry-pick dataSpace and BufferItem changes

DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.
(cherry picked from commit 82c6bcc9)

DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal
(cherry picked from commit cf3834db)

DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItem
(cherry picked from commit 11611f9b)
parent 8d9f899a
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ class BufferItem : public Flattenable<BufferItem> {
    // The default value of mBuf, used to indicate this doesn't correspond to a slot.
    enum { INVALID_BUFFER_SLOT = -1 };
    BufferItem();
    BufferItem(const IGraphicBufferConsumer::BufferItem& item);
    ~BufferItem();
    operator IGraphicBufferConsumer::BufferItem() const;

@@ -78,12 +79,22 @@ class BufferItem : public Flattenable<BufferItem> {
    // automatically when the buffer was queued.
    bool mIsAutoTimestamp;

    // mDataSpace is the current dataSpace value for this buffer slot. This gets
    // set by queueBuffer each time this slot is queued. The meaning of the
    // dataSpace is format-dependent.
    android_dataspace mDataSpace;

    // mFrameNumber is the number of the queued frame for this slot.
    uint64_t mFrameNumber;

    union {
        // mSlot is the slot index of this buffer (default INVALID_BUFFER_SLOT).
        int mSlot;

        // mBuf is the former name for mSlot
        int mBuf;
    };

    // mIsDroppable whether this buffer was queued with the
    // property that it can be replaced by a new buffer for the purpose of
    // making sure dequeueBuffer() won't block.
+11 −2
Original line number Diff line number Diff line
@@ -76,7 +76,9 @@ class BufferItemConsumer: public ConsumerBase
    //
    // If waitForFence is true, and the acquired BufferItem has a valid fence object,
    // acquireBuffer will wait on the fence with no timeout before returning.
    status_t acquireBuffer(BufferItem *item, nsecs_t presentWhen,
    status_t acquireBuffer(BufferQueue::BufferItem *item, nsecs_t presentWhen,
            bool waitForFence = true);
    status_t acquireBuffer(android::BufferItem* item, nsecs_t presentWhen,
            bool waitForFence = true);

    // Returns an acquired buffer to the queue, allowing it to be reused. Since
@@ -96,6 +98,13 @@ class BufferItemConsumer: public ConsumerBase
    // GraphicBuffers of a defaultFormat if no format is specified
    // in dequeueBuffer
    status_t setDefaultBufferFormat(PixelFormat defaultFormat);

    // setDefaultBufferDataSpace allows the BufferQueue to create
    // GraphicBuffers of a defaultDataSpace if no data space is specified
    // in queueBuffer.
    // The initial default is HAL_DATASPACE_UNKNOWN
    status_t setDefaultBufferDataSpace(android_dataspace defaultDataSpace);

};

} // namespace android
+9 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ public:
    // is CLOCK_MONOTONIC.
    virtual status_t acquireBuffer(BufferItem* outBuffer,
            nsecs_t expectedPresent);
    virtual status_t acquireBuffer(android::BufferItem* outBuffer,
            nsecs_t expectedPresent);

    // See IGraphicBufferConsumer::detachBuffer
    virtual status_t detachBuffer(int slot);
@@ -128,6 +130,13 @@ public:
    // in dequeueBuffer. The initial default is HAL_PIXEL_FORMAT_RGBA_8888.
    virtual status_t setDefaultBufferFormat(PixelFormat defaultFormat);

    // setDefaultBufferDataSpace allows the BufferQueue to create
    // GraphicBuffers of a defaultDataSpace if no data space is specified
    // in queueBuffer.
    // The initial default is HAL_DATASPACE_UNKNOWN
    virtual status_t setDefaultBufferDataSpace(
            android_dataspace defaultDataSpace);

    // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer.
    // These are merged with the bits passed to dequeueBuffer.  The values are
    // enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER; the default is 0.
+5 −0
Original line number Diff line number Diff line
@@ -209,6 +209,11 @@ private:
    // in dequeueBuffer if a width and height of 0 are specified.
    uint32_t mDefaultHeight;

    // mDefaultBufferDataSpace holds the default dataSpace of queued buffers.
    // It is used in queueBuffer if a dataspace of 0 (HAL_DATASPACE_UNKNOWN)
    // is specified.
    android_dataspace mDefaultBufferDataSpace;

    // mDefaultMaxBufferCount is the default limit on the number of buffers that
    // will be allocated at one time. This default limit is set by the consumer.
    // The limit (as opposed to the default limit) may be overriden by the
+2 −2
Original line number Diff line number Diff line
@@ -153,8 +153,8 @@ protected:
    // initialization that must take place the first time a buffer is assigned
    // to a slot.  If it is overridden the derived class's implementation must
    // call ConsumerBase::acquireBufferLocked.
    virtual status_t acquireBufferLocked(IGraphicBufferConsumer::BufferItem *item,
        nsecs_t presentWhen);
    virtual status_t acquireBufferLocked(BufferItem *item, nsecs_t presentWhen);
    virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item, nsecs_t presentWhen);

    // releaseBufferLocked relinquishes control over a buffer, returning that
    // control to the BufferQueue.
Loading