xf86-video-ati: Branch 'master' - 2 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Thu Mar 9 06:44:20 UTC 2017
src/radeon.h | 2 +
src/radeon_kms.c | 110 ++++++++++++++++++++++++++++++-------------------------
2 files changed, 62 insertions(+), 50 deletions(-)
New commits:
commit 9a71445094b728f3d78db8f6808b4782ee19a453
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Mar 8 17:42:56 2017 +0900
Pass TRUE to drmmode_set_desired_modes the first time for GPU screens
This is the only place we call drmmode_set_desired_modes for GPU screens
during server startup. Without this change, the display outputs of
secondary GPUs may stay on even while Xorg isn't using them.
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 907ebfc..424f9f7 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -328,7 +328,8 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
}
}
- if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE))
+ if (!drmmode_set_desired_modes(pScrn, &info->drmmode,
+ radeon_is_gpu_screen(pScreen)))
return FALSE;
drmmode_uevent_init(pScrn, &info->drmmode);
commit 67ae5e00a748ad52cf92738d401afff2947b1891
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Mar 8 11:20:30 2017 +0900
Skip some initialization steps for GPU screens
Xorg doesn't use the following functionality of GPU screens, so don't
bother initializing it:
* DRI page flipping
* DRI3 / Present / SYNC fences
* XVideo / XvMC
* Root window with background None
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
diff --git a/src/radeon.h b/src/radeon.h
index 815c12a..7374411 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -183,8 +183,10 @@ typedef enum {
#if XF86_CRTC_VERSION >= 5
#define RADEON_PIXMAP_SHARING 1
#define radeon_is_gpu_screen(screen) (screen)->isGPU
+#define radeon_is_gpu_scrn(scrn) (scrn)->is_gpu
#else
#define radeon_is_gpu_screen(screen) 0
+#define radeon_is_gpu_scrn(scrn) 0
#endif
#define RADEON_VSYNC_TIMEOUT 20000 /* Maximum wait for VSYNC (in usecs) */
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 7a561fa..907ebfc 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -1811,32 +1811,36 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
info->tear_free == 2 ? "auto" : (info->tear_free ? "on" : "off"));
}
- if (info->dri2.pKernelDRMVersion->version_minor >= 8) {
- Bool sw_cursor = xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE);
-
- info->allowPageFlip = xf86ReturnOptValBool(info->Options,
- OPTION_PAGE_FLIP, TRUE);
-
- if (sw_cursor || info->shadow_primary) {
- xf86DrvMsg(pScrn->scrnIndex,
- info->allowPageFlip ? X_WARNING : X_DEFAULT,
- "KMS Pageflipping: disabled%s\n",
- info->allowPageFlip ?
- (sw_cursor ? " because of SWcursor" :
- " because of ShadowPrimary") : "");
- info->allowPageFlip = FALSE;
- } else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "KMS Pageflipping: %sabled\n", info->allowPageFlip ? "en" : "dis");
+ if (!radeon_is_gpu_scrn(pScrn)) {
+ if (info->dri2.pKernelDRMVersion->version_minor >= 8) {
+ Bool sw_cursor = xf86ReturnOptValBool(info->Options,
+ OPTION_SW_CURSOR, FALSE);
+
+ info->allowPageFlip = xf86ReturnOptValBool(info->Options,
+ OPTION_PAGE_FLIP, TRUE);
+
+ if (sw_cursor || info->shadow_primary) {
+ xf86DrvMsg(pScrn->scrnIndex,
+ info->allowPageFlip ? X_WARNING : X_DEFAULT,
+ "KMS Pageflipping: disabled%s\n",
+ info->allowPageFlip ?
+ (sw_cursor ? " because of SWcursor" :
+ " because of ShadowPrimary") : "");
+ info->allowPageFlip = FALSE;
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "KMS Pageflipping: %sabled\n",
+ info->allowPageFlip ? "en" : "dis");
+ }
}
- }
- if (!info->use_glamor) {
- info->swapBuffersWait =
- xf86ReturnOptValBool(info->Options, OPTION_SWAPBUFFERS_WAIT, TRUE);
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "SwapBuffers wait for vsync: %sabled\n",
- info->swapBuffersWait ? "en" : "dis");
+ if (!info->use_glamor) {
+ info->swapBuffersWait =
+ xf86ReturnOptValBool(info->Options, OPTION_SWAPBUFFERS_WAIT, TRUE);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "SwapBuffers wait for vsync: %sabled\n",
+ info->swapBuffersWait ? "en" : "dis");
+ }
}
if (xf86ReturnOptValBool(info->Options, OPTION_DELETE_DP12, FALSE)) {
@@ -2244,33 +2248,35 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
}
#endif
- if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0))
- value = info->use_glamor;
- else
- value = FALSE;
- from = X_DEFAULT;
+ if (!radeon_is_gpu_screen(pScreen)) {
+ if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0))
+ value = info->use_glamor;
+ else
+ value = FALSE;
+ from = X_DEFAULT;
- if (!info->r600_shadow_fb) {
- if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value))
- from = X_CONFIG;
+ if (!info->r600_shadow_fb) {
+ if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value))
+ from = X_CONFIG;
- if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) &&
- (driLevel == 2 || driLevel == 3)) {
- from = X_CONFIG;
- value = driLevel == 3;
+ if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) &&
+ (driLevel == 2 || driLevel == 3)) {
+ from = X_CONFIG;
+ value = driLevel == 3;
+ }
}
- }
- if (value) {
- value = radeon_sync_init(pScreen) &&
- radeon_present_screen_init(pScreen) &&
- radeon_dri3_screen_init(pScreen);
+ if (value) {
+ value = radeon_sync_init(pScreen) &&
+ radeon_present_screen_init(pScreen) &&
+ radeon_dri3_screen_init(pScreen);
- if (!value)
- from = X_WARNING;
- }
+ if (!value)
+ from = X_WARNING;
+ }
- xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis");
+ xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis");
+ }
pScrn->vtSema = TRUE;
xf86SetBackingStore(pScreen);
@@ -2325,7 +2331,8 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
*/
/* xf86DiDGAInit(pScreen, info->LinearAddr + pScrn->fbOffset); */
#endif
- if (info->r600_shadow_fb == FALSE) {
+ if (info->r600_shadow_fb == FALSE &&
+ !radeon_is_gpu_screen(pScreen)) {
/* Init Xv */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
"Initializing Xv\n");
@@ -2341,12 +2348,14 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
}
pScrn->pScreen = pScreen;
- if (serverGeneration == 1 && bgNoneRoot && info->accelOn) {
- info->CreateWindow = pScreen->CreateWindow;
- pScreen->CreateWindow = RADEONCreateWindow_oneshot;
+ if (!radeon_is_gpu_screen(pScreen)) {
+ if (serverGeneration == 1 && bgNoneRoot && info->accelOn) {
+ info->CreateWindow = pScreen->CreateWindow;
+ pScreen->CreateWindow = RADEONCreateWindow_oneshot;
+ }
+ info->WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = RADEONWindowExposures_oneshot;
}
- info->WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = RADEONWindowExposures_oneshot;
/* Provide SaveScreen & wrap BlockHandler and CloseScreen */
/* Wrap CloseScreen */
More information about the xorg-commit
mailing list