[PATCH] present: Remove get_drmmode_crtc helper

Michel Dänzer michel at daenzer.net
Thu May 21 00:57:59 PDT 2015


From: Michel Dänzer <michel.daenzer at amd.com>

It was getting the drmmode_crtc_private_ptr in a roundabout way.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_present.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/src/radeon_present.c b/src/radeon_present.c
index 53819e0..2626044 100644
--- a/src/radeon_present.c
+++ b/src/radeon_present.c
@@ -202,22 +202,6 @@ radeon_present_flush(WindowPtr window)
     radeon_cs_flush_indirect(xf86ScreenToScrn(window->drawable.pScreen));
 }
 
-static drmmode_crtc_private_ptr
-get_drmmode_crtc(ScrnInfoPtr scrn, RRCrtcPtr crtc)
-{
-    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-    int i;
-
-    for (i = 0; i < config->num_crtc; i++) {
-	xf86CrtcPtr xf86crtc = config->crtc[i];
-
-	if (xf86crtc->randr_crtc == crtc)
-	    return xf86crtc->driver_private;
-    }
-
-    return NULL;
-}
-
 static uint32_t
 radeon_present_get_pixmap_tiling_flags(RADEONInfoPtr info, PixmapPtr pixmap)
 {
@@ -263,7 +247,8 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
 	return FALSE;
 
     if (crtc) {
-	drmmode_crtc_private_ptr drmmode_crtc = get_drmmode_crtc(scrn, crtc);
+	xf86CrtcPtr xf86_crtc = crtc->devPrivate;
+	drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private;
 
 	if (!drmmode_crtc ||
 	    drmmode_crtc->rotate.bo != NULL ||
-- 
2.1.4



More information about the xorg-driver-ati mailing list