diff options
author | Lajos Molnar <lajos@ti.com> | 2011-11-04 18:12:56 -0500 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2011-12-08 14:19:05 -0800 |
commit | 4b267e18b9e98b788d2b1bf2f1268ed25e5b726d (patch) | |
tree | a50ce1e915a610cbbbd6b4cfda47dafb74f9aaf2 /hwc | |
parent | bb7a8bcdce1c9192117cbdbec4aaafe67008bebb (diff) | |
download | hardware_ti_omap4xxx-4b267e18b9e98b788d2b1bf2f1268ed25e5b726d.zip hardware_ti_omap4xxx-4b267e18b9e98b788d2b1bf2f1268ed25e5b726d.tar.gz hardware_ti_omap4xxx-4b267e18b9e98b788d2b1bf2f1268ed25e5b726d.tar.bz2 |
hwc: fix issues handling force_sgx
There were a couple of incorrect fixes to force_sgx handling that
are fixed by this patch.
1. no need to disable force_sgx if there are protected layers.
We only need to route protected layer to DSS.
2. dockable layer must be rendered via DSS (or force_sgx must be
disabled, although that reduces power savings) if we are in
docking mode. Prior fix of cloning an arbitrary layer as the
docking layer was incorrect (as it was doing UI mirroring),
and was calculating the layer index incorrectly.
3. forcing sgx rendering actually increases power if there is only
one layer.
Change-Id: I121747ed06834f870e0f0793d38bf4e77f969858
Signed-off-by: Lajos Molnar <molnar@ti.com>
Diffstat (limited to 'hwc')
-rw-r--r-- | hwc/hwc.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -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) { |