summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Diaz Prado <a0273371@ti.com>2012-06-12 16:20:26 -0500
committerJason Simmons <jsimmons@google.com>2012-10-22 15:39:48 -0700
commite90714f1863dc151fb2bb7374c0c7ed0b7d75a14 (patch)
tree1dcb95be25efacb824bfcd62d5a5c846856019cc
parent8438ab1da64c136916ecf1dfe07869cfa688c8be (diff)
downloadomap4-aah-e90714f1863dc151fb2bb7374c0c7ed0b7d75a14.tar.gz
hwc: regionizer: Add asynchronous blits support
Regionizer adds the BVFLAG_ASYNC to all the blits, except for the last one which is made synchronous. The last blit acts like a fence to let the previous asynchronous blits to finish first. Support in the GC driver must be present for this feature to work properly. Rebased from p-ics-mr1: 822ec12 hwc: regionizer: Add asynchronous blits support Change-Id: Iec32de51e7d0b95d1b780e60ed4848e8daf7977f Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com> (cherry picked from commit 75bcf14b2937c1edbe83834ae93371995dd64b0f)
-rw-r--r--hwc/rgz_2d.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/hwc/rgz_2d.c b/hwc/rgz_2d.c
index 7717599..b87478f 100644
--- a/hwc/rgz_2d.c
+++ b/hwc/rgz_2d.c
@@ -287,6 +287,11 @@ static int rgz_out_bvdirect_paint(rgz_t *rgz, rgz_out_params_t *params)
return rv;
}
+static void rgz_set_async(struct rgz_blt_entry *e, int async)
+{
+ e->bp.flags = async ? e->bp.flags | BVFLAG_ASYNC : e->bp.flags & ~BVFLAG_ASYNC;
+}
+
/*
* Clear the destination buffer, if rect is NULL means the whole screen, rect
* cannot be outside the boundaries of the screen
@@ -336,6 +341,7 @@ static void rgz_out_clrdst(rgz_out_params_t *params, blit_rect_t *rect)
bp->flags = BVFLAG_CLIP | BVFLAG_ROP;
bp->op.rop = 0xCCCC; /* SRCCOPY */
+ rgz_set_async(e, 1);
}
static int rgz_out_bvcmd_paint(rgz_t *rgz, rgz_out_params_t *params)
@@ -381,6 +387,10 @@ static int rgz_out_bvcmd_paint(rgz_t *rgz, rgz_out_params_t *params)
params->data.bvc.out_nhndls++;
}
+ /* Last blit is made sync to act like a fence for the previous async blits */
+ struct rgz_blt_entry* e = &blts.bvcmds[blts.idx-1];
+ rgz_set_async(e, 0);
+
/* FIXME: we want to be able to call rgz_blts_free and populate the actual
* composition data structure ourselves */
params->data.bvc.cmdp = blts.bvcmds;
@@ -1022,6 +1032,7 @@ static int rgz_hwc_layer_blit(hwc_layer_t *l, rgz_out_params_t *params, int buff
bpflags |= BVFLAG_VERT_FLIP_SRC1;
bp->flags = bpflags;
+ rgz_set_async(e, 1);
return 0;
}
@@ -1265,6 +1276,7 @@ static int rgz_hwc_subregion_blit(blit_hregion_t *hregion, int sidx, rgz_out_par
rgz_src1_prep(e, hregion->rgz_layers[lix], rect, scrdesc, scrgeom, params);
rgz_src2blend_prep(e, hregion->rgz_layers[s2lix], rect, params);
rgz_batch_entry(e, BVFLAG_BATCH_BEGIN, 0);
+ rgz_set_async(e, 1);
/* Rest of layers blended with FB */
int first = 1;
@@ -1285,6 +1297,7 @@ static int rgz_hwc_subregion_blit(blit_hregion_t *hregion, int sidx, rgz_out_par
if (rgz_hwc_scaled(layer))
batchflags |= BVBATCH_SRC1RECT_ORIGIN | BVBATCH_SRC1RECT_SIZE;
rgz_batch_entry(e, BVFLAG_BATCH_CONTINUE, batchflags);
+ rgz_set_async(e, 1);
}
if (e->bp.flags & BVFLAG_BATCH_BEGIN)
@@ -1316,6 +1329,7 @@ static int rgz_hwc_subregion_blit(blit_hregion_t *hregion, int sidx, rgz_out_par
if (l->transform & HWC_TRANSFORM_FLIP_V)
bpflags |= BVFLAG_VERT_FLIP_SRC1;
e->bp.flags = bpflags;
+ rgz_set_async(e, 1);
}
return 0;
}
@@ -1423,6 +1437,10 @@ static int rgz_out_region(rgz_t *rgz, rgz_out_params_t *params)
params->data.bvc.out_nhndls++;
}
+ /* Last blit is made sync to act like a fence for the previous async blits */
+ struct rgz_blt_entry* e = &blts.bvcmds[blts.idx-1];
+ rgz_set_async(e, 0);
+
/* FIXME: we want to be able to call rgz_blts_free and populate the actual
* composition data structure ourselves */
params->data.bvc.cmdp = blts.bvcmds;