summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client
Commit message (Collapse)AuthorAgeFilesLines
* resolved conflicts for merge of 48a86240 to masterMathias Agopian2010-09-151-1/+18
|\ | | | | | | Change-Id: I2305fef9f4dd46183337217d822df3c675b6b6e5
| * Add logging of various important graphics eventsMathias Agopian2010-09-131-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 16 events logged in the event log: SF_APP_DEQUEUE_BEFORE SF_APP_DEQUEUE_AFTER SF_APP_LOCK_BEFORE SF_APP_LOCK_AFTER SF_APP_QUEUE SF_REPAINT SF_COMPOSITION_COMPLETE SF_UNLOCK_CLIENTS SF_SWAP_BUFFERS SF_REPAINT_DONE SF_FB_POST_BEFORE SF_FB_POST_AFTER SF_FB_DEQUEUE_BEFORE SF_FB_DEQUEUE_AFTER SF_FB_LOCK_BEFORE SF_FB_LOCK_AFTER all events log the buffer conserned and a timestamp in microseconds. by default the logging is not enabled, to turn it on: adb shell service call SurfaceFlinger 1006 i31 1 adb shell setprop debug.graphic_log 1 The effect is immediate in SurfaceFlinger, but applications need to be restarted. Change-Id: Ifc2e31f7aed072d9a7dede20ff2ce59231edbec1
* | am d322d163: am ae66946b: Merge "fix a race in SF buffer management" into ↵Mathias Agopian2010-08-271-12/+12
|\ \ | |/ | | | | | | | | | | | | | | gingerbread Merge commit 'd322d16323176ddd5fef3383798176f64d0078c8' * commit 'd322d16323176ddd5fef3383798176f64d0078c8': fix a race in SF buffer management
| * fix a race in SF buffer managementMathias Agopian2010-08-261-12/+12
| | | | | | | | | | | | also remove some unused code. Change-Id: Iae2c3309b7a08055f3e13a5b866c5c084993e352
* | am bc4389ed: am 8395b462: Merge "fix [2931513] Add support for setting the ↵Mathias Agopian2010-08-242-0/+68
|\ \ | |/ | | | | | | | | | | | | | | orientation of an ANativeWindow" into gingerbread Merge commit 'bc4389edfbb5777aec1a9af7863b2ca3ade2fa64' * commit 'bc4389edfbb5777aec1a9af7863b2ca3ade2fa64': fix [2931513] Add support for setting the orientation of an ANativeWindow
| * fix [2931513] Add support for setting the orientation of an ANativeWindowMathias Agopian2010-08-242-0/+68
| | | | | | | | | | | | Also implement support for cropping. Change-Id: Iba5888dd242bf2feaac9e9ce26e404c1f404c280
* | Change the framework to use the new camera preview path.Jamie Gennis2010-08-232-5/+10
|/ | | | | | | | | | | | This change makes the camera HAL interface take an ANativeWindow interface from which all the camera preview buffers will be allocated. The framework code running in application processes now passes a Surface object rather than an ISurface to the camera server via Binder when setting the preview surface. The camera server then forwards that Surface object (which implements the ANativeWindow interface) to the camera HAL, which uses it to communicate with SurfaceFlinger to allocate the camera preview buffers. Change-Id: Ie438f721559cd7de5e4f848a26d96360dda07b5f
* fix [2873058] Surface::dequeueBuffer blocks on last buffer, i.e. cannot ↵Mathias Agopian2010-07-271-30/+0
| | | | | | | | | | | | | | | | | | | | | dequeue all allocated buffers at once. this situation happened when the last buffer needed to be resized (or allocated, the first time). the assumption was that the buffer was in use by SF itself as the current buffer (obviously, this assumption made no sense when the buffer had never been allocated, btw). the system would wait until some other buffer became the "front" buffer. we fix this problem by entirely removing the requirement that the buffer being resized cannot be the front buffer. instead, we just allocate a new buffer and replace the front buffer by the new one. the downside is that this uses more memory (an extra buffer) for a brief amount of time while the old buffer is being reallocated and before it has actually been replaced. Change-Id: I022e4621209474ceb1c671b23deb4188eaaa7285
* Remove some debug logging that I accidentally committed.Jamie Gennis2010-07-191-3/+0
| | | | Change-Id: Ib182455fad5e5b3f3f59b3ff24f59dcd7f638292
* Re-use existing Surface objects when reading them from parcels.Jamie Gennis2010-07-161-7/+28
| | | | | | | | | | | | This change adds a process-global cache of previously deserialized Surface objects so that if a Surface object wrapping the same ISurface gets received again the same Surface can be used. This is important because the 'tail' pointer in the SharedBufferClient is stored only on the client side, and needs to be the same for all the Surface objects wrapping an ISurface instance. This solves the problem by making there only be one Surface object wrapping an ISurface per process. Change-Id: I4bf0b8787885c56277622fca053022d2bb638902
* Introduce official public NativeWindow type.Dianne Hackborn2010-06-301-18/+18
| | | | | | | Not yet hooked up to anything in the NDK, but requires renaming the existing android_native_window_t type everywhere. Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
* allow re-targetting of surfacesMathias Agopian2010-06-082-15/+44
| | | | | | | | | Surfaces can now be parcelized and sent to remote processes. When a surface crosses a process boundary, it looses its connection with the current process and gets attached to the new one. Change-Id: I39c7b055bcd3ea1162ef2718d3d4b866bf7c81c0
* fix [2751143] Device crashes when in a text box for too longMathias Agopian2010-06-081-3/+1
|
* optimize Surface.readFromParcel()Mathias Agopian2010-06-041-8/+13
| | | | | | | | | | | | this is called for each relayout() and used to create a full Surface (cpp) which in turn did some heavy work (including an IPC with surfaceflinger), most of the time to destroy it immediatelly when the returned surface (the one in the parcel) was the same. we now more intelligentely read from the parcel and construct the new object only if needed. Change-Id: Idfd40d9ac96ffc6d4ae5fd99bcc0773e131e2267
* split surface management from surface's buffers managementMathias Agopian2010-06-045-103/+121
| | | | Change-Id: If3c5655d1231f8f0c49ba68f972b1b20c93b3f87
* more clean-up in preparation of bigger changesMathias Agopian2010-05-286-61/+75
| | | | | | | the most important change here is the renaming of ISurfaceFlingerClient to ISurfaceComposerClient Change-Id: I94e18b0417f50e06f21377446639c61f65f959b3
* more clean-up of Surfaceflinger's client managementMathias Agopian2010-05-272-238/+170
| | | | | | | | | | | | SurfaceComposerClient now only exist on the WindowManager side, the client side uses the new SurfaceClient class, which only exposes what a client needs. also instead of keeping mappings from IBinder to SurfaceComposerClients we have a SurfaceClient per Surface (referring to the same IBinder), this is made possible by the fact that SurfaceClient is very light. Change-Id: I6a1f7015424f07871632a25ed6a502c55abfcfa6
* oopsie. forgot to displatch SET_BUFFERS_GEOMETRYMathias Agopian2010-05-261-0/+3
|
* fix [2712278] The preview buffer left some black borders in left and bottom ↵Mathias Agopian2010-05-253-100/+100
| | | | | | | | edges we were incorrectly flagging push_buffer surfaces as invalid Change-Id: I4dfd4ffbbe8a71f7e23e835db8d71966416c29bb
* added the notion of fixed-size buffersMathias Agopian2010-05-243-38/+132
| | | | | | | | | the new native_window_set_buffers_geometry allows to specify a size and format for all buffers to be dequeued. the buffer will be scalled to the window's size. Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
* fix a bug when reallocating a window's buffers is neededMathias Agopian2010-05-241-2/+2
| | | | | | | we need to mark the buffers that need to be reallocated, NOT the buffer's indices. Change-Id: I809e2e1b03b56c4d2ab983c25523dae99aa1da74
* added native_window_set_buffer_count()Mathias Agopian2010-05-212-1/+11
| | | | | | | this method can be used to change the number of buffers associated to a native window. the default is two. Change-Id: I608b959e6b29d77f95edb23c31dc9b099a758f2f
* fix the threading issue for setBuffercount()Mathias Agopian2010-05-204-57/+79
| | | | | | | | this change introduces R/W locks in the right places. on the server-side, it guarantees that setBufferCount() is synchronized with "retire" and "resize". on the client-side, it guarantees that setBufferCount() is synchronized with "dequeue", "lockbuffer" and "queue"
* add a few tests to SharedBufferStackTestMathias Agopian2010-05-171-4/+14
| | | | Change-Id: I1c46c07aa1483aee4d4ebd8745638a2c462cc1b3
* improve SharedBufferStack testMathias Agopian2010-05-171-15/+43
| | | | Change-Id: I32683bfe0916918757280db89113595867acd5a7
* fix a bug where queueBuffer() would fail after the SharedbufferStack is resizedMathias Agopian2010-05-171-2/+17
| | | | Change-Id: I12bf13a62018ce1349bab7be0b0cad7fad13fee8
* fix some bugs in SharedBufferStack::resizeMathias Agopian2010-05-171-2/+4
| | | | | | added buffers should now be labeled properly. Change-Id: I28aa753fbe89ab89134e7753575319478934c7fa
* am 900b6157: merge from open-source masterThe Android Open Source Project2010-05-141-4/+4
|\ | | | | | | | | | | | | Merge commit '900b6157f5dee2ed7b2c73cf320b2baf293230ff' into kraken * commit '900b6157f5dee2ed7b2c73cf320b2baf293230ff': Only hold a weak pointer on SurfaceComposerClients
| * merge from open-source masterThe Android Open Source Project2010-05-141-4/+4
| | | | | | | | Change-Id: I0249c6d796b35af9ba08cbccd463a1f5cf779ecd
* | SharedBufferStack now can grow up to 16 buffers.Mathias Agopian2010-05-123-6/+123
| | | | | | | | | | | | there is a new resize() api, which currently only allows growing. Change-Id: Ia37b81b73be466d2491ffed7f3a23cd8e113c6fe
* | Refactor some code in surfaceflinger in preparation of upcoming changesMathias Agopian2010-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | the new TextureMagager class now handle texture creation and upload as well as EGL image creation and binding to GraphicBuffers. This is used indirectly by Layer and directly by LayerBuffer the new BufferManager class handles the set of buffers used for a Layer (Surface), it abstracts how many buffer there is as well as the use of EGLimage vs. regular texture ops (glTexImage2D). Change-Id: I2da1ddcf27758e6731400f6cc4e20bef35c0a39a
* | make sure the server-side validates pointers/indices visible on the client sideMathias Agopian2010-04-301-1/+15
| | | | | | | | Change-Id: I604f58d3fcd2d09ec7998123c627401081345cd6
* | Add support for enqueuing buffers in arbitrary orderMathias Agopian2010-04-284-21/+290
| | | | | | | | | | | | Also added a very simple SharedBufferStack unit test. Change-Id: I253dbbe98a53c966b78d22d4d6dd59f8aefc8c40
* | cleanup. waitForCondition() now uses polymorphsim instead of templtesMathias Agopian2010-04-282-21/+51
| | | | | | | | | | | | | | | | | | the reason for the above change is that waitForCondition() had become large over time, mainly to handle error cases, using inlines to evaluate the condition doesn't buys us much anymore while it increases code size. Change-Id: I2595d850832628954b900ab8bb1796c863447bc7
* | fix a race condition in undoDequeue(), where 'tail' could be computed ↵Mathias Agopian2010-04-281-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrectly. in the undoDequeue() case, 'tail' was recalculated from 'available' and 'head' however there was a race between this and retireAndLock(), which could cause 'tail' to be recalculated wrongly. the interesting thing though is that retireAndLock() shouldn't have any impact on the value of 'tail', which is client-side only attribute. we fix the race by saving the value of 'tail' before dequeue() and restore it in the case of undoDequeue(), since we know it doesn't depend on retireAndLock(). Change-Id: I4bcc4d16b6bc4dd93717ee739c603040b18295a0
* | better fix for [2420565] Surface.lockCanvas() updates the dirty region too oftenMathias Agopian2010-04-212-33/+33
| | | | | | | | Change-Id: I83438b40effd21538f1c74396dc665254b9d5ab6
* | added setCrop() to android_native_window_tMathias Agopian2010-04-202-16/+59
| | | | | | | | | | | | | | hooked up the new method up to Surface.cpp the actual crop is not implemented in SF yet Change-Id: Ic6e313c98fd880f127a051a0ccc71808bd689751
* | add support for up to 16 buffers per surfaceMathias Agopian2010-04-201-8/+34
| | | | | | | | | | | | | | also increase the dirtyregion size from 1 to 6 rectangles. Overall we now need 27KiB process instead of 4KiB Change-Id: Iebda5565015158f49d9ca8dbcf55e6ad04855be3
* | fix [2420565] Surface.lockCanvas() updates the dirty region too oftenMathias Agopian2010-04-081-11/+14
|/ | | | | | There was a bug where we were we could be reallocating buffers for no reason. Change-Id: Ieb8a81a289da9339ab7faf987cd3a73428943c1a
* libutils Condition are now PRIVATE by defaultMathias Agopian2010-03-191-1/+1
| | | | | | | | | | | Condition must be initialized with SHARED for the old behavior, where they can be used accross processes. Updated the two places android that require SHARED conditions. PRIVATE conditions (and mutexes) use more efficient syscalls. Change-Id: I9a281a4b88206e92ac559c66554e886b9c62db3a
* implement connect/disconnect in our native_window_t implementationsMathias Agopian2010-03-111-7/+82
| | | | | | | | the framebuffer implementation doesn't do anything special with this but the surfaceflinger implementation makes sure the surface is not used by two APIs simultaneously. Change-Id: Id4ca8ef7093d68846abc2ac814327cc40a64b66b
* Fix a small bug where we could compute SharedBufferStack's tail incorrectly.Mathias Agopian2010-03-081-2/+5
| | | | | | Also add "tail" to the debug dump(). Change-Id: I04b1ea375dfc9ddcc22f0c6b6cd01300e507572e
* Added a name to Surface created by SurfaceFlingerMathias Agopian2010-03-012-2/+26
| | | | | Updated the window manager to use this new facility. Surfaces name are now printed by "dumpsys".
* remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).Mathias Agopian2010-02-211-2/+5
| | | | | | | | | Add a Flattenable interface to libutils which can be used to flatten an object into bytestream + filedescriptor stream. Parcel is modified to handle Flattenable. And GraphicBuffer implements Flattenable. Except for the overlay classes libui is now independent of libbinder.
* Remove a dependency of Region (libui) on Parcel (libbinder).Mathias Agopian2010-02-171-4/+24
|
* split libsurfaceflinger_client and libcamera_client out of libuiMathias Agopian2010-02-118-0/+2454