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

Commit 1c3f78f8 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Steve Kondik
Browse files

Add ifdefs for QC-specific custom buffer size feature

Change-Id: I317fa6fea1bb607858adbf4dd206d383ff9ca717
parent a8959109
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -169,6 +169,7 @@ public:
    // handle if any.
    virtual status_t setSidebandStream(const sp<NativeHandle>& stream);

#ifdef QCOM_BSP
    // setBufferSize enables us to specify user defined sizes for the buffers
    // that need to be allocated by surfaceflinger for its client. This is
    // useful for cases where the client doesn't want the gralloc to calculate
@@ -176,6 +177,7 @@ public:
    // to calculate the size for the buffer. this will take effect from next
    // dequeue buffer.
    virtual status_t setBuffersSize(int size);
#endif

    // See IGraphicBufferProducer::allocateBuffers
    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
+2 −0
Original line number Diff line number Diff line
@@ -35,9 +35,11 @@ public:
    virtual ~GraphicBufferAlloc();
    virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
        PixelFormat format, uint32_t usage, status_t* error);
#ifdef QCOM_BSP
    virtual void setGraphicBufferSize(int size);
private:
    int mBufferSize;
#endif
};


+2 −0
Original line number Diff line number Diff line
@@ -38,7 +38,9 @@ public:
     */
    virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
            PixelFormat format, uint32_t usage, status_t* error) = 0;
#ifdef QCOM_BSP
    virtual void setGraphicBufferSize(int size) = 0;
#endif
};

// ----------------------------------------------------------------------------
+2 −0
Original line number Diff line number Diff line
@@ -482,6 +482,7 @@ public:
    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
            uint32_t format, uint32_t usage) = 0;

#ifdef QCOM_BSP
    // setBufferSize enables to specify the user defined size of the buffer
    // that needs to be allocated by surfaceflinger for its client. This is
    // useful for cases where the client doesn't want the gralloc to calculate
@@ -489,6 +490,7 @@ public:
    // calculate the size for the buffer. this will take effect from next
    // dequeue buffer.
    virtual status_t setBuffersSize(int size) = 0;
#endif

};

+6 −0
Original line number Diff line number Diff line
@@ -149,7 +149,9 @@ private:
    int dispatchSetCrop(va_list args);
    int dispatchSetPostTransformCrop(va_list args);
    int dispatchSetUsage(va_list args);
#ifdef QCOM_BSP
    int dispatchSetBuffersSize(va_list args);
#endif
    int dispatchLock(va_list args);
    int dispatchUnlockAndPost(va_list args);
    int dispatchSetSidebandStream(va_list args);
@@ -176,7 +178,9 @@ protected:
    virtual int setBuffersTimestamp(int64_t timestamp);
    virtual int setCrop(Rect const* rect);
    virtual int setUsage(uint32_t reqUsage);
#ifdef QCOM_BSP
    virtual int setBuffersSize(int size);
#endif

public:
    virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds);
@@ -225,9 +229,11 @@ private:
    // at the next deuque operation. It is initialized to 0.
    uint32_t mReqUsage;

#ifdef QCOM_BSP
    // mReqSize is the size of the buffer that will be requested
    // at the next dequeue operation. It is initialized to 0.
    uint32_t mReqSize;
#endif

    // mTimestamp is the timestamp that will be used for the next buffer queue
    // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that
Loading