summaryrefslogtreecommitdiffstats
path: root/hwc/hwc.c
diff options
context:
space:
mode:
authorGustavo Diaz Prado <a0273371@ti.com>2012-10-15 14:58:19 -0500
committerDaniel Levin <dendy@ti.com>2012-11-28 21:16:25 +0200
commit3638f02591703be3f52f6b66f20ca56ce91eb692 (patch)
tree1856752fcc09219ddb2f525f4bc95f51b39e3062 /hwc/hwc.c
parent5b1f12fcfae6f9dc21297ee2072f0de8b5a2a67c (diff)
downloadhardware_ti_omap4-3638f02591703be3f52f6b66f20ca56ce91eb692.zip
hardware_ti_omap4-3638f02591703be3f52f6b66f20ca56ce91eb692.tar.gz
hardware_ti_omap4-3638f02591703be3f52f6b66f20ca56ce91eb692.tar.bz2
hwc: rgz: Handle geometry changes efficiently
Allow the regionizer to analyze the previous, current and target framebuffer states to draw only the needed areas of the screen. It is required that SurfaceFlinger supports the HWC_EXTENDED_API and the HWC_EXTENDED_OP_LAYERDATA operation to enable this feature. With this change the following scenarios are handled efficiently: A) When a layer moves, only draw the damaged area between the current and the target framebuffer state instead of redrawing the whole screen B) When a layer appears, only draw the area of the new layer, not the whole screen C) When a layer disappears, only draw the area where the layer used to be instead of the whole screen This change is also compatible with the dirty count per layer, that is, when a layer in the same position and has the same content for multiple frames. Change-Id: I281567440564fd4e9d5865a392676d18653e9ecd Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
Diffstat (limited to 'hwc/hwc.c')
-rw-r--r--hwc/hwc.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/hwc/hwc.c b/hwc/hwc.c
index 4e67a70..42cc278 100644
--- a/hwc/hwc.c
+++ b/hwc/hwc.c
@@ -237,6 +237,7 @@ static int debug = 0;
static int debugpost2 = 0;
static int debugblt = 0;
static rgz_t grgz;
+static rgz_ext_layer_list_t grgz_ext_layer_list;
static struct bvsurfgeom gscrngeom;
static void showfps(void)
@@ -1553,12 +1554,34 @@ static int blit_layers(omap4_hwc_device_t *hwc_dev, hwc_layer_list_t *list, int
break;
}
+ /*
+ * Request the layer identities to SurfaceFlinger, first figure out if the
+ * operation is supported
+ */
+ if (!(list->flags & HWC_EXTENDED_API) || !hwc_dev->procs ||
+ hwc_dev->procs->extension_cb(hwc_dev->procs, HWC_EXTENDED_OP_LAYERDATA, NULL, -1) != 0)
+ goto err_out;
+
+ /* Check if we have enough space in the extended layer list */
+ if ((sizeof(hwc_layer_extended_t) * list->numHwLayers) > sizeof(grgz_ext_layer_list))
+ goto err_out;
+
+ unsigned int i;
+ for (i = 0; i < list->numHwLayers; i++) {
+ hwc_layer_extended_t *ext_layer = &grgz_ext_layer_list.layers[i];
+ ext_layer->idx = i;
+ if (hwc_dev->procs->extension_cb(hwc_dev->procs, HWC_EXTENDED_OP_LAYERDATA,
+ (void **) &ext_layer, sizeof(hwc_layer_extended_t)) != 0)
+ goto err_out;
+ }
+
rgz_in_params_t in = {
.op = rgz_in_op,
.data = {
.hwc = {
.dstgeom = &gscrngeom,
.layers = list->hwLayers,
+ .extlayers = grgz_ext_layer_list.layers,
.layerno = list->numHwLayers
}
}
@@ -1571,7 +1594,7 @@ static int blit_layers(omap4_hwc_device_t *hwc_dev, hwc_layer_list_t *list, int
if (rgz_in(&in, &grgz) != RGZ_ALL)
goto err_out;
- unsigned int i, count = 0;
+ unsigned int count = 0;
for (i = 0; i < list->numHwLayers; i++) {
if (list->hwLayers[i].compositionType != HWC_OVERLAY) {
count++;