History log of /frameworks/base/libs/surfaceflinger/Layer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2df6f515675917a7a2812cf35faa5a1f47a6305f 07-May-2010 Mathias Agopian <mathias@google.com> fix [2664345] Flash: Bad flicker at the end of a pinch zoom.

the window manger puts SurfaceViews up before they have been
rendered into, because of that surfaceflinger doesn't have
anything ready to draw for that surface when an udpate occurs
and responds by filling the surface with black.
With this fix, we only fill those areas of the framebuffer
that would otherwise be undefined (no content at all).

in the Flash case, the "flash" window is not drawn at all
until it has some content, instead the underlaying browser
window is shown.

Change-Id: Ifb610f7f8c27b88edf83e09adc4803fc295c15a1
/frameworks/base/libs/surfaceflinger/Layer.cpp
967dce306267109a6e8aec408b65609ac5642a03 15-Apr-2010 Mathias Agopian <mathias@google.com> fix [2594950] Flash: Zooming in on some content crashes the Nexus One and causes it to reboot (runtime restart)

We now limit the size of the surface to the maximum size supported by the GPU.
On Nexus One this will 2048 -- it could be different on other devices.
Surface creation fails if the limit is exceeded.

Change-Id: I9ecfc2e9c58c9e283782b61ebfc6b590f71df785
/frameworks/base/libs/surfaceflinger/Layer.cpp
9e3d693b1895010f3a2dc1efaf11389da8557cb8 16-Mar-2010 Mathias Agopian <mathias@google.com> fix [2515291] Native crash and runtime restart while trying to preview captured picture on Sapphire

if a buffer couldn't be allocated because of an OOM, SF could, in some case dereference
a null pointer.

Change-Id: I5321248c38a21e56d5278b6aada2694e64451378
/frameworks/base/libs/surfaceflinger/Layer.cpp
1d211f8ee0b422a3a741c3f88246c7c72ce483b0 08-Mar-2010 Mathias Agopian <mathias@google.com> fixes for [2474091] Saw Poor behaviour playing a video.

- fix a bug when hacking video buffers into gralloc buffers
where the buffer size was incorrect this was causing the
"direct-form-texture" mode to fail

- also when the above fails, make sure to revert to the
"mdp copy mode" before going to "slow mode"

- finally disable completely the "direct-from-texture" mode
for now. It cannot work because the allocated buffers can't
respect the GPU constraints (alignment and such). We'll
have to find a solution for that.
/frameworks/base/libs/surfaceflinger/Layer.cpp
8f2423e8f394ae0666f1b61f83df4c0c7a4782d9 17-Feb-2010 Mathias Agopian <mathias@google.com> get rid off the YUV formats at the libui layer
/frameworks/base/libs/surfaceflinger/Layer.cpp
000479f9e325b4e426a67033abd92d47da412725 10-Feb-2010 Mathias Agopian <mathias@google.com> split libsurfaceflinger_client and libcamera_client out of libui
/frameworks/base/libs/surfaceflinger/Layer.cpp
f9b0e826689cca5ecbd40aa49f3ea7f7c73ad2a2 11-Dec-2009 Mathias Agopian <mathias@google.com> fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview screen is truncated after launching and back to home screen by home key repeatedly

When a surface is removed from the screen while it holds a "freeze lock", the
release of that lock happens in the destructor as a "safety net". However, it
doesn't trigger an update at that point.

Make sure that "freeze locks" are released from the transaction at the point
a surface is removed from the screen (if it's not on screen, it shouldn't
prevent the screen to redraw, and therefore cannot hold a freeze lock).
The refresh corresponding to that transaction will pick it up as soon as possible.
/frameworks/base/libs/surfaceflinger/Layer.cpp
083a557c25e0032bc4900f335b6643d0badd09ce 11-Dec-2009 Mathias Agopian <mathias@google.com> fix [2319255] crash in openGL : from the media recorder stress test.

never call eglCreateImageKHR() with a NULL native buffer, which can
happen in OOM conditions.
/frameworks/base/libs/surfaceflinger/Layer.cpp
5469a4ac1c5073bde2c7caf8540a459c8fb759cd 30-Nov-2009 Mathias Agopian <mathias@google.com> fixed [2260070] display stopped updating

always check that the visible region isn't empty after all visible regions are recomputed
clear he freeze-lock if it is.
/frameworks/base/libs/surfaceflinger/Layer.cpp
9042b4564de5477b18e680c7dce13b587a681dd9 27-Oct-2009 Mathias Agopian <mathias@google.com> fix [2143798] Need to figure out how to do video

Use EGLImageKHR instead of copybit directly.
We now have the basis to use streaming YUV textures (well, in fact
we already are). When/if we use the GPU instead of the MDP we'll
need to make sure it supports the appropriate YUV format.

Also make sure we compile if EGL_ANDROID_image_native_buffer is not supported
/frameworks/base/libs/surfaceflinger/Layer.cpp
382e17d46fc54396a303593f2db3abe1fb911411 22-Oct-2009 Mathias Agopian <mathias@google.com> fix [2211532] improves sholes graphics performance

Instead of using glTex{Sub}Image2D() to refresh the textures, we're using an EGLImageKHR object
backed up by a gralloc buffer. The data is updated using memcpy(). This is faster than
glTex{Sub}Image2D() because the texture is not swizzled. It also uses less memory because
EGLImageKHW is not limited to power-of-two dimensions.
/frameworks/base/libs/surfaceflinger/Layer.cpp
46b2df153fccf7f918ee5d7d747c208bdd2d55f4 08-Oct-2009 Mathias Agopian <mathias@google.com> fix [2164183] sometimes device just wants to stay asleep

When switching rapidily orientation back and forth, surfaces end-up
acquiring the freeze-lock when the first orientation change happens,
but never release it because by the time the 2nd orientation change
comes in, the surface size is back to its original size and
doesn't appear to have resized.

we now always release the freeze-lock when we receive a buffer of the
expected size.
/frameworks/base/libs/surfaceflinger/Layer.cpp
e05f07dffa196d6403733b26317faa9f267d518f 08-Oct-2009 Mathias Agopian <mathias@google.com> fix [2170319] gmail bulk operation checkbox latency on passion

This also fixes [2152536] ANR in browser

When SF is enqueuing buffers faster than SF dequeues them.
The update flag in SF is not counted and under some situations SF will only
dequeue the first buffer. The state at this point is not technically
corrupted, it's valid, but just delayed by one buffer.

In the case of the Browser ANR, because the last enqueued buffer was delayed
the resizing of the current buffer couldn't happen.

The system would always fall back onto its feet if anything -else- in
tried to draw, because the "late" buffer would be picked up then.
/frameworks/base/libs/surfaceflinger/Layer.cpp
4961c959aebac31991fd7653853d47dfd79d3472 07-Oct-2009 Mathias Agopian <mathias@google.com> fix [2152536] ANR in browser

A window is created and the browser is about to render into it the
very first time, at that point it does an IPC to SF to request a new
buffer. Meanwhile, the window manager removes that window from the
list and the shared memory block it uses is marked as invalid.
However, at that point, another window is created and is given the
same index (that just go freed), but a different identity and resets
the "invalid" bit in the shared block. When we go back to the buffer
allocation code, we're stuck because the surface we're allocating for
is gone and we don't detect it's invalid because the invalid bit has
been reset.

It is not sufficient to check for the invalid bit, I should
also check that identities match.
/frameworks/base/libs/surfaceflinger/Layer.cpp
351a7073fb60eb3534ec8c69ab263f057a124500 06-Oct-2009 Mathias Agopian <mathias@google.com> fix [2168528] enable glTexImage2D code path in SF for software-only buffers
/frameworks/base/libs/surfaceflinger/Layer.cpp
6950e428feaccc8164b989ef64e771a99948797a 06-Oct-2009 Mathias Agopian <mathias@google.com> fix [2167050] glTexImage2D code path buggy in SurfaceFlinger

When EGLImage extension is not available, SurfaceFlinger will fallback to using
glTexImage2D and glTexSubImage2D instead, which requires 50% more memory and an
extra copy. However this code path has never been exercised and had some bugs
which this patch fix.

Mainly the scale factor wasn't computed right when falling back on glDrawElements.
We also fallback to this mode of operation if a buffer doesn't have the adequate
usage bits for EGLImage usage.

This changes only code that is currently not executed. Some refactoring was needed to
keep the change clean. This doesn't change anything functionaly.
/frameworks/base/libs/surfaceflinger/Layer.cpp
0c4cec7e4df87181486d280c98fba9c0f4774c37 03-Oct-2009 Mathias Agopian <mathias@google.com> Attempt to fix [2152536] ANR in browser

The ANR is caused by SurfaceFlinger waiting for buffers of a removed surface to become availlable.
When it is removed from the current list, a Surface is marked as NO_INIT, which causes SF to return
immediately in the above case. For some reason, the surface here wasn't marked as NO_INIT.

This change makes the code more robust by always (irregadless or errors) setting the NO_INIT status
in all code paths where a surface is removed from the list.

Additionaly added more information in the logs, should this happen again.
/frameworks/base/libs/surfaceflinger/Layer.cpp
bd23e30de410761af8c68afd8c4b27990e7a099a 30-Sep-2009 Mathias Agopian <mathias@google.com> fix [2152247] Windows sometimes drawn scaled up.
/frameworks/base/libs/surfaceflinger/Layer.cpp
70cab91229c3c2ca4bb75ab63b552ac7d1a6a8bb 30-Sep-2009 Mathias Agopian <mathias@google.com> invalidate the surface when the physical changes
/frameworks/base/libs/surfaceflinger/Layer.cpp
e1b6f24423d61b7892e4a59f5a65b04231526712 30-Sep-2009 Mathias Agopian <mathias@google.com> introduce the notion of the requested size in the Layer state
/frameworks/base/libs/surfaceflinger/Layer.cpp
f2d28b74850ea0869aef2ce0727a6abb7b166a5c 24-Sep-2009 Mathias Agopian <mathias@google.com> minor SurfaceFlinger code cleanup and remove unnecessary tests
/frameworks/base/libs/surfaceflinger/Layer.cpp
cc934763c3fc789f53edb64de16fc36d43c3705d 24-Sep-2009 Mathias Agopian <mathias@google.com> turn dithering off if it's not needed
/frameworks/base/libs/surfaceflinger/Layer.cpp
2e4b68d57bb64d7e93139238c5a8be91ff956c2a 24-Sep-2009 Mathias Agopian <mathias@google.com> fix [2133214] STOPSHIP: revert I4a06bb4f: workaround for [2113743] Sholes: frozen then runtime restart going to list view

Revert "workaround for [2113743] Sholes: frozen then runtime restart going to list view"

This reverts commit 4a06bb4f3355b0ef2b76aa883704da9d154c44ae.
/frameworks/base/libs/surfaceflinger/Layer.cpp
4a06bb4f3355b0ef2b76aa883704da9d154c44ae 18-Sep-2009 Mathias Agopian <mathias@google.com> workaround for [2113743] Sholes: frozen then runtime restart going to list view
/frameworks/base/libs/surfaceflinger/Layer.cpp
ac7f13bc1ac8af99093987ebcb811f3892b49296 18-Sep-2009 Mathias Agopian <mathias@google.com> fix [2129080] Soft reboot after clicking around and then rubbing the screen
/frameworks/base/libs/surfaceflinger/Layer.cpp
7cf03bace826631259aaa5ddc87a517e13bdee17 17-Sep-2009 Mathias Agopian <mathias@google.com> fix [2119400] sholes: artifacting when switching orientation
/frameworks/base/libs/surfaceflinger/Layer.cpp
64a7c6bf5b73c1a401cb2aa8dfad3898166ae326 15-Sep-2009 Mathias Agopian <mathias@google.com> add support for RGBX_8888 surfaces in SurfaceFlinger
/frameworks/base/libs/surfaceflinger/Layer.cpp
248b5bd51e325107f8119b564db6a06ac51c232a 11-Sep-2009 Mathias Agopian <mathias@google.com> fix [2112575] stuck on DequeueCondition for a surface that doesn't exist anymore

this also fixes part of [2111536] Device is soft rebooted after ending the call through voice dialer
/frameworks/base/libs/surfaceflinger/Layer.cpp
9779b221e999583ff89e0dfc40e56398737adbb3 08-Sep-2009 Mathias Agopian <mathias@google.com> fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly

Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.

The main new feature is to be able to dequeue all buffers at once (very important when there are only two).

A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.

The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.

eg. Allowed sequence: DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
/frameworks/base/libs/surfaceflinger/Layer.cpp
c4915de8bb9454b8f10b0c9b7ac21e2bb7f65202 14-Aug-2009 Mathias Agopian <mathias@google.com> fix a bug that could cause a window to be hidden in some cases.

this would happen is the window is made visible but the client didn't render yet into it. This happens often with SurfaceView.
Instead of filling the window with solid black, SF would simply ignore it which could lead to more disturbing artifacts.

in theory the window manager should not display a window before it has been drawn into, but it does happen occasionnaly.
/frameworks/base/libs/surfaceflinger/Layer.cpp
317a6280cc109e873646e4652be1582d870eedfd 14-Aug-2009 Mathias Agopian <mathias@google.com> Surface::GPU and Surface::HARDWARE are now deprecated; they will be set automatically if needed.

this also ripples into the window manager API by making some constant there deprecated as well.
/frameworks/base/libs/surfaceflinger/Layer.cpp
5cec4742b3a1d7448bd32ae57cb4cf70b484c64c 12-Aug-2009 Mathias Agopian <mathias@google.com> second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
/frameworks/base/libs/surfaceflinger/Layer.cpp
64e89a8aff9a45a491f1d7064a655b9021fe644a 12-Aug-2009 Fred Quintana <fredq@google.com> Revert "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."

This reverts commit 8b76a0ac6fbf07254629ed1ea86af014d5abe050.
/frameworks/base/libs/surfaceflinger/Layer.cpp
8b76a0ac6fbf07254629ed1ea86af014d5abe050 11-Aug-2009 Mathias Agopian <mathias@google.com> SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything.

This change makes SurfaceHolder.setType(GPU) obsolete (it's now ignored).
Added an API to android_native_window_t to allow extending the functionality without ever breaking binary compatibility. This is used to implement the new set_usage() API. This API needs to be called by software renderers because the default is to use usage flags suitable for h/w.
/frameworks/base/libs/surfaceflinger/Layer.cpp
1d40f50de5a207351d5fe3f0eada2c8bf74dcd82 08-Aug-2009 Mathias Agopian <mathias@google.com> remove unused and confusing comment
/frameworks/base/libs/surfaceflinger/Layer.cpp
359140c171f67b9b29a1beae9743b49d0759414b 03-Jul-2009 Mathias Agopian <mathias@google.com> free gralloc buffers as soon as possible (when a surface is not visible any longer), client who have the buffers still mapped won't crash, btu may see garbage data
/frameworks/base/libs/surfaceflinger/Layer.cpp
999543ba26d10ff9879144965d0c0abcb400636a 24-Jun-2009 Mathias Agopian <mathias@google.com> checkpoint. bring back video/camera
/frameworks/base/libs/surfaceflinger/Layer.cpp
6edf5af578c1ab1fcd44b7c08ca371456e4b7430 20-Jun-2009 Mathias Agopian <mathias@google.com> fix a memory corruption where a SF Client could be used after it's been destroyed
/frameworks/base/libs/surfaceflinger/Layer.cpp
947f4f4d384ea26eb2145cc070a3eed42c59534a 22-May-2009 Mathias Agopian <mathias@google.com> merge master to master_gl
dff8e58d47ede6e748c0b02e128ca33b42a4f362 04-May-2009 Mathias Agopian <mathias@google.com> update surfaceflinger, libui and libagl to the new gralloc api

- Currently the lock/unlock path is naive and is done for each drawing operation (glDrawElements and glDrawArrays). this should be improved eventually.
- factor all the lock/unlock code in SurfaceBuffer.
- fixed "showupdate" so it works even when we don't have preserving eglSwapBuffers().
- improved the situation with the dirty-region and fixed a problem that caused GL apps to not update.
- make use of LightRefBase() where needed, instead of duplicating its implementation
- add LightRefBase::getStrongCount()
- renamed EGLNativeWindowSurface.cpp to FramebufferNativeWindow.cpp

- disabled copybits test, since it clashes with the new gralloc api

- Camera/Video will be fixed later when we rework the overlay apis
/frameworks/base/libs/surfaceflinger/Layer.cpp
fa6eda01a9f3df0102ce6a65302c8674cc9c7e50 30-Apr-2009 Mathias Agopian <mathias@google.com> Merge commit 'goog/master' into merge_master

Conflicts:
libs/surfaceflinger/Layer.cpp
libs/surfaceflinger/SurfaceFlinger.cpp
opengl/libagl/egl.cpp
opengl/libs/EGL/egl.cpp
opengl/libs/GLES_CM/gl.cpp
opengl/libs/GLES_CM/gl_api.in
opengl/libs/gl_entries.in
opengl/libs/tools/glapigen
0c6b5f6ec38b14add24c44360aa60d91ab61ff34 28-Apr-2009 Mathias Agopian <mathias@google.com> fix 1803886 android15 Translucent GLSurfaceView demo does not display properly
/frameworks/base/libs/surfaceflinger/Layer.cpp
81b0aa696ac954180caec6cb8cc1bb97440e03b5 23-Apr-2009 Mathias Agopian <mathias@google.com> get rid of an old hack to work around a bug around glDeleteTextures() in the adreno drivers
/frameworks/base/libs/surfaceflinger/Layer.cpp
a3aa6c9aa96873a70e2ff3170218a275f503520e 23-Apr-2009 Mathias Agopian <mathias@google.com> Surfaces are now destroyed properly in SurfaceFlinger.

First, the window manager tells us when a surface is no longer needed. At this point, several things happen:
- the surface is removed from the active/visible list
- it is added to a purgatory list, where it waits for all clients to release their reference
- it destroys all data/state that can be spared

Later, when all clients are done, the remains of the Surface are disposed off: it is removed from the purgatory and destroyed.
In particular its gralloc buffers are destroyed at that point (when we're sure nobody is using them anymore).
/frameworks/base/libs/surfaceflinger/Layer.cpp
6cf0db228ca275dfcda57d79c55e5fa306809632 18-Apr-2009 Mathias Agopian <mathias@google.com> more Surface lifetime management

Surfaces are now destroyed once all references from the clients are gone, but they go through a partial destruction as soon as the window manager requests it.
This last part is still buggy. see comments in SurfaceFlinger::destroySurface()
/frameworks/base/libs/surfaceflinger/Layer.cpp
1473f46cbc82aa6f0ba744cc896a36923823d55b 10-Apr-2009 Mathias Agopian <mathias@google.com> Integrate from //sandbox/mathias/donut/...@145728

SurfaceFlinger rework for new EGL driver model support.
/frameworks/base/libs/surfaceflinger/Layer.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/libs/surfaceflinger/Layer.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/libs/surfaceflinger/Layer.cpp
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
/frameworks/base/libs/surfaceflinger/Layer.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/libs/surfaceflinger/Layer.cpp
b798689749c64baba81f02e10cf2157c747d6b46 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
/frameworks/base/libs/surfaceflinger/Layer.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/libs/surfaceflinger/Layer.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/libs/surfaceflinger/Layer.cpp