summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2015-08-10 23:34:39 +0200
committerMichel Dänzer <michel.daenzer@amd.com>2015-08-11 09:48:53 +0900
commitf123096877f0a0044f3d0315285441f2b5790c29 (patch)
treec6bcdf38fb5a3a78ad357c446c0d75c2584e977d
parent3791fceabf2cb037467dc41c15364e9f9ec1e47e (diff)
Make selection between DRI2 and DRI3 consistent with other drivers. (v2)
Add Option "DRI" to allow selection of maximum DRI level. This allows the user to select the maximum level of DRI implementation to use, DRI2 or DRI3. It replaces the old option "DRI3" which had exactly the same purpose, but differs from the method used in both intel ddx and nouveau ddx. Make this consistent before a new stable driver is released. v2: Retain handling of old Option "DRI3" for backwards compatibility, but Option "DRI" will take precedence over "DRI3" if both are provided. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r--man/radeon.man7
-rw-r--r--src/radeon.h1
-rw-r--r--src/radeon_kms.c12
3 files changed, 15 insertions, 5 deletions
diff --git a/man/radeon.man b/man/radeon.man
index f0a6be1a..fa55c6d1 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -267,9 +267,10 @@ The default value is
for R/RV6XX, R/RV7XX, RS780, RS880, EVERGREEN, CAYMAN, ARUBA, Southern Islands, and
Sea Islands.
.TP
-.BI "Option \*qDRI3\*q \*q" boolean \*q
-Enable the DRI3 extension. The default is
-.B off.
+.BI "Option \*qDRI\*q \*q" integer \*q
+Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 for DRI3.
+The default is
+.B 2 for DRI2.
.TP
.BI "Option \*qEnablePageFlip\*q \*q" boolean \*q
Enable DRI2 page flipping. The default is
diff --git a/src/radeon.h b/src/radeon.h
index 88df93f0..e2fd41cf 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -151,6 +151,7 @@ typedef enum {
OPTION_SWAPBUFFERS_WAIT,
OPTION_DELETE_DP12,
OPTION_DRI3,
+ OPTION_DRI,
OPTION_SHADOW_PRIMARY,
OPTION_TEAR_FREE,
} RADEONOpts;
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index c75aa97b..8aa76332 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -78,6 +78,7 @@ const OptionInfoRec RADEONOptions_KMS[] = {
{ OPTION_SWAPBUFFERS_WAIT,"SwapbuffersWait", OPTV_BOOLEAN, {0}, FALSE },
{ OPTION_DELETE_DP12, "DeleteUnusedDP12Displays", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_DRI3, "DRI3", OPTV_BOOLEAN, {0}, FALSE },
+ { OPTION_DRI, "DRI", OPTV_INTEGER, {0}, FALSE },
{ OPTION_TEAR_FREE, "TearFree", OPTV_BOOLEAN, {0}, FALSE },
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
@@ -1518,6 +1519,7 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
int subPixelOrder = SubPixelUnknown;
MessageType from;
Bool value;
+ int driLevel;
const char *s;
void *front_ptr;
@@ -1629,10 +1631,15 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
#endif
value = FALSE;
+ from = X_DEFAULT;
if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value))
from = X_CONFIG;
- else
- from = X_DEFAULT;
+
+ if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) &&
+ (driLevel == 2 || driLevel == 3)) {
+ from = X_CONFIG;
+ value = driLevel == 3;
+ }
if (value) {
value = radeon_sync_init(pScreen) &&
@@ -1642,6 +1649,7 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
if (!value)
from = X_WARNING;
}
+
xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis");
pScrn->vtSema = TRUE;