summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-06 14:11:05 +0000
committerOwain G. Ainsworth <oga@openbsd.org>2011-05-29 22:59:55 +0100
commite13f6d39ff40bd1e215bf97d389f1770bc87b285 (patch)
treeec1d7d0d03d80541448822a29ec7fd50cf6b2179
parentef04ad33f86e7c2d7cd1d6dbf6b04257efc52fe1 (diff)
snb: Cache pixmap binding locations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit f3a47d7f235d18e4529e3898a48673c7c3cbd489) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/i965_render.c18
-rw-r--r--src/intel.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index c944ed04..fffcae7f 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1121,6 +1121,14 @@ i965_set_picture_surface_state(intel_screen_private *intel,
struct brw_surface_state *ss;
int offset;
+ if (is_dst) {
+ if (priv->dst_bound)
+ return priv->dst_bound;
+ } else {
+ if (priv->src_bound)
+ return priv->src_bound;
+ }
+
ss = (struct brw_surface_state *)
(intel->surface_data + intel->surface_used);
@@ -1170,6 +1178,11 @@ i965_set_picture_surface_state(intel_screen_private *intel,
offset = intel->surface_used;
intel->surface_used += sizeof(struct brw_surface_state_padded);
+ if (is_dst)
+ priv->dst_bound = offset;
+ else
+ priv->src_bound = offset;
+
return offset;
}
@@ -1511,6 +1524,8 @@ static Bool i965_composite_check_aperture(ScrnInfoPtr scrn)
static void i965_surface_flush(struct intel_screen_private *intel)
{
+ struct intel_pixmap *priv;
+
drm_intel_bo_subdata(intel->surface_bo,
0, intel->surface_used,
intel->surface_data);
@@ -1527,6 +1542,9 @@ static void i965_surface_flush(struct intel_screen_private *intel)
intel->surface_bo =
drm_intel_bo_alloc(intel->bufmgr, "surface data",
sizeof(intel->surface_data), 4096);
+
+ list_foreach_entry(priv, struct intel_pixmap, &intel->batch_pixmaps, batch)
+ priv->dst_bound = priv->src_bound = 0;
}
Bool
diff --git a/src/intel.h b/src/intel.h
index 490c221f..06bb740f 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -172,6 +172,7 @@ struct intel_pixmap {
struct list flush, batch, in_flight;
+ uint16_t src_bound, dst_bound;
uint16_t stride;
uint8_t tiling;
int8_t busy :2;