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>
This commit is contained in:
Chris Wilson 2018-10-19 13:44:43 +01:00
parent 25c9a2fcc8
commit f146dc06ce
3 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;