[Intel-gfx] [PATCH] Emit proper relocations to pixmaps in BOs in i965 video.

Eric Anholt eric at anholt.net
Fri Dec 5 00:23:41 CET 2008


---
 src/i965_video.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/i965_video.c b/src/i965_video.c
index 68a12ec..7e84ae0 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -349,6 +349,7 @@ i965_create_dst_surface_state(ScrnInfoPtr scrn,
 {
     I830Ptr pI830 = I830PTR(scrn);
     struct brw_surface_state *dest_surf_state;
+    drm_intel_bo *pixmap_bo = i830_get_pixmap_bo(pixmap);
     drm_intel_bo *surf_bo;
 
     surf_bo = drm_intel_bo_alloc(pI830->bufmgr,
@@ -375,7 +376,14 @@ i965_create_dst_surface_state(ScrnInfoPtr scrn,
     dest_surf_state->ss0.mipmap_layout_mode = 0;
     dest_surf_state->ss0.render_cache_read_mode = 0;
 
-    dest_surf_state->ss1.base_addr = intel_get_pixmap_offset(pixmap);
+    if (pixmap_bo != NULL)
+	dest_surf_state->ss1.base_addr =
+	    intel_emit_reloc(surf_bo, offsetof(struct brw_surface_state, ss1),
+			     pixmap_bo, 0,
+			     I915_GEM_DOMAIN_SAMPLER, 0);
+    else
+	dest_surf_state->ss1.base_addr = intel_get_pixmap_offset(pixmap);
+
     dest_surf_state->ss2.height = scrn->virtualY - 1;
     dest_surf_state->ss2.width = scrn->virtualX - 1;
     dest_surf_state->ss2.mip_count = 0;
-- 
1.5.6.5




More information about the Intel-gfx mailing list