summaryrefslogtreecommitdiffstats
path: root/hwc
Commit message (Collapse)AuthorAgeFilesLines
* hwc: fallback on GL after idle for power savingsErik Gilling2011-10-121-5/+70
| | | | | | | | If no frame has been posted for 250ms, rerender using GL to take load off the overlay engine. Change-Id: I1790f7b7b43fd0d60b7392b9aec01339234aa915 Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: fix docking mode orientation and croppingLajos Molnar2011-10-121-33/+41
| | | | | | | | | | | | | | | | | | | We cannot reset orientation to 0 when docking, as video layer may be encoded in non-0 orientation. hwc.hdmi.docking.transform is now applied (as an add-on) to the UI orientation, but only if mirroring is not enabled. Otherwise, mirroring transform is used. This is because UI is already oriented into "mirroring/landscape mode". To simplify the pixel ratio preservation, introduced a float xpy instead of integer xratio/yratio. xpy should be same as xratio / yratio, and is the x:y pixel ratio. Also docked layers do not need to be cropped to the mirroring region. Change-Id: If01d2ae698f4fb896db65417c0bc218b294f966f
* hwc: make clone region property persistentLajos Molnar2011-10-121-1/+1
| | | | Change-Id: Ibf36295966522f03104a77cd6842559f6607fc5d
* hwc: allow specifying clone regionLajos Molnar2011-10-111-11/+117
| | | | | | | | | Added android property ro.display.clone.region to set the clone region in case we do not want to clone the full framebuffer to HDMI. (E.g. status bar may not need to be cloned.) Change-Id: I35f2207c49b3a56ff61309efebe61b9dee6cfb8c Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: cleanup: consolidate cloning state and configuration variablesLajos Molnar2011-10-111-115/+145
| | | | | | | | consolidate variables used to select cloning configuration and state. Signed-off-by: Erik Gilling <konkers@android.com> Change-Id: I49af8efdefef6dcb784bfed1da58f704cdb76dba
* hwc: simplify: use macros for getting width and height of hwc_rectLajos Molnar2011-10-111-12/+14
| | | | | Change-Id: I5fbccdb3b9504d1fe3480da59578909e1c233d83 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: simplify: use swap() macroLajos Molnar2011-10-111-21/+9
| | | | | Change-Id: I3c4a83a64bee10d8810fd292bb53dfff7be8d664 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: assume possible TILER2D layers when deciding HDMI modeLajos Molnar2011-10-111-4/+5
| | | | | | | | | TILER2D layers have stricter scaling limitations, so assume possibility of TILER2D layers when deciding if they will be able to be cloned for the HDMI mode. Change-Id: I7b6c89cb4216ae27a793ea3b1b4f8e8e40b654cc Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: shorten persist property names DO NOT MERGEErik Gilling2011-10-111-4/+4
| | | | | | | The old ones were too long and could not be set. Change-Id: Ic0519025dcb0df223e4f87b4af67c12e94f5f486 Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: make docking/mirroring properties persistantErik Gilling2011-10-061-4/+4
| | | | | Change-Id: I343b2c8ff7adbe56ce16ac80aa3c001e20eba56b Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: finetune hdmi cloning supportLajos Molnar2011-10-061-27/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use properties to enable/disable hdmi mirroring/docking, and to set transformation for mirroring/docking: hwc.hdmi.mirroring.enabled hwc.hdmi.docking.enabled hwc.hdmi.mirroring.transform hwc.hdmi.docking.transform The following use-cases are supported: 1) mirroring-only (external layers are ignored) - for testing only 2) docking-only 3) mirroring and docking (default) transform values are bitfields: bits 0-1: number of clockwise 90-degree rotations bit 2: horizontal mirroring (applied after rotation) mirroring transform is performed in addition to LCD transformations. docking transform is performed on the actual layers. Change-Id: I9822355afba79f4e7f1f7615e7e1e713daab4dd7 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: refine HDMI best mode selection: favor less scaling over aspect ratioLajos Molnar2011-10-061-5/+5
| | | | | | | | | Pick a size that scales less over a size with a better aspect ratio fit, because the aspect ratio of the display is constant anyways. This will avoid selecting e.g. a 4:3 aspect ratio 480p format when displaying a 4:3 high-resolution video. Change-Id: If5e378208809625c34c1d53ec8018cf0b653be3e
* hwc: invalidate only when we have to when switching to hdmiLajos Molnar2011-10-061-5/+11
| | | | | | | | | | | | This moves forcing of invalidate only if all overlays are used on LCD. Then the layers will be first rendered with one less overlay/half of the overlays on LCD, freeing up overlays. On the second invalidate the cloning will start. This patch also resolves a potential race conditino when setting ext_requested. Change-Id: I0b9cf81091c9f66e37d3dab5f9f9648147c7295c
* hwc: do not pick interlaced hdmi mode as it is not yet supportedLajos Molnar2011-10-061-0/+2
| | | | Change-Id: Icc68bc26d7acc939d512dfaaf0bad12c97f9d701
* hwc: decide scaling support based on correct display's pixel clockLajos Molnar2011-10-061-9/+18
| | | | | | | | | | | Fixes the following issues: - external display scaling check should use mode's pixel clock - pixel clock is not relevant for manual displays (where pixel clock is 0); however, 0 pixel clock for external display means that display is off. Change-Id: Ief404811ed0f5152784490e97ac965f0e44fb4de Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: reset screen before first setLajos Molnar2011-10-041-11/+31
| | | | | | | | | Move resetting of screen (blank/unblank) to just before first set. Also turn off bootloader image, as blank/unblank does not change the composition. Change-Id: Ia1d25887dcc566ba2c20f8d390199d815d374d7a Signed-off-by: Lajos Molnar <molnar@ti.com>
* improve logging in hwc.Mathias Agopian2011-09-291-4/+4
| | | | | | we now print the handle of overlay buffers. Change-Id: I6df51fec1f0227afce2d7e5bb85b994167ca1e01
* hwc: fix overlay assignment if all layers are scaledLajos Molnar2011-09-271-1/+2
| | | | | | | | | | Fix a bug that assigned the same overlay for multiple layers if all layers were scaled or NV12. Also, the number of NV12 layers displayable by DSS is limited. Change-Id: I4db33d7fc8563930a1e4214a704af2728fb9cec0 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: keep video pixel ratio in docking modeLajos Molnar2011-09-211-14/+20
| | | | | | | Use the displayFrame size to determine pixel ratio for layer to be externally displayed Change-Id: I5eff81b2d91c4b1e5cd76a623eb73dd37e8684db
* hwc: fix issue if external display dimensions are zeroLajos Molnar2011-09-211-0/+9
| | | | | | | | | Assume 1:1 pixel ratio if any of the physical dimensions of the external display is 0. This fixes a division by zero error. Change-Id: I54d257e7fdcdd2daf49212b358d3ff2cf5d76ffc
* hwc: set hdmi resolution in docking mode based on layer dimensionsLajos Molnar2011-09-211-102/+130
| | | | | | This allows e.g. playing 1080p video in 1080p mode. Change-Id: Ie0063baeb5d09325ab36a10b73050d9eb3fbbbe0
* hwc: unify HDMI docking and cloningLajos Molnar2011-09-211-20/+56
| | | | | | | | | | | | | | | | | | | | If we have a surface with external display usage marked, switch to docking (clone only that surface to HDMI). Once the surface goes away, switch back to cloning. Also change docking mode support: Select dockable surface based on the usage bit instead of the color format. For multiple such surfaces, pick the one with the largest display area. Change meaning of hwc_dev->ext transform bits for docking mode. These are applied purely to the surface buffer, instead of as an additional transform on the surface displayed on LCD. In other words, the surface displayed on HDMI is independent of the UI orientation. Change-Id: Ic6895ba0ff275ca374eb72d0fa7d93a634111d1a
* hwc: blank and unblank screen on openErik Gilling2011-09-191-0/+11
| | | | | Change-Id: Ib6c1ce8183a2dcd4aef3bf03e075766efafd1435 Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: remove log spam on unhandled formatsLajos Molnar2011-09-161-1/+0
| | | | | | | Fixes b/5290568 Change-Id: Ie02c4bc1f06d251e057d2a17adfa8e4f04ace667 Signed-off-by: Iliyan Malchev <malchev@google.com>
* hwc: call wait-for-vsync in set if eglSwapBuffers is not called.Lajos Molnar2011-09-141-1/+31
| | | | | | | | This adds a rate-limiting similar to when eglSwapBuffer is called, so that DSS-only compositions do not complete instantly. Change-Id: I5b6ea7f5b258d6b0c35068ba1bdc91f342227e4a Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: support CEA standard aspect ratios and finetune HDMI mode selectionLajos Molnar2011-09-141-36/+124
| | | | | | | | | | | | | | | | | | | Using the screen's aspect ratio does not work for CEA modes, where the mode's aspect ratio takes precedence. Select HDMI mode based on the following precedence: 1. pick CEA mode over VESA mode (for audio support) 2. pick a mode where we are upscaling (for scaling support) 3. pick a mode where the framebuffer fits most of the screen (minimize black bar area). This in effect picks a mode with the closest aspect ratio to the frame buffer 4. pick a resolution closest to framebuffer's resolution 5. pick the highest refresh rate Also only select an HDMI mode where we will be able to scale the UI to the screen. Change-Id: Ic8985436b88577cfa59f284eecbda6cdd340de6f
* hwc: actually check if DSS can support scalingLajos Molnar2011-09-141-9/+96
| | | | | | | | | | | This is needed so we do not commit surfaces to be rendered by HWC if DSS will not be able to ultimately display it. Checks include: - scaling limits - NV12 format support Change-Id: Ib53d0a60494f9d55ffedc48aa32181d04691e182
* hwc: call wait-for-vsync in set if eglSwapBuffers is not called.Lajos Molnar2011-09-121-0/+4
| | | | | | | | | | | This adds a rate-limiting similar to when eglSwapBuffer is called, so that DSS-only compositions do not complete instantly. Also include FBIO_WAITFORVSYNC until it is defined in bionic's linux/fb.h Change-Id: I858da95b18cc2bca107b5ece616db42da38719f1 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: do not call Post2 if there is no display/surface.Lajos Molnar2011-09-121-9/+12
| | | | | | | This is in line with prior commit to not call eglSwapBuffer. Change-Id: If19abfee407a5bdbeac97a66e8da4b1cb95d0e63 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: process all layersLajos Molnar2011-09-091-2/+3
| | | | | | | | | remove optimization that stopped processing layers after we filled all overlays, since these layers will need to be rendered via framebuffer, which will affect framebuffer z-order. Change-Id: I84ac97442432eb11ccb92baed250d7e3ee5bb179 Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: remove unused fb_zmaxLajos Molnar2011-09-091-5/+4
| | | | Change-Id: I3ae9ccb75ee64367dfac9b778fda6753fd3100b8
* never set the CLEAR_FB flag on OVERLAY layers (it makes no sense)Mathias Agopian2011-09-091-0/+2
| | | | Change-Id: I4f8c38645c8317fc0ac073324a1b477b9a28db07
* hwc: set hdmi mode (resolution) through new dsscomp APILajos Molnar2011-09-071-15/+42
| | | | | | | | Read supported monitor resolutions on hpd. Try to pick one that is the same size as the main screen. If that is not supported, pick the default (TV preferred) resolution. Change-Id: I49732b292d4651aeac504b7053fad928c0de2251
* configure the overlays with an opaque format when the layer is opaqueMathias Agopian2011-09-061-0/+4
| | | | | | | previously if a layer was configured as RGBA but was not blended, hwc would blend the layer anyways (based on the format). Change-Id: I174d39e9c16f5bf1cc989d94823cb9e4656a61b4
* do not call eglSwapBuffers() when EGLDisplay or EGLSurface are NULLMathias Agopian2011-09-021-1/+4
| | | | | | | this happens when turning the screen off, where we call set with all parameters set to NULL Change-Id: Ia5f913fbbee70e310508894800c220488ed8a061
* fix more drawing artifacts caused by hw composerMathias Agopian2011-09-021-3/+4
| | | | | | | hwc used the pixelformat to determine if a layer was opaque instead of using the blending field. Change-Id: I0e3dba7234639cb75156c6e941bf5e6aa0ecaf8d
* hwc: clear FB above all opaque layers if using SGXLajos Molnar2011-09-011-9/+5
| | | | | | | | | | | | | | | | To take advantage of some SGX optimizations, it would be useful to always set the HWC_HINT_CLEAR_FB on opaque layers unless there are no HWC_FRAMEBUFFER layers. In other words, if at least one layer is composited (HWC_FRAMEBUFFER), we want to tell SF to clear the framebuffer for all opaque layers that are handled by h/w composer (HWC_HINT_CLEAR_FB). If all layers are going into the overlays, then we do not want to do this. This will prevent SGX to needlessly preserve the backbuffer under those opaque layers and improve performance a bit in those cases. Change-Id: If3d969fa8ee3ce3ff6c49cde7d19de456b8aa321
* hwc: handle NULL for prepare() and set()Lajos Molnar2011-09-011-11/+6
| | | | | | | | Go through normal SGX Post2 cycle if layer_list is NULL. Set up framebuffer if prepare is called with NULL list, and call Post2 interface as usual if set is called with NULL list. Change-Id: I2d9d52a6ae6f55c8776361d1733f29de53183154
* hwc: mark framebuffer as pre-multipliedErik Gilling2011-09-011-0/+1
| | | | | Change-Id: I1e5c92c4e598c3c98b2680da4281481d90d41bf7 Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: fix z-order settings for fbLajos Molnar2011-08-311-0/+1
| | | | | | | | | If a hardware layer was sandwiched between framebuffer layers, the z-order of the framebuffer layer was not adjusted. This is now fixed. Change-Id: Ib9eff3e3f1cd14b7c2a1d00ce2b451b04667e09a Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: account for 1 16MB tiler slot instead of 4 4MB oneLajos Molnar2011-08-251-4/+20
| | | | | | | | This requires corresponding kernel change that manages TILER1D mappings into 1 large tiler slot. Change-Id: I868e2c252378ef74c343876eb94c15fe549cd2ed Signed-off-by: Lajos Molnar <molnar@ti.com>
* hwc: scale cloned UI/video to full screen with correct aspect ratioLajos Molnar2011-08-241-1/+141
| | | | | | | | | | | | | | | | Added support to scale the cloned UI to full screen. Screen aspect ratio is detected using EDID information, and UI aspect ratio is preserved on the external display. For now we are hardcoding square pixels on the internal display. In docking mode, the first NV12 layer is scaled to full screen on the external display. In mirroring mode, the whole UI and any video layers are scaled to full screen. Change-Id: Ib4887fb341c22758de7a9c2fc89a9ff660d4fbd3 Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: add uevent listener to handle switching to HDMI cloningLajos Molnar2011-08-242-15/+140
| | | | | | | | | | | | | Added uevent listener that listens to the hdmi switch. Cloning is now enabled by hwc after it receives hpd event. On startup, hpd state is detected to start cloning immediately. Only the DOCK flag will be read from debug.hwc.ext property to determine whether to do full mirroring, or only docking to external display. Change-Id: I7ea888d9048ad642ce1cdc7b71b75c62faafc227 Signed-off-by: Erik Gilling <konkers@android.com>
* hwc: added support for mirroring on external displayLajos Molnar2011-08-241-48/+196
| | | | | | | | | | | | | | | | | | | | | | | Rotation/mirroring has to be specified using the debug.hwc.ext property for now, which is read every 32 frame compositions: bits 0-1: clockwise 90-degree rotations bit 2: left to right mirroring (applied after rotation) bit 3: clone enable bit 4: docking mode bit 5: cloning to TV/HDMI (vs. LCD2) (cloning always happens to display1) Rotation and mirroring is not yet applied. In docking mode, the first NV12 layer is cloned to the external display. In mirroring mode, the whole UI and any video layers are cloned to the external display. NOTE: needs matching kernel update Change-Id: Ia8332e5892cd0855dd0fb510662da660ab8ee6d5 Signed-off-by: Erik Gilling <konkers@android.com>
* update hal_public.h to DDK 1.8@276629Erik Gilling2011-08-171-4/+9
| | | | | Change-Id: Id4947b195984f664809cd1aa6bfe1e2246ac70cb Signed-off-by: Erik Gilling <konkers@android.com>
* initial commitIliyan Malchev2011-08-083-0/+874
Change-Id: I8f7a7eeece0e516efa486b77e9d97805c0e65d3e Signed-off-by: Iliyan Malchev <malchev@google.com>