[Mesa-dev] [PATCH 2/5] intel: Use intel_region_map/unmap in intel_renderbuffer_map/unmap

Chad Versace chad at chad-versace.us
Mon Oct 17 07:40:25 PDT 2011


Before this commit, intel_renderbuffer_map/unmap() directly called
drm_intel_gem_bo_map_gtt(). Since a buffer resolve may be required before
mapping, though, we need instead need to call intel_region_map().

Signed-off-by: Chad Versace <chad at chad-versace.us>
---
 src/mesa/drivers/dri/intel/intel_span.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 8da3b11..f2b7c26 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -234,9 +234,8 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb)
    if (!irb->region)
       return;
 
-   drm_intel_gem_bo_map_gtt(irb->region->bo);
-
-   rb->Data = irb->region->bo->virtual;
+   rb->Data = intel_region_map(intel, irb->region,
+                               GL_MAP_READ_BIT | GL_MAP_WRITE_BIT);
    rb->RowStride = irb->region->pitch;
 
    if (!rb->Name) {
@@ -271,7 +270,7 @@ intel_renderbuffer_unmap(struct intel_context *intel,
    if (!irb->region)
       return;
 
-   drm_intel_gem_bo_unmap_gtt(irb->region->bo);
+   intel_region_unmap(intel, irb->region);
 
    rb->GetRow = NULL;
    rb->PutRow = NULL;
-- 
1.7.6.4



More information about the mesa-dev mailing list