summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-04-17 18:32:31 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2017-04-17 18:32:31 +0900
commit4c91f36d3058180b5a2d6a23e9b82f5c933d8716 (patch)
tree3e12378a7002de650879661477eb06b9d6e30ad8 /src
parentd6c29250dbc293c932ca14997eb23399610b106d (diff)
Don't set modes before RADEONWindowExposures_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: cc9d6b7db9c2 ("Move DPMS check from radeon_scanout_do_update to radeon_scanout_flip") (Ported from amdgpu commit 981bac185cfd74ae50dffc28f57cf34623a9595f) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c6
-rw-r--r--src/radeon.h5
-rw-r--r--src/radeon_kms.c6
3 files changed, 14 insertions, 3 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9911c0a6..84e7ef96 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -833,6 +833,12 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
int fb_id;
drmModeModeInfo kmode;
+ /* 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 == RADEONWindowExposures_oneshot)
+ return FALSE;
+
saved_mode = crtc->mode;
saved_x = crtc->x;
saved_y = crtc->y;
diff --git a/src/radeon.h b/src/radeon.h
index 73744115..2cb188e1 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -634,6 +634,11 @@ Bool radeon_dri3_screen_init(ScreenPtr screen);
/* radeon_kms.c */
Bool radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id);
+void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0)
+ , RegionPtr pBSRegion
+#endif
+ );
/* radeon_present.c */
Bool radeon_present_screen_init(ScreenPtr screen);
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 424f9f72..b3427c46 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -1627,11 +1627,11 @@ static Bool RADEONCreateWindow_oneshot(WindowPtr pWin)
}
/* When the root window is mapped, set the initial modes */
-static void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion
+void RADEONWindowExposures_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);