summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Diaz Prado <a0273371@ti.com>2012-08-03 16:30:50 -0500
committerJason Simmons <jsimmons@google.com>2012-10-22 15:51:05 -0700
commite563de0e326074ab07d98384b35ecf7477b5d3df (patch)
tree08cbe2be4e1425a2465e8c73b1a257bd2a1895b9
parentec3c877e686bc277a2ba425c2a5e7a73790eb328 (diff)
downloadomap4-aah-e563de0e326074ab07d98384b35ecf7477b5d3df.tar.gz
hwc: rgz: Remove workaround, Avoid parsing region data if it's not needed
This patch removes the workaround introduced by the patch: 2cb90b8 hwc: rgz: Workaround for hdmi hotplug crash with 2D blitter enabled Basically when the number of layers differ from the ones handled in the previous frame, we don't trust anymore the region data and we need to calculate it again. If the layers are the same in number and there has not been a geometry change the region data can be reused for the same frame Change-Id: I4421ca5c7bc1b556cd54de888865ed83e957b919 Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com> (cherry picked from commit 3789ed446d031fbec5fd52ddc0dcde759129ce19)
-rw-r--r--hwc/rgz_2d.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/hwc/rgz_2d.c b/hwc/rgz_2d.c
index 33f04b2..5a74377 100644
--- a/hwc/rgz_2d.c
+++ b/hwc/rgz_2d.c
@@ -600,6 +600,17 @@ static int rgz_in_valid_hwc_layer(hwc_layer_t *layer)
return 1;
}
+/* Reset dirty region data and state */
+static void rgz_delete_region_data(rgz_t *rgz){
+ if (!rgz)
+ return;
+ if (rgz->hregions)
+ free(rgz->hregions);
+ rgz->hregions = NULL;
+ rgz->nhregions = 0;
+ rgz->state &= ~RGZ_REGION_DATA;
+}
+
static void rgz_handle_dirty_region(rgz_t *rgz, int reset_counters)
{
unsigned int i;
@@ -692,6 +703,12 @@ static int rgz_in_hwccheck(rgz_in_params_t *p, rgz_t *rgz)
unsigned int blit_layers = possible_blit + 1; /* Account for background layer */
int reset_dirty_counters = rgz->rgz_layerno != blit_layers ? 1 : 0;
+ /*
+ * The layers we are going to blit differ in number from the previous frame,
+ * we can't trust anymore the region data, calculate it again
+ */
+ if (reset_dirty_counters)
+ rgz_delete_region_data(rgz);
rgz->state |= RGZ_STATE_INIT;
rgz->rgz_layerno = blit_layers;
@@ -713,12 +730,10 @@ static int rgz_in_hwc(rgz_in_params_t *p, rgz_t *rgz)
return -1;
}
-#if 0
/* If there is already region data avoid parsing it again */
if (rgz->state & RGZ_REGION_DATA) {
return 0;
}
-#endif
int layerno = rgz->rgz_layerno;
@@ -1647,23 +1662,11 @@ int rgz_get_screengeometry(int fd, struct bvsurfgeom *geom, int fmt)
return 0;
}
-/* Reset the values needed for every frame, except the dirty region handles */
-static void rgz_reset(rgz_t *rgz){
- if (!rgz)
- return;
- if (rgz->hregions)
- free(rgz->hregions);
- rgz->hregions = NULL;
- rgz->nhregions = 0;
- rgz->state = 0;
-}
-
int rgz_in(rgz_in_params_t *p, rgz_t *rgz)
{
int rv = -1;
switch (p->op) {
case RGZ_IN_HWC:
- rgz_reset(rgz);
rv = rgz_in_hwccheck(p, rgz);
if (rv == RGZ_ALL)
rv = rgz_in_hwc(p, rgz) ? 0 : RGZ_ALL;