From 5d5dfb3e7a6056df7f6af1bcdc789a50ed00b068 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 21 Oct 2013 13:25:01 +0100 Subject: sna: Copy the EDID mode name for the current CRTC mode As the kernel does not preserve the name and driver type when returning the current CRTC mode, we need to reconstruct those from the EDID mode when available. Signed-off-by: Chris Wilson --- src/sna/sna_display.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index a7957eb9..d7ef344f 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -705,6 +705,12 @@ mode_from_kmode(ScrnInfoPtr scrn, const struct drm_mode_modeinfo *kmode, DisplayModePtr mode) { + DBG(("kmode: %s, clock=%d, %d %d %d %d %d, %d %d %d %d %d, flags=%x, type=%x\n", + kmode->name, kmode->clock, + kmode->hdisplay, kmode->hsync_start, kmode->hsync_end, kmode->htotal, kmode->hskew, + kmode->vdisplay, kmode->vsync_start, kmode->vsync_end, kmode->vtotal, kmode->vscan, + kmode->flags, kmode->type)); + mode->status = MODE_OK; mode->Clock = kmode->clock; @@ -2116,6 +2122,8 @@ sna_output_get_modes(xf86OutputPtr output) } } + DBG(("%s: adding %d probed modes\n", __FUNCTION__, sna_output->num_modes)); + Mode = NULL; for (i = 0; i < sna_output->num_modes; i++) { if (Mode == NULL) @@ -2128,6 +2136,9 @@ sna_output_get_modes(xf86OutputPtr output) if (!current || !xf86ModesEqual(Mode, current)) { Modes = xf86ModesAdd(Modes, Mode); Mode = NULL; + } else { + current->name = strdup(Mode->name); + current->type = Mode->type; } } } -- cgit v1.2.3