From 0bd8a5e2d9cea8c3ef4b1817f1680d5964a3cbac Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mar 05 2009 07:28:50 +0000 Subject: - modeset: fixup radeon Xv with latest kernel --- diff --git a/radeon-modeset.patch b/radeon-modeset.patch index d2b1231..65390c3 100644 --- a/radeon-modeset.patch +++ b/radeon-modeset.patch @@ -1,3 +1,12 @@ +commit e66aba3c88e6bbd8abe0f481da28872fa17a4f57 +Author: Dave Airlie +Date: Thu Mar 5 16:05:41 2009 +1000 + + radeon: add support for relocatable CRTC inside VLINE + + We cannot let userspace decide which CRTC it wants because its userspace + and might not own the crtc, so we need to provide a way to relocate it + commit 00c0032dac820986b84effdb37c5cc1884eabcaf Author: Dave Airlie Date: Tue Mar 3 15:30:21 2009 +1000 @@ -3278,7 +3287,7 @@ index 0000000..6d3b6fe +int radeon_bo_gem_name_buffer(dri_bo *bo, uint32_t *name); +#endif diff --git a/src/radeon_commonfuncs.c b/src/radeon_commonfuncs.c -index eabd87d..582b80f 100644 +index eabd87d..8712a74 100644 --- a/src/radeon_commonfuncs.c +++ b/src/radeon_commonfuncs.c @@ -62,12 +62,15 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) @@ -3317,7 +3326,89 @@ index eabd87d..582b80f 100644 OUT_ACCEL_REG(R300_GB_SELECT, 0); OUT_ACCEL_REG(R300_GB_ENABLE, 0); FINISH_ACCEL(); -@@ -712,7 +717,7 @@ void FUNC_NAME(RADEONWaitForIdle)(ScrnInfoPtr pScrn) +@@ -626,6 +631,39 @@ static void FUNC_NAME(RADEONInit3DEngine)(ScrnInfoPtr pScrn) + + } + ++#if defined(ACCEL_CP) && defined(XF86DRM_MODE) ++void drmmode_wait_for_vline(ScrnInfoPtr pScrn, PixmapPtr pPix, ++ int crtc, int start, int stop) ++{ ++ RADEONInfoPtr info = RADEONPTR(pScrn); ++ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); ++ uint32_t offset; ++ drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[crtc]->driver_private; ++ ACCEL_PREAMBLE(); ++ ++ BEGIN_ACCEL(3); ++ ++ if (IS_AVIVO_VARIANT) { ++ uint32_t reg = AVIVO_D1MODE_VLINE_START_END; /* this is just a marker */ ++ OUT_ACCEL_REG(reg, ++ ((start << AVIVO_D1MODE_VLINE_START_SHIFT) | ++ (stop << AVIVO_D1MODE_VLINE_END_SHIFT) | ++ AVIVO_D1MODE_VLINE_INV)); ++ } else { ++ OUT_ACCEL_REG(RADEON_CRTC_GUI_TRIG_VLINE, /* another placeholder */ ++ ((start << RADEON_CRTC_GUI_TRIG_VLINE_START_SHIFT) | ++ (stop << RADEON_CRTC_GUI_TRIG_VLINE_END_SHIFT) | ++ RADEON_CRTC_GUI_TRIG_VLINE_INV)); ++ } ++ OUT_ACCEL_REG(RADEON_WAIT_UNTIL, (RADEON_WAIT_CRTC_VLINE | ++ RADEON_ENG_DISPLAY_SELECT_CRTC0)); ++ ++ OUT_RING(CP_PACKET3(RADEON_CP_PACKET3_NOP, 0)); ++ OUT_RING(drmmode_crtc->mode_crtc->crtc_id); ++ FINISH_ACCEL(); ++} ++#endif ++ + /* inserts a wait for vline in the command stream */ + void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix, + int crtc, int start, int stop) +@@ -644,16 +682,19 @@ void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix, + if (!xf86_config->crtc[crtc]->enabled) + return; + ++ if (info->drm_mode_setting) { ++ if (pPix != pScrn->pScreen->GetScreenPixmap(pScrn->pScreen)) ++ return; ++ } else { ++ if (info->useEXA) + #ifdef USE_EXA +- if (info->useEXA) +- offset = exaGetPixmapOffset(pPix); +- else ++ offset = exaGetPixmapOffset(pPix); ++ else + #endif +- offset = pPix->devPrivate.ptr - info->FB; +- +- /* if drawing to front buffer */ +- if (offset != 0) +- return; ++ offset = pPix->devPrivate.ptr - info->FB; ++ if (offset != 0) ++ return; ++ } + + start = max(start, 0); + stop = min(stop, xf86_config->crtc[crtc]->mode.VDisplay); +@@ -661,6 +702,13 @@ void FUNC_NAME(RADEONWaitForVLine)(ScrnInfoPtr pScrn, PixmapPtr pPix, + if (start > xf86_config->crtc[crtc]->mode.VDisplay) + return; + ++#if defined(ACCEL_CP) && defined(XF86DRM_MODE) ++ if (info->drm_mode_setting) { ++ drmmode_wait_for_vline(pScrn, pPix, crtc, start, stop); ++ return; ++ } ++#endif ++ + BEGIN_ACCEL(2); + + if (IS_AVIVO_VARIANT) { +@@ -712,7 +760,7 @@ void FUNC_NAME(RADEONWaitForIdle)(ScrnInfoPtr pScrn) #ifdef ACCEL_CP /* Make sure the CP is idle first */ diff --git a/xorg-x11-drv-ati.spec b/xorg-x11-drv-ati.spec index e22670a..ca8d820 100644 --- a/xorg-x11-drv-ati.spec +++ b/xorg-x11-drv-ati.spec @@ -5,7 +5,7 @@ Summary: Xorg X11 ati video driver Name: xorg-x11-drv-ati Version: 6.11.0 -Release: 3%{?dist} +Release: 4%{?dist} URL: http://www.x.org License: MIT Group: User Interface/X Hardware Support @@ -76,6 +76,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man4/radeon.4* %changelog +* Thu Mar 05 2009 Dave Airlie 6.11.0-4 +- modeset: fixup radeon Xv with latest kernel + * Tue Mar 03 2009 Dave Airlie 6.11.0-3 - initial support for dynamic fb resize