summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/DisplayDevice.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "surfaceflinger: Consolidate display orientation compensation hooks"Steve Kondik2015-11-101-2/+0
| | | | | | | | * This is completely breaking graphics. This reverts commit f8e2372ad7c6ab5ba0363352607f5ded918add01. Change-Id: I1d694f4228199891a191ce3fb924cec71a6100f0
* surfaceflinger: Consolidate display orientation compensation hooksRicardo Cerqueira2015-11-101-0/+2
| | | | | | | Dedupe rotation calculation code and make rotation a statically available property in the DisplayDevice Change-Id: Ic517ab0d2c05026cd6fa46d664aab7926be17b62
* sf: This is a combination of following changes.Ramkumar Radhakrishnan2015-10-061-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Author: Prabhanjan Kandula<pkandula@codeaurora.org> SF: Add support for inverse mounted panels. Add 180 rotation in SF to account for inverse mounted panels. The framework will be unaffected and use policies for a 0 mounted panel. SF changes the global transform and silently induces the H,V flips. Similar flips are added to screenshots as well. CRs-Fixed: 894147 Change-Id: I6e9576ee734ee85097491eaa1e8e94cfb3731e0f Author: Ramkumar Radhakrishnan<ramkumar@codeaurora.org> SF: Clear visible region of layer appropriately. Clear visible region of layer having layer stack id different than the display layer stack id to ensure that the layer won't be present on the wrong display layer list. Change-Id: I59289fea63ec7a2451d4715cfe7926ba34fdb8e3 Change-Id: I5ad08a6013aa173d621ee80c766a6e19e1086a35
* surfaceflinger: fix -Wmismatched-tags warningsJesse Hall2014-09-041-1/+1
| | | | | | | | | | warning: struct 'HWComposer' was previously declared as a class [-Wmismatched-tags] warning: class 'DisplayInfo' was previously declared as a struct [-Wmismatched-tags] Change-Id: I13db9f8aab3a957ce8ff8d64598dae1807d6fe7e
* am 514e30a9: am c3d1889e: Merge "surfaceflinger: skip composition for empty ↵Jesse Hall2014-08-201-0/+1
|\ | | | | | | | | | | | | frames" into klp-modular-dev * commit '514e30a96cefad109509ce01622fa7f82f3f318c': surfaceflinger: skip composition for empty frames
| * surfaceflinger: skip composition for empty framesJesse Hall2014-08-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | By not committing the results of composition for empty frames, we avoid spitting out series of black frames for virtual displays that don't have visible layers. We still draw one black frame when going from having layers to not having any. In particular, this avoids having a series of empty frames due to re-compositing the primary display in the period between creating the virtual display and adding layers to it. Bug: 16786752 Change-Id: I7e9b2ed2e407d8d49c7af736b447d4c6181b0ad8
| * Fix virtual display nestingDan Stoza2014-04-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | This fixes the cycling rendering loop caused by nesting virtual displays by preventing them from recomposing if their contents haven't changed. (cherry-pick from master I600365c0fd5d3ad93e04295d26cf9de177ffc79b) Bug: 12101046 Change-Id: I6182993d53537781aedb522f97a50f06eed8b80f
* | Allow for resizing of Virtual Displays.Michael Lentine2014-07-301-0/+2
| | | | | | | | | | | | | | | | | | | | Modify SurfaceFlinger to use VirtualDisplaySurface in all cases when a virtual display is used. Add functionality in VirtualDisplaySurface to resize the buffers aquired in the QueueBufferOutput. Add transaction support in SurfaceFlinger for resize. Add the modification of the size in DisplayDevice. Change-Id: Iae7e3556dc06fd18d470adbbd76f7255f6e6dd6b Tested: None
* | Modified SurfaceFlinger to implment setActiveConfig and getActiveConfig.Michael Lentine2014-07-291-0/+8
| | | | | | | | | | | | | | | | This can be used to change the current display mode of the device. Change-Id: Icdc3fb58389b861dc77b68102083da6f7a96eccb Tested: None (cherry picked from commit 2651fa94635a96d653038fb389a0dd827338f8d3)
* | surfaceflinger: Replace blank/unblank with setPowerModePrashant Malani2014-06-051-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We replace the blank/unblank calls in surfaceFlinger with a more generic setPowerMode() routine. Some displays support different power modes (for example, with reduced color palettes). Depending on the use case we should be able to toggle these modes, so as to achieve incremental power savings. Initially, three power modes will be supported: - HWC_POWER_MODE_OFF - HWC_POWER_MODE_DOZE - HWC_POWER_MODE_NORMAL HWC_POWER_MODE_OFF will correspond to blanking the display, while HWC_POWER_MODE_NORMAL will correspond to unblanking. HWC_POWER_MODE_DOZE will put the display into a low power setting, if it is supported in hardware. If such a low power mode is not supported, it should be treated as a call to set the mode to HWC_POWER_MODE_NORMAL. As a consequence of adding the mPowerMode field, the mScreenAcquired is no longer required, and thus references to it are removed and replaced equivalent references to mPowerMode. We also add the glue code to connect the services invocation of setting a power mode and the HAL implementation in HWComposer. Bug: 13472578 Change-Id: I431595ecf16d2f2c94259272db3dd42f29636204 Signed-off-by: Prashant Malani <pmalani@google.com>
* | Fix virtual display nestingDan Stoza2014-02-041-1/+3
|/ | | | | | | | | This fixes the cycling rendering loop caused by nesting virtual displays by preventing them from recomposing if their contents haven't changed. Bug: 12101046 Change-Id: I600365c0fd5d3ad93e04295d26cf9de177ffc79b
* Implement per-display EGLConfig and configless EGLContextJesse Hall2013-12-231-0/+1
| | | | | | Bug: 12230666 Change-Id: Icca608b108cbdcab9cf01a9236d8cdbda000a836 Signed-off-by: Jesse Hall <jessehall@google.com>
* fix camera API 2.0 orientationMathias Agopian2013-09-171-0/+1
| | | | | | | | | we add a flag to ANativeWindow::setBufferTransform that means "apply the inverse rotation of the display this buffer is displayed onto to". Bug: 10804238 Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
* Merge "Provide HWC prepare with a valid output buffer" into klp-devJesse Hall2013-08-211-0/+1
|\
| * Provide HWC prepare with a valid output bufferJesse Hall2013-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We weren't dequeing and setting the output buffer until just before set(). This didn't allow HWC to make decisions in prepare() based on the output buffer format, dimensions, etc. Now we dequeue the output buffer at the beginning of the composition loop and provide it to HWC in prepare. In GLES-only rendering, we may have to cancel the buffer and acquire a new one if GLES requests a buffer with properties different than the one we already dequeued. Bug: 10365313 Change-Id: I96b4b0a851920e4334ef05080d58097d46467ab8
* | SurfaceFlinger now runs in the process's main threadMathias Agopian2013-08-201-0/+1
|/ | | | | | | | | | it used to spawn its own thread and return the main thread to the binder thread pool -- this was confusing the naming of things in the kernel. Bug: 10331839 Change-Id: I2d13a6d73409a38109300fcbe6a04b4c41cb5d00
* Use new HWC display type/count constants.Jesse Hall2013-08-161-2/+3
| | | | Change-Id: I774d0c68906ac6dc69268f708c30a6b0868b8816
* Merge "Set the swap interval of virtual display surfaces to 0"Jesse Hall2013-08-071-1/+0
|\
| * Set the swap interval of virtual display surfaces to 0Jesse Hall2013-08-061-1/+0
| | | | | | | | | | | | | | | | | | This prevents slow/malicious virtual display consumers from backpressuring SurfaceFlinger and preventing it from updating other displays. Bug: 10193714 Change-Id: I3e877d97202628d2d9abea24b66576f38299c14d
* | All consumers now take an IGraphicBufferConsumer instead of a BufferQueueMathias Agopian2013-08-061-0/+1
|/ | | | | | | | | | 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
* Rewrite VirtualDisplaySurfaceJesse Hall2013-07-151-0/+2
| | | | | | | | | | | | The previous implementation assumed that the HWC could read and write the same buffer on frames that involved both GLES and HWC composition. It turns out some hardware can't do this. The new implementation maintains a scratch buffer pool to use on these mixed frames, but on GLES-only or HWC-only frames still does composition directly into the output buffer. Bug: 8384764 Change-Id: I7a3addb34fad9bfcbdabbb8b635083e10223df69
* Refactor SF. Move all GL operations in their own class.Mathias Agopian2013-07-031-4/+2
| | | | | | | | | | this is the first step to add support for GLES 2.x, this change breaks the dependency of SF on GLES 1.x by moving all operation into their own class. Bug: 8679321 Change-Id: I0d2741eca2cefe67dfd9cf837cac10c4d126928b
* clean-up/simplify all dump() APIsMathias Agopian2013-04-221-1/+1
| | | | | | | remove the scratch buffer parameter and use String8::appendFormat() instead. Change-Id: Ib96c91617c8e7292de87433d15cf6232b7d591b0
* Clean up HWC state when releasing a DisplayDeviceJesse Hall2013-03-271-0/+3
| | | | | | | | | | DisplayDevices can be released when DisplayManager removes them from the display list, or (for virtual displays) when the surface is set to NULL. We were only cleaning up HWC resources associated with the display in the first case. Bug: 8384764 Change-Id: Id3d226dd7178fbe6d0a2ac4e2660b864ee073de3
* Fix virtual displays for HWC<=1.1Jesse Hall2013-03-221-2/+1
| | | | | | | | | | | | | | If we're using a HWC that doesn't support virtual displays, or we have more virtual displays than HWC supports concurrently, the VirtualDisplaySurface should simply be a passthrough from source (GLES) to sink. This change also tries to distinguish between display types and HWC display IDs a little better, though there's more to do here. Probably needs a higher-level rethink; it's too error-prone now. Bug: 8446838 Change-Id: I708d2cf262ec30177042304f174ca5b8da701df1
* Add DisplaySurface abstractionJesse Hall2013-03-181-6/+3
| | | | | | | | | | | | | DisplayDevice now has a DisplaySurface instead of using FramebufferSurface directly. FramebufferSurface implements DisplaySurface, and so does the new VirtualDisplaySurface class. DisplayDevice now always has a surface, not just for virtual displays. In this change VirtualDisplaySurface is just a stub; buffers still go directly from GLES to the final consumer. Bug: 8384764 Change-Id: I57cb668edbc6c37bfebda90b9222d435bf589f37
* Get rid of LayerBase.Mathias Agopian2013-03-051-4/+4
| | | | | | | | The functionality of LayerBase and Layer is folded into Layer. There wasn't a need for this abstraction anymore. Change-Id: I66511c08cc3d89009ba4deabf47e26cd4cfeaefb
* Merge "Init displays to null layer stack" into jb-mr2-devJesse Hall2013-03-051-1/+5
|\
| * Init displays to null layer stackJesse Hall2013-02-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | When a display is added, initialize it to use an empty layer stack, so if it is somehow visible it will show black. It will be assigned the real layer stack -- along with a projection and other properties -- by window manager soon. Normally a display remains blanked until window manager has decided what to show on it, but for HDMI connected at boot that isn't currently the case. Bug: 7258935 Change-Id: Ic9bb25f7a9b8d9d3772b097ab1d6fa03bc8780a1
* | apply the projection's viewport to the visibleregion passed to hwcMathias Agopian2013-02-281-4/+2
|/ | | | | | | | | | | each desplay's projection's viewport essentially clips each layer, so this should be reflected in the visibleregion passed to h/w composer. DisplayDevice getViewport and getFrame are now guaranteed to return valid Rects. Change-Id: I4c25f34fb26af10179eb26d429ca6c384c671e91
* rework a bit how we scissor the displayMathias Agopian2012-10-311-0/+5
| | | | | | | | | | the scissor rect is now computed once by DisplayDevice and is combined with the "undefined" region so that the letter-boxed area of the screen get cleared in drawWormhole. Bug: 7149437 Change-Id: Id2f30516a5786f32eace7f876ff32028f954f357
* SurfaceFlinger: add support for secure displaysJamie Gennis2012-10-221-1/+8
| | | | | | | | | This change adds support for displays that are not allowed to display surfaces with the eSecure flag set. All non-virtual displays are considered secure, while virtual displays have their secure-ness specified at creation time. Bug: 7368436 Change-Id: I81ad535d2d1e5a7ff78269017e85b111f0098500
* reset GL viewport and project when caputring the screenMathias Agopian2012-09-281-0/+2
| | | | | Bug: 7241739 Change-Id: I3bb5214b070384de9be2026647865c6c236a4331
* add/remove displays properly on hotplug eventsMathias Agopian2012-09-211-3/+1
| | | | | Bug: 7191563 Change-Id: I8f0fbf3b29658c9479443141798e6f288a1f2d52
* calculate wether we filter on a per-display basisMathias Agopian2012-09-201-0/+2
| | | | Change-Id: I79d80b432b20b3d02428da19add464ac1e2b9378
* improve logging of external displaysMathias Agopian2012-09-181-1/+1
| | | | Change-Id: I041aebb7fc655aeca98bbf698d15e05d7c12cac9
* Plumb display name into SurfaceFlingerAndy McFadden2012-09-181-1/+7
| | | | | | | | | | The Surface createDisplay() call takes a display name for debugging. This change carries it through SurfaceFlinger and displays it in the "dumpsys SurfaceFlinger" output. Bug 7058158 Change-Id: I79f3474a8656ff1beb7b478e0dbf2c5de666118a
* add support hwc 1.1Mathias Agopian2012-09-171-0/+5
| | | | | | Bug: 7124069 Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
* display projection API now has a single function instead of 3Mathias Agopian2012-09-041-3/+1
| | | | Change-Id: I9bf46d372b77d547486d4bbe6f1953ec8c65e98f
* implement display viewport and frameMathias Agopian2012-09-041-6/+17
| | | | | | note: viewport clipping is not implemented yet Change-Id: I7fde7c4de075d409d95c48bb20ba8ee017f6f00a
* Eradicate DisplayID.Mathias Agopian2012-08-271-12/+12
| | | | | | | | DisplayDevices are now keyed of the wp<IBinder> the client uses. DisplayID has now become DisplayType which is just used to identify physical displays (as opposed to virtual displays such as wifi displays). Change-Id: I0c5968f2c902dcd699a7e0afacf833ff070c12ea
* teach HWC about multiple displaysMathias Agopian2012-08-231-3/+5
| | | | Change-Id: I5e72a83d419a729835cb0e1ec45557b4d3fb56b1
* HWComposer now has its own concept of display IDsMathias Agopian2012-08-231-1/+3
| | | | | | | | | | | | HWComposer can now create IDs representing a display it can deal with. IDs MAIN and HDMI are reserved. SurfaceFlinger associate HWComposer IDs with a DisplayDevice and uses that when it talks to HWComposer. A DisplayDevice doesn't have to have a HWComposer ID, in that case it just can't use h/w composer composition. Change-Id: Iec3d7ac92e0c22bf975052ae2847402f58bade71
* refactor compositing code to avoid multiple eglMakeCurrent() callsMathias Agopian2012-08-161-0/+1
| | | | | | | | when multiple displays are connected, we ended-up having to call eglMakeCurrent() twice per display due to a limitation in EGL. this fixes that. Change-Id: I11e4584df50f8c24bbecee74e37b28b3ee031d2f
* xdpi / ydpi were reported as 0Mathias Agopian2012-08-131-6/+0
| | | | | Bug: 6975723 Change-Id: Ia7fa37ec11e2308804f5034959a37e508d292d31
* make multi-display more realMathias Agopian2012-08-101-1/+2
| | | | | | | - displays are represented by a binder on the client side - c++ clients can now create and modify displays Change-Id: I203ea5b4beae0819d742ec5171c27568f4e8354b
* Add a display parameter to HWComposer where neededMathias Agopian2012-08-101-0/+1
| | | | | | | | - also replace C casts with C++ casts - only the interface is changed, HWComposer still doesn't fully handle multiple displays Change-Id: I48eb89bff2edb76bf1d4d41f46802b9b2a7166a8
* now able to set the layer stack on a DisplayDeviceMathias Agopian2012-08-101-0/+2
| | | | Change-Id: Ia9691cf221b9444c243eb468d9e276a30e600b6b
* surfaceflinger: refactor FrambufferSurfaceJamie Gennis2012-08-061-1/+2
| | | | | | | | This change refactors the FramebufferSurface class to inherit from the new ConsumerBase class. Bug: 6620200 Change-Id: I46ec942ddb019658e3c5e79465548b171b2261f2
* DisplayDevice doesn't need weak pointers or polymorphismMathias Agopian2012-08-051-2/+2
| | | | | | let's use a LightRefBase for now. Change-Id: Ida068fa902343a8f89ffb6d34c2cd4627ab43c6c