summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-03-23 18:51:38 +0900
committerMichel Dänzer <michel@daenzer.net>2017-04-17 18:27:13 +0900
commit981bac185cfd74ae50dffc28f57cf34623a9595f (patch)
treeb84c9f5f02fbc36ebe7d7c6cd0abc0a3305c9a36 /src
parent51e17041cb89806c934c5cf795207940a6aaccfe (diff)
Don't set modes before AMDGPUWindowExposures_oneshot is called
The root window contents may be undefined before that, so we don't want to show anything yet. Fixes a crash on startup with rotation and virtual resolution set in xorg.conf. Bugzilla: https://bugs.freedesktop.org/100276 Fixes: ad53635af150 ("Move DPMS check from amdgpu_scanout_do_update to amdgpu_scanout_flip") Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h5
-rw-r--r--src/amdgpu_kms.c6
-rw-r--r--src/drmmode_display.c6
3 files changed, 14 insertions, 3 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index 532d99d..e5c44dc 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -315,6 +315,11 @@ Bool amdgpu_dri3_screen_init(ScreenPtr screen);
/* amdgpu_kms.c */
Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id);
+void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+ , RegionPtr pBSRegion
+#endif
+ );
/* amdgpu_present.c */
Bool amdgpu_present_screen_init(ScreenPtr screen);
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index c4ac90d..0182cbe 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1258,11 +1258,11 @@ static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin)
}
/* When the root window is mapped, set the initial modes */
-static void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
- , RegionPtr pBSRegion
+ , RegionPtr pBSRegion
#endif
- )
+ )
{
ScreenPtr pScreen = pWin->drawable.pScreen;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f58d28f..5e0c413 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -779,6 +779,12 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
drmModeModeInfo kmode;
uint32_t bo_handle;
+ /* The root window contents may be undefined before the WindowExposures
+ * hook is called for it, so bail if we get here before that
+ */
+ if (pScreen->WindowExposures == AMDGPUWindowExposures_oneshot)
+ return FALSE;
+
saved_mode = crtc->mode;
saved_x = crtc->x;
saved_y = crtc->y;