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

Commit 6902b75a authored by Omprakash Dhyade c_odhyad@quicinc.com's avatar Omprakash Dhyade c_odhyad@quicinc.com Committed by Steve Kondik
Browse files

frameworks/base: Handle false copybit failure

Copybit can fail while MDP is serving FBIOBLANK ioctl.
Handle this case of false copybit failure.

CRs-Fixed: 225796
parent 6521ff09
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ gralloc_module_t const* LayerBuffer::sGrallocModule = 0;
LayerBuffer::LayerBuffer(SurfaceFlinger* flinger, DisplayID display,
        const sp<Client>& client, int32_t i)
    : LayerBaseClient(flinger, display, client, i),
      mNeedsBlending(false), mBlitEngine(0)
      mNeedsBlending(false), mBlitEngine(0), mInvalidEGLImage(false)
{
}

@@ -489,6 +489,7 @@ void LayerBuffer::BufferSource::onDraw(const Region& clip) const
        t.data = (GGLubyte*)src.img.base;
        const Region dirty(Rect(t.width, t.height));
        mLayer.loadTexture(&mTexture, dirty, t);
        mLayer.mInvalidEGLImage = true;
    }

    mTexture.transform = mBufferHeap.transform;
@@ -515,13 +516,15 @@ status_t LayerBuffer::BufferSource::initTempBuffer() const
            Texture defaultTexture;
            mTexture.name = mLayer.createTexture();
            mTempGraphicBuffer.clear();
        } else {
        } else if (!mLayer.mInvalidEGLImage) {
            // we're good, we have an EGLImageKHR and it's (still) the
            // right size
            return NO_ERROR;
        }
    }

    mLayer.mInvalidEGLImage = false;

    // figure out if we need linear filtering
    if (buffers.w * h == buffers.h * w) {
        // same pixel area, don't use filtering
+1 −0
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ private:
    bool            mInvalidate;
    bool            mNeedsBlending;
    copybit_device_t* mBlitEngine;
    bool            mInvalidEGLImage;
};

// ---------------------------------------------------------------------------
+7 −1
Original line number Diff line number Diff line
@@ -469,6 +469,12 @@ static bool copybit(GLint x, GLint y,
        err = copybit->stretch(copybit, &dst, &src, &drect, &srect, &it);
    }
    if (err != NO_ERROR) {
        /* copybit could fail if the service is turned down
         * that does not mean we should not be using copybit
         * again. A valid scenario is LCD is being turned off
         * when copybit request is made.
         */
        if (!copybit || (copybit && err != -EPERM))
            c->textures.tmu[0].texture->try_copybit = false;
    }
    return err == NO_ERROR ? true : false;