summaryrefslogtreecommitdiffstats
path: root/hwc
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2011-10-05 16:10:29 -0500
committerErik Gilling <konkers@android.com>2011-12-08 14:19:06 -0800
commitb81fb68ce4c70170ebc9e41f9fe4540cc05685d5 (patch)
tree1b4327b6aa73f4c1a8e0d30ed8774cd741d1436e /hwc
parent5706ba0da054830e63b82b195ec32a97c390bd2c (diff)
downloadhardware_ti_omap4xxx-b81fb68ce4c70170ebc9e41f9fe4540cc05685d5.zip
hardware_ti_omap4xxx-b81fb68ce4c70170ebc9e41f9fe4540cc05685d5.tar.gz
hardware_ti_omap4xxx-b81fb68ce4c70170ebc9e41f9fe4540cc05685d5.tar.bz2
hwc: simplify layer hint setting
Set HWC_CLEAR_FB hints in the main loop. Change-Id: I9fb0e4241b9d3975422070daeef0706d954947b2
Diffstat (limited to 'hwc')
-rw-r--r--hwc/hwc.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 5cd3f84..092926d 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -1093,6 +1093,7 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t*
/* set up if DSS layers */
unsigned int mem_used = 0;
+ hwc_dev->ovls_blending = 0;
for (i = 0; list && i < list->numHwLayers; i++) {
hwc_layer_t *layer = &list->hwLayers[i];
IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle;
@@ -1110,6 +1111,14 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t*
/* render via DSS overlay */
mem_used += mem1d(handle);
layer->compositionType = HWC_OVERLAY;
+
+ /* clear FB above all opaque layers if rendering via SGX */
+ if (hwc_dev->use_sgx && !is_BLENDED(layer))
+ layer->hints |= HWC_HINT_CLEAR_FB;
+ /* see if any of the (non-backmost) overlays are doing blending */
+ else if (is_BLENDED(layer) && i > 0)
+ hwc_dev->ovls_blending = 1;
+
hwc_dev->buffers[dsscomp->num_ovls] = layer->handle;
omap4_hwc_setup_layer(hwc_dev,
@@ -1156,33 +1165,6 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t*
}
}
- /* clear FB above all opaque layers if rendering via SGX */
- if (hwc_dev->use_sgx) {
- for (i = 0; list && i < list->numHwLayers; i++) {
- hwc_layer_t *layer = &list->hwLayers[i];
- IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle;
- if (layer->compositionType == HWC_FRAMEBUFFER)
- continue;
- if ((layer->flags & HWC_SKIP_LAYER) || !layer->handle)
- continue;
- if (!is_BLENDED(layer))
- layer->hints |= HWC_HINT_CLEAR_FB;
- }
- }
-
- /* see if any of the (non-backmost) overlays are doing blending */
- hwc_dev->ovls_blending = 0;
- for (i = 1; list && i < list->numHwLayers; i++) {
- hwc_layer_t *layer = &list->hwLayers[i];
- IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle;
- if (layer->compositionType == HWC_FRAMEBUFFER)
- continue;
- if ((layer->flags & HWC_SKIP_LAYER) || !layer->handle)
- continue;
- if (is_BLENDED(layer))
- hwc_dev->ovls_blending = 1;
- }
-
/* if scaling GFX (e.g. only 1 scaled surface) use a VID pipe */
if (scaled_gfx)
dsscomp->ovls[0].cfg.ix = dsscomp->num_ovls;