mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-25 19:56:43 +00:00
xorg-server:
- add patch from debian to fix some EDID aspect ratio issues
This commit is contained in:
parent
0e1ad0dc32
commit
d25fcf4d69
@ -0,0 +1,61 @@
|
|||||||
|
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
|
||||||
|
index c0e3df9..32288f7 100644
|
||||||
|
--- a/hw/xfree86/ddc/interpret_edid.c
|
||||||
|
+++ b/hw/xfree86/ddc/interpret_edid.c
|
||||||
|
@@ -51,6 +51,15 @@ static void get_whitepoint_section(Uchar *, struct whitePoints *);
|
||||||
|
static void get_detailed_timing_section(Uchar*, struct detailed_timings *);
|
||||||
|
static Bool validate_version(int scrnIndex, struct edid_version *);
|
||||||
|
|
||||||
|
+static Bool
|
||||||
|
+is_standard_aspect_ratio(int x, int y)
|
||||||
|
+{
|
||||||
|
+ return ((x == 16 && y == 9) ||
|
||||||
|
+ (x == 16 && y == 10) ||
|
||||||
|
+ (x == 4 && y == 3) ||
|
||||||
|
+ (x == 5 && y == 4));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
handle_edid_quirks(xf86MonPtr m)
|
||||||
|
{
|
||||||
|
@@ -91,10 +100,7 @@ handle_edid_quirks(xf86MonPtr m)
|
||||||
|
* try to find the largest detailed timing that matches that aspect
|
||||||
|
* ratio and use that to fill in the feature section.
|
||||||
|
*/
|
||||||
|
- if ((m->features.hsize == 16 && m->features.vsize == 9) ||
|
||||||
|
- (m->features.hsize == 16 && m->features.vsize == 10) ||
|
||||||
|
- (m->features.hsize == 4 && m->features.vsize == 3) ||
|
||||||
|
- (m->features.hsize == 5 && m->features.vsize == 4)) {
|
||||||
|
+ if (is_standard_aspect_ratio(m->features.hsize, m->features.vsize)) {
|
||||||
|
int real_hsize = 0, real_vsize = 0;
|
||||||
|
float target_aspect, timing_aspect;
|
||||||
|
|
||||||
|
@@ -130,6 +136,28 @@ handle_edid_quirks(xf86MonPtr m)
|
||||||
|
xf86Msg(X_INFO, "Quirked EDID physical size to %dx%d cm\n",
|
||||||
|
m->features.hsize, m->features.vsize);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Some monitors do the reverse, putting real size in the global block
|
||||||
|
+ * and aspect ratios in the detailed timings. Check, but only if we
|
||||||
|
+ * think we've got a real physical size.
|
||||||
|
+ */
|
||||||
|
+ if (m->features.hsize && m->features.vsize) {
|
||||||
|
+ for (i = 0; i < 4; i++) {
|
||||||
|
+ if (m->det_mon[i].type == DT) {
|
||||||
|
+ struct detailed_timings *timing;
|
||||||
|
+ timing = &m->det_mon[i].section.d_timings;
|
||||||
|
+
|
||||||
|
+ if (is_standard_aspect_ratio(timing->h_size, timing->v_size)) {
|
||||||
|
+ timing->h_size = m->features.hsize * 10;
|
||||||
|
+ timing->v_size = m->features.vsize * 10;
|
||||||
|
+ xf86Msg(X_INFO, "Quirked timing size to %dx%d mm\n",
|
||||||
|
+ timing->h_size, timing->v_size);
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
xf86MonPtr
|
Loading…
x
Reference in New Issue
Block a user