Add dataSpace to buffer queues; remove old format enums.
(cherry picked from commit 82c6bcc970)
libgui: Prepare for IGBC::BufferItem removal
(cherry picked from commit cf3834db10)
SurfaceFlinger: Stop using IGBC::BufferItem
(cherry picked from commit 11611f9be5)
Change-Id: Ic2e4770b916d2d1477e5ce98c4b49a0072ea03ff
(cherry picked from commit 6c45010175)
DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.
(cherry picked from commit 82c6bcc970)
DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal
(cherry picked from commit cf3834db10)
DO NOT MERGE SurfaceFlinger: Stop using IGBC::BufferItem
(cherry picked from commit 11611f9be5)
Exposes the attachBuffer and detachNextBuffer calls from
IGraphicBufferProducer to the public Surface interface. Also moves
the version of connect that takes a producer callback from protected
to public.
Bug: 19628705
Change-Id: I9ebc3013c4d9c84c4e8ef150c00e03f8af80319e
(cherry picked from commit c14ecb9de2)
In restricted mode, only CTS tests can register for sensors or call flush() on them. The requests
from other applications will be ignored.
Change-Id: Ieb923df3e0cfe3390fe2d052af776da79589744b
Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
I187b3a7d05196b6289596afac8fb9a9d4aebff76
I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc
Cherry-pick of Id1fa56d092188f2cb712768d5d2fc6a9027fb73c
Change-Id: I3edf0db8fba656fd78e18a5a7f1137f0fb6b237d
Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, and we want to remove
the IGBC version. This changes things so that client code may be
incrementally switched over to the libgui version.
This is a squashed commit containing the following changes:
I64f495105f56cbf5803cea4aa6b072ea29b70cf5
I1394e693314429ada93427889f10b7b01c948053
I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
I699ed0a6837076867ca756b28d1ffb2238f7a0d9
Iac8425e1241774304a131da2fb9dec6e82922f13
Change-Id: Ic4d51f5df6dbc70b376d13fceba2335b9bae4f3d
- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace
Cherry pick of I070bd2e7c56506055c419004c29e2e3feac725df
Change-Id: I461952389c18051176c6b75e664f20ad369f5760
This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer.
Cherry pick of I5ea5229bf3a329bf02c6bd20e7247039c75d136b
Change-Id: I6f8f52c72654e4cee649721383819bafe378f964
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
Cherry pick of I034abec27bf4020d84af60d7acc1939c59986dd6 plus a
couple of minor changes to CpuConsumer.cpp to make it work with a
prior change:
Uncomment CC_LOGV on line 46
Change C-style cast to static_cast on line 71
Change-Id: Iaec610477ea0122317b0578fb74caf2383d4cf08
Adds CpuConsumer::{detachNextBuffer,attachAndReleaseBuffer}, which
can be used to more carefully manage the ownership of GraphicBuffers.
Bug: 19628705
Change-Id: Ia7a7e30da6d81eb2367241998f14988db0afc3bf
Exposes the attachBuffer and detachNextBuffer calls from
IGraphicBufferProducer to the public Surface interface. Also moves
the version of connect that takes a producer callback from protected
to public.
Bug: 19628705
Change-Id: I9ebc3013c4d9c84c4e8ef150c00e03f8af80319e
Adds CpuConsumer::{detachNextBuffer,attachAndReleaseBuffer}, which
can be used to more carefully manage the ownership of GraphicBuffers.
Bug: 19628705
Change-Id: Ia7aa1ac59c2f768f2d8a0f35ad23067936a7427c
Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
I187b3a7d05196b6289596afac8fb9a9d4aebff76
I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc
Change-Id: Id1fa56d092188f2cb712768d5d2fc6a9027fb73c
Switches some dependencies from IGraphicBufferConsumer::BufferItem to
android::BufferItem and adds some methods to facilitate incrementally
changing client code to do the same.
Change-Id: I699ed0a6837076867ca756b28d1ffb2238f7a0d9
Adds an overload of IGraphicBufferConsumer::acquireBuffer which takes
an android::BufferItem instead of an IGBC::BufferItem.
Change-Id: I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, so this change modifies
the one inside of libgui to have a union of both names so that the
one inside of IGBC can eventually be refactored away.
Change-Id: I64f495105f56cbf5803cea4aa6b072ea29b70cf5
- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace
Change-Id: I070bd2e7c56506055c419004c29e2e3feac725df
This change allows clients of Surface to provide an IProducerListener
callback object to Surface::connect, which will be passed down to the
underlying IGraphicBufferProducer.
Change-Id: I5ea5229bf3a329bf02c6bd20e7247039c75d136b
When the touch firmware or driver sends a key event that is triggered
by a low-level gesture such as a palm slap. For this to work, the
touch device's .kl file must specify the "GESTURE" flag for each
key that is produced by a gesture.
Note that the "VIRTUAL" flag should also be specified for any such
keys for which we would like to generate haptic feedback.
eg. key 142 SLEEP VIRTUAL GESTURE
Bug: 19264992
Change-Id: Ief494ec7e3ca66d2358a1001fdfae4f263ee1cd1
This seems to have the same layout as OMX_COLOR_FormatYUV420SemiPlanar,
but used under this value on some devices.
Bug: 19246722
Change-Id: Ib866024e52cf7b12608f02eefc43c6d58a1c0aa1
Adds a Rect constructor that takes uint32_t instead of int32_t, as
required by a change to Region and -Werror
Change-Id: If91915e5b4ec9ce9e7ba0fb84f03b045d000b023
The Region::set(uint32_t,uint32_t) ABI is used by the Nexus 10 graphics
driver blobs.
After commit dd883c0b08, Nexus 10 blobs
need a rebuild unless the old ABI is added back
Change-Id: I138dcc1cc281b8d3cde0021282bf874054ec4eaf
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
This is a squashed commit based on an initial change with a couple of
fixes to avoid breaking certain targets. The source commits are:
d723bd766900d504c06e429ba89cd2
Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
The redefinition of LOG_TAG in a header file was causing some issues
for code that had strict warnings and -Werror enabled, so remove the
(possible re-)definition
Change-Id: I7ecb907463ba98fbdbd8b9734a000b2f27f43a65
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
Change-Id: I470a267e9b1c373f2d5c960f005c3b0e02b2db63
(cherry picked from commit 303b9a5123)
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.
Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
(cherry picked from commit f10c46ef85)
Enables -Weverything and -Werror, with just a few exceptions for
warnings we can't (or shouldn't need to) work around.
Change-Id: I470a267e9b1c373f2d5c960f005c3b0e02b2db63
Adds readUint32 and writeUint32 methods to the Parcel class. This
saves a lot of static_casting in anything implementing a Binder
interface on the native side.
Change-Id: Iafc73b0633654a3a4c49767f41806b56906c924f
* commit 'eb0ad057628f18bf762084b5bbefa81c3a228e3f':
omx: add (temporary) index for automatic video frc support
Fix issue #18356768: some app process may hang at Runtime#exit...
* commit 'a63caa1983138e561b2b033c5d178636beeb1578':
omx: add (temporary) index for automatic video frc support
Fix issue #18356768: some app process may hang at Runtime#exit...
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.
Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.
Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
...in Parcel destructor
Don't use a Mutux object, just use simple posix mutex primitives,
to avoid static init/destroy order problems.
Change-Id: Ic012d94297564c0a55d58869f8276d7d10545fbc
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.
Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents. Also
adds an onFrameReplaced callback, which is necessary if the consumer
wants to do anything more than simple queue length tracking.
Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
warning: struct 'HWComposer' was previously declared as a class
[-Wmismatched-tags]
warning: class 'DisplayInfo' was previously declared as a struct
[-Wmismatched-tags]
Change-Id: I13db9f8aab3a957ce8ff8d64598dae1807d6fe7e
(cherry picked from commit 646f541050)
Throttling was previously controlled by a combination of the
driver and the number of buffers in the queue. This patch makes
a more consistent trade-off, which allows two GPU frames pending
but not three. More buffering could improve throughput in the
case of varying frame times, but this also increases latency.
Bug: 17502897
Change-Id: I4ee68019ca94c635294c5959931a555a6c4ef2df
i) Call removeFd() only if the fd in the BitTube has been
previously added to the Looper. Use a flag to determine whether the fd
has been previously added or not.
ii) Increment mPendingFlushEventsToSend after holding a connectionLock.
iii) Store the number of acks that are pending in SensorEventQueue
and send them all at once.
Bug: 17472228
Change-Id: I1ec834fea1112a9cfbd9cddd2198438793698502
* commit '4f99490ad21bd999ec532dae1f0754c3ad34809a':
add a parameter for PCM limiter enable
Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup
Revert "Modify EGL to disconnect the window when the surface gets destroyed."
crash if getNativeBuffer() called on NULL GraphicBuffer
* commit 'dd230cb8d2a43ea453a507b12c612a221a3780e7':
add a parameter for PCM limiter enable
Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup
Revert "Modify EGL to disconnect the window when the surface gets destroyed."
crash if getNativeBuffer() called on NULL GraphicBuffer
* commit 'dd230cb8d2a43ea453a507b12c612a221a3780e7':
add a parameter for PCM limiter enable
Use set_sched_policy to put dexopt operations in SP_BACKGROUND cgroup
Revert "Modify EGL to disconnect the window when the surface gets destroyed."
crash if getNativeBuffer() called on NULL GraphicBuffer
This is used by media service to schedule video frames at the
proper time, based on precise vsync timings.
Bug: 14659809
Change-Id: I1a90603f3dc09dca9aa4f90a3aa845fab56e0a5e
i) Significant Motion multiple clients fix. Make a copy of
mActiveConnections vector before cleaning up SensorEventConnections
when one-shot sensors trigger.
ii) Maintain a mapping between flush_complete_events and
SensorEventConnections to accurately map flush() API calls and
corresponding flush_complete_events
iii) Remove all references to 1_1 and 1_2 HALs.
iv) Dynamically allocate sensor_event buffers in SensorService main
threadLoop.
Bug: 17412359
Change-Id: If3c3986197660cafef2d2e0b4dc7582e229cf1c4
In C++11 mode, "foo"MACRO_THAT_EXPANDS_TO_STRING gets lexed as a user
defined literal. Add space around the macro.
Had missed these when resolving merge conflicts last night.
Change-Id: I1a381a06c3909b76a3b44ce79c37aa6f244d3736
+ This is needed so that activity manager does not
have to do cpu side rotations when capturing recents
thumbnails.
Change-Id: If998008e675ad01305db8399fd643cf4608b7025
But provide a temporary escape hatch for AudioFlinger.
This oneway option will be removed as soon as possible.
Bug: 16408906
Change-Id: I20d6da1969ae05b96e72795463470eb4c1f8fbdc
warning: struct 'HWComposer' was previously declared as a class
[-Wmismatched-tags]
warning: class 'DisplayInfo' was previously declared as a struct
[-Wmismatched-tags]
Change-Id: I13db9f8aab3a957ce8ff8d64598dae1807d6fe7e
Bug: 17379740
This function was missing a return statement, even though it declares a return
type. This is undefined behavior, which clang miscompiled into just falling
through to a later function in some cases. Adding the return statement
fixes the undefined behavior (and probably fixes a bug too).
Change-Id: I05c03b6473b831769dc4fa8b5ba43fb4249f7626
i) Fix a possible race condition when adding a pending flush connection
to mActiveSensors data structure.
ii) Invalidate flush_complete_events as soon as they are consumed by a
connection so that they are not used by other connections which are
registered for the same sensor.
Change-Id: I1491bea8c2081c4aab1feacc60add13b7aa26bb7
After fixing b/16874785.
This reverts commit f010a05c7e.
Original comment, which actually describes the effect of this:
Change the mExtras field in Binder.h to be a stdatomic.h atomic
value, and replace references to it with proper stdatomic.h calls.
This removes one of a small number of remaining 64 bit
android_atomic references. It also replaces the erroneously
non-atomic read accesses to mExtras.
It would be better if this used the C++11 <atomic> facility,
but we don't quite have that yet.
Fixes
Bug:16513433
Change-Id: I1645ca5d6f60595bf5d388913665ce4b8780b26d
(cherry picked from commit 3effababf2)
Keys which are necessary for supporting world-wide broadcast
standard or used commonly for TV/STB remotes.
Change-Id: I2721ceb7d956c87f1d4106b99f9d21947ae13d47
If a display is terminated and then initialized, we can't detect
this using the display itself (it has the same value), but all
EglImages still become invalid for the display. This patch detects
this during image binding and forces creation of a new EglImage.
Bug: 10430249
Change-Id: I75101c50962f21263dca3ec6e241a2e5a3c23dad
1) Flush should only be received by the app calling flush(). Maintain
a queue of all flush() calls and send flush_complete events in that
order.
2) Log warnings for older HALs. Remove batch() calls with DRY_RUN flag.
3) Reallocate event cache when more sensors register and the desired
maxCacheSize increases. Clear NEEDS_ACK flag in the buffer whenever
there is a write() failure.
4) More dump information. Add wake-up flag, maxDelay and timestamps for
sensor events.
Bug: 16874778
Change-Id: I195646191059fd31f75f2f07886c0f98bf9b509a
Add new fields to OMX_AUDIO_PARAM_AACPROFILETYPE for
- SBR configuration
- decoder max number of channels
- decoder DRC parameters
Bug 16740915
Change-Id: Ib01822bc402fe9064c6c1c68b72c570cf72b7ecb
If available, surfaceflinger will use the hwc setCursorPositionAsync()
api to change the position of supported cursor layers outside of
the usual prepare/set loop.
Change-Id: Ib3fc5c0c390b3489ddbba202379840a1d2748917
i) Send ack for wake_up sensors on the socket connection instead of using Binder RPC.
ii) Cache events per connection in case there are write failures. Compute cache size
from FIFO counts of sensors.
iii) Send FlushCompleteEvent only for apps that explicitly called flush().
Change-Id: I018969736b7794b1b930529586f2294a03ee8667
Change the mExtras field in Binder.h to be a stdatomic.h atomic
value, and replace references to it with proper stdatomic.h calls.
This removes one of a small number of remaining 64 bit
android_atomic references. It also replaces the erroneously
non-atomic read accesses to mExtras.
It would be better if this used the C++11 <atomic> facility,
but we don't quite have that yet.
Bug: 16513433
Change-Id: Ibabb88d05025187ee1ce6c7f1aa670b133a547f8
BufferQueueProducer::allocateBuffers used to keep the BufferQueueCore
mutex while doing the buffer allocation, which would cause the consumer
(which also needs the mutex) to block if the allocation takes a long
time.
Instead, release the mutex while doing the allocation, and grab it again
before filling the slots. Keep a bool state and a condvar to prevent
other producers from trying to allocate the slots while the mutex is
released.
Bug: 11792166
Change-Id: I4ab1319995ef892be2beba892f1fdbf50ce0416d
(cherry picked from commit ea96044470)
In most cases, EGLImages can be created one-to-one with graphic
buffers in slots, but that was difficult due to some special
cases:
- ReleaseTexImage binds a custom 'unslotted' debug image.
- When all slots are freed, we still need to hang on to one.
These cases were handled by keeping an additional reference to
the 'current' buffer (mCurrentTextureBuf), but we would create
new images since we can't reference count them in the same way.
This patch uses the same semantics, except that it reference
counts the image (an EglImage wrapper class) rather than just
buffer. The wrapper class also detects the cases when we need
a new EGLImage, and only creates them in those rare cases.
Change-Id: I2915761dbe49d2a9bda1f59e60f857543634636b
Bug: 15116722
- Adds a sticky transform field that can be set from a
SurfaceFlinger client Surface. This transform is
added to any transform applied to the Surface.
Change-Id: Idaa4311dfd027b2d2b8ea5e2c6cba2da5779d753
Adds a constructor that doesn't require a GLES texture name and sets
up the GLConsumer in detached mode.
Bug: 15616428
Change-Id: Idc9ea2e59baa24bbd959da9fffe0fb71c0aa9818
Removes the dependency on default constructor parameters for
GLConsumer so that a different constructor prototype can safely be
added.
Change-Id: I0da924bbd4c141edbf305598c1be8bc575654680
This adds an allocateBuffers method to BufferQueue, which instructs
it to allocate up to the maximum number of buffers allowed by the
current configuration. The goal is that this method can be called
ahead of render time, which will prevent dequeueBuffers from blocking
in allocation and inducing jank.
This interface is also plumbed up to the native Surface (and, in
another change, up to the Java Surface and ThreadedRenderer).
Bug: 11792166
Change-Id: I4aa96b4351ea1c95ed5db228ca3ef98303229c74
All uses of this API have been removed. It should
never have been made public in the first place.
bug: 15424960
Change-Id: Id07d24ec95b2b393e6da138a7e8a9a4ecebeca94
All uses of this API have been removed. It should
never have been made public in the first place.
bug: 15424960
(cherry picked from commit 7da40c0a84)
Change-Id: I8d89f62dbdaee7149ef908e0c97417b85e0c48a2
We replace the blank/unblank calls in surfaceFlinger with a more generic
setPowerMode() routine.
Some displays support different power modes (for example, with reduced
color palettes). Depending on the use case we should be able to toggle
these modes, so as to achieve incremental power savings.
Initially, three power modes will be supported:
- HWC_POWER_MODE_OFF
- HWC_POWER_MODE_DOZE
- HWC_POWER_MODE_NORMAL
HWC_POWER_MODE_OFF will correspond to blanking the display, while
HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE
will put the display into a low power setting, if it is supported in
hardware.
If such a low power mode is not supported, it should be treated as a
call to set the mode to HWC_POWER_MODE_NORMAL.
As a consequence of adding the mPowerMode field, the mScreenAcquired is
no longer required, and thus references to it are removed and replaced
equivalent references to mPowerMode.
We also add the glue code to connect the services invocation of setting
a power mode and the HAL implementation in HWComposer.
Bug: 13472578
Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204
Signed-off-by: Prashant Malani <pmalani@google.com>
To make sure the stature which pass between 32/64bit process have
same memory layout for 32/64bit.
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Co-Authored-by: Narayan Kamath <narayan@google.com> (Unit test only.)
Change-Id: I1bc2d12cce41ec0bc484adcaf968f274bec75c12
Adds a sourceCrop Rect parameter to screenshot commands, which allows
clients to capture only a portion of the screen instead of the whole
screen.
Bug: 15137922
Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8