summaryrefslogtreecommitdiff
path: root/src/intel_uxa.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-04-04 19:21:10 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2011-05-29 23:46:30 +0100
commit66be3aab2c7b43290161e13b58f09b3de461fe5f (patch)
treeed86f940e8906685beea511ebaa6852f7766c000 /src/intel_uxa.c
parent6ad066d274133dd3f2e8ca085f762e09497bfaf7 (diff)
Take advantage of the kernel flush for dirty bo in the busy ioctl
Rather than just creating and submitting a batch that simply contains a flush in order to periodically ensure that rendering reaches the scanout, we can simply ask the kernel whether the scanout is busy. The kernel will then submit a flush on our behalf if it is dirty, which takes advantage of the kernel's dirty state tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit 6f104189bb9439ab0e05f04d4be020813eb04bf9) Conflicts: src/intel_display.c src/intel_driver.c
Diffstat (limited to 'src/intel_uxa.c')
-rw-r--r--src/intel_uxa.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 7a287aa8..1ae1f303 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -89,7 +89,7 @@ static void
gen6_context_switch(intel_screen_private *intel,
int new_mode)
{
- intel_batch_submit(intel->scrn, FALSE);
+ intel_batch_submit(intel->scrn);
}
static void
@@ -137,7 +137,7 @@ intel_get_aperture_space(ScrnInfoPtr scrn, drm_intel_bo ** bo_table,
bo_table[0] = intel->batch_bo;
if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) != 0) {
- intel_batch_submit(scrn, FALSE);
+ intel_batch_submit(scrn);
bo_table[0] = intel->batch_bo;
if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) !=
0) {
@@ -703,7 +703,7 @@ static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
if (!list_is_empty(&priv->batch) &&
(access == UXA_ACCESS_RW || priv->batch_write))
- intel_batch_submit(scrn, FALSE);
+ intel_batch_submit(scrn);
if (priv->tiling || bo->size <= intel->max_gtt_map_size)
ret = drm_intel_gem_bo_map_gtt(bo);
@@ -920,7 +920,7 @@ static Bool intel_uxa_get_image(PixmapPtr pixmap,
FreeScratchGC(gc);
- intel_batch_submit(xf86Screens[screen->myNum], FALSE);
+ intel_batch_submit(xf86Screens[screen->myNum]);
x = y = 0;
pixmap = scratch;
@@ -934,6 +934,11 @@ static Bool intel_uxa_get_image(PixmapPtr pixmap,
return ret;
}
+static void intel_flush_rendering(intel_screen_private *intel)
+{
+ drm_intel_bo_busy(intel->front_buffer);
+}
+
void intel_uxa_block_handler(intel_screen_private *intel)
{
/* don't call this if switche,d doesn't matter and we won't complain
@@ -943,15 +948,14 @@ void intel_uxa_block_handler(intel_screen_private *intel)
if (intel->shadow_damage &&
pixman_region_not_empty(DamageRegion(intel->shadow_damage))) {
intel_shadow_blt(intel);
- /* Emit a flush of the rendering cache, or on the 965
- * and beyond rendering results may not hit the
- * framebuffer until significantly later.
- */
- intel_batch_submit(intel->scrn, TRUE);
-
DamageEmpty(intel->shadow_damage);
- } else
- intel_batch_submit(intel->scrn, TRUE);
+ }
+
+ /* Emit a flush of the rendering cache, or on the 965
+ * and beyond rendering results may not hit the
+ * framebuffer until significantly later.
+ */
+ intel_flush_rendering(intel);
}
static PixmapPtr