rpms/xorg-x11-drv-ati/F-10 radeon-modeset-gtt-map.patch, NONE, 1.1 xorg-x11-drv-ati.spec, 1.144, 1.145

Dave Airlie airlied at fedoraproject.org
Fri Nov 14 05:00:30 UTC 2008


Author: airlied

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

Modified Files:
	xorg-x11-drv-ati.spec 
Added Files:
	radeon-modeset-gtt-map.patch 
Log Message:
- try and speed up fallback cases a bit


radeon-modeset-gtt-map.patch:

--- NEW FILE radeon-modeset-gtt-map.patch ---
commit 40804bd0927833048fd92ec7a1332f10f9d6a850
Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Nov 14 11:03:34 2008 +1000

    radeon: force gtt for mmap after fallbacks

diff --git a/src/radeon_bufmgr_gem.c b/src/radeon_bufmgr_gem.c
index a8bc465..54d5df6 100644
--- a/src/radeon_bufmgr_gem.c
+++ b/src/radeon_bufmgr_gem.c
@@ -72,6 +72,7 @@ typedef struct _dri_bo_gem {
 	const char *name;
 	struct _dri_bo_gem *next;
 	int in_vram; /* have we migrated this bo to VRAM ever */
+	int force_gtt;
 	int pinned;
 	int touched;
 	int space_accounted;
@@ -238,15 +239,27 @@ void radeon_bufmgr_gem_wait_rendering(dri_bo *buf)
 {
 	dri_bufmgr_gem *bufmgr_gem = (dri_bufmgr_gem *)buf->bufmgr;
 	struct drm_radeon_gem_wait_rendering args;
+	struct drm_radeon_gem_set_domain sd_args;
 	dri_bo_gem *gem_bo = (dri_bo_gem *)buf;
 	int ret;
 
-	args.handle = gem_bo->gem_handle;
+	/* do a set domain */
+	if (gem_bo->force_gtt) {
+		sd_args.handle = gem_bo->gem_handle;
+		sd_args.read_domains = RADEON_GEM_DOMAIN_GTT;
+		sd_args.write_domain = 0;
+
+		ret = drmCommandWriteRead(bufmgr_gem->fd, DRM_RADEON_GEM_SET_DOMAIN,
+					  &sd_args, sizeof(sd_args));
+
+	} else {
+		args.handle = gem_bo->gem_handle;
 
-	do {
-	ret = drmCommandWriteRead(bufmgr_gem->fd, DRM_RADEON_GEM_WAIT_RENDERING,
-				  &args, sizeof(args));
-	} while (ret == -EAGAIN);
+		do {
+		ret = drmCommandWriteRead(bufmgr_gem->fd, DRM_RADEON_GEM_WAIT_RENDERING,
+					  &args, sizeof(args));
+		} while (ret == -EAGAIN);
+	}
 	return;
 }
 
@@ -326,6 +339,9 @@ void radeon_bufmgr_gem_emit_reloc(dri_bo *buf, struct radeon_relocs_info *reloc_
 		}
 	}
 
+	if (gem_bo->force_gtt && (read_domains & RADEON_GEM_DOMAIN_VRAM))
+		read_domains = RADEON_GEM_DOMAIN_GTT;
+
 	if (have_reloc != -1) {
 		uint32_t old_write, old_read;
 
@@ -545,3 +561,10 @@ void radeon_bufmgr_gem_set_limit(dri_bufmgr *bufmgr, uint32_t domain, uint32_t l
 	    bufmgr_gem->gart_limit = limit;
 
 }
+
+void radeon_bufmgr_gem_force_gtt(dri_bo *buf)
+{
+	dri_bo_gem *gem_bo = (dri_bo_gem *)buf;
+
+	gem_bo->force_gtt = 1;
+}
diff --git a/src/radeon_bufmgr_gem.h b/src/radeon_bufmgr_gem.h
index c40a24e..b13a642 100644
--- a/src/radeon_bufmgr_gem.h
+++ b/src/radeon_bufmgr_gem.h
@@ -11,5 +11,8 @@ void radeon_bufmgr_pin(dri_bo *buf);
 void radeon_bufmgr_unpin(dri_bo *buf);
 uint32_t radeon_bufmgr_get_handle(dri_bo *buf);
 int radeon_bufmgr_gem_has_references(dri_bo *buf);
+int radeon_bufmgr_gem_force_gtt(dri_bo *buf);
 void radeon_bufmgr_gem_set_limit(dri_bufmgr *bufmgr, uint32_t domain, uint32_t limit);
+
+
 #endif
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index c19ca0b..9b67943 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -1007,6 +1007,10 @@ static Bool R300CheckCompositeTexture(PicturePtr pPict,
 				      int unit,
 				      Bool is_r500)
 {
+    ScreenPtr pScreen = pDstPict->pDrawable->pScreen;
+    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+    RADEONInfoPtr info = RADEONPTR(pScrn);
+
     int w = pPict->pDrawable->width;
     int h = pPict->pDrawable->height;
     int i;
@@ -1032,8 +1036,17 @@ static Bool R300CheckCompositeTexture(PicturePtr pPict,
 	RADEON_FALLBACK(("Unsupported picture format 0x%x\n",
 			 (int)pPict->format));
 
-    if (!RADEONCheckTexturePOT(pPict, unit == 0))
+    if (!RADEONCheckTexturePOT(pPict, unit == 0)) {
+	if (info->new_cs) {
+    		struct radeon_exa_pixmap_priv *driver_priv;
+		PixmapPtr pPix;
+
+    		pPix = RADEONGetDrawablePixmap(pPict->pDrawable);
+		driver_priv = exaGetPixmapDriverPrivate(pPix);
+		radeon_bufmgr_gem_force_gtt(driver_priv->bo);
+	}
 	return FALSE;
+    }
 
     if (pPict->filter != PictFilterNearest &&
 	pPict->filter != PictFilterBilinear)


Index: xorg-x11-drv-ati.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-ati/F-10/xorg-x11-drv-ati.spec,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -r1.144 -r1.145
--- xorg-x11-drv-ati.spec	10 Nov 2008 05:06:38 -0000	1.144
+++ xorg-x11-drv-ati.spec	14 Nov 2008 04:59:59 -0000	1.145
@@ -5,7 +5,7 @@
 Summary:   Xorg X11 ati video driver
 Name:      xorg-x11-drv-ati
 Version:   6.9.0
-Release:   44%{?dist}
+Release:   45%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -22,6 +22,7 @@
 Patch7:	    radeon-6.9.0-add-hd3300.patch
 Patch8:     radeon-6.9.0-quirk-agp.patch
 Patch9:	    radeon-6.9.0-dig1-hdmi.patch
+Patch10:    radeon-modeset-gtt-map.patch
 
 ExcludeArch: s390 s390x
 
@@ -51,6 +52,7 @@
 %patch7 -p1 -b .pciid
 %patch8 -p1 -b .quirk
 %patch9 -p1 -b .hdmi
+%patch10 -p1 -b .gtt
 
 %build
 autoreconf
@@ -82,6 +84,9 @@
 %{_mandir}/man4/radeon.4*
 
 %changelog
+* Fri Nov 14 2008 Dave Airlie <airlied at redhat.com> 6.9.0-45
+- try and speed up fallback cases a bit
+
 * Mon Nov 10 2008 Dave Airlie <airlied at redhat.com> 6.9.0-44
 - fix rendering from very large pixmaps (#468571)
 




More information about the scm-commits mailing list