sna: Hook into crtc_notify rather than ModeSet

ModeSet is called after updating each CRTC, unlike crtc_notify which is
called after applying all changes. The last is what we need as if we are
called too early we detect that the next CRTC doesn't match our
expectations and so we disable it, right before applying the desired
mode.

References: https://bugs.freedesktop.org/show_bug.cgi?id=66494
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-07-02 14:27:03 +01:00
parent c361b449cc
commit 67a6a4bfd9
2 changed files with 8 additions and 12 deletions

View File

@ -3142,6 +3142,13 @@ static bool sna_probe_initial_configuration(struct sna *sna)
return scrn->modes != NULL;
}
static void
sna_crtc_config_notify(ScreenPtr screen)
{
DBG(("%s\n", __FUNCTION__));
sna_mode_update(to_sna_from_screen(screen));
}
bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
{
struct sna_mode *mode = &sna->mode;
@ -3150,6 +3157,7 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
mode->kmode = drmModeGetResources(sna->kgem.fd);
if (mode->kmode) {
xf86CrtcConfigInit(scrn, &sna_mode_funcs);
XF86_CRTC_CONFIG_PTR(sna->scrn)->xf86_crtc_notify = sna_crtc_config_notify;
for (i = 0; i < mode->kmode->count_crtcs; i++)
if (!sna_crtc_init(scrn, mode, i))

View File

@ -781,14 +781,6 @@ static Bool sna_late_close_screen(CLOSE_SCREEN_ARGS_DECL)
return TRUE;
}
static void sna_mode_set(ScrnInfoPtr scrn)
{
struct sna *sna = to_sna(scrn);
DBG(("%s\n", __FUNCTION__));
sna_mode_update(sna);
}
static Bool
sna_register_all_privates(void)
{
@ -1129,10 +1121,6 @@ Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num)
scrn->ValidMode = sna_valid_mode;
scrn->PMEvent = sna_pm_event;
#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0)
scrn->ModeSet = sna_mode_set;
#endif
xf86SetEntitySharable(entity_num);
xf86SetEntityInstanceForScreen(scrn, entity_num,
xf86GetNumEntityInstances(entity_num)-1);