From d97057a1e547747348980a280e77dba3897b7d78 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 4 Jan 2011 14:21:57 -0500 Subject: [PATCH] radeon: add vline wait support for rotated pixmaps (v2) Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=32789 v2: update logic as per Michel's comments. --- src/evergreen_accel.c | 3 ++- src/r6xx_accel.c | 13 +++++++++---- src/radeon_commonfuncs.c | 13 +++++++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/evergreen_accel.c b/src/evergreen_accel.c index f3691d7..6a1703d 100644 --- a/src/evergreen_accel.c +++ b/src/evergreen_accel.c @@ -260,7 +260,8 @@ void evergreen_cp_wait_vline_sync(ScrnInfoPtr pScrn, PixmapPtr pPix, return; if (info->cs) { - if (pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) + if ((pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) && + (!drmmode_crtc->rotate_bo || (drmmode_crtc->rotate_bo != radeon_get_pixmap_bo(pPix)))) return; } else { #ifdef USE_EXA diff --git a/src/r6xx_accel.c b/src/r6xx_accel.c index e436514..79ceb2d 100644 --- a/src/r6xx_accel.c +++ b/src/r6xx_accel.c @@ -303,6 +303,9 @@ r600_cp_wait_vline_sync(ScrnInfoPtr pScrn, drmBufPtr ib, PixmapPtr pPix, xf86CrtcPtr crtc, int start, int stop) { RADEONInfoPtr info = RADEONPTR(pScrn); +#if defined(XF86DRM_MODE) + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; +#endif uint32_t offset; if (!crtc) @@ -314,10 +317,14 @@ r600_cp_wait_vline_sync(ScrnInfoPtr pScrn, drmBufPtr ib, PixmapPtr pPix, if (!crtc->enabled) return; +#if defined(XF86DRM_MODE) if (info->cs) { - if (pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) + if ((pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) && + (!drmmode_crtc->rotate_bo || (drmmode_crtc->rotate_bo != radeon_get_pixmap_bo(pPix)))) return; - } else { + } else +#endif + { #ifdef USE_EXA if (info->useEXA) offset = exaGetPixmapOffset(pPix); @@ -338,8 +345,6 @@ r600_cp_wait_vline_sync(ScrnInfoPtr pScrn, drmBufPtr ib, PixmapPtr pPix, #if defined(XF86DRM_MODE) if (info->cs) { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - BEGIN_BATCH(11); /* set the VLINE range */ EREG(ib, AVIVO_D1MODE_VLINE_START_END, /* this is just a marker */ diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c index 2199daf..2dbed10 100644 --- a/src/radeon_commonfuncs.c +++ b/src/radeon_commonfuncs.c @@ -833,6 +833,9 @@ void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix, xf86CrtcPtr crtc, int start, int stop) { RADEONInfoPtr info = RADEONPTR(pScrn); +#if defined(ACCEL_CP) && defined(XF86DRM_MODE) + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; +#endif uint32_t offset; ACCEL_PREAMBLE(); @@ -845,10 +848,14 @@ void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix, if (!crtc->enabled) return; +#if defined(ACCEL_CP) && defined(XF86DRM_MODE) if (info->cs) { - if (pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) + if ((pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) && + (!drmmode_crtc->rotate_bo || (drmmode_crtc->rotate_bo != radeon_get_pixmap_bo(pPix)))) return; - } else { + } else +#endif + { #ifdef USE_EXA if (info->useEXA) offset = exaGetPixmapOffset(pPix); @@ -869,8 +876,6 @@ void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix, #if defined(ACCEL_CP) && defined(XF86DRM_MODE) if (info->cs) { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - BEGIN_ACCEL(3); if (IS_AVIVO_VARIANT) { OUT_ACCEL_REG(AVIVO_D1MODE_VLINE_START_END, /* this is just a marker */ -- 1.7.1.1