rpms/xorg-x11-drv-ati/F-12 radeon-kms-no-scratch.patch, NONE, 1.1 xorg-x11-drv-ati.spec, 1.191, 1.192

Dave Airlie airlied at fedoraproject.org
Fri Oct 9 05:15:54 UTC 2009


Author: airlied

Update of /cvs/pkgs/rpms/xorg-x11-drv-ati/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4473

Modified Files:
	xorg-x11-drv-ati.spec 
Added Files:
	radeon-kms-no-scratch.patch 
Log Message:
* Fri Oct 09 2009 Dave Airlie <airlied at redhat.com> 6.13.0-0.10.20091006git457646d73
- Don't use scratch pixmaps for rotate


radeon-kms-no-scratch.patch:
 drmmode_display.c |   81 ++++++++++++++++++++++++++++++------------------------
 1 file changed, 45 insertions(+), 36 deletions(-)

--- NEW FILE radeon-kms-no-scratch.patch ---
>From a493feb94c0d84aaf5bfd84c6940d7f03974dd86 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied at redhat.com>
Date: Fri, 9 Oct 2009 15:05:25 +1000
Subject: [PATCH] kms: don't use scratch pixmaps at all

use our own wrapper to allocate a pixmap for wrapping a bo in.
---
 src/drmmode_display.c |   80 +++++++++++++++++++++++++++---------------------
 1 files changed, 45 insertions(+), 35 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 1e78746..8310e0b 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -48,6 +48,34 @@
 #include <X11/extensions/dpms.h>
 #endif
 
+static PixmapPtr drmmode_create_bo_pixmap(ScreenPtr pScreen,
+					  int width, int height,
+					  int depth, int bpp,
+					  int pitch, struct radeon_bo *bo)
+{
+	PixmapPtr pixmap;
+
+	pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
+	if (!pixmap)
+		return NULL;
+
+	if (!(*pScreen->ModifyPixmapHeader)(pixmap, width, height,
+					    depth, bpp, pitch, NULL)) {
+		return NULL;
+	}
+
+	exaMoveInPixmap(pixmap);
+	radeon_set_pixmap_bo(pixmap, bo);
+
+	return pixmap;
+}
+
+static void drmmode_destroy_bo_pixmap(PixmapPtr pixmap)
+{
+	ScreenPtr pScreen = pixmap->drawable.pScreen;
+
+	(*pScreen->DestroyPixmap)(pixmap);
+}
 
 static void
 drmmode_ConvertFromKMode(ScrnInfoPtr	scrn,
@@ -156,21 +184,12 @@ create_pixmap_for_fbcon(drmmode_ptr drmmode,
 		return NULL;
 	}
 
-	pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, fbcon->depth, 0);
+	pixmap = drmmode_create_bo_pixmap(pScreen, fbcon->width, fbcon->height,
+					  fbcon->depth, fbcon->bpp,
+					  fbcon->pitch, bo);
 	if (!pixmap) 
 		return NULL;
 
-	if (!(*pScreen->ModifyPixmapHeader)(pixmap, fbcon->width, fbcon->height,
-					   fbcon->depth, fbcon->bpp,
-					   fbcon->pitch, NULL)) {
-		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			   "Couldn't allocate pixmap fbcon contents\n");
-		return NULL;
-	}
-	
-	exaMoveInPixmap(pixmap);
-	radeon_set_pixmap_bo(pixmap, bo);
-
 	radeon_bo_unref(bo);
 	drmModeFreeFB(fbcon);
 	return pixmap;
@@ -202,28 +221,23 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	if (!src)
 		return;
 
-	dst = (*pScreen->CreatePixmap)(pScreen, 0, 0, pScrn->depth, 0);
+	dst = drmmode_create_bo_pixmap(pScreen, pScrn->virtualX,
+				       pScrn->virtualY, pScrn->depth,
+				       pScrn->bitsPerPixel, pitch,
+				       info->front_bo);
 	if (!dst)
 		goto out_free_src;
 
-	if (!(*pScreen->ModifyPixmapHeader)(dst, pScrn->virtualX,
-					    pScrn->virtualY, pScrn->depth,
-					    pScrn->bitsPerPixel, pitch,
-					    NULL))
-		goto out_free_dst;
-
-	exaMoveInPixmap(dst);
-	radeon_set_pixmap_bo(dst, info->front_bo);
 	info->accel_state->exa->PrepareCopy (src, dst,
 					     -1, -1, GXcopy, FB_ALLONES);
 	info->accel_state->exa->Copy (dst, 0, 0, 0, 0,
 				      pScrn->virtualX, pScrn->virtualY);
 	info->accel_state->exa->DoneCopy (dst);
 	radeon_cs_flush_indirect(pScrn);
- out_free_dst:
-	(*pScreen->DestroyPixmap)(dst);
+
+	drmmode_destroy_bo_pixmap(dst);
  out_free_src:
-	(*pScreen->DestroyPixmap)(src);
+	drmmode_destroy_bo_pixmap(src);
 
 }
 
@@ -445,20 +459,16 @@ drmmode_crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
 
 	rotate_pitch = RADEON_ALIGN(width, 63) * drmmode->cpp;
 
-	rotate_pixmap = GetScratchPixmapHeader(pScrn->pScreen,
-					       width, height,
-					       pScrn->depth,
-					       pScrn->bitsPerPixel,
-					       rotate_pitch,
-					       NULL);
-
+	rotate_pixmap = drmmode_create_bo_pixmap(pScrn->pScreen,
+						 width, height,
+						 pScrn->depth,
+						 pScrn->bitsPerPixel,
+						 rotate_pitch,
+						 drmmode_crtc->rotate_bo);
 	if (rotate_pixmap == NULL) {
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "Couldn't allocate shadow pixmap for rotated CRTC\n");
 	}
-
-	if (drmmode_crtc->rotate_bo)
-		radeon_set_pixmap_bo(rotate_pixmap, drmmode_crtc->rotate_bo);
 	return rotate_pixmap;
 
 }
@@ -470,7 +480,7 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *dat
 	drmmode_ptr drmmode = drmmode_crtc->drmmode;
 
 	if (rotate_pixmap)
-	    FreeScratchPixmapHeader(rotate_pixmap);
+		drmmode_destroy_bo_pixmap(rotate_pixmap);
 
 	if (data) {
 		drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id);
-- 
1.6.5.rc2



Index: xorg-x11-drv-ati.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-ati/F-12/xorg-x11-drv-ati.spec,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -p -r1.191 -r1.192
--- xorg-x11-drv-ati.spec	9 Oct 2009 04:50:00 -0000	1.191
+++ xorg-x11-drv-ati.spec	9 Oct 2009 05:15:53 -0000	1.192
@@ -7,7 +7,7 @@
 Summary:   Xorg X11 ati video driver
 Name:      xorg-x11-drv-ati
 Version:   6.13.0
-Release:   0.9.%{gitdate}git%{gitversion}%{?dist}
+Release:   0.10.%{gitdate}git%{gitversion}%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -24,6 +24,7 @@ Patch10:    radeon-6.12.2-lvds-default-m
 Patch13:    fix-default-modes.patch
 Patch14:    r600-enable-mixed.patch
 Patch15:    radeon-kms-cursor-reload.patch
+Patch16:    radeon-kms-no-scratch.patch
 
 ExcludeArch: s390 s390x
 
@@ -53,6 +54,7 @@ X.Org X11 ati video driver.
 %patch13 -p1 -b .def
 %patch14 -p1 -b .mix
 %patch15 -p1 -b .cursor-reload
+%patch16 -p1 -b .noscratch
 
 %build
 autoreconf -iv
@@ -86,6 +88,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man4/radeon.4*
 
 %changelog
+* Fri Oct 09 2009 Dave Airlie <airlied at redhat.com> 6.13.0-0.10.20091006git457646d73
+- Don't use scratch pixmaps for rotate
+
 * Fri Oct 09 2009 Dave Airlie <airlied at redhat.com> 6.13.0-0.9.20091006git457646d73
 - reload cursors on mode switch/rotate
 




More information about the fedora-extras-commits mailing list