diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-01-14 17:32:54 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-01-14 17:32:54 +0900 |
commit | b16856b25086ffb27365ac2249b8da921066ce62 (patch) | |
tree | 71c4766aa4d25a558d13dbd9ac1f4500ce945605 | |
parent | c7cf00487cd6d4a5d0f39d5b92ff04f6420d6a32 (diff) |
Set the RandR primary output on startup if Xorg hasn't
Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary
after startup.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/radeon_kms.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index d4597404..971f11c4 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -241,6 +241,7 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); RADEONInfoPtr info = RADEONPTR(pScrn); + rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen); PixmapPtr pixmap; struct radeon_surface *surface; @@ -249,6 +250,20 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen) return FALSE; pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS; + /* Set the RandR primary output if Xorg hasn't */ + if ( +#ifdef RADEON_PIXMAP_SHARING + !pScreen->isGPU && +#endif + !rrScrPriv->primaryOutput) + { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + + rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output; + RROutputChanged(rrScrPriv->primaryOutput, FALSE); + rrScrPriv->layoutChanged = TRUE; + } + if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE)) return FALSE; |