summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-03-09 15:47:24 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2017-03-09 15:47:24 +0900
commit82b15a4da156e18da4c8fc0093500c32b549e487 (patch)
tree64615f816e01e5ab1baeb98314bef8b617cc459d
parentfa85331f0ce27e16a9338516518433955133840e (diff)
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 (Ported from radeon commit 67ae5e00a748ad52cf92738d401afff2947b1891) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_drv.h2
-rw-r--r--src/amdgpu_kms.c90
2 files changed, 51 insertions, 41 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 0700dae..532d99d 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -169,8 +169,10 @@ typedef enum {
#if XF86_CRTC_VERSION >= 5
#define AMDGPU_PIXMAP_SHARING 1
#define amdgpu_is_gpu_screen(screen) (screen)->isGPU
+#define amdgpu_is_gpu_scrn(scrn) (scrn)->is_gpu
#else
#define amdgpu_is_gpu_screen(screen) 0
+#define amdgpu_is_gpu_scrn(scrn) 0
#endif
#define AMDGPU_VSYNC_TIMEOUT 20000 /* Maximum wait for VSYNC (in usecs) */
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 92bf5fa..3deaef7 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1397,23 +1397,26 @@ Bool AMDGPUPreInit_KMS(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowPrimary enabled\n");
}
- 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 (!amdgpu_is_gpu_scrn(pScrn)) {
+ 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 (xf86ReturnOptValBool(info->Options, OPTION_DELETE_DP12, FALSE)) {
@@ -1736,30 +1739,32 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
}
#endif
- value = xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0);
- from = X_DEFAULT;
+ if (!amdgpu_is_gpu_screen(pScreen)) {
+ value = xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0);
+ from = X_DEFAULT;
- if (info->use_glamor) {
- if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value))
- from = X_CONFIG;
+ if (info->use_glamor) {
+ 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 = amdgpu_sync_init(pScreen) &&
- amdgpu_present_screen_init(pScreen) &&
- amdgpu_dri3_screen_init(pScreen);
+ if (value) {
+ value = amdgpu_sync_init(pScreen) &&
+ amdgpu_present_screen_init(pScreen) &&
+ amdgpu_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);
@@ -1819,7 +1824,8 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
*/
/* xf86DiDGAInit(pScreen, info->LinearAddr + pScrn->fbOffset); */
#endif
- if (info->shadow_fb == FALSE) {
+ if (info->shadow_fb == FALSE &&
+ !amdgpu_is_gpu_screen(pScreen)) {
/* Init Xv */
xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG,
"Initializing Xv\n");
@@ -1835,12 +1841,14 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
}
pScrn->pScreen = pScreen;
- if (serverGeneration == 1 && bgNoneRoot && info->use_glamor) {
- info->CreateWindow = pScreen->CreateWindow;
- pScreen->CreateWindow = AMDGPUCreateWindow_oneshot;
+ if (!amdgpu_is_gpu_screen(pScreen)) {
+ if (serverGeneration == 1 && bgNoneRoot && info->use_glamor) {
+ info->CreateWindow = pScreen->CreateWindow;
+ pScreen->CreateWindow = AMDGPUCreateWindow_oneshot;
+ }
+ info->WindowExposures = pScreen->WindowExposures;
+ pScreen->WindowExposures = AMDGPUWindowExposures_oneshot;
}
- info->WindowExposures = pScreen->WindowExposures;
- pScreen->WindowExposures = AMDGPUWindowExposures_oneshot;
/* Provide SaveScreen & wrap BlockHandler and CloseScreen */
/* Wrap CloseScreen */