diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-04 11:21:17 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-04 11:21:17 +0100 |
commit | 16a5d0ee3ca4d41af6a6876a8baf81e3f715781d (patch) | |
tree | 09533ffdada6c3b6e7800fb0600e901810cd5a01 | |
parent | 516d235c5b3bd51e9533925140d95d3b4533129c (diff) |
shadow: Map the scanout directly on i8xx
Even with the minimal use of the BLT to copy from the GTT shadow to the
GTT scanout, i830 was still hanging. Just write to the scanout directly.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_shadow.c | 95 |
1 files changed, 33 insertions, 62 deletions
diff --git a/src/intel_shadow.c b/src/intel_shadow.c index a4b14f90..de273485 100644 --- a/src/intel_shadow.c +++ b/src/intel_shadow.c @@ -101,22 +101,13 @@ void intel_shadow_blt(intel_screen_private *intel) while (n--) { int pitch; dri_bo *bo; - int offset; - - if (IS_I8XX(intel)) { - bo = intel->shadow_buffer; - offset = box->x1 | box->y1 << 16; - pitch = intel->shadow_stride; - } else { - bo = intel_shadow_create_bo(intel, - box->x1, box->y1, - box->x2, box->y2, - &pitch); - if (bo == NULL) - return; - - offset = 0; - } + + bo = intel_shadow_create_bo(intel, + box->x1, box->y1, + box->x2, box->y2, + &pitch); + if (bo == NULL) + return; BEGIN_BATCH(8); OUT_BATCH(blt); @@ -127,7 +118,7 @@ void intel_shadow_blt(intel_screen_private *intel) I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0); - OUT_BATCH(offset); + OUT_BATCH(0); OUT_BATCH(pitch); OUT_RELOC(bo, I915_GEM_DOMAIN_RENDER, 0, 0); @@ -145,62 +136,43 @@ void intel_shadow_create(struct intel_screen_private *intel) ScreenPtr screen = scrn->pScreen; PixmapPtr pixmap; int stride; + void *buffer; pixmap = screen->GetScreenPixmap(screen); if (IS_I8XX(intel)) { - dri_bo *bo; - int size; - - /* Reduce the incoherency worries for gen2 - * by only allocating a static shadow, at about 2-3x - * performance cost for forcing rendering to uncached memory. + /* Okay, this is a lie. We just use the scanout directly + * via a GTT (uncached) mapping and never attempt anything + * more dangerous... */ - if (intel->shadow_buffer) { - drm_intel_gem_bo_unmap_gtt(intel->shadow_buffer); - drm_intel_bo_unreference(intel->shadow_buffer); - intel->shadow_buffer = NULL; - } - - stride = ALIGN(scrn->virtualX * intel->cpp, 4); - size = stride * scrn->virtualY; - bo = drm_intel_bo_alloc(intel->bufmgr, - "shadow", size, - 0); - if (bo && drm_intel_gem_bo_map_gtt(bo) == 0) { + if (intel->front_buffer && + drm_intel_gem_bo_map_gtt(intel->front_buffer) == 0) { screen->ModifyPixmapHeader(pixmap, scrn->virtualX, scrn->virtualY, -1, -1, - stride, - bo->virtual); - intel->shadow_buffer = bo; + intel->front_pitch, + intel->front_buffer->virtual); } - } else { - void *buffer; - - stride = intel->cpp*scrn->virtualX; - buffer = malloc(stride * scrn->virtualY); - - if (buffer && screen->ModifyPixmapHeader(pixmap, - scrn->virtualX, - scrn->virtualY, - -1, -1, - stride, - buffer)) { - if (intel->shadow_buffer) - free(intel->shadow_buffer); - - intel->shadow_buffer = buffer; - } else - stride = intel->shadow_stride; + return; } + stride = intel->cpp*scrn->virtualX; + buffer = malloc(stride * scrn->virtualY); + if (buffer && + screen->ModifyPixmapHeader(pixmap, + scrn->virtualX, scrn->virtualY, + -1, -1, + stride, buffer)) { + free(intel->shadow_buffer); + intel->shadow_buffer = buffer; + } else + stride = intel->shadow_stride; + if (!intel->shadow_damage) { - intel->shadow_damage = DamageCreate(NULL, NULL, - DamageReportNone, - TRUE, - screen, - intel); + intel->shadow_damage = + DamageCreate(NULL, NULL, + DamageReportNone, TRUE, + screen, intel); DamageRegister(&pixmap->drawable, intel->shadow_damage); DamageSetReportAfterOp(intel->shadow_damage, TRUE); } @@ -208,4 +180,3 @@ void intel_shadow_create(struct intel_screen_private *intel) scrn->displayWidth = stride / intel->cpp; intel->shadow_stride = stride; } - |