[PATCH] Allow drivers to force EXA UTS and DFS

Stephen Kitt steve at sk2.org
Sat Mar 5 14:13:26 PST 2011


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 <steve at sk2.org>
---
 exa/exa.h                  |    7 +++++++
 hw/xfree86/exa/examodule.c |   20 ++++++++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/exa/exa.h b/exa/exa.h
index 8c93d15..190f0f8 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -769,6 +769,13 @@ typedef struct _ExaDriver {
  */
 #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 */
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index 83f72b5..ece7dee 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -163,16 +163,23 @@ exaDDXDriverInit(ScreenPtr pScreen)
     }
 
     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_WARNING, "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_WARNING, "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);
-- 
1.7.2.3



More information about the xorg-devel mailing list