summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-01-19 19:11:41 -0800
committerEric Anholt <eric@anholt.net>2009-01-20 10:50:20 -0800
commita340fe5e4227ebea5493e658eb6289624b07ab0b (patch)
treed7859ce899772490dad34360a8f74b53ed59b12d
parentaefe198ca427a5ad69717f49948eb3ede713bb28 (diff)
Use intel_emit_reloc from video to prettify 965 render bind_bo setup.
-rw-r--r--src/i830.h17
-rw-r--r--src/i965_render.c32
-rw-r--r--src/i965_video.c17
3 files changed, 33 insertions, 33 deletions
diff --git a/src/i830.h b/src/i830.h
index b726dd68..4ee9c39d 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -1023,6 +1023,23 @@ Bool i830_pixmap_tiled(PixmapPtr p);
if (pitch > KB(8)) I830FALLBACK("pitch exceeds 3d limit 8K\n");\
} while(0)
+/**
+ * Little wrapper around drm_intel_bo_reloc to return the initial value you
+ * should stuff into the relocation entry.
+ *
+ * If only we'd done this before settling on the library API.
+ */
+static inline uint32_t
+intel_emit_reloc(drm_intel_bo *bo, uint32_t offset,
+ drm_intel_bo *target_bo, uint32_t target_offset,
+ uint32_t read_domains, uint32_t write_domain)
+{
+ drm_intel_bo_emit_reloc(bo, offset, target_bo, target_offset,
+ read_domains, write_domain);
+
+ return target_bo->offset + target_offset;
+}
+
extern const int I830PatternROP[16];
extern const int I830CopyROP[16];
diff --git a/src/i965_render.c b/src/i965_render.c
index 281eb0da..821be40a 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1360,24 +1360,24 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
}
binding_table = binding_table_bo->virtual;
- binding_table[0] = 0 * sizeof (brw_surface_state_padded) + surface_state_bo->offset;
- dri_bo_emit_reloc (binding_table_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
- 0 * sizeof (brw_surface_state_padded),
- 0 * sizeof (uint32_t),
- surface_state_bo);
-
- binding_table[1] = 1 * sizeof (brw_surface_state_padded) + surface_state_bo->offset;
- dri_bo_emit_reloc (binding_table_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
- 1 * sizeof (brw_surface_state_padded),
- 1 * sizeof (uint32_t),
- surface_state_bo);
+ binding_table[0] = intel_emit_reloc(binding_table_bo,
+ 0 * sizeof(uint32_t),
+ surface_state_bo,
+ 0 * sizeof(brw_surface_state_padded),
+ I915_GEM_DOMAIN_INSTRUCTION, 0);
+
+ binding_table[1] = intel_emit_reloc(binding_table_bo,
+ 1 * sizeof(uint32_t),
+ surface_state_bo,
+ 1 * sizeof(brw_surface_state_padded),
+ I915_GEM_DOMAIN_INSTRUCTION, 0);
if (pMask) {
- binding_table[2] = 2 * sizeof (brw_surface_state_padded) + surface_state_bo->offset;
- dri_bo_emit_reloc (binding_table_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
- 2 * sizeof (brw_surface_state_padded),
- 2 * sizeof (uint32_t),
- surface_state_bo);
+ binding_table[2] = intel_emit_reloc(binding_table_bo,
+ 2 * sizeof(uint32_t),
+ surface_state_bo,
+ 2 * sizeof(brw_surface_state_padded),
+ I915_GEM_DOMAIN_INSTRUCTION, 0);
} else {
binding_table[2] = 0;
}
diff --git a/src/i965_video.c b/src/i965_video.c
index cd726a28..7cd20f36 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -326,23 +326,6 @@ i965_post_draw_debug(ScrnInfoPtr scrn)
#define URB_CS_ENTRIES 0
#define URB_CS_ENTRY_SIZE 0
-/**
- * Little wrapper around drm_intel_bo_reloc to return the initial value you
- * should stuff into the relocation entry.
- *
- * If only we'd done this before settling on the library API.
- */
-static uint32_t
-intel_emit_reloc(drm_intel_bo *bo, uint32_t offset,
- drm_intel_bo *target_bo, uint32_t target_offset,
- uint32_t read_domains, uint32_t write_domain)
-{
- drm_intel_bo_emit_reloc(bo, offset, target_bo, target_offset,
- read_domains, write_domain);
-
- return target_bo->offset + target_offset;
-}
-
static int
intel_alloc_and_map(I830Ptr i830, char *name, int size,
drm_intel_bo **bop, void *virtualp)