summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-05-15 09:23:57 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2023-05-15 10:33:21 +0200
commit814a04927d54586ea478ba6ac14eb4fca5667239 (patch)
treee0ace3e57abb45cd4c0b4d9a965bf82cf3c48e1b
parent2713383548cc1abf4f578f8d2623da91c52dde84 (diff)
downloadxserver-814a04927d54586ea478ba6ac14eb4fca5667239.tar.gz
xwayland: Keep the CVT timings for non-standard modesHEADmaster
The current code, as changed by commit ad2d461de „Do not round non-standard modes“ is reported to be logically incongruent. We should either drop libxcvt entirely or simply fix the size, keeping the CVT timings unchanged. For backward compatibility and simplicity, I'd rather simply fix the hdisplay/vdisplay to match the given size. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Fixes: ad2d461de - xwayland: Do not round non-standard modes Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1549
-rw-r--r--hw/xwayland/xwayland-cvt.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/hw/xwayland/xwayland-cvt.c b/hw/xwayland/xwayland-cvt.c
index d052471eb..4248d3869 100644
--- a/hw/xwayland/xwayland-cvt.c
+++ b/hw/xwayland/xwayland-cvt.c
@@ -53,17 +53,6 @@ xwayland_modeinfo_from_cvt(xRRModeInfo *modeinfo,
free(libxcvt_mode_info);
}
-static void
-xwayland_modeinfo_from_values(xRRModeInfo *modeinfo,
- int hdisplay, int vdisplay, float vrefresh)
-{
- modeinfo->width = hdisplay;
- modeinfo->height = vdisplay;
- modeinfo->hTotal = hdisplay;
- modeinfo->vTotal = vdisplay;
- modeinfo->dotClock = hdisplay * vdisplay * vrefresh;
-}
-
RRModePtr
xwayland_cvt(int hdisplay, int vdisplay, float vrefresh, Bool reduced,
Bool interlaced)
@@ -75,14 +64,13 @@ xwayland_cvt(int hdisplay, int vdisplay, float vrefresh, Bool reduced,
hdisplay, vdisplay, vrefresh, reduced, interlaced);
/* Horizontal granularity in libxcvt is 8, so if our horizontal size is not
- * divisible by 8, libxcvt will round it down, and we will advertise a wrong
- * size to our XRandR clients. Fallback to a simpler method in that case.
+ * divisible by 8, libxcvt will round it up, and we will advertise a wrong
+ * size to our XRandR clients.
+ * Force the width/height (i.e. simply increase blanking which should not
+ * hurt anything), keeping the rest of the CVT mode timings unchanged.
*/
- if (modeinfo.width != hdisplay || modeinfo.height != vdisplay) {
- memset(&modeinfo, 0, sizeof(xRRModeInfo));
- xwayland_modeinfo_from_values(&modeinfo,
- hdisplay, vdisplay, vrefresh);
- }
+ modeinfo.width = hdisplay;
+ modeinfo.height = vdisplay;
snprintf(name, sizeof name, "%dx%d",
modeinfo.width, modeinfo.height);