diff options
author | Marcus Cooksey <mcooksey@ti.com> | 2016-01-07 19:55:29 -0600 |
---|---|---|
committer | Marcus Cooksey <mcooksey@ti.com> | 2016-01-15 17:46:40 -0500 |
commit | f760c5036b77ed071a3dde06fd3658e0650a4baa (patch) | |
tree | b554e31ca55cbbffb54e82b01c251b83df2c5984 | |
parent | 964982a18b4c101eca3903cd19ceebbc3ebfbfba (diff) | |
download | dra7xx-f760c5036b77ed071a3dde06fd3658e0650a4baa.tar.gz |
hwcomposer: [hack] Prevent DSS from blending overlapping layers
Blending of overlapping layers should be handled by the SGX,
to prevent scenarios where, for example, the video playback
window (composited by DSS) covers the playback
menubar (composited by the SGX). This patch is needed until
HWC is enhanced to properly blend layers.
Change-Id: Ib92463bc0ba697f6f0b215d90a4f0d3b50747e18
Signed-off-by: Marcus Cooksey <mcooksey@ti.com>
-rw-r--r-- | hwcomposer/display.h | 13 | ||||
-rw-r--r-- | hwcomposer/hwc.c | 9 |
2 files changed, 21 insertions, 1 deletions
diff --git a/hwcomposer/display.h b/hwcomposer/display.h index 44feac5..07960ea 100644 --- a/hwcomposer/display.h +++ b/hwcomposer/display.h @@ -35,7 +35,18 @@ #define MAX_COMPOSITION_LAYERS MAX_COMPOSITION_BUFFERS #define HWC_DISPLAY_SECONDARY HWC_DISPLAY_EXTERNAL+1 -#define MAX_DSS_OVERLAYS 4 +/* Kludge + * The MAX_DSS_OVERLAYS should be 4, as supported by DSS HW. + * It has been reduced to 2 for the case when the primary display + * (LCD) is the only display available. In this case, we only + * desire to support a single overlay plane. So if the 2 overlays + * are consumed and more layers are required for compositing to generate + * the final frame, then HWC will defer composition to SF. + * Allowing more that 2 overlays (when only LCD) will result + * in incorrect blending of DSS OVERLAYs and the surfaceflinger layer + * when both layer/planes overlap. + */ +#define MAX_DSS_OVERLAYS 2 #define NUM_NONSCALING_OVERLAYS 1 diff --git a/hwcomposer/hwc.c b/hwcomposer/hwc.c index 40d55b5..41540fb 100644 --- a/hwcomposer/hwc.c +++ b/hwcomposer/hwc.c @@ -86,6 +86,15 @@ static void reserve_overlays_for_displays(omap_hwc_device_t *hwc_dev) uint32_t max_overlays = MAX_DSS_OVERLAYS; uint32_t num_nonscaling_overlays = NUM_NONSCALING_OVERLAYS; + + /* (see comment in display.h for MAX_DSS_OVERLAYS definition) + * If an external display is present, we allow for 4 overlays so + * that at least one overlay can be used for DSS composition of a + * single layer/plane. + */ + if (hwc_dev->displays[HWC_DISPLAY_EXTERNAL]) + max_overlays = 4; + /* If FB is not same resolution as LCD don't use GFX overlay. */ if (primary_display->transform.scaling) { ovl_ix_base = OMAP_DSS_VIDEO1; |