Commit Graph

194 Commits

Author SHA1 Message Date
Conley Owens
7badf9c5e8 am a47c0d29: am 58e4a5e2: Merge "Fixed to draw texture when loadTexture() is called at first time"
* commit 'a47c0d29bec7c242fb8d5ffe206c4c6ff85a178a':
  Fixed to draw texture when loadTexture() is called at first time
2011-04-29 17:15:35 -07:00
Conley Owens
e85e4d4ed2 Merge "Fixed to draw texture when loadTexture() is called at first time" 2011-04-29 10:00:12 -07:00
Conley Owens
56b79aa816 Merge "Fixed to call computeVisibleRegions() when transparent value changed" 2011-04-29 09:59:30 -07:00
Conley Owens
ddc25bb92e am ac505b86: am f0556bb9: am 86d1d747: Merge "Add lock before calling initEglImage"
* commit 'ac505b86b45462d9883f9c36fad0ef85e0885ee4':
  Add lock before calling initEglImage
2011-04-27 13:41:12 -07:00
Conley Owens
a97b487178 am 86d1d747: Merge "Add lock before calling initEglImage"
* commit '86d1d74762e65b6f64c2d4758aa5fd4af6275696':
  Add lock before calling initEglImage
2011-04-27 12:43:19 -07:00
Kobi Cohen Arazi
0d11baf889 Add lock before calling initEglImage
Without that lock, there is a chance of race condition
where while composing a specific index, requestBuf with
the same index can be executed and touch the
same data that is being used in initEglImage.
(e.g. dirty flag in texture)
2011-04-15 10:38:33 -07:00
Ichitaro Kohara
dcab18c9c1 Fixed to draw texture when loadTexture() is called at first time
SW renderer of Stagefright reaches loadTexture() to draw image.
The first time loadTexture() is called, it just initializes OGL
texture, then returns. Thus, the first time call doesn't draw.
This patch fixes to move on to draw stage after the initialization.

Change-Id: I3ec1ad68fb8d376a4ad7aefded1c18a002d175c4
2011-04-05 08:58:44 +02:00
Jamie Gennis
d32a694a0c Merge "SurfaceFlinger: Fix a typo." into honeycomb-mr1 2011-03-18 17:32:25 -07:00
Jamie Gennis
5fd799dab6 SurfaceFlinger: Fix a typo.
This change makes Layer skip its cleanup of its old shared memory region
when the UserClient object that owned the memory has been freed.

Bug: 3429357
Change-Id: I9e4d8eb190f6914dc043674b9bb8dd28e959901b
2011-03-18 16:35:13 -07:00
James Dong
5f7204cb66 Fix missing AOSP copyright headers for more files
o Update the copyright date on InputDispatcher_test.cpp and InputReader_test.cpp
  because these two files were moved from other places to the current location,
  and were actually created in 2010.

bug - 4119349

Change-Id: Ic93b81ddafb58e9e72a2e9e02ca3d9f173d6dca7
2011-03-17 14:43:12 -07:00
Mathias Agopian
d0b55c011a fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
a memory corruption happned when the buffer pool was resized
(like when playing a video or using camera) and there was
no current active buffer. In this case, the faulty code
would index into an array at position -1 which corrupted
24 bytes of data.

also improved region validation code (ifdef'ed out by default)

Bug: 4093196
Change-Id: I915c581d131148959d720e00e3892e9186ab733d
2011-03-17 00:04:42 -07:00
Jamie Gennis
7a4d0dfd43 SurfaceFlinger: Respect the PROTECTED gralloc bit.
This change makes SurfaceFlinger treat layers for which the active
buffer has the GRALLOC_USAGE_PROTECTED bit set as if they have the
'secure' flag set.

Change-Id: Ic60b6513a63e4bb92ec6ce9fd12fd39b4ba5f674
Bug: 4081304
2011-03-10 16:25:48 -08:00
Mathias Agopian
18570db84e am 33029221: Merge "revert the surface purgatory list and dependent changes." into gingerbread
* commit '33029221619f14577bd0d0e7c2f815abc8f1b8ea':
  revert the surface purgatory list and dependent changes.
2011-03-09 17:11:10 -08:00
Mathias Agopian
f7662afb76 revert the surface purgatory list and dependent changes.
6d0f6cb Revert "Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only"
6154412 Revert "partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)"
37c2a37 fix [3408713] Dialog window invisible sometimes

It looks like there is a surface leak, it's unclear where it is.
Without those reverts, this would cause a leak of the associated buffers
which is far more problematic. this change might hide the surface leak.

Bug: 4078032
Change-Id: Iedcda3ffcdd2f69d41047b5c3134c1e867ff90d7
2011-03-09 17:00:41 -08:00
Jamie Gennis
134f042286 ANativeWindow: add queues-to-window-composer check.
This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.

Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
2011-03-08 16:49:51 -08:00
Mathias Agopian
5f1e78d730 am df6410dc: Merge "Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only" into gingerbread
* commit 'df6410dce3dae0bdb7e13118b3878079a1dcce03':
  Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only
2011-03-07 18:04:06 -08:00
Mathias Agopian
ee65ac8a71 Fix [3513017] in lockscreen but showing empty launcher (live wallpaper) only
37c2a37 fix [3408713] Dialog window invisible sometimes
d35c666 fix [3385504] Surface flinger hang when adding dim surface
1723b04 fix [3389263] OMX.Nvidia.h264.decode fails to shutdown
1b0114f fix a surface leak in SurfaceFlinger

Bug: 3513017

Change-Id: Ia13ed8c9cdcb1f484e177cdcaff687e7c88a10c3
2011-03-07 16:56:16 -08:00
Mathias Agopian
1c71a47a6d remove some logs
Change-Id: Ia476184048ee419e19330a56dc8e6553189f6a24
2011-03-02 18:45:50 -08:00
Jamie Gennis
e7809762e1 am 0dc5fdb9: am e630e5f4: am 919853ce: Merge "Prevent SurfaceFlinger from using layer token 31." into gingerbread
* commit '0dc5fdb9b2fd3b3e2ede5e9607bc21423f357a01':
  Prevent SurfaceFlinger from using layer token 31.
2011-02-27 16:04:42 -08:00
Jamie Gennis
d1ad86f66b am e630e5f4: am 919853ce: Merge "Prevent SurfaceFlinger from using layer token 31." into gingerbread
* commit 'e630e5f49ba15005172dceeda7299569b2d2351f':
  Prevent SurfaceFlinger from using layer token 31.
2011-02-27 15:55:21 -08:00
Jamie Gennis
db7b742f65 am 919853ce: Merge "Prevent SurfaceFlinger from using layer token 31." into gingerbread
* commit '919853ce244f853966817d4adb2f3b7b6e4bbe74':
  Prevent SurfaceFlinger from using layer token 31.
2011-02-27 15:44:36 -08:00
Eric Hassold
ab0225e330 Merge "Correctly handle translucency of device-specific pixel formats" 2011-02-23 14:10:04 -08:00
Ichitaro Kohara
2168e2de24 Fixed to call computeVisibleRegions() when transparent value changed
When some Surfaces are overlapping and one of them changed to
transparent or opaque, the back Surfaces should appear or
disappear. This patch calls SurfaceFlinger::computeVisibleRegions()
to re-calculate region of each Surface to implement the behavior.

Change-Id: Iffb1caf1b4ce28dff252e114fe5b9b07d9c84a6f
2011-02-17 12:31:23 +01:00
Mathias Agopian
a1f47b90ab fix a surface leak in SurfaceFlinger
SF kept a strong reference to ISurface until the
window manager removed the surface from the screen.
This fell appart when running standalone tests, that is
when the window manager wasn't involved.

When the window manager is around, it would clean-up surfaces
even when an application died.

with this change, SF is able to do its own cleanup without
relying on the window manager.

the change is very simple, we simply don't keep a reference
to ISurface and make sure no more than one of them can
be created.

Change-Id: I61f2d7473bf8d4aa651549a846c34cdbb0d0c85a
2011-02-16 15:31:07 -08:00
Eric Hassold
ac45e6bff1 Correctly handle translucency of device-specific pixel formats
Check requested format for device-specific formats, and assume (as
documented in libhardware/include/hardware/hardware.h) this is opaque
layer so no blending is necessary.

Bug: 3215931
Change-Id: Ib4dff8060ac522d201ff1e74807ac340c17d3fa7
2011-02-15 16:20:03 -08:00
Jamie Gennis
8a08392833 Prevent SurfaceFlinger from using layer token 31.
Bug: 2964479
Change-Id: I81e948924bff35b8b300d409f2c09f3779bcdeec
2011-02-10 16:18:36 -08:00
Mathias Agopian
48840800f4 am 50b029d5: am 7ba35f5a: Merge "[3418265] apply layer transformations to the DimLayer." into honeycomb
* commit '50b029d578fa06cd0733dcc7c69cb94f5f824908':
  [3418265] apply layer transformations to the DimLayer.
2011-02-02 16:46:46 -08:00
Mathias Agopian
bce26daaaf [3418265] apply layer transformations to the DimLayer.
with this change DimLayers will behave just like any other layer,
in particular they'll respect the layer transformations.

Change-Id: Icb4a1275e8bca9e3deb5f57c9f9219aaa69f9877
2011-02-02 16:05:39 -08:00
Jamie Gennis
79676ac8e6 am 09443aeb: am 62884505: Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycomb
* commit '09443aeb6470d66f5bc1938b70d74b3e2f9bbbb9':
  Reset ANativeWindow crop on buffer geometry changes.
2011-01-30 15:05:42 -08:00
Jamie Gennis
da04384f18 Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycomb 2011-01-30 15:00:44 -08:00
Mathias Agopian
3cbe436bfd am 8d778b37: am 231da079: Merge "fix [3389263] OMX.Nvidia.h264.decode fails to shutdown" into honeycomb
* commit '8d778b375ccb4945cdcd7cc93272a6d36466ad00':
  fix [3389263] OMX.Nvidia.h264.decode fails to shutdown
2011-01-28 18:43:08 -08:00
Mathias Agopian
3cc2677efc fix [3389263] OMX.Nvidia.h264.decode fails to shutdown
We were still destroying an ANativeWindow's buffer pretty soon
after it was removed from the window manager. This time
we really wait for the ISurace to go away.

Change-Id: I329273fedaeef76ee92836f6180c2c3808389330
2011-01-28 18:23:24 -08:00
Jamie Gennis
68f9127e88 Reset ANativeWindow crop on buffer geometry changes.
This changes the ANativeWindow API and the two implementations to reset
the window's crop rectangle to be uncropped when the window's buffer
geometry is changed.

Bug: 3359604
Change-Id: I64283dc8382ae687787ec0bebe6a5d5b4a0dcd6b
2011-01-28 18:21:54 -08:00
Glenn Kasten
16f0453fee Protected surface API
To be used by DRM framework, implemented by display HAL

Change-Id: I054a07a94f4d5dbe792f3a597e2e49a100d90eb2
2011-01-28 08:04:00 -08:00
Mathias Agopian
0d1561275e fix [3385504] Surface flinger hang when adding dim surface
Change-Id: I8e0cda414bcad5854d2ca5dde8370bfd8b2e5ea4
2011-01-25 20:52:46 -08:00
Mathias Agopian
275e627ef6 am 239fd805: Merge "fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)" into gingerbread
* commit '239fd805ef7c0e4116b0a89e20caaf287e91f017':
  fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)
2011-01-25 14:46:40 -08:00
Mathias Agopian
c92ba8851e am 1955a5c9: Merge "partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)" into gingerbread
* commit '1955a5c9da421dc89bb1a1dd3d3193159192cde9':
  partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)
2011-01-25 14:46:35 -08:00
Mathias Agopian
f7701fabe8 am d0441f92: Merge "fix a small bug that caused screenshot to show garbage in some cases (DO NOT MERGE)" into gingerbread
* commit 'd0441f921b2b1879fb44041f521d9bfaa5a547d0':
  fix a small bug that caused screenshot to show garbage in some cases (DO NOT MERGE)
2011-01-25 14:46:31 -08:00
Mathias Agopian
63e4bba515 am 043a3cdd: Merge "workaround [3201922] display not on: log full of gralloc errors (DO NOT MERGE)" into gingerbread
* commit '043a3cddf67e2baf38711bcb125084599f8f9802':
  workaround [3201922] display not on: log full of gralloc errors (DO NOT MERGE)
2011-01-25 14:46:27 -08:00
Mathias Agopian
59f71e7feb am d3fcd0a1: Merge "minor clean-up. SurfaceFlinger doesn\'t need libpixelflinger.so. (DO NOT MERGE)" into gingerbread
* commit 'd3fcd0a1c923498921107bb44fbc8b24582a170a':
  minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so. (DO NOT MERGE)
2011-01-25 14:46:22 -08:00
Mathias Agopian
d1a99ec6b2 fix [3361121] hang in glClear() - device unresponsive, OTA fails (DO NOT MERGE)
Generally we never want to lock a buffer for write access if it is at
the "head" on the surfaceflinger side. The only exception (1) is when
the buffer is not currently in use AND there is at least one queued
buffer -- in which case, SurfaceFlinger will never use said buffer
anymore, because on the next composition around, it will be able to
retire the first queued buffer.

The logic above relies on SurfaceFlinger always retiring
and locking a buffer before composition -- unfortunately this
didn't happen during a screenshot.

This could leave us in a situation where a buffer is locked by the
application for write, and used by SurfaceFlinger for texturing,
causing a hang.

Here, we fix this issue by never assuming the exception (1), it was
intended as an optimization allowing ANativeWindow::lockBuffer() to
return sooner and was justified when most of SF composition was
done in software. The actual buffer locking is now ensured by
gralloc. We could have handled screenshots in a similar way to
a regular composition, but it could have caused glitches on screen,
essentially, taking a screenshot could cause to skip a frame.

now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.
2011-01-25 14:19:13 -08:00
Mathias Agopian
53a67e1663 partially fix [3306150] HTML5 video with H/W acceleration blackout (DO NOT MERGE)
We used to guarantee that a layer in SurfaceFlinger would never be
destroyed before all references (to its ISurface) on the client
side would be released. At some point, this guarantee got
relaxed to allow to free gralloc resources sooner. This last
change was incorrect, because:
- in implementations with reference-counting the gralloc resources
wouldn't be released anyways, until all the mapping were gone
- in implementations without ref counting, the client side
would most likely crash or do something bad
- it also caused the SharedBufferStack slot to be reallocated
to another surface, which could be problematic if the client
continued to use the surface after the window manager destroyed it.

So, we essentially reinstate the guarantee that layers won't be
destroyed until after all references to their ISurface are
released.

NOTE: This doesn't entirely fix 3306150 because there is another
problem there where the Browser continues to use a surface after it
has been destroyed.

also improve SurfaceFlinger 'dumpsys' log

list the purgatory, which shows windows that have been closed,
but for which the client still has references.
2011-01-25 14:19:13 -08:00
Mathias Agopian
cfb676f1ae fix a small bug that caused screenshot to show garbage in some cases (DO NOT MERGE)
we were not clearing the screen entirely, which caused garbage when
the screen wasn't entirely covered by windows.

Change-Id: Ia7aa13c36a8a314e0e8427d419b16b9aa2165ddf
2011-01-25 14:18:58 -08:00
Mathias Agopian
5dc7e7da92 workaround [3201922] display not on: log full of gralloc errors (DO NOT MERGE)
we make sure to call compositionComplete after everytime we do
composition with the GPU (even for the screenshot case), which is
where the buffer locks are released.

Change-Id: I450430d1e4d1ee9ce1023970642378c42cdcfa4c
2011-01-25 14:18:29 -08:00
Mathias Agopian
a0c6b76173 minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so. (DO NOT MERGE)
Change-Id: I1ddbbbec4fa5b2521ef3787bc28efe1bc90d0060
2011-01-25 14:18:15 -08:00
Mathias Agopian
0c2648ab64 tone down the log spew regarding taking screenshots.
Change-Id: I673806bda23eba6aab25f7505b7e0170afc9920b
2011-01-24 18:13:54 -08:00
Mathias Agopian
a9f54a77cd Merge "fix [3369743] SurfaceFlinger reads hardware composer hints before calling hwc.prepare()" into honeycomb 2011-01-20 12:25:33 -08:00
Mathias Agopian
2bd1d95efe clean-up unneeded code
now that we removed the notion of a "inUse" buffer in surfaceflinger
a lot of code can be simplified / removed.

noteworthy, the whole concept of "unlockClient" wrt. "compositionComplete"
is also gone.

Change-Id: I210413d4c8c0998dae05c8620ebfc895d3e6233d
2011-01-20 12:10:11 -08:00
Mathias Agopian
48b888aab9 improve SurfaceFlinger 'dumpsys' log
list the purgatory, which shows windows that have been closed,
but for which the client still has references.

Change-Id: I5168bb88cb328d5d77d71d0871deb9190f493126
2011-01-19 16:15:53 -08:00
Mathias Agopian
f20a32415d fix [3369743] SurfaceFlinger reads hardware composer hints before calling hwc.prepare()
Change-Id: If3277c7b9d4cb8ef20d1706155fac7b87e64fb20
2011-01-19 15:24:23 -08:00