Commit Graph

238 Commits

Author SHA1 Message Date
Jesse Hall c2e41222bf Add support for EGL_KHR_gl_colorspace
Change-Id: I684d0b8556cd6c84ee4b4d67e1bb95c3b96fccfb
2013-08-13 12:10:51 -07:00
Mathias Agopian db89edc94b All consumers now take an IGraphicBufferConsumer instead of a BufferQueue
this means they only have access to the consumer end of
the interface. we had a lot of code that assumed consumers
where holding a BufferQueue (i.e.: both ends), so most of
this change is untangling in fix that

Bug: 9265647
Change-Id: Ic2e2596ee14c7535f51bf26d9a897a0fc036d22c
2013-08-06 20:05:36 +00:00
Mathias Agopian c2414bb098 get rid of HAL pixelformats 5551 and 4444
Change-Id: I39409103144c1ba09078c4ddc323a58987fb09ea
2013-07-26 15:43:33 -07:00
Mathias Agopian dd533712f8 make transparent pixels transparents again
apparently boolean logic in hard...

Change-Id: Ie70401fe12e0fa00b0b8c7cc475c1438cdbbf531
2013-07-26 15:31:39 -07:00
Mathias Agopian 5773d3f5b2 get rid of PixelFormatInfo and simplify things
Change-Id: I025a362cc12d5b9b794fac14be500e25aab65396
2013-07-25 19:24:31 -07:00
Jamie Gennis 6547ff4327 surfaceflinger: add frame duration logging
Change-Id: Ib414a45e7e191f23a2726cbbbeb606e9ce68a3b5
2013-07-23 17:28:47 -07:00
Mathias Agopian 595264f1af BufferQueue improvements and APIs changes
this is the first step of a series of improvements to
BufferQueue. A few things happen in this change:

- setSynchronousMode() goes away as well as the SynchronousModeAllowed flag
- BufferQueue now defaults to (what used to be) synchronous mode
- a new "controlled by app" flag is passed when creating consumers and producers
  those flags are used to put the BufferQueue in a mode where it
  will never block if both flags are set. This is achieved by:
  - returning an error from dequeueBuffer() if it would block
  - making sure a buffer is always available by replacing
    the previous buffer with the new one in queueBuffer()
    (note: this is similar to what asynchrnous mode used to be)

Note: in this change EGL's swap-interval 0 is broken; this will be
fixed in another change.

Change-Id: I691f9507d6e2e158287e3039f2a79a4d4434211d
2013-07-18 22:28:18 -07:00
Mathias Agopian 8f938a5338 always pass the BufferQueue explicitely to consumers
Change-Id: I883b0a7b19d8e722f9ab714ba6f49e658b02ca86
2013-07-12 22:06:26 -07:00
Andy McFadden c33f9a76b5 Merge "Pay attention to buffer timestamps" 2013-07-11 14:40:45 +00:00
Andy McFadden 1585c4d9fb Pay attention to buffer timestamps
When acquiring a buffer, SurfaceFlinger now computes the expected
presentation time and passes it to the BufferQueue acquireBuffer()
method.  If it's not yet time to display the buffer, acquireBuffer()
returns PRESENT_LATER instead of a buffer.

The current implementation of the expected-present-time computation
uses approximations and guesswork.

Bug 7900302

Change-Id: If9345611c5983a11a811935aaf27d6388a5036f1
2013-07-10 15:38:40 -07:00
Mathias Agopian 6b44267a3b fix SF buffer cropping
When a buffer had a crop (meaning its content is scaled to the window size)
and a window crop was defined, the resulting crop couldn't be expressed
properly because h/w composer's API was limited to integers, since
this is fixed in h/w composer 1.3, we take adventage of this to
make sure we get the correct crop.

this bug could result in the buffer being scaled by an incorrect ratio and
be slightly offset; moreover, it would produce different results from the
GL code path, which is always correct.

Change-Id: I8e20e00b6e26177d14f4ab4d2cd581e26c818892
2013-07-10 15:08:29 -07:00
Mathias Agopian 875d8e1323 Refactor SF. Move all GL operations in their own class.
this is the first step to add support for GLES 2.x, this
change breaks the dependency of SF on GLES 1.x by moving
all operation into their own class.

Bug: 8679321

Change-Id: I0d2741eca2cefe67dfd9cf837cac10c4d126928b
2013-07-03 14:39:27 -07:00
Mathias Agopian 1eae0ee494 clean-up SurfaceFlinger a bit
- most methods on Layer didn't need to be virtual
- more consistency in naming drawing/current state

Change-Id: Ieb7b4951b40fc673b807994ed21ae4aea7281068
2013-06-06 13:06:10 -07:00
Jesse Hall 29c3f35279 Prevent opaque windows from making framebuffer translucent
To keep the code readable now that we have four different texenv
configurations, this change separates the decisions about what
configuration to use from the GL calls to set up the configuration.

Bug: 8963244
Change-Id: Ia07a306a7809ba8f93493d0160ccbd509e948581
2013-05-24 10:51:41 -07:00
Mathias Agopian f3e85d4327 take the "transparent region" into account for blending
until now it was only used to discard a layer entirely.
we're now reducing the size of the layer if it is still
visible, if possible.

this works for instance when a surfaceView is used and
only the menu bar is displayed over it.

Change-Id: I3f5527c5cd1e69ecc968272c8948f1513ada8c55
2013-05-10 18:35:43 -07:00
Mathias Agopian 6c7f25afb7 reformat Rect.{cpp|h}
Change-Id: I45b1f6646541a1abacce1e70df00a770e47b820e
2013-05-10 18:03:31 -07:00
Mathias Agopian 3e25fd8609 Add a --color option to dumpsys SurfaceFlinger
colorize a bit the output of dumpsys SurfaceFlinger to
make it easier to read. Right now it will bold the
title of each section and use green for the name of
each layer.

Change-Id: I0d9f18d115401cb45109d244ef3a278481f68cc6
2013-04-22 21:51:28 +02:00
Mathias Agopian 74d211ae26 clean-up/simplify all dump() APIs
remove the scratch buffer parameter and use
String8::appendFormat() instead.

Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
2013-04-22 21:51:28 +02:00
Mathias Agopian 6c67f0fe45 make sure to update the "current state" when we "fake" the transaction
this mimics the code we used for the size. basically we need to
also update the "current state" because it gets copied to the
"drawing state" when a transaction occurs, and it would
"undo" our change.

Bug: 8511430
Bug: 8581533
Change-Id: I08c02abbf21b7f168f7124cd14ee717d7d3d502c
2013-04-12 16:58:11 -07:00
Mathias Agopian 2ca79399b9 latch transparent region hint only when we get a new frame
since the transparent region hint really depends on the
content of the window containing the SurfaceView
(it's calculated by the view hierarchy based on
overlapping views), it makes sense to latch it only when
the content of the window (the app) changes.

This should help fixing drawing artifacts when changing the
layout of a window containing a SurfaceView.

Bug: 8511430
Change-Id: Ic3aa668495293cb4d82a2cd7dcf3b6a337287678
2013-04-02 18:30:32 -07:00
Jesse Hall 13f01cbdbd Pass sp<Fence>s around instead of file descriptors
Change-Id: Iac70584a2207940730e8f803a543e4e9a4000c47
2013-03-22 09:56:58 -07:00
Mathias Agopian 6710604286 get rid of purgatory and fix QueuesToWindowComposer query
the purgatory list wasn't needed anymore; in fact it had no effect as
buffer life-time management is now handled by the BufferQueue.

For QueuesToWindowComposer we keep a list of wp<> on the IBinder
for IGraphicBufferProducers we hand over to clients so we can
easily check if an IGraphicBufferProducer is ours. We clean-up the
list when our IGraphicBufferProducer are destroyed.

Bug: 8349142
Change-Id: I1aa06652ade8c72d0004a3f5e6c3d6e8a82fc2ae
2013-03-14 19:18:13 -07:00
Mathias Agopian 4d9b822e2c get rid of ISurface
ISurface was only used to get the IGraphicBufferProducer from
a Layer. It's now replaced by a BBinder subclass / IBinder and
is only used as a handle to the surface, to both refer to it
and manage its life-time.

Also cleaned-up a bit the ISurfaceComposer interface and
"create layer" code path.

Change-Id: I68d0e02d57b862cffb31d5168c3bc10cea0906eb
2013-03-12 17:11:48 -07:00
Mathias Agopian 13127d8921 Get rid of LayerBase.
The functionality of LayerBase and Layer is folded
into Layer. There wasn't a need for this abstraction
anymore.

Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
2013-03-05 19:52:30 -08:00
Mathias Agopian b79f61d41e fold LayerBaseClient into LayerBase
Change-Id: Ic745136522df59c42f0885fd969e75ea55d09f01
2013-03-05 19:52:30 -08:00
Mathias Agopian a8bca8d84b refactor the crop region for hwc is calculated/set
- the crop region is now always calculated and set
  in LayerBase::setGeometry which uses new virtuals to
  access the "content" crop and transform (which are
  provided by the Layer subclass)

Change-Id: Ib7769bdec0917dd248f926600c14ddf9ea84897a
2013-02-28 18:43:04 -08:00
Jamie Gennis 789a6c3f1d SurfaceFlinger: fix a couple NULL fence checks
This change replaces checks for a NULL fence pointer with calls to
Fence::isValid.  There should no longer be NULL fences.

Change-Id: If17c9c132fcb1801531bf7588f8ba53476c57dad
2013-02-25 15:34:30 -08:00
Jamie Gennis 1df8c34585 libgui: disallow NULL Fence pointers
This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required.  Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.

Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
2013-02-12 18:15:38 -08:00
Jamie Gennis 351c294173 Merge changes I8bded1ea,I7478293e
* changes:
  SurfaceFlinger: add win anim frame time tracking
  SurfaceFlinger: remove a driver bug workaround
2013-02-11 19:48:18 +00:00
Jamie Gennis 4b0eba949c SurfaceFlinger: add win anim frame time tracking
This change makes the 'dumpsys SurfaceFlinger --latency' command with no extra
args dump the frame timestamp data for the most recent frames that
SurfaceFlinger generated that included window animation transaction changes.

Change-Id: I8bded1ea08a4cddefef0aa955401052bb9107c90
2013-02-08 13:32:21 -08:00
Mathias Agopian 9f8386e111 Add support for plane-alpha in HWC
Change-Id: I218e7dd5f23de535aabce61e993002ab6cb46cdd
2013-02-05 14:46:32 -08:00
Jamie Gennis 33c544c4d3 SurfaceFlinger: remove a driver bug workaround
Change-Id: I7478293e87899d6e467db8c2f9e295935c8b1d4e
2013-02-04 14:43:07 -08:00
Andy McFadden 882e3a39ed Add some comments.
Also, minor tweak to SurfaceTextureLayer.

Change-Id: If616d5ee4e8226dd0e16c5dbb0e0f80db553110e
2013-01-11 10:16:10 -08:00
Andy McFadden 2adaf04fab Rename ISurfaceTexture and SurfaceTexture
The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
2012-12-18 13:10:48 -08:00
Andy McFadden 97eba8904c Avoid unnecessary texture bind
In SurfaceFlingerConsumer, check to see if native fence sync is
enabled.  If so, defer the texture binding step to Layer::onDraw.

Change-Id: I7d4034a31c0143207eea2509dfa13ef3820f9b8c
2012-12-11 16:26:51 -08:00
Andy McFadden bf974abe92 Refactor SurfaceTexture a bit.
Rearranges updateTexImage() so that the SurfaceFlinger-specific
behavior is in a new SurfaceFlingerConsumer subclass.

SurfaceTexture behavior should not be altered.  Instead of
acquire-bind-release we now do acquire-release-bind, but since
it's all done with the lock held there shouldn't be any
externally-visible change.

Change-Id: Ia566e4727945e2cfb9359fc6d2a8f8af64d7b7b7
2012-12-11 09:42:51 -08:00
Jamie Gennis 46b6bce198 SurfaceFlinger: work around a driver bug
Change-Id: I4490f308b12e9b6fda2ea7255eb19d867d6d008c
2012-12-07 15:43:02 -08:00
Mathias Agopian 9913b9941e am a7da0dda: am 98cbec81: am efd614b8: Merge "make transform hint multi-display aware" into jb-mr1.1-dev
* commit 'a7da0dda39cf1e807eea1304b48d4583e7329b72':
  make transform hint multi-display aware
2012-11-27 18:43:52 -08:00
Mathias Agopian 8430095879 make transform hint multi-display aware
if a layer is not mirrored, we now use its display
as the source for the transfrom hint calculation
instead of always using the default (main) display.

this change does two thing:
1) we make updateTransformHint take a DisplayDevice
   as a parameter instead of hard-coding the
   main display.

2) each time we do a transaction that could change
   the hint, we go through all layers and
   figure out which display should be used for their
   transform hint.

Bug: 7599344
Change-Id: I9b04a95e6c372dd770bacf81d8ef6f8e31b87b83
2012-11-21 16:03:52 -08:00
Jamie Gennis 82dbc7429f SurfaceFlinger: refactor frame time tracking
This change moves the frame time history tracking code out of Layer and into a
new class called FrameTracker.  It also changes the tracking to use signal
timestamps from fences when available for more accurate results.

Change-Id: I323c5f075c58bf86ce363b52af885ad0f6365f2b
2012-11-19 17:45:09 -08:00
Igor Murashkin a4a3149a36 Change ConsumerBase's FrameAvailableListener to be a weak pointer
This prevents strong reference cycles when the listener implementation also
holds a strong pointer to the ConsumerBase

Bug: 7425644
Change-Id: I1514b13a32b18d421c902dddebec0765a989c55c
2012-11-05 13:39:02 -08:00
Jamie Gennis dd3cb84cfb SurfaceFlinger: add support for secure displays
This change adds support for displays that are not allowed to display surfaces
with the eSecure flag set.  All non-virtual displays are considered secure,
while virtual displays have their secure-ness specified at creation time.

Bug: 7368436
Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
2012-10-22 13:41:21 -07:00
Andy McFadden ab10c5804c Recompute visible regions more vigorously
Some of the code in latchBuffer was calling invalidateHwcGeometry,
but that didn't cause the SurfaceFlinger visible region code to
re-evaluate the layer's visibility.  Set the recomputeVisibleRegions
"out" parameter instead.

Bug 7235797

Change-Id: If6ba33fbd1a594cd64cc5253aebf752d6ceda1c9
2012-09-26 16:19:12 -07:00
Mathias Agopian eba8c688f6 calculate wether we filter on a per-display basis
Change-Id: I79d80b432b20b3d02428da19add464ac1e2b9378
2012-09-20 17:13:58 -07:00
Jamie Gennis 3941cb240d SurfaceTexture: default to doing GL sync
This change makes updateTexImage default to performing the necessary
synchronization and adds an argument for SurfaceFlinger to disable that
synchronization so that it can be performed lazily.

Change-Id: I7c20923cc786634126fbf7021c9d2541aa77be5d
Bug: 6991805
2012-09-18 10:59:40 -07:00
Mathias Agopian da27af9832 add support hwc 1.1
Bug: 7124069

Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
2012-09-17 18:57:53 -07:00
Andy McFadden 6905205c8d Fix transform hints
The hints were being set a little too late, so the pre-rotation stuff
wasn't quite working.

Bug 7054997

Change-Id: Id8d5c626db7a76f768ba762a145b315878ee08e6
2012-09-16 11:39:09 -07:00
Andy McFadden b0d1dd36f1 Reshuffle FramebufferSurface
FramebufferSurface no longer speaks directly to the FB HAL.  Now
everything goes through HWComposer (which may or may not be
connected to a hardware composer).

Added display index arg to some query methods.

Change-Id: Id3e157d2d4e3555d33afbb703e518b6e92e2d6d5
2012-09-11 09:31:34 -07:00
Jamie Gennis 61e04b92bd SurfaceTexture: use eglWaitSync
This change adds a compile-option to use eglWaitSyncANDROID to ensure that
texturing operations that access the current buffer of a SurfaceTexture do not
occur until the buffer is completely written.  It also moves this
synchronization into a new SurfaceTexture method called doGLFenceWait and
changes SurfaceFlinger's Layer class to use that method rather than performing
its own wait on the fence.

Change-Id: I70afa88086ca7ff49a80e3cd03d423767db7cb88
2012-09-10 13:27:23 -07:00
Mathias Agopian 71e83e1202 the visibleRegion was never set in hwcomposer
Bug: 7089478
Change-Id: I13b031b23ce908d33f431a04e1cf87831b551260
2012-09-04 20:25:39 -07:00
Mathias Agopian c397360883 the visible region sent to HWC was garbage
we used to have a visibleRegion object per layer, but now
it's per screen; so at somepoint the code got changed to
calculate the per-screen visible region on the stack and that's
what got passed to HWC.

we're now setting the visibleRegionScreen at each frame and
freeing at after the HWC set() call. We use the underlaying
SharedBuffer so that in most cases we don't have to allocate,
free or copy memory around.

Bug: 7089478
Change-Id: I24fa556c76613a225d9fe7a6c6b727bb476144d8
2012-08-31 18:41:22 -07:00
Jamie Gennis 31a353da22 BufferQueue: clean up buffer counting
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
2012-08-29 15:35:34 -07:00
Mathias Agopian 3ee454a7be Eradicate DisplayID.
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
2012-08-27 17:43:43 -07:00
Mathias Agopian 3165cc21cf libgui includes refactoring
Change-Id: I1d24ec17f5003ec2abab5f7472daaff4cc4cc2d3
2012-08-10 13:18:24 -07:00
Mathias Agopian 4297734c11 turn DisplayDevice into a reference-counted object
it's safer this way because this object owns an
EGLSurface which cannot be easily reference-counted.

it also gives us the ability to sub-class it, which
we might want to do soon.

Change-Id: I07358bb052dc5a13b4f2196b2c2b6e6e94c4bb4f
2012-08-05 00:40:46 -07:00
Mathias Agopian 888c822c4c remove a dependency of DisplayDevice on the refresh rate
this remove a dependency (not all) on FramebufferSurface

Change-Id: Ie07ce70760cdcedfb41b5b41bea8da45637bf474
2012-08-04 21:23:47 -07:00
Mathias Agopian d3ee231edd cleanups in preparation of bigger changes
- fix typo drawForSreenshot misspelled
- get rid of DisplayDeviceBase
- removed unused or unneeded code
- always pass a DisplayDevice to Layer methods that are called
  on a per-display basis (to make it clear that this could be
  called more than once per composition).

Change-Id: Id948b7e09fe5c06db0e42d40d6ed75dd095c7f44
2012-08-02 22:24:12 -07:00
Mathias Agopian 0f2f5ff75b rename DisplayHardware to DisplayDevice
Change-Id: I3f7250cd914e0da4f9ec2c9403587bbe12f3cc62
2012-08-02 22:24:12 -07:00
Mathias Agopian 52bbb1ae23 getting closer to final main composition loop
Change-Id: Icd63782366ffd11d9ea00c925ae5783ed7440cdb
2012-08-02 22:24:12 -07:00
Mathias Agopian 921e6ac4b7 SurfaceFlinger cleanup
mostly refactored SurfaceFlinger.h, but also removed dead code.
cleaned-up a few includes as well.

Change-Id: Ib15f4ffe567912b61ee98aa076c6a283b72811b5
2012-07-24 00:09:35 -07:00
Mathias Agopian a49126087b factor EGL/GL and surface creation out of DisplayHardware
Change-Id: Icd85a6a4caad06f056578008af3e21666fa8b1f4
2012-07-19 14:14:58 -07:00
Mathias Agopian 4fec873a98 one more step towards multiple display support
- 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
2012-07-10 14:29:27 -07:00
Jesse Hall c5c5a14c06 Only set acquire fences on overlay layers
Change-Id: I08e8173f83580de5a4e43a0ba5ea03e5ec6e8782
2012-07-02 16:49:28 -07:00
Jesse Hall dc5b485f74 Pass fence to HWC on first use of buffer
Also do a CPU-wait on the fence before using it for GL composition.

Change-Id: I0f645a42a44803276cae11b904e5a26d65871562
2012-06-30 21:38:51 -07:00
Mathias Agopian 1b03149f35 get rid of GraphicPlane
its functionality is now folded into DisplayHardware
there will be more changes in that area.
2012-06-28 17:27:19 -07:00
Jesse Hall ef19414bd8 Transfer HWC release fences to BufferQueue
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
2012-06-21 22:21:12 -07:00
Mathias Agopian 3e8b853d67 refactor HWComposer to break dependency with the HAL headers
HWComposer must abstract the HWC HAL entirely, so that the
HAL can continue to evolve (and break binary compatibility)
without breaking SurfaceFlinger. The HWC data structure had
leaked outside of HWComposer, this is now fixed.

We now have an abstract interface that provide all the
needed functionality, HWCompose provides concrete
implementations of it based on the the HWC version.

Change-Id: I40c4676dc986b682ede5520a1c60efe64037b0bb
2012-06-14 11:56:55 -07:00
Mathias Agopian 0cd545f142 sometimes we would incorrectly scale the content of a surface
this would happen when a resize was pending (ie: we have received
and processed a resize transaction but have not received a buffer
with the right size) and a new transaction came in that didn't
involve a resize, for instance a translate-only transaction.

in this case, we would incorrectly update the drawing state
with the pending size, eventhough we still don't have a buffer
for it.

the solution is quite simple, we never allow the size to propagate
from current to drawing state during the regular transaction processing
(unless we are in fixed-size mode -- meaning we don't need to have
a matching size buffer), this propagation happens later once we
receive the buffer.

Bug: 6624163
Change-Id: I11a97e4b88a7f3a0571ddcfe99c86cb04ce01a4d
2012-06-07 17:12:20 -07:00
Mathias Agopian 4824d40a35 sometimes SF would not process a surface resize
this would happen when a window started with size A, was
resized to B and immediately resized to A. In this situation
the erquested and active size would be the same, and SF
would think a transaction wasn't needed.

we fix this by always comparing the requested sizes.

Also, make sure to set mRefreshPending once we're sure
we have succesfully called updateTexImage().

Bug: 6580962
Change-Id: I2c48b4df7f05fd35c9e1d2dd82095b0f3d5a0b6a
2012-06-04 18:16:30 -07:00
Mathias Agopian e31564d8eb Fix a crasher is surfaceflinger.
this bug introduced recently would happen when the very first
buffer of a surface was rejected for not having the right size

Bug: 6577035
Change-Id: I9fabf20006019f2a6c308be7c7f5c05bdcfd5014
2012-05-29 20:41:03 -07:00
Mathias Agopian 2c8207e962 add the ability to reject buffers in SurfaceTexture::updateTexImage
SurfaceFlinger is using this new feature to reject buffers that
don't have the right size.

Bug: 6498869
Change-Id: I8a7250a47db6c082a357b703feb3b9d0fc8d3443
2012-05-23 18:01:33 -07:00
Mathias Agopian 702634a4da refactoring in preparation for bug:6498869 fix
here we just shuffle a bit the code inside lockPageFlip(),
we move the code that handles the buffer size closer to the call
to updateTexImage(). no functionality change.

Change-Id: Ie3193cd86cd32cf3c89532449fd747d145ca0ab6
2012-05-23 18:01:33 -07:00
Mathias Agopian 05cec9d127 improve resize transactions
use a flag instead of pre-committing the "requested" state
to prevent propagation or "requested" to "active", which makes
things a lot clearer when reading the code.

also avoid going through the "resized" code-path when requested
size is equal to "active" size.

Bug: 6498869
Change-Id: I24f893ba0ec5ca06aac5b8da9818989ae7ce4005
2012-05-23 18:01:24 -07:00
Mathias Agopian 419e196e63 Improve debug logs and minor clean-up
Bug: 6498869
Change-Id: I14d1b4d6960b87b5a7c4d7e20b92538edd9331ff
2012-05-23 18:01:14 -07:00
Mathias Agopian b30c415539 Fix "Battery/Status/Clock status bar area flickers when dragging down"
The crop is now handled like a resize, it's latched only when we
receive a new buffer in the case we have a resize in the same
transaction.

Bug: 6498869
Change-Id: I9f3cbbe08fb19443899461ec441c714748a4fd1a
2012-05-16 18:21:32 -07:00
Mathias Agopian 93ffb86b90 minor refactoring in praparation of crop fix
Bug: 6498869
Change-Id: I12a6f9a9fdfd2ea1db3fbe5fc8cb443aeaedb328
2012-05-16 17:07:49 -07:00
Jamie Gennis cbad735d8c SurfaceFlinger: recompute visible regions less
This change removes some visible region recomputation that was needed to handle
the SCALING_MODE_FREEZE cropping.  We've changed things to use a window crop
from the WindowManager instead, so this is no longer needed.

Bug: 6299171
Change-Id: I32fbc2b689c985837126d8ba3d9a91e79613ffbf
2012-05-14 15:41:38 -07:00
Jamie Gennis f15a83f581 SurfaceFlinger: add a crop to the layer state
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
2012-05-11 03:16:02 -07:00
Jamie Gennis 51dcd581b1 SurfaceFlinger: recompute visible regions more
This change makes a change in the crop, scaling mode, transform, or buffer
dimensions trigger a recomputation of the visible regions of a window.  With
the new cropping behavior for SCALING_MODE_FREEZE all of these can now affect
the visible region.

Bug: 6470541
Change-Id: I1904e47efbd708e28bf189f637d24dbef65cd41e
2012-05-10 15:35:56 -07:00
Jamie Gennis 161534a3c5 SurfaceFlinger: SCALING_MODE_FREEZE cropping support
This change adss support for applying a buffer crop to layers with the
SCALING_MODE_FREEZE scaling mode.  These layers do not scale the image, but
rather treat all pixels outside the crop rectangle as fully transparent.

Change-Id: I762518e56a37aef7747f9b581df2f2589b232c49
Bug: 6299171
2012-05-09 12:53:13 -07:00
Jamie Gennis cbb1a95819 SurfaceFlinger: tell SurfaceTex about filtering
This change makes SurfaceFlinger set the filtering-enable on each layer's
SurfaceTexture before querying the texture matrix to use for GLES composition.

Change-Id: I40c3defd73ebf96e3cabb3bfdb1fc97f2036753a
2012-05-09 12:53:13 -07:00
Mathias Agopian a0db308c3d remove SurfaceTexture::connect()
use BufferQueue::connect() instead

Change-Id: I04aab7cf11304bf962cde38470747f3b19ddba42
2012-04-23 20:06:02 -07:00
Mathias Agopian 7f42a9c47c triple buffering is now controled by BoardConfig and enabled by default
use TARGET_DISABLE_TRIPLE_BUFFERING := true to disable
triple buffering.

Change-Id: I9875d6ddefd23c1af9e51e7ee7dec1bacd1e6799
2012-04-23 20:00:16 -07:00
Daniel Lam b267579ba8 SurfaceTexture: Fully refactored from BufferQueue
SurfaceTexture and BufferQueue are separate objects.

Change-Id: I230bc0ae6f78d0f9b2b5df902f40ab443ed5a055
2012-03-13 14:39:07 -07:00
Mathias Agopian ed61a47c5b Merge "a window could get stuck to gpu composition" 2012-02-27 19:48:36 -08:00
Jamie Gennis 1c8e95cf86 Add tracing to various graphics components.
This change adds ATRACE call tracing to BufferQueue,
SurfaceTextureClient, SurfaceTexture, SurfaceFlinger, Layer, and EGL.

Change-Id: I9d75ed26f5a3f0d1af635da38289520134cfbbb7
2012-02-27 17:50:35 -08:00
Mathias Agopian ec923ee0d0 a window could get stuck to gpu composition
this could happen after an orientation change. basically
we need to triger a geometry-changed when the very first buffer
is received

Change-Id: I097e411fd6612c18725737cffccdbf6b2af3511c
2012-02-27 16:58:04 -08:00
Mathias Agopian 90ac799241 fix libgui header location
Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
2012-02-27 13:03:08 -08:00
Mathias Agopian ff615cc7a1 deprecate L_8, LA_88 and RGB_332 in sdk
re-add support for pixelformats L_8, LA_88 and RGB_332 in libui
for backward compatibility.

This may or may not fix 6058926

Bug: 6049685
Change-Id: Ic1b8b4cc994522f7fe664da64c0ef76b98bc6d53
2012-02-24 14:58:36 -08:00
Mathias Agopian 4d143eed99 fix an issue in SF where we could miss some updates
Change-Id: I7d350bc05d1596655baddff3deaebaba58c9bcc0
2012-02-23 21:17:01 -08:00
Mathias Agopian 303d538bb0 ui freeze workaround: reenable triple buffering mode
we're seeing UI freezes when window updates and
composition are separated. for now we workaround this
by always doing a composition after window updates on
vsync. triple buffering is reenabled for performance.

Change-Id: I693d705000b7452489bb0b4918fbeadb9879315c
2012-02-05 01:49:16 -08:00
Mathias Agopian 99ce5cdeb3 separate transactions from updates
with this changes, SF transactions are handled as soon as possible
but do not trigger updates. the update is delayed until the next
vsync.

this allows us to work much better without requiring triple-buffering.

Change-Id: I1fa10794d0cf742129f0877698b7b1e1f2ec7401
2012-02-01 20:43:06 -08:00
Mathias Agopian 8aedd4737d SF now synchronizes to VSYNC
Change-Id: Ic5e4f2ea9927ce133eef9499c03161325e9d02c5
2012-01-30 15:21:23 -08:00
Mathias Agopian 25e66fc324 added a few more commands to SF's dumpsys
--latency-clear [name]
clears the latency data for the specified layer or for
all layers if none is specified

--list
prints the list of all layers regardless of their visibility

Change-Id: I7c07ae020f838c173b98ee50f3fb3e93da78acbb
2012-01-28 22:31:55 -08:00
Mathias Agopian 82d7ab6c7e improve SurfaceFlinger dumpsys
It is now possible to say:

dumpsys SurfaceFlinger --latency

to print latency information about all windows

dumpsys SurfaceFlinger --latency window-name

to print the latency stats of the specified window

for instance: dumpsys SurfaceFlinger --latency SurfaceView

The data consists of one line containing global stats, followed by
128 lines of tab separated timestamps in nanosecond.

The first line currently contains the refresh period in nanosecond.
Each 128 following line contains 3 timestamps, of respectively
the app draw time, the vsync timestamp just prior the call to set and
the timestamp of the call to set.

Change-Id: Ib6b6da1d7e2e6ba49c282bdbc0b56a7dc203343a
2012-01-24 18:22:56 -08:00
Jamie Gennis e8696a40e0 hack up frame latency measurement
Change-Id: I6d9a466a23285304f0e229a5649815636ab5d6af
2012-01-24 15:41:50 -08:00
Steve Block 9d45368352 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Xavier Ducrohet 4c4163b53e Fix software GL renderer.
Change-Id: I07ab2709fa694e41aa3fcc5b9dfc809f55853ab4
2011-10-21 16:18:48 -07:00
Dave Burke 818fb24357 am 70ac412b: Merge "Add a LayerScreenshot" into ics-mr0
* commit '70ac412b2fe7be2507189a9fdfb30c43b36d56ac':
  Add a LayerScreenshot
2011-10-18 23:00:08 -07:00
Mathias Agopian 5ba8f366bd am 23bf2505: Merge "Make sure set GL state properly" into ics-mr0
* commit '23bf250522b7dff9acd14c5900b66b1df9c76745':
  Make sure set GL state properly
2011-10-18 20:24:21 -07:00