This change passes a reference to the IGraphicBufferAlloc binder object
to SurfaceTextureClient objects. When STC objects are created they
query their associated ISurfaceTexture object for the
IGraphicBufferAlloc that the SurfaceTexture uses to allocate buffers.
Having the SurfaceTextureClient hold this reference prevents the
GraphicBufferAlloc in SurfaceFlinger from freeing the allocated buffers
before the SurfaceTextureClient is done with them.
Change-Id: Ib8e30e8b37fdd60438cbb4cb7e9174d0ba6d661c
related-bug: 3362519
This changes the ANativeWindow API and the two implementations to reset
the window's crop rectangle to be uncropped when the window's buffer
geometry is changed.
Bug: 3359604
Change-Id: I64283dc8382ae687787ec0bebe6a5d5b4a0dcd6b
This is a temporary WAR for the case where dequeueBuffer is called when
all the buffers owned by a SurfaceTexture are not available - either
they're the current texture buffer or the next one. Currently, an error
is returned in that case, and this change just prevents that error from
being logged. In the future this will be fixed to not return an error
in that case.
Bug: 3356050
Change-Id: Ic6cc304881a63ce134cfd0bcb4265e3e3fa94b6a
...gallery while attaching picture to gmail message
In various places we could block switching the IME target incorrectly.
Change-Id: I7e647fb35f4ea6f2e39eb7efd911420ea9ee64fa
A previously exited Thread object refuses to run again, if the
thread-id of the caller, conincides with the thread-id it previously
used in the worker thread. Hence reset the previously used worker
thread-id to -1 when it exits.
Signed-off-by: Ritu Srivastava <rsrivast@sta.samsung.com>
Change-Id: I873925c312a43ec8a16392b98cc959042ff6bfd2
Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
Generally we never want to lock a buffer for write access if it is at
the "head" on the surfaceflinger side. The only exception (1) is when
the buffer is not currently in use AND there is at least one queued
buffer -- in which case, SurfaceFlinger will never use said buffer
anymore, because on the next composition around, it will be able to
retire the first queued buffer.
The logic above relies on SurfaceFlinger always retiring
and locking a buffer before composition -- unfortunately this
didn't happen during a screenshot.
This could leave us in a situation where a buffer is locked by the
application for write, and used by SurfaceFlinger for texturing,
causing a hang.
Here, we fix this issue by never assuming the exception (1), it was
intended as an optimization allowing ANativeWindow::lockBuffer() to
return sooner and was justified when most of SF composition was
done in software. The actual buffer locking is now ensured by
gralloc. We could have handled screenshots in a similar way to
a regular composition, but it could have caused glitches on screen,
essentially, taking a screenshot could cause to skip a frame.
now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.
noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.
We used to guarantee that a layer in SurfaceFlinger would never be
destroyed before all references (to its ISurface) on the client
side would be released. At some point, this guarantee got
relaxed to allow to free gralloc resources sooner. This last
change was incorrect, because:
- in implementations with reference-counting the gralloc resources
wouldn't be released anyways, until all the mapping were gone
- in implementations without ref counting, the client side
would most likely crash or do something bad
- it also caused the SharedBufferStack slot to be reallocated
to another surface, which could be problematic if the client
continued to use the surface after the window manager destroyed it.
So, we essentially reinstate the guarantee that layers won't be
destroyed until after all references to their ISurface are
released.
NOTE: This doesn't entirely fix 3306150 because there is another
problem there where the Browser continues to use a surface after it
has been destroyed.
also improve SurfaceFlinger 'dumpsys' log
list the purgatory, which shows windows that have been closed,
but for which the client still has references.
now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.
noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.
Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
InputReader::getSwitchState always returns AKEY_STATE_UNKNOWN
because SwitchInputMapper::getSources() returns 0 which cannot
match any source mask including AINPUT_SOURCE_ANY. As a result
initial lid switch detection is broken.
This change adds a new source constant AINPUT_SOURCE_SWITCH
that indicates that the source has switches.
Change-Id: I5321ecf0ce84f1c2b4535f6c163d3f4dcf9b7a9b
EGLUtils::selectConfigForPixelFormat() now uses EGL_NATIVE_VISUAL_ID
to select a config with the proper format. this is more robust and
future proof.
Change-Id: I7245d904adab1e339f062b9b498ddd9324cfe7a4
list the purgatory, which shows windows that have been closed,
but for which the client still has references.
Change-Id: I5168bb88cb328d5d77d71d0871deb9190f493126
Generally we never want to lock a buffer for write access if it is at
the "head" on the surfaceflinger side. The only exception (1) is when
the buffer is not currently in use AND there is at least one queued
buffer -- in which case, SurfaceFlinger will never use said buffer
anymore, because on the next composition around, it will be able to
retire the first queued buffer.
The logic above relies on SurfaceFlinger always retiring
and locking a buffer before composition -- unfortunately this
didn't happen during a screenshot.
This could leave us in a situation where a buffer is locked by the
application for write, and used by SurfaceFlinger for texturing,
causing a hang.
Here, we fix this issue by never assuming the exception (1), it was
intended as an optimization allowing ANativeWindow::lockBuffer() to
return sooner and was justified when most of SF composition was
done in software. The actual buffer locking is now ensured by
gralloc. We could have handled screenshots in a similar way to
a regular composition, but it could have caused glitches on screen,
essentially, taking a screenshot could cause to skip a frame.
Change-Id: I1f226b1ebdf6918439b687c2723955d55b842c55
EGLUtils::selectConfigForPixelFormat() now uses EGL_NATIVE_VISUAL_ID
to select a config with the proper format. this is more robust and
future proof.
Change-Id: Ib85e0974160945d838956b50a3cac4de78618957
Two of the cases in the ISurfaceComposer onTransact switch statement
were missing 'break' statements at the end, and would fall through to
the next case block. This change adds those break statements.
Change-Id: I6dcc84263d3ea03d94612c667103283846b3dee1
This change implements the onFrameAvailable callback for the
SurfaceTexture java class. It includes the C++ SurfaceTexture code as
well as the JNI and Java code to enable the callback.
Change-Id: Ifd8b8e7ad46ee70cba6da1c2e96dab8045d1ea30
This change fixes a bug in SurfaceTextureClient where GraphicBuffers
were being compared using pointer comparison rather than handles.
Change-Id: Ib8989af94be32d4efd86e020a732f5143088a863