diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2015-04-02 17:54:33 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2015-04-23 10:16:17 +0900 |
commit | 673e1c7637687c74fc9bdeeeffb7ace0d04b734f (patch) | |
tree | 8a64fd5fd12eda1fe73eacdde18e12b879dcda7b /src/radeon_kms.c | |
parent | 37874a4eeace5df04b02c8fc28f67b824e3f0f5f (diff) |
Defer initial modeset until the first BlockHandler invocation
This ensures that the screen pixmap contents have been initialized when
the initial modes are set.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27757
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r-- | src/radeon_kms.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 8ec156fc..5a2d2dae 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -245,7 +245,7 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen) return FALSE; pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS; - if (!drmmode_set_desired_modes(pScrn, &info->drmmode)) + if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE)) return FALSE; drmmode_uevent_init(pScrn, &info->drmmode); @@ -535,6 +535,17 @@ static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL) #endif } +static void RADEONBlockHandler_oneshot(BLOCKHANDLER_ARGS_DECL) +{ + SCREEN_PTR(arg); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + RADEONInfoPtr info = RADEONPTR(pScrn); + + drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE); + + RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS); +} + static void radeon_flush_callback(CallbackListPtr *list, pointer user_data, pointer call_data) @@ -1707,7 +1718,7 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL) pScreen->CloseScreen = RADEONCloseScreen_KMS; pScreen->SaveScreen = RADEONSaveScreen_KMS; info->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = RADEONBlockHandler_KMS; + pScreen->BlockHandler = RADEONBlockHandler_oneshot; if (!AddCallback(&FlushCallback, radeon_flush_callback, pScrn)) return FALSE; @@ -1765,7 +1776,7 @@ Bool RADEONEnterVT_KMS(VT_FUNC_ARGS_DECL) drmmode_copy_fb(pScrn, &info->drmmode); #endif - if (!drmmode_set_desired_modes(pScrn, &info->drmmode)) + if (!drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE)) return FALSE; return TRUE; |