public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3] lib/igt_edid: fix detailed pixel timing analog/digital
Date: Mon,  6 May 2019 17:30:33 +0300	[thread overview]
Message-ID: <20190506143033.16028-1-simon.ser@intel.com> (raw)

The generated EDIDs were wrongly indicating that they support analog sync.
Fixup the detailed timings flags to advertise digital sync instead.

Currently the Linux kernel seems to ignore this completely. However I'd prefer
to fix this anyway to make sure we don't run into issues if an EDID consumer
actually cares about it.

The header definitions for EDID_PT_* values has been re-organized to make it
clearer in which situations the flags are relevant.

Changes from v1 to v2:
- Fix misleading commit message
- Revert the "misc" → "features" rename
- Re-organize EDID_PT_* definitions to make them clearer

Changes from v2 to v3:
- Include review changelog in commit message
- Fix "Fixes:" tag to conform to the kernel style
- Re-order EDID_PT_* definitions to sort by descending bitshift

Signed-off-by: Simon Ser <simon.ser@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: a2fd0489c87a ("lib/igt_edid: new library for generating EDIDs")
---
 lib/igt_edid.c |  2 +-
 lib/igt_edid.h | 16 +++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lib/igt_edid.c b/lib/igt_edid.c
index 52e66ab289a7..9d604b13c4d6 100644
--- a/lib/igt_edid.c
+++ b/lib/igt_edid.c
@@ -110,7 +110,7 @@ void detailed_timing_set_mode(struct detailed_timing *dt, drmModeModeInfo *mode,
 	pt->width_height_mm_hi = (width_mm & 0xF00) >> 4
 				 | (height_mm & 0xF00) >> 8;

-	pt->misc = 0;
+	pt->misc = EDID_PT_SYNC_DIGITAL_SEPARATE;
 	if (mode->flags & DRM_MODE_FLAG_PHSYNC)
 		pt->misc |= EDID_PT_HSYNC_POSITIVE;
 	if (mode->flags & DRM_MODE_FLAG_PVSYNC)
diff --git a/lib/igt_edid.h b/lib/igt_edid.h
index bbcb939a2dbe..36eec7e9dedb 100644
--- a/lib/igt_edid.h
+++ b/lib/igt_edid.h
@@ -52,11 +52,17 @@ struct std_timing {

 #define DETAILED_TIMINGS_LEN 4

-#define EDID_PT_HSYNC_POSITIVE (1 << 1)
+#define EDID_PT_INTERLACED (1 << 7)
+#define EDID_PT_STEREO (1 << 5)
+
+/* Sync type */
+#define EDID_PT_SYNC_ANALOG (0b00 << 3)
+#define EDID_PT_SYNC_DIGITAL_COMPOSITE (0b10 << 3)
+#define EDID_PT_SYNC_DIGITAL_SEPARATE (0b11 << 3)
+
+/* Applies to EDID_PT_SYNC_DIGITAL_SEPARATE only */
 #define EDID_PT_VSYNC_POSITIVE (1 << 2)
-#define EDID_PT_SEPARATE_SYNC  (3 << 3)
-#define EDID_PT_STEREO         (1 << 5)
-#define EDID_PT_INTERLACED     (1 << 7)
+#define EDID_PT_HSYNC_POSITIVE (1 << 1)

 struct detailed_pixel_timing {
 	uint8_t hactive_lo;
@@ -74,7 +80,7 @@ struct detailed_pixel_timing {
 	uint8_t width_height_mm_hi;
 	uint8_t hborder;
 	uint8_t vborder;
-	uint8_t misc;
+	uint8_t misc; /* EDID_PT_* */
 } __attribute__((packed));

 struct detailed_data_string {
--
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-05-06 14:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 14:30 Simon Ser [this message]
2019-05-06 15:05 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_edid: fix detailed pixel timing analog/digital (rev3) Patchwork
2019-05-06 17:39 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190506143033.16028-1-simon.ser@intel.com \
    --to=simon.ser@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox