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

Commit 88f70a21 authored by Jesse Hall's avatar Jesse Hall Committed by Android Git Automerger
Browse files

am fae23b87: Merge changes I61ae54f3,I57cb668e,I7a3f1e1a,Id28a2f9b into jb-mr2-dev

* commit 'fae23b87':
  Add BufferQueueInterposer and use it for virtual displays
  Add DisplaySurface abstraction
  Fix argument types in IGraphicBufferProducer methods
  Minor cleanups/fixes before virtual display refactoring
parents 0bb2d18a fae23b87
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -128,7 +128,7 @@ public:
    // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
    // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv).
    // An error due to invalid dimensions might not be reported until
    // An error due to invalid dimensions might not be reported until
    // updateTexImage() is called.
    // updateTexImage() is called.
    virtual status_t dequeueBuffer(int *buf, sp<Fence>& fence,
    virtual status_t dequeueBuffer(int *buf, sp<Fence>* fence,
            uint32_t width, uint32_t height, uint32_t format, uint32_t usage);
            uint32_t width, uint32_t height, uint32_t format, uint32_t usage);


    // queueBuffer returns a filled buffer to the BufferQueue. In addition, a
    // queueBuffer returns a filled buffer to the BufferQueue. In addition, a
@@ -139,7 +139,7 @@ public:
    virtual status_t queueBuffer(int buf,
    virtual status_t queueBuffer(int buf,
            const QueueBufferInput& input, QueueBufferOutput* output);
            const QueueBufferInput& input, QueueBufferOutput* output);


    virtual void cancelBuffer(int buf, sp<Fence> fence);
    virtual void cancelBuffer(int buf, const sp<Fence>& fence);


    // setSynchronousMode set whether dequeueBuffer is synchronous or
    // setSynchronousMode set whether dequeueBuffer is synchronous or
    // asynchronous. In synchronous mode, dequeueBuffer blocks until
    // asynchronous. In synchronous mode, dequeueBuffer blocks until
+3 −4
Original line number Original line Diff line number Diff line
@@ -69,10 +69,9 @@ public:
    // ConsumerBase is connected.
    // ConsumerBase is connected.
    sp<BufferQueue> getBufferQueue() const;
    sp<BufferQueue> getBufferQueue() const;


    // dump writes the current state to a string.  These methods should NOT be
    // dump writes the current state to a string. Child classes should add
    // overridden by child classes.  Instead they should override the
    // their state to the dump by overriding the dumpLocked method, which is
    // dumpLocked method, which is called by these methods after locking the
    // called by these methods after locking the mutex.
    // mutex.
    void dump(String8& result) const;
    void dump(String8& result) const;
    void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;
    void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const;


+2 −2
Original line number Original line Diff line number Diff line
@@ -84,7 +84,7 @@ public:
    // the buffer. The contents of the buffer must not be overwritten until the
    // the buffer. The contents of the buffer must not be overwritten until the
    // fence signals. If the fence is NULL, the buffer may be written
    // fence signals. If the fence is NULL, the buffer may be written
    // immediately.
    // immediately.
    virtual status_t dequeueBuffer(int *slot, sp<Fence>& fence,
    virtual status_t dequeueBuffer(int *slot, sp<Fence>* fence,
            uint32_t w, uint32_t h, uint32_t format, uint32_t usage) = 0;
            uint32_t w, uint32_t h, uint32_t format, uint32_t usage) = 0;


    // queueBuffer indicates that the client has finished filling in the
    // queueBuffer indicates that the client has finished filling in the
@@ -165,7 +165,7 @@ public:
    // cancelBuffer indicates that the client does not wish to fill in the
    // cancelBuffer indicates that the client does not wish to fill in the
    // buffer associated with slot and transfers ownership of the slot back to
    // buffer associated with slot and transfers ownership of the slot back to
    // the server.
    // the server.
    virtual void cancelBuffer(int slot, sp<Fence> fence) = 0;
    virtual void cancelBuffer(int slot, const sp<Fence>& fence) = 0;


    // query retrieves some information for this surface
    // query retrieves some information for this surface
    // 'what' tokens allowed are that of android_natives.h
    // 'what' tokens allowed are that of android_natives.h
+3 −3
Original line number Original line Diff line number Diff line
@@ -254,7 +254,7 @@ status_t BufferQueue::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
    return NO_ERROR;
    return NO_ERROR;
}
}


status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence,
status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>* outFence,
        uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
        uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
    ATRACE_CALL();
    ATRACE_CALL();
    ST_LOGV("dequeueBuffer: w=%d h=%d fmt=%#x usage=%#x", w, h, format, usage);
    ST_LOGV("dequeueBuffer: w=%d h=%d fmt=%#x usage=%#x", w, h, format, usage);
@@ -393,7 +393,7 @@ status_t BufferQueue::dequeueBuffer(int *outBuf, sp<Fence>& outFence,


        dpy = mSlots[buf].mEglDisplay;
        dpy = mSlots[buf].mEglDisplay;
        eglFence = mSlots[buf].mEglFence;
        eglFence = mSlots[buf].mEglFence;
        outFence = mSlots[buf].mFence;
        *outFence = mSlots[buf].mFence;
        mSlots[buf].mEglFence = EGL_NO_SYNC_KHR;
        mSlots[buf].mEglFence = EGL_NO_SYNC_KHR;
        mSlots[buf].mFence = Fence::NO_FENCE;
        mSlots[buf].mFence = Fence::NO_FENCE;
    }  // end lock scope
    }  // end lock scope
@@ -590,7 +590,7 @@ status_t BufferQueue::queueBuffer(int buf,
    return OK;
    return OK;
}
}


void BufferQueue::cancelBuffer(int buf, sp<Fence> fence) {
void BufferQueue::cancelBuffer(int buf, const sp<Fence>& fence) {
    ATRACE_CALL();
    ATRACE_CALL();
    ST_LOGV("cancelBuffer: slot=%d", buf);
    ST_LOGV("cancelBuffer: slot=%d", buf);
    Mutex::Autolock lock(mMutex);
    Mutex::Autolock lock(mMutex);
+5 −5
Original line number Original line Diff line number Diff line
@@ -81,7 +81,7 @@ public:
        return result;
        return result;
    }
    }


    virtual status_t dequeueBuffer(int *buf, sp<Fence>& fence,
    virtual status_t dequeueBuffer(int *buf, sp<Fence>* fence,
            uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
            uint32_t w, uint32_t h, uint32_t format, uint32_t usage) {
        Parcel data, reply;
        Parcel data, reply;
        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
@@ -99,8 +99,8 @@ public:
            // If the fence was written by the callee, then overwrite the
            // If the fence was written by the callee, then overwrite the
            // caller's fence here.  If it wasn't written then don't touch the
            // caller's fence here.  If it wasn't written then don't touch the
            // caller's fence.
            // caller's fence.
            fence = new Fence();
            *fence = new Fence();
            reply.read(*fence.get());
            reply.read(*(fence->get()));
        }
        }
        result = reply.readInt32();
        result = reply.readInt32();
        return result;
        return result;
@@ -121,7 +121,7 @@ public:
        return result;
        return result;
    }
    }


    virtual void cancelBuffer(int buf, sp<Fence> fence) {
    virtual void cancelBuffer(int buf, const sp<Fence>& fence) {
        Parcel data, reply;
        Parcel data, reply;
        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
        data.writeInterfaceToken(IGraphicBufferProducer::getInterfaceDescriptor());
        data.writeInt32(buf);
        data.writeInt32(buf);
@@ -215,7 +215,7 @@ status_t BnGraphicBufferProducer::onTransact(
            uint32_t usage  = data.readInt32();
            uint32_t usage  = data.readInt32();
            int buf;
            int buf;
            sp<Fence> fence;
            sp<Fence> fence;
            int result = dequeueBuffer(&buf, fence, w, h, format, usage);
            int result = dequeueBuffer(&buf, &fence, w, h, format, usage);
            reply->writeInt32(buf);
            reply->writeInt32(buf);
            reply->writeInt32(fence != NULL);
            reply->writeInt32(fence != NULL);
            if (fence != NULL) {
            if (fence != NULL) {
Loading