summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-06-24 11:12:49 +0900
committerMichel Dänzer <michel@daenzer.net>2016-06-24 11:12:49 +0900
commit3be841d0ae7d505cef325993205b12d15e98dba9 (patch)
treeaef8bc30e011140ceacf3a302ee543e1564920ba
parent7835558acdce318130ba4a09ef936fd675e3197d (diff)
Only use RandR APIs if RandR is enabled
Fixes crash with Xinerama enabled, which disables RandR. Fixes: https://bugs.debian.org/827984 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c2
-rw-r--r--src/radeon_kms.c21
2 files changed, 13 insertions, 10 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b5d3dc93..25554657 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2613,7 +2613,7 @@ restart_destroy:
changed = TRUE;
}
- if (changed) {
+ if (changed && dixPrivateKeyRegistered(rrPrivKey)) {
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
RRSetChanged(xf86ScrnToScreen(scrn));
#else
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 940aad27..41ee597a 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -241,7 +241,6 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
RADEONInfoPtr info = RADEONPTR(pScrn);
- rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
PixmapPtr pixmap;
struct radeon_surface *surface;
@@ -251,17 +250,21 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen)
pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS;
/* Set the RandR primary output if Xorg hasn't */
- if (
+ if (dixPrivateKeyRegistered(rrPrivKey)) {
+ rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
+
+ if (
#ifdef RADEON_PIXMAP_SHARING
- !pScreen->isGPU &&
+ !pScreen->isGPU &&
#endif
- !rrScrPriv->primaryOutput)
- {
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ !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;
+ rrScrPriv->primaryOutput = xf86_config->output[0]->randr_output;
+ RROutputChanged(rrScrPriv->primaryOutput, FALSE);
+ rrScrPriv->layoutChanged = TRUE;
+ }
}
if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE))