The ComposerService object wasn't watching for SurfaceFlinger
restarts, which doesn't usually matter because the app framework
restarts when SurfaceFlinger dies. However, mediaserver continues
to run, which means its ComposerService object was trying to use
a dead handle, and playback of DRM movies was failing.
This adds a DeathRecipient listener and some logic to re-establish
the SurfaceFlinger connection.
Bug 6645813
Change-Id: I07581b881d3835601aa57d5358c8259d93bc4515
This change moves some common fence handling code into the base class for
BufferQueue consumer classes. It also makes the ConsumerBase class initialize
a buffer slot's fence with the acquire fence every time a buffer is acquired.
Change-Id: I0bd88bc269e919653b659bfb3ebfb04dd61692a0
We used to keep the bounds of the region as a
separate rectangle. Instead we now store it as the last
element of the Vector<> of Rects.
This has the benefit of being slightly more efficient when
copying regions and reduces the overhead of small regions,
but more importantly will allow us to export the underlaying
SharedBuffer (eventually).
Change-Id: I80790e4fb1a09a747a5616000cfef852ac4ce9e9
This change adds some infrastructure for testing the BufferQueue class. It
also includes a test that tests the new check in BufferQueue::acquireBuffer
that prevents the consumer from acquiring more than one buffer beyond the max
acquired buffer count that was set.
Change-Id: I38554ad3f9a53d2ddeba7ef0deee35ec2e2f9775
This change makes BufferQueue derive the min undequeued buffer count from a max
acquired buffer count that is set by the consumer. This value may be set at
any time that a producer is not connected to the BufferQueue rather than at
BufferQueue construction time.
Change-Id: Icf9f1d91ec612a079968ba0a4621deffe48f4e22
This change is a clean up of some of the handling of the maximum number of
buffers that are allowed at once. It mostly renames a few member variables and
methods, but it includes a couple small refactorings.
Change-Id: I9959310f563d09583548d4291e1050a7bbc7d87d
DisplayDevices are now keyed of the wp<IBinder> the client uses.
DisplayID has now become DisplayType which is just used to identify
physical displays (as opposed to virtual displays such as wifi displays).
Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
This is a compatibility shim for one product whose drivers
are depending on SurfaceComposerClient::getDisplayInfo(
int, DisplayInfo*) when it really shouldn't.
Revert this patch when the problem has been resolved.
Bug: 7065398
Change-Id: I6542691b81fd1b1e1d79500a62e82d40a3d51db7
Use only display tokens in the API to refer to new displays.
Don't require the caller to specify the display when creating
a surface (since in general a surface could be shown on
any display).
This is intended to be a minimum change just to update the API.
Note that SurfaceFlinger still uses DisplayID in a few places
internally that might cause some features not to work properly
when there are multiple displays (LayerScreenshot, for example).
Change-Id: I3d91eec2da406eefd97bcd53655d403ad865a7e6
Fixed the order of the statements in ANDROID_SINGLETON_STATIC_INSTANCE
macro so that the templated static member variable initialization
comes before the instantiation of the Singleton class. This
fixes the clang compile error.
Change-Id: Ic47d17e152b657f2dff3191ccc3770753fdf002b
Author: Tareq A. Siraj <tareq.a.siraj@intel.com>
Reviewed-by: Edwin Vane <edwin.vane@intel.com>
This change makes SurfaceTexture inherit from ConsumerBase. It removes all of
the functionality from SurfaceTexture that is now provided by the base class.
This includes fixes for two bugs that were found after checking this change in
the first time and then reverting it.
Change-Id: Ie2d9f4f27cfef26fdac341de3152e842b01a58d2
BufferItemConsumer allows for acquiring BufferQueue's BufferItems,
which contain all the data and metadata the BufferQueue has for a
given graphics buffer.
This consumer is useful when direct access to the native buffer_handles
is needed by the client.
Also includes a minor cleanup of CpuConsumer's use of 'virtual'.
Bug: 6243944
Change-Id: If7dc4192b15ac499555f1eda42a85140f2434795
some binaries are using these private APIs and broke
(as they should!) with this change. Temporarily restore the
virtuals to work around this.
Bug: 6977550
Change-Id: I7c37f24b16e4d586b89205c493db5169cf87e024
This change fixes SurfaceTexture::freeBufferLocked so that it calls the base
class implementation.
Change-Id: I45d76fb2eb02c1fa6e4e917823ead83e2086bd15
This change makes SurfaceTexture inherit from ConsumerBase. It removes all of
the functionality from SurfaceTexture that is now provided by the base class.
Change-Id: I4a881df42810a14ee32d4ef7c8772a8f2510f4c7
this change introduces a new class LightFlattenable<> which is
a protocol to flatten simple objects that don't require
binders or file descriptors; the benefit of this protocol is that
it doesn't require the objects to have a virtual table and give us
a consitant way of doing this.
we also introduce an implementation of this protocol for
POD structures, LightFlattenablePod<>.
Parcel has been update to handle this protocol automatically.
Sensor, Rect, Point and Region now use this new protocol.
Change-Id: Icb3ce7fa1d785249eb666f39c2129f2fc143ea4a
- displays are represented by a binder on the client side
- c++ clients can now create and modify displays
Change-Id: I203ea5b4beae0819d742ec5171c27568f4e8354b
- make errors that will always cause a memory corruption always fatal
(for eg: KeyedVector<>::editValue{For|At}() failure)
- make other errors fatal in debug mode, those that can be caught by
the caller.
- fix typos
Change-Id: I65cc7d81035c37ce2906fc4500c50e5d5b5c49eb
This change refactors the FramebufferSurface class to inherit from the new
ConsumerBase class.
Bug: 6620200
Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
this attribute can be set through a regular transaction using
SurfaceComposerClient (just like any other attribute, eg: position or size)
Change-Id: I701a47c677ea6442ca713728a93335328cd2b172
no change of functionality -- the old behavior is implemented
on top of this new protocol.
this new protocol will allow, eventually, to pass informations
about displays and layer stacks.
Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc
- remove dependency on cached state in validateVisibility
- get rid of mVertices and mTransformedBounds
- get rid of validateVisibility
- get rid of unlockPageFlip
- handleTransaction now returns a dirty region
- computevisibileregion now uses window-manager space
both API and implementation will change, this is just a prototype
intended to show feasability.
SurfaceFlinger is passed an ISurfaceTexture through a new
callback, it is in turn used to create an EGLSurface which
surfaceflinger will draw into in addition to the main screen.
Change-Id: Id0bbb0b854bb7bae44d57246a90b65d4567f9a21
ISurfaceTexture::dequeueBuffer now returns the buffer's fence for the
client to wait on. For BufferQueue, this means passing it through
Binder so it can be returned to the SurfaceTextureClient. Now
SurfaceTextureClient is responsible for waiting on the fence in
dequeueBuffer instead of BufferQueue: one step closer to the goal.
Change-Id: I677ae758bcd23acee2d784b8cec11b32cccc196d
After a HWC set, each SurfaceFlinger Layer retrieves the release fence
HWC returned and gives it to the layer's SurfaceTexture. The
SurfaceTexture accumulates the fences into a merged fence until the
next updateTexImage, then passes the merged fence to the BufferQueue
in releaseBuffer.
In a follow-on change, BufferQueue will return the fence along with
the buffer slot in dequeueBuffer. For now, dequeueBuffer waits for the
fence to signal before returning.
The releaseFence default value for BufferQueue::releaseBuffer() is
temporary to avoid transient build breaks with a multi-project
checkin. It'll disappear in the next change.
Change-Id: Iaa9a0d5775235585d9cbf453d3a64623d08013d9
This change updates the uses of ANativeWindow to use the new ANW functions that
accept and return Sync HAL fence file descriptors.
Change-Id: I3ca648b6ac33f7360e86754f924aa072f95242f6
SF now has its own implementation of ANW for the
framebuffer and it uses BufferQueue. FramebufferNativeWindow
is now only used by stand-alone apps.
Change-Id: Iddeb24087df62bd92b0f78e391dda9b97ddc859c
SurfaceFlinger will no longer directly synchronize with early suspend.
Instead, PowerManagerService will synchronize with SurfaceFlinger to
ensure that a black frame has been drawn on the display, and then
trigger all early suspend handlers.
Change-Id: I07acdd628440d23fdb69db94319ec5d65d3f4919
SurfaceFlinger is using this new feature to reject buffers that
don't have the right size.
Bug: 6498869
Change-Id: I8a7250a47db6c082a357b703feb3b9d0fc8d3443
CameraParameters was moved over to frameworks/native before
frameworks/av was created, since it is referenced by HAL
implementations. Move it to frameworks/av to keep it together with its
implementation.
Bug: 6500863
Change-Id: Iffd890c861a334930da71a2722553572bad1cb54
Aimed for use cases where gralloc buffers need to be consumed by CPU
users, such as camera image data streams.
The CpuConsumer is a synchronous queue, which exposes raw pointers to
the underlying graphics buffers to applications. Multiple buffers may
be acquired at once, up to the limit set at time of construction.
Change-Id: If1d99f12471438e95a69696e40685948778055fd
Previous kernels have allowed opening the CPU frequency file regardless
whether the CPU is up or not. This fixes some log spam on one device
with dynamic hot plug CPU feature, which does not allow opening the CPU
frequency file if CPU is down.
Also, since the file descriptors are global and have long lives, add
the close-on-exec flag.
Change-Id: Ia14a2b9e20038dfb96a573920176a47a96bd3f5a
This change removes the setPostTransformCrop function from
SurfaceTextureClient. It also includes a small logging fix in BufferQueue.
Bug: 6299171
Change-Id: Ifd0ed05b95dad6085e7a8267fda4d69b76ea3bad
add getBounds(), getWidth(), getHeight(), width() and height()
are kept for backward compatibility.
Change-Id: I83837abf17dc2f8bded1beff73430e8c7d9bbdb3
This change adds a crop rectangle specified in window coordinates to the layer
state. The all window pixels outside this crop rectangle are treated as though
they were fully transparent. This change also adds the plumbing necessary for
WindowManager to set that crop.
Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
Every IBinder object can accept a new transaction to tell it that
it might want to reload system properties, and in the process
anyone can register a callback to be executed when this happens.
Use this to reload the trace property.
This is very much ONLY for debugging.
Change-Id: I55c67c46f8f3fa9073bef0dfaab4577ed1d47eb4
This change reduces the shrinking of the crop rectangle in some cases. It adds
a way to inform the SurfaceTexture that its texture will be used without
bilinear interpolation, and uses knowledge of the pixel format to avoid
shrinking unecessarily.
Change-Id: I72365f39f74ecb7fcc51b4cf42f2d0fa97727212
This change adds support for specifying a crop rectangle to a
SurfaceTextureClient that is in post-transformed coordinate space.
Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d
Bug: 6299171
This change adds a method to Rect to transform a rectangle by a graphics HAL
transform.
Change-Id: Ic0d0988e731bdb5662faee41a5927b1242891658
Bug: 6299171
This change adds the plumbing to SurfaceTextureClient, BufferQueue, and
SurfaceTexture to get the active rectangle passed to the ANativeWindow to
the buffer consumer.
Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
indeed, connect and queueBuffer return the same data, so it's
easier to have them use the same protocol.
Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
Remove C++ APIs androidSetThreadSchedulingGroup and
androidGetThreadSchedulingGroup, and the ANDROID_TGROUP_* constants.
Former callers of these should now use the C APIs set_sched_policy and
get_sched_policy, and the SP_* constants.
Note: debug.sys.noschedgroups is not supported by the C APIs,
this needs to be discussed.
Change-Id: I32bbfc539ef4090faf9ef0320380e8cca9eae07c
- it returned an empty rect when the region was empty, instead
of returning an empty list of rect.
- also fixed an infinite loop when boolean_operation was given
an empty list of rects
Change-Id: I62225c7dcd2832025bb8f12e6cb3762f2a7b36cb
SurfaceTexture will modify the crop rect so it matches
the desired output aspect ratio when the scaling
mode is NATIVE_WINDOW_SCALING_MODE_CROP. Added a test
for this new scaling mode.
Change-Id: I60f24dcbc294b65cd10a393d9e27d40f07d27bb6
Add a new API native_window_set_buffers_user_dimensions to allow native
applications to override the native window size for the default buffer size.
This has lower precedence than the existing
native_window_set_buffers_dimensions and allows the two to co-exist.
Change-Id: Ie73590e1c94ef0dadbce500bd0941dfabbcace3c
BufferQueue is now more flexible as it can be used
by SurfaceMediaSource in addition to SurfaceTexture.
Change-Id: I4222be8918d63372c44fcd412d9ad241c6a3eeb9
These keys are specific to Japanese hardware keyboard which can be
used by input method.
Patch ported from AOSP, with the addition of KANA.
Change-Id: I1474f0eb8971ed5d632822b1f9825c426f4817eb
BufferQueue's disconnect could race with updateTexImage
where invalid buffers could be released. Additionally
fixed similar bug with setBufferCount. Tests were added
to stress the disconnect mechanism.
Change-Id: I9afa4c64f3e025984e8a9e8d924852a71d044716
This change adds the detachFromContext and attachToContext methods to
SurfaceTexture. These methods allow the SurfaceTexture to switch from
one consumer GLES context to another. This change also includes a few
cleanups to the error return codes in updateTexImage.
Change-Id: I0df1eb599aa7b6f58f07431f242f8f09269559ed
collapse setCrop, setTransform and setScalingMode to queueBuffer()
this ends up simplifying things quite a bit and reducing the numnber
of IPC needed per frame.
Change-Id: I3a13c07603abe4e76b8251e6380b107fde22e6d9
Move services/powermanager into frameworks/native so audioflinger can
use it. Note that this is not the same as a PowerManagerService,
which is part of systemserver and handles turning the screen on and
off, etc. This is just a binder interface to allow taking wakelocks.
Change-Id: I6b6a8b41cdbad17e826fda45aab5f059f22fc64e
The DummyConsumer is a consumer that can connect to BufferQueue
that does nothing. It is required as BufferQueue checks
if a consumer is connected. Also fixes a bug where SurfaceTexture
was reusing old texture slots.
Bug: 6172739
Change-Id: I5e7a118dd4d07807ba4c763200242b5ee7d3412b
ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).
Change-Id: Ib8c41134ccdec6d6aa8d49860f8dddef49a24783
This is a copy of libcore's UniquePtr.h header which is used until we
get C++11 which has std::unique_ptr which is essentially the same.
Taken from libcore project at commit
3e6dd45baa0d7f9b4fa06f4ade76e088b59cc7bf
Change-Id: I7537b016f9eae33bfc4c57b24f86260909719ab8
This change adds a check to SurfaceTexture::updateTexImage to verify
that the current GL context is the same as the one that was used for
previous updateTexImage calls.
Change-Id: If02d2f787bcfdb528046dc9ddf6665f8a90e1bf4
This change adds a new callback for BufferQueue consumers to be notified
when the BufferQueue frees some or all of its buffers. This is needed
to retain SurfaceTexture behavior where all buffers would be freed when
the producer disconnects. This change also modifies the
SurfaceTextureGLToGLTest.EglDestroySurfaceUnrefsBuffers test to catch
when the buffers are not freed.
The implementation is a little complicated because it needs to avoid
circular sp<> references across what will be a binder interface (so wp<>
can't be used directly). It also needs to avoid the possibility of
locking the BufferQueue and consumer (e.g. SurfaceTexture) mutexes in
the wrong order.
This change also includes a few additional fixes and test cleanups.
Change-Id: I27b77d0af15cb4b135f4b63573f634f5f0da2182
Many of our basic data structures are trivially movable using
memcpy() even if they are not trivially constructable, destructable
or copyable. It's worth taking advantage of this *ahem* trait.
Adding trivial_move_trait to String16 reduces appt running
time on frameworks/base/core/res by 40%!
Change-Id: I630a1a027e2d0ded96856e4ca042ea82906289fe
CameraParameters.h is indirectly required to implement the Camera
HAL. Move it to frameworks/native.
Bug: 6171735
Change-Id: If4ccb273ea7ca79f54402ebc00febf1c3e59799f
This is used by the Java trace wrappers to avoid JNI overhead
when trace tags are disabled.
Also added a new tag for the input subsystem and view hierarchy.
Change-Id: Ia04a507e42a37b1d3bbb19859e6c07a92f4fe9aa
MemoryHeapPmem is not used any longer. PMEM is not a supported
type of memory by the system anymore. a particular device might
use PMEM and need something like MemoryHeapPmem, in this case this
should be implemented in device specific code (HAL).
This will most likely break older no longer supported targets.
Change-Id: I434e4291219950018de8b793b0403bb2d92dd5cc
Refactored SurfaceTexture and BufferQueue such that share
no protected members. Created an consumer facing interface
for BufferQueue in preparation of connecting SurfaceTexture
and BufferQueue through a binder.
Change-Id: I938e63e085128148c58d0e26c7213b30145c109f