[PATCH 11/18] Add intel_flush to abstract flushing pending acceleration operations

Keith Packard keithp at keithp.com
Sat Aug 16 23:13:14 PDT 2014


intel_flush flushes any pending acceleration operations to the
hardware, just like intel_uxa_batch_submit does today except that it is
not uxa-specific.

Signed-off-by: Keith Packard <keithp at keithp.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
 src/uxa/intel.h         |  3 +++
 src/uxa/intel_display.c |  9 +++------
 src/uxa/intel_driver.c  | 14 +++++++++-----
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/src/uxa/intel.h b/src/uxa/intel.h
index 0c96b15..dbd718d 100644
--- a/src/uxa/intel.h
+++ b/src/uxa/intel.h
@@ -537,4 +537,7 @@ intel_get_pixmap_bo(PixmapPtr pixmap);
 void
 intel_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo);
 
+void
+intel_flush(intel_screen_private *intel);
+
 #endif /* _I830_H_ */
diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 746cc93..ecd8544 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -437,8 +437,7 @@ intel_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 	crtc->y = y;
 	crtc->rotation = rotation;
 
-	intel_glamor_flush(intel);
-	intel_batch_submit(crtc->scrn);
+        intel_flush(intel);
 
 	mode_to_kmode(crtc->scrn, &intel_crtc->kmode, mode);
 	ret = intel_crtc_apply(crtc);
@@ -1437,8 +1436,7 @@ intel_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	if (scrn->virtualX == width && scrn->virtualY == height)
 		return TRUE;
 
-	intel_glamor_flush(intel);
-	intel_batch_submit(scrn);
+        intel_flush(intel);
 
 	old_width = scrn->virtualX;
 	old_height = scrn->virtualY;
@@ -1552,8 +1550,7 @@ intel_do_pageflip(intel_screen_private *intel,
 		goto error_out;
 
 	drm_intel_bo_disable_reuse(new_front);
-	intel_glamor_flush(intel);
-	intel_batch_submit(scrn);
+        intel_flush(intel);
 
 	mode->pageflip_data = pageflip_data;
 	mode->pageflip_handler = pageflip_handler;
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index 435bab9..8ee3fad 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -180,6 +180,12 @@ intel_get_pixmap_bo(PixmapPtr pixmap)
         return intel_uxa_get_pixmap_bo(pixmap);
 }
 
+void
+intel_flush(intel_screen_private *intel)
+{
+        intel_batch_submit(intel->scrn);
+}
+
 static void PreInitCleanup(ScrnInfoPtr scrn)
 {
 	if (!scrn || !scrn->driverPrivate)
@@ -646,7 +652,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty)
 	PixmapSyncDirtyHelper(dirty, &pixregion);
 	RegionUninit(&pixregion);
 
-	intel_batch_submit(scrn);
+        intel_flush(intel);
 	if (!intel->has_prime_vmap_flush) {
 		drm_intel_bo *bo = intel_uxa_get_pixmap_bo(dirty->slave_dst->master_pixmap);
 		was_blocked = xf86BlockSIGIO();
@@ -754,10 +760,8 @@ intel_flush_callback(CallbackListPtr *list,
 		     pointer user_data, pointer call_data)
 {
 	ScrnInfoPtr scrn = user_data;
-	if (scrn->vtSema) {
-		intel_batch_submit(scrn);
-		intel_glamor_flush(intel_get_screen_private(scrn));
-	}
+	if (scrn->vtSema)
+                intel_flush(intel_get_screen_private(scrn));
 }
 
 #if HAVE_UDEV
-- 
2.0.1



More information about the xorg-devel mailing list