On Tue, 01 Mar 2011 11:50:23 +0100, Michel Dänzer <daen...@debian.org> wrote:
> On Die, 2011-03-01 at 11:33 +0100, Stephen Kitt wrote: 
> > Would you like a patch to ignore (with a warning) these options if they're
> > set?
> 
> I'm afraid it's not that simple, see
> https://bugs.freedesktop.org/show_bug.cgi?id=30647#c3 . That said, if
> you can come up with a solution, it'll certainly be considered though.

How about the attached patches (against current unstable)? On the server side,
they add an EXA_REQUIRES_UPLOAD_DOWNLOAD flag, which ignores options
deactivating UTS and DFS with a warning in the logs; on the driver side, they
state that r600 requires UTS and DFS. I imagine radeon_exa_funcs.c and
evergreen_exa.c would need a similar patch, but I don't have the hardware to
test them.

I'm running with a patched server and driver just now, with my original
xorg.conf; the logs state

[ 28052.140] 
X.Org X Server 1.9.4
Release Date: 2011-02-04
[ 28052.140] X Protocol Version 11, Revision 0
[ 28052.140] Build Operating System: Linux 2.6.37-trunk-686-bigmem i686 Debian
[ 28052.140] Current Operating System: Linux heffalump.sk2.org 
2.6.37-trunk-686-bigmem #1 SMP Mon Jan 24 12:58:38 CET 2011 i686
[ 28052.140] Kernel command line: BOOT_IMAGE=/vmlinuz-2.6.37-trunk-686-bigmem 
root=/dev/mapper/vg--large--mirror-root ro clocksource=acpi_pm irqpoll quiet 
splash
[ 28052.140] Build Date: 01 March 2011  09:31:59PM
[ 28052.140] xorg-server 2:1.9.4-3.1 (Stephen Kitt <st...@sk2.org>) 
...
[ 28052.401] (**) RADEON(0): Option "EXANoUploadToScreen" "on"
[ 28052.401] (**) RADEON(0): Option "EXANoDownloadFromScreen" "on"
[ 28052.401] (**) RADEON(0): EXA: Driver requires UploadToScreen, ignoring 
request to disable it
[ 28052.401] (**) RADEON(0): EXA: Driver requires DownloadFromScreen, ignoring 
request to disable it

and everything works as though the configuration was correct.

I pondered using two flags, but reckoned there was a fair chance a driver
requiring one of UTS and DFS would also require the other!

Regards,

Stephen
Allow drivers to specify that they require UploadToScreen() and
DownloadFromScreen(), as is the case for recent radeon drivers. Such
drivers cause the exa module to ignore configuration settings which
would disable these two functions, with a warning.

Signed-off-by: Stephen Kitt <st...@sk2.org>

--- xorg-server-1.9.4.orig/exa/exa.h
+++ xorg-server-1.9.4/exa/exa.h
@@ -769,6 +769,13 @@
  */
 #define EXA_MIXED_PIXMAPS (1 << 6)
 
+/**
+ * EXA_REQUIRES_UPLOAD_DOWNLOAD indicates that the driver requires
+ * UploadToScreen() and DownloadFromScreen(), and that options
+ * disabling them should therefore be ignored.
+ */
+#define EXA_REQUIRES_UPLOAD_DOWNLOAD (1 << 7)
+
 /** @} */
 
 /* in exa.c */
--- xorg-server-1.9.4.orig/hw/xfree86/exa/examodule.c
+++ xorg-server-1.9.4/hw/xfree86/exa/examodule.c
@@ -163,15 +163,23 @@
     }
 
     if (xf86ReturnOptValBool(pScreenPriv->options, EXAOPT_NO_UTS, FALSE)) {
-	xf86DrvMsg(pScreen->myNum, X_CONFIG,
-		   "EXA: Disabling UploadToScreen\n");
-	pExaScr->info->UploadToScreen = NULL;
+	if (pExaScr->info->flags & EXA_REQUIRES_UPLOAD_DOWNLOAD) {
+	    xf86DrvMsg(pScreen->myNum, X_CONFIG, "EXA: Driver requires UploadToScreen, ignoring request to disable it\n");
+	} else {
+	    xf86DrvMsg(pScreen->myNum, X_CONFIG,
+		       "EXA: Disabling UploadToScreen\n");
+	    pExaScr->info->UploadToScreen = NULL;
+	}
     }
 
     if (xf86ReturnOptValBool(pScreenPriv->options, EXAOPT_NO_DFS, FALSE)) {
-	xf86DrvMsg(pScreen->myNum, X_CONFIG,
-		   "EXA: Disabling DownloadFromScreen\n");
-	pExaScr->info->DownloadFromScreen = NULL;
+	if (pExaScr->info->flags & EXA_REQUIRES_UPLOAD_DOWNLOAD) {
+	    xf86DrvMsg(pScreen->myNum, X_CONFIG, "EXA: Driver requires DownloadFromScreen, ignoring request to disable it\n");
+	} else {
+	    xf86DrvMsg(pScreen->myNum, X_CONFIG,
+		       "EXA: Disabling DownloadFromScreen\n");
+	    pExaScr->info->DownloadFromScreen = NULL;
+	}
     }
 
     dixSetPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey, pScreenPriv);
Declare that r600 requires UploadToScreen() and DownloadFromScreen(),
and that users are not allowed to disable them.

Signed-off-by: Stephen Kitt <st...@sk2.org>

--- xserver-xorg-video-ati-6.14.0.orig/src/r600_exa.c
+++ xserver-xorg-video-ati-6.14.0/src/r600_exa.c
@@ -2221,6 +2221,7 @@
     }
 
     info->accel_state->exa->flags = EXA_OFFSCREEN_PIXMAPS;
+    info->accel_state->exa->flags |= EXA_REQUIRES_UPLOAD_DOWNLOAD;
 #ifdef EXA_SUPPORTS_PREPARE_AUX
     info->accel_state->exa->flags |= EXA_SUPPORTS_PREPARE_AUX;
 #endif

Attachment: signature.asc
Description: PGP signature

Reply via email to