Commit Graph

1847 Commits

Author SHA1 Message Date
Dan Stoza e64a79cd85 Fix PTS handling for buffer replacement
This changes the way that SurfaceFlinger's shadow buffer management
works such that instead of tracking the size of the shadow queue in the
BufferQueue, SF tracks the last frame number it has seen, and passes
that into the acquireBuffer call. BufferQueueConsumer then ensures that
it never returns a buffer newer than that frame number, even if that
means that it must return PRESENT_LATER for an otherwise valid buffer.

Change-Id: I3fcb45f683ed660c3f18a8b85ae1f8a962ba6f0e
(cherry picked from commit a4650a50a0)
2015-05-13 09:43:35 -07:00
Ronghua Wu f183395296 binder: add uint64 support to Parcel.
Bug: 19620911
Change-Id: Ifce5319e4e35afd344dead67ab7ba1cd399476a3
(cherry picked from commit 2d13afdfa1)
2015-05-13 09:43:35 -07:00
Johan Euphrosine bf6d5e012c frameworks/native: document native types and enums
Change-Id: Id94b610f27b87426abb30e13484cbd16990aa995
2015-05-12 14:39:28 -07:00
Dan Stoza a3b6693272 libgui: Hook up onFrameReplaced
This completes the plumbing from ConsumerListener::onFrameReplaced into
SurfaceFlinger (and other consumers that may care).

Change-Id: I376e78ace95d6748e8662e6b4d47c0dfa697a300
(cherry picked from commit dc13c5b85b)
2015-05-12 09:35:29 -07:00
Dan Stoza 2e36f2283f SurfaceFlinger: Fix PTS on stale buffers
SurfaceFlinger's (Layer's) shadow copy of the BufferQueue queue was
getting out of sync for a few reasons. This change fixes these by
doing the following:

- Adds a check to re-synchronize the shadow copy every time we
  successfully acquire a buffer by first dropping stale buffers before
  removing the current buffer.
- Avoids trying to perform updates for buffers which have been rejected
  (for incorrect dimensions) by SurfaceFlinger.
- Adds IGraphicBufferConsumer::setShadowQueueSize, which allows the
  consumer to notify the BufferQueue that it is maintaining a shadow
  copy of the queue and prevents it from dropping so many buffers
  during acquireBuffer that it ends up returning a buffer for which the
  consumer has not yet received an onFrameAvailable call.

Bug: 20096136
Change-Id: I78d0738428005fc19b3be85cc8f1db498043612f
2015-04-30 15:29:05 -07:00
Dan Stoza 8de71a2408 Merge "BufferQueue: Add NATIVE_WINDOW_BUFFER_AGE query" 2015-04-29 17:21:51 +00:00
Dan Stoza 81cde67a55 BufferQueue: Add NATIVE_WINDOW_BUFFER_AGE query
Adds a NATIVE_WINDOW_BUFFER_AGE query, which returns the age of the
contents of the most recently dequeued buffer as the number of frames
that have elapsed since it was last queued.

Change-Id: Ib6fd62945cb62d1e60133a65beee510363218a23
2015-04-28 14:26:05 -07:00
Dan Stoza 745ac038b9 libgui: Change detachNextBuffer to return sp<GB>
Changes Surface::detachNextBuffer to return an sp<GraphicBuffer>
instead of an ANativeWindowBuffer* to ensure that reference counting
works correctly.

Bug: 20092217
Change-Id: I3979ea6121aaf14845f0554477b778770413581e
2015-04-27 11:16:15 -07:00
Dan Stoza 9de7293b0a libgui: Allow an IGBProducer to disable allocation
Adds a new method IGBP::allowAllocation, which controls whether
dequeueBuffer is permitted to allocate a new buffer. If allocation is
disallowed, dequeueBuffer will block or return an error as it
normally would (as controlled by *ControlledByApp).

If there are free buffers, but they are not of the correct dimensions,
format, or usage, they may be freed if a more suitable buffer is not
found first.

Bug: 19801715
Change-Id: I0d604958b78b2fd775c2547690301423f9a52165
2015-04-23 15:28:12 -07:00
Dan Stoza 0de7ea7529 libgui: Change BufferQueue to use free lists
BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

Fixes an issue with the first version of this change, found in bugs
20482952, 20443314, and 20464549.

Bug: 13175420
Change-Id: I9b6e83cfe8f9b4329a976025cb8e291d51fb6d4a
2015-04-23 13:25:11 -07:00
Dan Stoza 7637e35d17 Merge "Revert "libgui: Change BufferQueue to use free lists"" 2015-04-22 18:59:02 +00:00
Dan Stoza 1fc9cc25a4 Revert "libgui: Change BufferQueue to use free lists"
This reverts commit 8dddc99010.

Change-Id: I0b0fed9f1394c6f6ae812f6c562ead4473a8226e
2015-04-22 18:57:39 +00:00
Dan Stoza c62acbd127 libgui: Fix CPU rendering on Surface
When the surface damage code went in, it incorrectly assumed that if
an application was doing CPU rendering, it would be using lock and
unlockAndPost instead of dequeue and queue, so it repurposed the dirty
region too aggressively. This change keeps it from clobbering the
dirty region if a CPU producer is attached.

Bug: 20431815
Change-Id: Id4dfd71378311ea822f0289f6de2d20a7bd84014
2015-04-21 16:56:52 -07:00
Dan Stoza 8dddc99010 libgui: Change BufferQueue to use free lists
BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

Bug: 13175420
Change-Id: Ic8398e7511bd11a60a1c82e3ad2ee271c9822be1
2015-04-17 09:28:41 -07:00
Dan Stoza 5065a55291 libgui: Pass surface damage through BufferQueue
This change adds support for passing surface damage all of the way
down from the EGL interface through the consumer side of the
BufferQueue. Depends on system/core change
Ie645e6a52b37b5c1b3be19481e8348570d1aa62c

Bug: 11239309
Change-Id: I4457ea826e9ade4ec187f973851d855b7b93a31b
2015-04-15 13:19:38 -07:00
Dan Stoza 634f5ee6a7 libgui: Plumb detachBuffer through ConsumerBase
Exposes IGraphicBufferConsumer::detachBuffer as a ConsumerBase
method. attachBuffer is not currently exposed, because all current
clients will be recycling buffers through the allocator.

Bug: 19628705
Change-Id: I3e519767fa43d5d880c1d5695e31b60f6ad588af
2015-04-07 15:05:40 -07:00
Dan Stoza 231832eb27 DO NOT MERGE libgui: Plumb attach/detach through Surface
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)
2015-04-02 13:35:45 -07:00
Dan Stoza 1c87e474d8 DO NOT MERGE libgui: Remove IGBC::BufferItem
Removes IGraphicBufferConsumer::BufferItem. Depends on the
following changes:
    I187b3a7d05196b6289596afac8fb9a9d4aebff76
    I0ddd38df37500cfd6b21d1e768ed14e39c5cd9fc

Cherry-pick of Id1fa56d092188f2cb712768d5d2fc6a9027fb73c

Change-Id: I3edf0db8fba656fd78e18a5a7f1137f0fb6b237d
2015-03-20 12:29:04 -07:00
Dan Stoza cf3834db10 DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal
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
2015-03-19 13:58:07 -07:00
Eino-Ville Talvala 82c6bcc970 DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.
- 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
2015-03-19 13:56:00 -07:00
Dan Stoza 966b98bd86 Surface: Permit an IProducerListener on connect
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
2015-03-18 16:01:20 -07:00
Dan Stoza 3be1c6b60a libgui: Enable -Weverything and -Werror
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
2015-03-18 15:57:27 -07:00
Lajos Molnar 459c0b6d36 am 9b6be8e1: Revert "omx: add Intel\'s SemiPlanar OMX color format that is used on some devices"
* commit '9b6be8e10b25f6f0bb949fec67b36fc773f5b591':
  Revert "omx: add Intel's SemiPlanar OMX color format that is used on some devices"
2015-02-11 20:04:40 +00:00
Lajos Molnar 9b6be8e10b Revert "omx: add Intel's SemiPlanar OMX color format that is used on some devices"
This reverts commit 61b17d64f90b85fd367ea1c7609cac69485957d4.

Bug: 19317169
Change-Id: Ib1fcc26c46a52c848ffa8238ddbf6abfe57cfa5d
2015-02-11 09:58:58 -08:00
Lajos Molnar dac8c96955 am d25be0ea: DO NOT MERGE: omx: add OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar
* commit 'd25be0ea48c775e4038163b546c9553e294d4fdc':
  DO NOT MERGE: omx: add OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar
2015-02-07 00:06:07 +00:00
Lajos Molnar d25be0ea48 DO NOT MERGE: omx: add OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar
This seems to have the same layout as OMX_COLOR_FormatYUV420SemiPlanar,
but used under this value on some devices.

Bug: 19246722

Change-Id: Ib866024e52cf7b12608f02eefc43c6d58a1c0aa1
2015-02-06 19:26:50 +00:00
Lajos Molnar 8f706b5ddb am ea5da67d: add bUsingNativeBuffers to DescribeColorFormatParams
* commit 'ea5da67d90647a1d4b395be51bf9cec218b98b71':
  add bUsingNativeBuffers to DescribeColorFormatParams
2015-02-04 20:47:43 +00:00
Lajos Molnar ea5da67d90 add bUsingNativeBuffers to DescribeColorFormatParams
This is needed to find proper color format for flex-YUV native
buffer support.

Bug: 19179927
Change-Id: I91ae6764e302c4307a0750c1d6820506d735c942
2015-01-30 12:02:20 -08:00
Lajos Molnar ec41d55b8d am 94ee9b59: Merge "CpuConsumer: lock buffers that could be YUV as ycbcr" into lmp-mr1-dev
* commit '94ee9b5916903e6ee23bb1ce8f688900a4eb6f65':
  CpuConsumer: lock buffers that could be YUV as ycbcr
2015-01-29 08:41:35 +00:00
Lajos Molnar 6a26be7c2b CpuConsumer: lock buffers that could be YUV as ycbcr
Bug: 17906609
Change-Id: Ic71af69ec3b19ab1224ed3ad5e0a97c60e81cda6
2015-01-28 16:52:43 -08:00
Dan Stoza 471ec6b428 libui: Add Rect(uint32_t, uint32_t)
Adds a Rect constructor that takes uint32_t instead of int32_t, as
required by a change to Region and -Werror

Change-Id: If91915e5b4ec9ce9e7ba0fb84f03b045d000b023
2015-01-21 17:39:13 -08:00
Dan Stoza e18155e1c6 am 4ecf6ec9: Merge "Restore Region::set(uint32_t, uint32_t)"
* commit '4ecf6ec932644b680d5e13791275dd3bc1a1ee6d':
  Restore Region::set(uint32_t, uint32_t)
2015-01-22 00:13:22 +00:00
Rachad 2f70741547 am 806f23de: OpenMax IL: Added support for E-AC3 codec configuration params
* commit '806f23de71be2494cfabbe08d11c09606966a5d5':
  OpenMax IL: Added support for E-AC3 codec configuration params
2015-01-10 02:00:07 +00:00
Rachad 806f23de71 OpenMax IL: Added support for E-AC3 codec configuration params
Bug: 17883772
Change-Id: Ibf00534607db4bba14c935cf1eaa80eb740297f9
2014-12-23 16:04:59 -08:00
Bernhard Rosenkraenzer fe4966d59b Restore Region::set(uint32_t, uint32_t)
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>
2014-12-22 21:15:08 +01:00
Dan Stoza dd883c0b08 libgui: Enable -Weverything and -Werror
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:
  d723bd7669
  00d504c06e
  429ba89cd2

Change-Id: I034abec27bf4020d84af60d7acc1939c59986dd6
2014-12-05 14:59:29 -08:00
Dan Albert bb37153577 am 35df7531: Merge "libui: Enable -Weverything and -Werror"
* commit '35df753169397d9b647b251446af7093e237d047':
  libui: Enable -Weverything and -Werror
2014-12-05 18:01:49 +00:00
Dan Albert 7530114619 am 5588d900: Merge "Enable clang for libui/libgui/surfaceflinger"
* commit '5588d9000cd1ef217185c9001d6b5ecd84db9741':
  Enable clang for libui/libgui/surfaceflinger
2014-12-05 18:01:48 +00:00
Dan Stoza d318240042 libui: Enable -Weverything and -Werror
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)
2014-12-04 17:56:27 -08:00
Dan Stoza 01049c8321 Enable clang for libui/libgui/surfaceflinger
Enables clang and C++11 for libui/libgui/surfaceflinger, and
eliminates all compile-time warnings.

Change-Id: Ie237fdb5ae44f2bfcddaa884f9c65ec3f08ae50f
(cherry picked from commit f10c46ef85)
2014-12-04 17:56:17 -08:00
Dan Stoza e4ea03f74d am 80e81505: Merge "binder: Add {read,write}Uint32 methods to Parcel"
* commit '80e8150549c9d8380dadf942336d41ab3d92bf78':
  binder: Add {read,write}Uint32 methods to Parcel
2014-12-01 19:27:00 +00:00
Dan Stoza 32ad1d518b am 104e1259: Merge "binder: Return pid_t/uid_t instead of int"
* commit '104e12594e085bc8dd32eedb96643b774b1508a0':
  binder: Return pid_t/uid_t instead of int
2014-12-01 19:23:22 +00:00
Dan Stoza 41a0f2f86c binder: Add {read,write}Uint32 methods to Parcel
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
2014-12-01 11:13:11 -08:00
Dan Stoza 9c634fd2d1 binder: Return pid_t/uid_t instead of int
Makes IPCThreadState::getCalling{Pid,Uid} return a more
appropriate type.

Change-Id: I97f8a83c1c0722bc1afbf8a6df1a288f8f1f0d2c
2014-12-01 11:07:14 -08:00
Lajos Molnar eb0ad05762 am a63caa19: Merge "omx: add (temporary) index for automatic video frc support" into lmp-mr1-dev
* commit 'a63caa1983138e561b2b033c5d178636beeb1578':
  omx: add (temporary) index for automatic video frc support
  Fix issue #18356768: some app process may hang at Runtime#exit...
2014-11-20 23:05:47 +00:00
Lajos Molnar 76d4c5cf73 omx: add (temporary) index for automatic video frc support
Bug: 17383204
Change-Id: I9b22da03ea3f2a7d9dd85042fff442d2414cbc26
2014-11-19 16:09:49 -08:00
Marco Nelissen e12cfc23b2 am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"
* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b':
  Replace IInterface::asBinder() with a static
2014-11-17 18:52:56 +00:00
Marco Nelissen 097ca275f4 Replace IInterface::asBinder() with a static
so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
2014-11-17 08:47:01 -08:00
Narayan Kamath 5d07648b36 am 26653bad: Fix build.
* commit '26653bad7cdaa09470828781c5a2bab7c4d2445f':
  Fix build.
2014-11-14 10:42:55 +00:00
Narayan Kamath 26653bad7c Fix build.
Remove reference to undefined open max index extension.

Change-Id: I984b91afad3ca4d279a31048b4112fa9afdba9e9
2014-11-14 10:24:28 +00:00