xf86-video-ati: Branch 'master' - 2 commits

Michel Daenzer daenzer at kemper.freedesktop.org
Thu Sep 27 03:55:43 PDT 2007


 src/radeon_driver.c    |    4 ++--
 src/radeon_exa.c       |    2 +-
 src/radeon_exa_funcs.c |   15 +++++++++++----
 3 files changed, 14 insertions(+), 7 deletions(-)

New commits:
diff-tree 5902e913010a2fb0c17efe01f9aade73f9646f16 (from ca728973bce504e03bf6228d18287906c35eaa3f)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 12:53:34 2007 +0200

    radeon: EXA pitch fixes.
    
    The combined pitch/offset registers only support pitches up to 16320 bytes.
    
    With EXA >= 2.3, set the maxPitchBytes field accordingly. With older versions,
    limit maxX such that the pitch of 32bpp pixmaps doesn't exceed the limit.
    
    Also check the limit in RADEONGetOffsetPitch just in case.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=12551 .

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index e7cccf6..89254d3 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1938,8 +1938,8 @@ static Bool RADEONPreInitAccel(ScrnInfoP
 
 #ifdef USE_EXA
 	if (info->useEXA) {
-	    info->exaReq.majorversion = 2;
-	    info->exaReq.minorversion = 0;
+	    info->exaReq.majorversion = EXA_VERSION_MAJOR;
+	    info->exaReq.minorversion = EXA_VERSION_MINOR;
 
 	    if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL,
 			       &info->exaReq, &errmaj, &errmin)) {
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index d074f08..8a12e1b 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -157,7 +157,7 @@ static Bool RADEONGetOffsetPitch(PixmapP
 {
 	RINFO_FROM_SCREEN(pPix->drawable.pScreen);
 
-	if (pitch % info->exa->pixmapPitchAlign != 0)
+	if (pitch > 16320 || pitch % info->exa->pixmapPitchAlign != 0)
 		RADEON_FALLBACK(("Bad pitch 0x%08x\n", pitch));
 
 	if (offset % info->exa->pixmapOffsetAlign != 0)
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index d233813..8e14cd9 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -511,8 +511,8 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr
 	return FALSE;
     }
 
-    info->exa->exa_major = 2;
-    info->exa->exa_minor = 0;
+    info->exa->exa_major = EXA_VERSION_MAJOR;
+    info->exa->exa_minor = EXA_VERSION_MINOR;
 
     info->exa->PrepareSolid = FUNC_NAME(RADEONPrepareSolid);
     info->exa->Solid = FUNC_NAME(RADEONSolid);
@@ -564,7 +564,14 @@ Bool FUNC_NAME(RADEONDrawInit)(ScreenPtr
     }
 #endif
 
+#if EXA_VERSION_MAJOR > 2 || (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 3)
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting EXA maxPitchBytes\n");
+
+    info->exa->maxPitchBytes = 16320;
     info->exa->maxX = info->exa->Composite ? 2048 : 8192;
+#else
+    info->exa->maxX = info->exa->Composite ? 2048 : 16320 / 4;
+#endif
     info->exa->maxY = info->exa->Composite ? 2048 : 8192;
 
     RADEONEngineInit(pScrn);
diff-tree ca728973bce504e03bf6228d18287906c35eaa3f (from 21593d04d222b05dbba9abd31eaa3bfb91d999b6)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Thu Sep 27 11:14:21 2007 +0200

    radeon: Don't use pixmap data pointer directly with EXA.
    
    Fixes segfault with current xserver master without AccelDFS.

diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index c356de7..d233813 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -244,7 +244,7 @@ FUNC_NAME(RADEONUploadToScreen)(PixmapPt
 #if X_BYTE_ORDER == X_BIG_ENDIAN || defined(ACCEL_CP)
     RINFO_FROM_SCREEN(pDst->drawable.pScreen);
 #endif
-    CARD8	   *dst	     = pDst->devPrivate.ptr;
+    CARD8	   *dst	     = info->FB + exaGetPixmapOffset(pDst);
     unsigned int   dst_pitch = exaGetPixmapPitch(pDst);
     unsigned int   bpp	     = pDst->drawable.bitsPerPixel;
 #ifdef ACCEL_CP
@@ -362,7 +362,7 @@ FUNC_NAME(RADEONDownloadFromScreen)(Pixm
 	    ~(RADEON_NONSURF_AP0_SWP_32BPP | RADEON_NONSURF_AP1_SWP_32BPP |
 	      RADEON_NONSURF_AP0_SWP_16BPP | RADEON_NONSURF_AP1_SWP_16BPP);
 #endif
-    CARD8	  *src	     = pSrc->devPrivate.ptr;
+    CARD8	  *src	     = info->FB + exaGetPixmapOffset(pSrc);
     int		   src_pitch = exaGetPixmapPitch(pSrc);
     int		   bpp	     = pSrc->drawable.bitsPerPixel;
 #ifdef ACCEL_CP


More information about the xorg-commit mailing list