Don't set modes before RADEONWindowExposures_oneshot is called
PATCH 1/1 Don't set modes before RADEONWindowExposures_oneshot is called
From: Michel Dänzer <[email protected]>
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
radeon_scanout_flip")
(Ported from amdgpu commit 981bac185cfd74ae50dffc28f57cf34623a9595f)
--- src/drmmode_display.c | 6 ++++++ src/radeon.h | 5 +++++ src/radeon_kms.c | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-)
src/drmmode_display.c +6 -0
@@ -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;
src/radeon.h +5 -0
@@ -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);
src/radeon_kms.c +3 -3
@@ -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);
Signature · 6 lines
2.11.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20170417093959.5798-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
Alex Deucher
Reviewed-byQuoted 8 lines · Michel Dänzer
From: Michel Dänzer <[email protected]>
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.
Quoted 6 lines
Bugzilla: https://bugs.freedesktop.org/100276
Fixes cc9d6b7db9c2 ("Move DPMS check from radeon_scanout_do_update to
radeon_scanout_flip")
(Ported from amdgpu commit981bac185cfd74ae50dffc28f57cf34623a9595f)Signed-off-by Michel Dänzer <[email protected]>
Quoted 61 lines
--- src/drmmode_display.c | 6 ++++++ src/radeon.h | 5 +++++ src/radeon_kms.c | 6 +++--- 3 files changed, 14 insertions(+), 3 deletions(-)src/drmmode_display.c +6
-0@@ -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;src/radeon.h +5
-0@@ -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);src/radeon_kms.c +3
-4@@ -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); --2.11.0
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx