summaryrefslogtreecommitdiff
path: root/hwc/hwc.c
diff options
context:
space:
mode:
authorLajos Molnar <lajos@ti.com>2011-12-12 12:34:49 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-12 12:34:49 -0800
commit3ef73757e76e5109d78ad67b244a4f0706cc62f6 (patch)
tree9d3ca9aefd7fccc211b8b308880915107f1804a2 /hwc/hwc.c
parent1d6010b6be8bdbe411db0bd6f4d72517d98c5337 (diff)
parent4b9a8e20618eab9b5a581a97586c5808f8571d28 (diff)
downloadomap4xxx-omapzoom-3ef73757e76e5109d78ad67b244a4f0706cc62f6.tar.gz
am 4b9a8e20: am 4b267e18: hwc: fix issues handling force_sgx
* commit '4b9a8e20618eab9b5a581a97586c5808f8571d28': hwc: fix issues handling force_sgx
Diffstat (limited to 'hwc/hwc.c')
-rw-r--r--hwc/hwc.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 74d06477..680e0e2f 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -877,7 +877,8 @@ static inline int can_dss_render_all(omap4_hwc_device_t *hwc_dev, struct counts
int on_tv = hwc_dev->ext.on_tv;
int tform = hwc_dev->ext.current.enabled && (hwc_dev->ext.current.rotation || hwc_dev->ext.current.hflip);
- return /* must have at least one layer if using composition bypass to get sync object */
+ return !hwc_dev->force_sgx &&
+ /* must have at least one layer if using composition bypass to get sync object */
num->possible_overlay_layers &&
num->possible_overlay_layers <= num->max_hw_overlays &&
num->possible_overlay_layers == num->composited_layers &&
@@ -952,17 +953,15 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t*
num.dockable++;
num.mem += mem1d(handle);
-
- /* Check if any of the layers are protected.
- * if so, disable the SGX force usage
- */
- if (hwc_dev->force_sgx && isprotected(layer))
- hwc_dev->force_sgx = 0;
}
}
+ /* Disable the forced SGX rendering if there is only one layer */
+ if (hwc_dev->force_sgx && num.composited_layers <= 1)
+ hwc_dev->force_sgx = 0;
+
/* phase 3 logic */
- if (!hwc_dev->force_sgx && can_dss_render_all(hwc_dev, &num)) {
+ if (can_dss_render_all(hwc_dev, &num)) {
/* All layers can be handled by the DSS -- don't use SGX for composition */
hwc_dev->use_sgx = 0;
hwc_dev->swap_rb = num.BGR != 0;
@@ -998,9 +997,12 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t*
hwc_layer_t *layer = &list->hwLayers[i];
IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle;
- if (!hwc_dev->force_sgx &&
- dsscomp->num_ovls < num.max_hw_overlays &&
+ if (dsscomp->num_ovls < num.max_hw_overlays &&
can_dss_render_layer(hwc_dev, layer) &&
+ (!hwc_dev->force_sgx ||
+ /* render protected and dockable layers via DSS */
+ isprotected(layer) ||
+ (hwc_dev->ext.current.docking && hwc_dev->ext.current.enabled && dockable(layer))) &&
mem_used + mem1d(handle) < MAX_TILER_SLOT &&
/* can't have a transparent overlay in the middle of the framebuffer stack */
!(is_BLENDED(layer->blending) && fb_z >= 0)) {
@@ -1102,9 +1104,6 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t*
/* mirror layers */
hwc_dev->post2_layers = dsscomp->num_ovls;
- if (hwc_dev->ext.current.docking && (ix_docking == -1))
- ix_docking = dsscomp->ovls[0].cfg.ix;
-
if (hwc_dev->ext.current.enabled && hwc_dev->ext_ovls) {
int ix_back, ix_front, ix;
if (hwc_dev->ext.current.docking) {