summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-10-19 13:44:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-10-19 13:44:43 +0100
commitf146dc06ce32df9c2f9b46691e968c7e1bcaeb52 (patch)
tree91025e48b783853f3a54733b2d9b2bbc4bfc8db7
parent25c9a2fcc83ae7252a178b42262da383e59df744 (diff)
sna: Only generate a coldprobe RR probe when RandR is enabled
If Xinerama is enabled, RandR is disabled and calling into RR functions merely explode, so don't. Reported-by: Mariusz Białończyk <manio@skyboo.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108495 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna.h3
-rw-r--r--src/sna/sna_display.c5
-rw-r--r--src/sna/sna_driver.c3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 496460ca..cf2a7a51 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -482,6 +482,9 @@ extern void sna_crtc_config_notify(ScreenPtr screen);
extern bool sna_cursors_init(ScreenPtr screen, struct sna *sna);
+extern CARD32 sna_mode_coldplug(OsTimerPtr timer, CARD32 now, void *data);
+#define COLDPLUG_DELAY_MS 2000
+
typedef void (*sna_flip_handler_t)(struct drm_event_vblank *e,
void *data);
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 96e7b1bc..307d5344 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -93,8 +93,6 @@ void *alloca(size_t);
#define FAIL_CURSOR_IOCTL 0
-#define COLDPLUG_DELAY_MS 2000
-
/* Minor discrepancy between 32-bit/64-bit ABI in old kernels */
union compat_mode_get_connector{
struct drm_mode_get_connector conn;
@@ -5698,7 +5696,7 @@ void sna_mode_discover(struct sna *sna, bool tell)
* list of modes available until the user explicitly requests them. Fake a
* hotplug event after a second after starting to fill in any missing modes.
*/
-static CARD32 sna_mode_coldplug(OsTimerPtr timer, CARD32 now, void *data)
+CARD32 sna_mode_coldplug(OsTimerPtr timer, CARD32 now, void *data)
{
struct sna *sna = data;
ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
@@ -7743,7 +7741,6 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
}
}
sort_config_outputs(sna);
- TimerSet(NULL, 0, COLDPLUG_DELAY_MS, sna_mode_coldplug, sna);
sna_setup_provider(scrn);
return scrn->modes != NULL;
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 2007e354..d7a6953b 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -1110,6 +1110,9 @@ sna_mode_init(struct sna *sna, ScreenPtr screen)
if (rp) {
sna->mode.rrGetInfo = rp->rrGetInfo;
rp->rrGetInfo = sna_randr_getinfo;
+
+ /* Simulate a hotplug event on wakeup to force a RR probe */
+ TimerSet(NULL, 0, COLDPLUG_DELAY_MS, sna_mode_coldplug, sna);
}
return TRUE;