summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger_client
Commit message (Collapse)AuthorAgeFilesLines
* ANativeWindow: add query for the concrete type.Jamie Gennis2011-03-142-1/+13
| | | | | | | | This change adds a query to the ANativeWindow interface for getting the concrete type of the ANativeWindow. Bug: 4086509 Change-Id: I64aa86d72fbca3b52a98e1fc35608737781a3178
* SurfaceFlinger: Respect the PROTECTED gralloc bit.Jamie Gennis2011-03-101-6/+59
| | | | | | | | | 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
* ANativeWindow: add queues-to-window-composer check.Jamie Gennis2011-03-084-1/+179
| | | | | | | | | 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
* Merge "Add the MIN_UNDEQUEUED_BUFFERS query to ANW."Jamie Gennis2011-03-011-0/+3
|\
| * Add the MIN_UNDEQUEUED_BUFFERS query to ANW.Jamie Gennis2011-02-281-0/+3
| | | | | | | | | | | | | | | | | | This change adds a new query to ANativeWindow for getting the minimum number of buffers that must be left un-dequeued during the steady-state operation of the ANativeWindow. Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551 Related-Bug: 3356050
* | surfaceflinger_client: Don't dereference NULL ptrs.Jamie Gennis2011-02-271-1/+1
|/ | | | | | | | | This change adds a null pointer check before dereferencing buffers in a Surface list of known GraphicBuffer objects. If not all the buffers have been dequeued before this list can legitimately contain NULL entries. Change-Id: I0e105b53a3f6f9a5404716b7bf150c793ff648a6
* allow root to call into surfaceflingerMathias Agopian2011-02-151-1/+1
| | | | | | | this is useful for running standalone tests with standalone SurfaceFlinger. Change-Id: I08d054f6214affa3a777a82765f4e0bd256ba26d
* Merge "Reset ANativeWindow crop on buffer geometry changes." into honeycombJamie Gennis2011-01-301-5/+10
|\
| * Reset ANativeWindow crop on buffer geometry changes.Jamie Gennis2011-01-281-5/+10
| | | | | | | | | | | | | | | | | | 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
* | am 72abf01a: Merge "Fix the ISurfaceComposer onTransact switch." into ↵Mathias Agopian2011-01-271-2/+2
|\ \ | |/ |/| | | | | | | | | gingerbread * commit '72abf01a8b6958ac1f86d36302a8462c4f51fd9d': Fix the ISurfaceComposer onTransact switch.
| * Fix the ISurfaceComposer onTransact switch.Jamie Gennis2011-01-161-2/+2
| | | | | | | | | | | | | | | | Two of the cases in the ISurfaceComposer onTransact switch statement were missing 'break' statements at the end, and would fall through to the next case block. This change adds those break statements. Change-Id: I6dcc84263d3ea03d94612c667103283846b3dee1
* | clean-up unneeded codeMathias Agopian2011-01-201-36/+2
| | | | | | | | | | | | | | | | | | | | 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
* | fix [3361121] hang in glClear() - device unresponsive, OTA failsMathias Agopian2011-01-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Change-Id: I1f226b1ebdf6918439b687c2723955d55b842c55
* | Merge "Fix error reporting in Surface::cancelBuffer()" into honeycombMathias Agopian2011-01-141-18/+11
|\ \
| * | Fix error reporting in Surface::cancelBuffer()Mathias Agopian2011-01-141-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | when we validate the surface there, most errors are in fact allowed because it is legal to cancel a buffer after a surface has been destroyed (for instance). in that case make sure to not log error messages as they are very confusing. Change-Id: Iecdfbaf6d9ee5da54d56cd7ea7a0d430c30934b0
* | | Fix remote GraphicBuffer allocation in SurfaceFlinger.Jamie Gennis2011-01-133-32/+123
|/ / | | | | | | | | | | | | | | | | | | | | This change fixes a horrible hack that I did to allow application processes to create GraphicBuffer objects by making a binder call to SurfaceFlinger. This change introduces a new binder interface specifically for doing this, and does it in such a way that SurfaceFlinger will maintain a reference to the buffers until the app is done with them. Change-Id: Icb240397c6c206d7f69124c1497a829f051cb49b
* | Add the ISurfaceComposer::createGraphicBuffer IPC.Jamie Gennis2011-01-061-0/+32
| | | | | | | | | | | | | | | | This change adds a new binder method to the ISurfaceComposer interface. This IPC is intended to allow SurfaceFlinger clients to allocate gralloc buffers using SurfaceFlinger as a proxy to gralloc. Change-Id: Ide9fc283aec5da6268ba62cfed0c3319a50b640d
* | Merge "minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so."Mathias Agopian2010-12-141-3/+3
|\ \
| * | minor clean-up. SurfaceFlinger doesn't need libpixelflinger.so.Mathias Agopian2010-12-131-3/+3
| | | | | | | | | | | | Change-Id: I3bdca74351c8e480a05084bc412a96c5f685221d
* | | Merge "dump callstack on Surface use error"Mathias Agopian2010-12-141-0/+6
|\ \ \ | |/ /
| * | dump callstack on Surface use errorMathias Agopian2010-12-101-0/+6
| | | | | | | | | | | | Change-Id: I38e260dd47349b9af3a999dda683a083a94be16d
* | | [3258939] Need snapshot to limit which layers are includedMathias Agopian2010-12-102-4/+21
|/ / | | | | | | Change-Id: Id7351a0e3f53dde99b291cffba553d89fd4d7ca9
* | remove support for PUSH_BUFFER surfaces and overlaysMathias Agopian2010-12-081-112/+0
| | | | | | | | | | | | | | the same functionality is now supported through the h/w composer HAL, and YUV support in the GPU. Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
* | Implement reducing the buffer count of a Surface.Jamie Gennis2010-11-113-6/+82
| | | | | | | | | | Change-Id: I7f979c60c06d654aa8265002836277434bc1a64f Bug: 3095167
* | Fix a compile warning in the Surface class.Jamie Gennis2010-11-111-1/+1
| | | | | | | | Change-Id: Id744e71d2cd23c287925a5090e13a6d9908cdd99
* | am 85c5ca07: am 2f19f56a: Merge "Updade Surface (ANativeWindow) format based ↵Mathias Agopian2010-10-261-0/+11
|\ \ | |/ | | | | on its buffers format" into gingerbread
| * Updade Surface (ANativeWindow) format based on its buffers formatMathias Agopian2010-10-251-0/+11
| | | | | | | | | | | | | | | | this is to allow applications to change the format of a surface's buffer, and have it reflected in EGL; which is needed for EGLConfig validation. Change-Id: Iee074c30ad765881e2409c1d37450b05e561c44d
* | am 5bfa3a34: am 011b5bcc: Merge "implement part of [3094280] New animation ↵Mathias Agopian2010-10-151-0/+15
|\ \ | |/ | | | | | | | | | | | | | | for screen on and screen off add support for screen on animation" into gingerbread Merge commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f' * commit '5bfa3a34eaef759c3ec4def76f646eb1c0bf997f': implement part of [3094280] New animation for screen on and screen off
| * implement part of [3094280] New animation for screen on and screen offMathias Agopian2010-10-131-0/+15
| | | | | | | | | | | | add support for screen on animation Change-Id: If50cf52ae04b95b42da7d74cf7fa96d5cb54d238
* | am 9a12a3c8: am ba799098: Merge changes I76513387,I335fb671 into gingerbreadJoe Onorato2010-10-131-0/+15
|\ \ | |/ | | | | | | | | | | | | Merge commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96' * commit '9a12a3c8d4bb20042cf69e07d268e3a04ac71f96': Remove dead code, and make the animation a setting. turn off the electron beam
| * turn off the electron beamMathias Agopian2010-10-121-0/+15
| | | | | | | | Change-Id: I335fb6719f1d5a3f1c6f37a046fd1c2c4ed2bbc6
* | Move binder magic from the Surface class to GraphicBuffer.Jamie Gennis2010-10-101-19/+17
| | | | | | | | | | | | | | | | - Register buffers with Gralloc when unflattening a GraphicBuffer (rather than doing it in the Surface class). - Add support for a GraphicBuffer that wraps an android_native_window_t*. Change-Id: I029ac086111bbac800e5ca37eb505f558b718cd8
* | am ff04e97f: am f4619308: Merge "fix [2835280] Add support for cancelling ↵Mathias Agopian2010-10-062-11/+53
|\ \ | |/ | | | | | | | | | | | | | | buffers to ANativeWindow" into gingerbread Merge commit 'ff04e97faf75c435e453d4c1caf7eeac8b9c1ceb' * commit 'ff04e97faf75c435e453d4c1caf7eeac8b9c1ceb': fix [2835280] Add support for cancelling buffers to ANativeWindow
| * fix [2835280] Add support for cancelling buffers to ANativeWindowMathias Agopian2010-10-042-11/+53
| | | | | | | | | | | | | | | | | | | | There is a new ANativeWindow::cancelBuffer() API that can be used to cancel any dequeued buffer, BEFORE it's been enqueued. The buffer is returned to the list of availlable buffers. dequeue and cancel are not mutually thread safe, they must be called from the same thread or external synchronization must be used. Change-Id: I86cc7985bace8b6a93ad2c75d2bef5c3c2cb4d61
| * refactored screenshot codeMathias Agopian2010-10-042-2/+58
| | | | | | | | | | | | | | | | | | | | | | the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I33689bba98507ab928d0898b21596d0d2fe4b953
* | refactored screenshot codeMathias Agopian2010-09-292-2/+58
| | | | | | | | | | | | | | | | | | | | | | the core screenshot function now can capture the screen at any lower resolution performing bilinear filtering. we also now have some client code to interface with the screenshot service. it's now possible to request a screenshot at a lower resolution. Change-Id: I5a3b0e431421800e3aad601d9af8f94adffbc71f
* | am 495ad4f2: am beabe75a: Merge changes I1f7c4535,I741c68a2 into gingerbreadMathias Agopian2010-09-241-0/+28
|\ \ | |/ | | | | | | | | | | | | Merge commit '495ad4f22096aa172d025c16c25497e7dad8f2bd' * commit '495ad4f22096aa172d025c16c25497e7dad8f2bd': simple test app for screen capture API add support for [1974164] Be able to take a screen shot on the device
| * add support for [1974164] Be able to take a screen shot on the deviceMathias Agopian2010-09-241-0/+28
| | | | | | | | | | | | | | | | | | | | | | screenshots are taken using ISurfaceComposer::captureScreen() which returns the size of the screenshot and an IMemoryHeap containing the data. screenshots have limitations: - they will always fail if a secure window is up on screen - require GL_OES_framebuffer_object extension - in some situation, video planes won't been captured Change-Id: I741c68a2d2984fb139039301c3349e6780e2cd58
* | 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