Commit Graph

48989 Commits

Author SHA1 Message Date
Andy McFadden
3c25621ad7 Re-enable frame dropping for non-auto timestamps
This change adds an entire field to note whether the timestamp was
auto-generated by Surface or supplied by the application.

The value is used when deciding whether or not to drop frames based
on buffer presentation timestamps.  If a desired presentation time
was set explicitly, BufferQueue will use that value to decide if a
frame should be dropped.  If the timestamp was generated by Surface
at the time the buffer was queued, the timestamp is ignored.

Bug 10151804

Change-Id: Ibd571a7578351063b813cbdad2ddbeed70655ba5
2013-08-16 15:15:16 -07:00
Jesse Hall
a33b62cc47 Merge "Replace sRGB_888 with sRGB_X_8888" into klp-dev 2013-08-16 21:50:22 +00:00
Igor Murashkin
e60a0b1e6a Merge "gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquired" into klp-dev 2013-08-16 21:02:02 +00:00
Jesse Hall
bc2a90b024 Replace sRGB_888 with sRGB_X_8888
Bug: 10357459
Change-Id: I3a1d92cce2c9d3e930408129fb20887276fffddc
2013-08-16 07:50:11 -07:00
Jesse Hall
e048a4374c Merge "Add support for EGL_KHR_gl_colorspace" into klp-dev 2013-08-15 23:17:49 +00:00
Mathias Agopian
e0ec2a9568 Merge "Fix ES2 composition on some devices" into klp-dev 2013-08-15 23:12:26 +00:00
Mathias Agopian
2eaefe198a Simplify handling of opaque layers in shader generation
just ensure the alpha value is 1.0 in the opaque case
when reading the color from the texture or the
global color.

Bug: 8679321

Change-Id: Ia38b30e97c3bce5a2d534a40c0d66e0bfc3ea40d
2013-08-15 15:11:01 -07:00
Mathias Agopian
458197de00 Fix ES2 composition on some devices
- turns out fragment shaders don't have default precision by default
- GLES 1.x extensions that became core in GLES 2.0 don't always work
  as extensions in GLES 2.0 (!)

Bug: 8679321
Change-Id: I5a4a93e158247910399325a965af5d2e3bbece9b
2013-08-15 14:56:51 -07:00
Andy McFadden
6db4ff6218 Disable GLES 2.x rendering
Bug 10340705

Change-Id: I91f3baf0d79655d8d031c100d0b116f745c2fbef
2013-08-15 10:39:11 -07:00
Andy McFadden
892f22dcb9 Initialize mIndent
Bug 10334731

Change-Id: Ia3aa118a1516cc480b0d85179b78c4447f982dd6
2013-08-15 10:05:01 -07:00
Igor Murashkin
a5b7513711 gui: CpuConsumer::lockNextBuffer change return code when too many bufs acquired
- Return NOT_ENOUGH_DATA instead of INVALID_OPERATION when too many
  buffers have already been locked.
- INVALID_OPERATION is nominally used when something irrecoverable happens,
  but in this case the client just needs to call unlockBuffer to go back into a
  good state.

Bug: 10333400
Change-Id: I3a034d77de85741429f832a90eedd670afa1dc94
2013-08-14 20:17:17 -07:00
Mathias Agopian
5bbe0ab655 fix build. optional test broke.
Change-Id: I0ed5e2cd4c8945ee95673ed0eec5820d9def5097
2013-08-14 18:22:02 -07:00
Mathias Agopian
c6bae007e6 Fix build. optional tests were broken.
Change-Id: Iba9f5cb57f134559e1f9c55e293578d9f5d8cb96
2013-08-14 16:27:19 -07:00
Mathias Agopian
b2620900a8 Merge "don't reallocate the mesh each time we use it" into klp-dev 2013-08-14 22:43:25 +00:00
Mathias Agopian
56f825e7ab Merge "SurfaceFlinger now uses GLES 2.x when available" into klp-dev 2013-08-14 22:42:52 +00:00
Mathias Agopian
5cdc8994a0 don't reallocate the mesh each time we use it
the Mesh object can be part of each Layer (at least currently).
also reworked the Mesh code a bit to make it easier to access
the vertex data.

Change-Id: I0490851ba898f0aa2e55b62958dcd8bdb535e98b
2013-08-13 20:51:23 -07:00
Todd Poynor
5025593d0e Merge "dumpstate: switch to HAL static libraries" into klp-dev 2013-08-14 00:22:41 +00:00
Todd Poynor
4f5b9a701b dumpstate: switch to HAL static libraries
Change-Id: I865a0b4b4a84a2d54a239e7b09874287f0c1ad56
2013-08-13 16:30:01 -07:00
Mathias Agopian
3f84483382 SurfaceFlinger now uses GLES 2.x when available
Bug: 8679321

Change-Id: I2b152d01fb4e2de2ea9fe87f1ddbd6826d7520d7
2013-08-13 16:07:45 -07:00
Mathias Agopian
5ff5a84e48 allow "system" screenshots even when the secure flag is set
we need too allow this case so that things like the rotation
animation can work.
with this change we only permit these screenshot if the
destination is SurfaceFlinger itself.

Bug: 10235036
Change-Id: I66fea5391e52b0d7f17f25827572b236f2d9eb71
2013-08-13 15:58:38 -07:00
Jesse Hall
c2e41222bf Add support for EGL_KHR_gl_colorspace
Change-Id: I684d0b8556cd6c84ee4b4d67e1bb95c3b96fccfb
2013-08-13 12:10:51 -07:00
Jesse Hall
6f23562e0c Merge "Don't swallow eglCreateContext errors" into klp-dev 2013-08-13 18:33:07 +00:00
Mathias Agopian
45155969dc make sure GLConsumer::releaseTexImage() works after detachFromContext()
Change-Id: I27e0bc57e927d47b2b98113ee37b5396bcc72019
2013-08-12 23:45:28 -07:00
Jesse Hall
ea4fdd4beb Don't swallow eglCreateContext errors
If the implementation eglCreateContext failed, we called
eglGetError(), so we could check that it set the EGL error properly.
But since we'd already called this, when the app called eglGetError()
it would get EGL_SUCCESS!

Bug: 10181333
Change-Id: Ic45d3a8fcb8c4421e04844c6d2f52761790b5948
2013-08-12 16:43:34 -07:00
Mathias Agopian
96a7dc08f2 Merge "make sure we have a context when creating the 1st surface" into klp-dev 2013-08-09 04:41:19 +00:00
Mathias Agopian
9870c9b66c make GLConsumer's debug texture static
this is so that we don't burn a gralloc handle and a bit
of memory per GLConsumer.

Change-Id: I30c3e7ec45d7f1b5426aca8e06c7716870877706
2013-08-08 17:46:48 -07:00
Mathias Agopian
a6bb107434 make sure we have a context when creating the 1st surface
also add an option to dump the stack trace when
calling a GL function without a context.

Change-Id: I57b72bb8c322ac4253c3077bf150621bd9863b69
2013-08-08 16:38:06 -07:00
Jesse Hall
6c913be9ca Add ISurfaceComposer::destroyDisplay
Bug: 10191053
Change-Id: Ia89286f95421344a60ffedaaca5825c4e3cd7f9e
2013-08-08 13:12:29 -07:00
Mathias Agopian
74020ca133 Merge "don't hardcode debug texture dimensions" 2013-08-07 20:36:07 +00:00
Mathias Agopian
45263e2475 don't hardcode debug texture dimensions
Change-Id: I356333801d246a8cafb3e977a77dc7325e8b822d
2013-08-07 13:35:20 -07:00
Jean-Baptiste Queru
0de07adb02 am 046b72fc: Merge "fix a possible deadlock when removing a layer and destroying a client"
* commit '046b72fc5d93aae3b47b88b9f6683512d01d75d0':
  fix a possible deadlock when removing a layer and destroying a client
2013-08-07 13:18:51 -07:00
Todd Poynor
b98240cc6c batteryservice: add battery current now and charge counter data
Change-Id: I4b3ea25342d4a03a8e38bfee2ef3b1ce54f82582
2013-08-07 18:30:13 +00:00
Jesse Hall
43c2718b3f Merge "Add EGL_KHR_get_all_proc_addresses to extension string" 2013-08-07 15:23:05 +00:00
Jesse Hall
ff866e7642 Merge "Set the swap interval of virtual display surfaces to 0" 2013-08-07 15:23:00 +00:00
Jesse Hall
f460f55c84 Set the swap interval of virtual display surfaces to 0
This prevents slow/malicious virtual display consumers from
backpressuring SurfaceFlinger and preventing it from updating other
displays.

Bug: 10193714
Change-Id: I3e877d97202628d2d9abea24b66576f38299c14d
2013-08-06 19:32:02 -07:00
Mathias Agopian
5f51ed9499 fix tests more
Change-Id: I05c3dd6a22440844f8bd071f4c2b620b2bd8c720
2013-08-06 16:47:04 -07:00
Mathias Agopian
3dce3360e7 fix tests
Change-Id: I0f4d613481eda2c44a2d631a81d75de7e52e7a62
2013-08-06 16:42:05 -07:00
Mathias Agopian
3ca76f416b remove support for glReadPixels screenshot path
this was only needed on some chipset we're not
supporting in KLP.

Change-Id: I2e8fc07f135030bd61d2e241a8e426f1a4316425
2013-08-06 16:07:33 -07:00
Jesse Hall
21558daf69 Add EGL_KHR_get_all_proc_addresses to extension string
We've had the extended behavior since Android 4.3, but the extension
hadn't been ratified by Khronos yet so we couldn't add it to the
extension string.

Bug: 9681677
Change-Id: I78842316a3ab7a3f66a0ac1a4742d837de664c4c
2013-08-06 15:33:46 -07:00
Mathias Agopian
126b9c8e95 Fix build. 3rd attempt
Change-Id: I4317b34fd07890ea7cf9db51be42d72ef21aca89
2013-08-06 15:19:15 -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
Jean-Baptiste Queru
046b72fc5d Merge "fix a possible deadlock when removing a layer and destroying a client" 2013-08-06 18:37:12 +00:00
Mathias Agopian
e5886d9178 fix a possible deadlock when removing a layer and destroying a client
generally the last reference to a Layer is released in commitTransaction()
with mStateLock held. Layer itself only holds weak references to Client,
however, ~Layer() briefly promotes this weak reference -- during that time
the all other strong references to that Client go away, ~Layer is left with
the last one... then hell breaks loose as ~Client is called, which in turn
needs to acquire mStateLock.

We fix this by holding a temporary copy of the drawing state during
the transaction so that the side-effects of copying the current
state into the drawing state are seen only after mStateLock has
been released.

Bug: 9106453
Change-Id: Ic5348ac12283500ead87286a37565e8da35f1db2
2013-08-05 14:28:46 -07:00
Eino-Ville Talvala
687821c05b Merge "BufferQueue: Support query of consumer usage bits" 2013-08-05 21:10:45 +00:00
Andy McFadden
d9ba9707b0 Merge "Roll back recent change" 2013-08-02 22:34:13 +00:00
Andy McFadden
4b49e08385 Roll back recent change
Disable dropping of frames based on timestamp.  Resume auto-
generating timestamps in Surface.

Bug 10151804

Change-Id: I15de26158e1d7ef22a5b150e685a126dc48ae2b4
2013-08-02 15:31:45 -07:00
Mathias Agopian
c1c39f8807 Merge "Binderize the consumer side of BufferQueue" 2013-08-02 20:35:26 +00:00
Andy McFadden
86cd09d388 Merge "Drop frames based on presentation timestamp" 2013-08-02 16:53:11 +00:00
Mathias Agopian
a4e19521ac Binderize the consumer side of BufferQueue
While currently untested, this should allow to move the
BuffereQueue in the consumer process and have everything
work as usual.

Bug: 9265647

Change-Id: I9ca8f099f7c65b9a27b7e7a3643b46d1b58eacfc
2013-08-01 17:20:08 -07:00
Andy McFadden
14fab7dd79 Drop frames based on presentation timestamp
If there are two or more buffers pending that are ready for
immediate presentation, drop all but the last one.

Any code that didn't explicitly specify timestamps for buffers
was using the default value (auto-generated "now").  As a result,
surfaceflinger would drop frames whenever more than one buffer
was queued.  We now use zero as the auto-generated timestamp,
and we don't set the timestamp in eglBeginFrame().

Change-Id: I187f42d33de227cd3411ff0dcd3b9ce1961457eb
2013-08-01 15:58:08 -07:00