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

Commit af2dde62 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by fuzz
Browse files

native: Make setting the buffers size conditional to qualcomm hardware

This is a partial ifdef of CAF commit d6eecf50.

Some devices might have proprietary bits that link against libgui/libui components
and are not expecting the ABI mismatch introduced in that commit.

Change-Id: I0670990fcb903ee750d4d2925175b9588cf35f45
parent bf9b6621
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ public:
    // connected to the specified producer API.
    virtual status_t disconnect(int api);

#ifdef QCOM_HARDWARE
    // 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
@@ -214,6 +215,7 @@ public:
    // to calculate the size for the buffer. this will take effect from next
    // dequeue buffer.
    virtual status_t setBuffersSize(int size);
#endif

    /*
     * IGraphicBufferConsumer interface
+2 −0
Original line number Diff line number Diff line
@@ -238,6 +238,7 @@ public:
    // connected to the specified client API.
    virtual status_t disconnect(int api) = 0;

#ifdef QCOM_HARDWARE
    // 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
@@ -245,6 +246,7 @@ public:
    // calculate the size for the buffer. this will take effect from next
    // dequeue buffer.
    virtual status_t setBuffersSize(int size) = 0;
#endif

};

+2 −0
Original line number Diff line number Diff line
@@ -150,7 +150,9 @@ protected:
    virtual int setBuffersTimestamp(int64_t timestamp);
    virtual int setCrop(Rect const* rect);
    virtual int setUsage(uint32_t reqUsage);
#ifdef QCOM_HARDWARE
    virtual int setBuffersSize(int size);
#endif

public:
    virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds);
+2 −0
Original line number Diff line number Diff line
@@ -191,12 +191,14 @@ status_t BufferQueue::setBufferCount(int bufferCount) {
    return NO_ERROR;
}

#ifdef QCOM_HARDWARE
status_t BufferQueue::setBuffersSize(int size) {
    ST_LOGV("setBuffersSize: size=%d", size);
    Mutex::Autolock lock(mMutex);
    mGraphicBufferAlloc->setGraphicBufferSize(size);
    return NO_ERROR;
}
#endif

int BufferQueue::query(int what, int* outValue)
{
+4 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ public:
        return result;
    }

#ifdef QCOM_HARDWARE
    virtual status_t setBuffersSize(int size) {
        Parcel data, reply;
        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
@@ -192,6 +193,7 @@ public:
        result = reply.readInt32();
        return result;
    }
#endif

};

@@ -268,6 +270,7 @@ status_t BnGraphicBufferProducer::onTransact(
            reply->writeInt32(res);
            return NO_ERROR;
        } break;
#ifdef QCOM_HARDWARE
        case SET_BUFFERS_SIZE: {
            CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
            int size = data.readInt32();
@@ -275,6 +278,7 @@ status_t BnGraphicBufferProducer::onTransact(
            reply->writeInt32(res);
            return NO_ERROR;
        } break;
#endif
        case CONNECT: {
            CHECK_INTERFACE(IGraphicBufferProducer, data, reply);
            sp<IBinder> token = data.readStrongBinder();
Loading