summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-10-21 13:25:01 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-10-21 13:25:01 +0100
commit5d5dfb3e7a6056df7f6af1bcdc789a50ed00b068 (patch)
tree2188f6a0133efdbbc515f170a45e4a748daefec7
parente1027ad7c60b9fd229ed196646c88ba7bb72a282 (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c11
1 files changed, 11 insertions, 0 deletions
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;
}
}
}