All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
@ 2017-03-22 17:35 Jose Abreu
  2017-03-22 17:35 ` [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob Jose Abreu
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 17:35 UTC (permalink / raw)
  To: dri-devel; +Cc: Jose Abreu, Carlos Palminha

Hi all,

This is a RFC series that aims to collect comments regarding the handling
of HDMI 2.0+ video modes and features in the DRM core.

Some of the HDMI 2.0 features are already implemented and only affect kernel
drivers (SDCD for example). There are some features, though, which can,
and will, affect userspace.

It is clear that userspace can't be broken, so, based on previous discussions
I started implementing a "HDMI 2.0+ knob" which can be set by userspace to
enable HDMI 2.0+ features.

For now this only limits the exposing of the video modes defined in CEA-861-F,
but it can be extended adding, for example, YCbCr 4:2:0.

Please do not see this as a formal patch as this wasn't even compiled tested but,
please, feel free to comment :)

NOTE: The adding of the new video modes timings was originally done by
Shashank Sharma <shashank.sharma@intel.com> so, credit to him. I modified it a
little bit (added the HDMI 2.0+ flag) and I don't know if I should add his
signed-off-by as it was modified.

Best regards,
Jose Miguel Abreu

Cc: Carlos Palminha <palminha@synopsys.com>
Cc: dri-devel@lists.freedesktop.org

Jose Abreu (5):
  drm: Add HDMI 2.0+ features exposing knob
  drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
  drm: edid: Add HDMI 2.0 CEA video modes
  drm: connector: Add hdmi2_allowed flag
  drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked
    to

 drivers/gpu/drm/drm_connector.c    |   2 +
 drivers/gpu/drm/drm_edid.c         | 258 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_ioctl.c        |   5 +
 drivers/gpu/drm/drm_probe_helper.c |   9 +-
 include/drm/drm_connector.h        |   2 +
 include/drm/drm_file.h             |   8 ++
 include/drm/drm_modes.h            |  14 ++
 include/uapi/drm/drm.h             |   7 +
 include/uapi/drm/drm_mode.h        |   9 ++
 9 files changed, 313 insertions(+), 1 deletion(-)

-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob
  2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
@ 2017-03-22 17:35 ` Jose Abreu
  2017-03-23  7:22   ` Daniel Vetter
  2017-03-22 17:35 ` [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag Jose Abreu
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 17:35 UTC (permalink / raw)
  To: dri-devel; +Cc: Jose Abreu, Carlos Palminha

We can't expect userspace to have full support for all HDMI 2.0+
features. Instead of expecting/waiting for userspace to support
the new features add a knob, much like the stereo knob, so that
DRM core will only expose the features when asked too.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_ioctl.c | 5 +++++
 include/drm/drm_file.h      | 8 ++++++++
 include/uapi/drm/drm.h      | 7 +++++++
 3 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index a7c61c2..2430e2e 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
 		file_priv->atomic = req->value;
 		file_priv->universal_planes = req->value;
 		break;
+	case DRM_CLIENT_CAP_HDMI2:
+		if (req->value > 1)
+			return -EINVAL;
+		file_priv->hdmi2_allowed = req->value;
+		break;
 	default:
 		return -EINVAL;
 	}
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 5dd27ae..7b97d85 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -192,6 +192,14 @@ struct drm_file {
 	unsigned is_master:1;
 
 	/**
+	 * @hdmi2_allowed:
+	 *
+	 * True if client understands HDMI 2.0+ features like, for example,
+	 * extended aspect ratios
+	 */
+	unsigned hdmi2_allowed:1;
+
+	/**
 	 * @master:
 	 *
 	 * Master this node is currently associated with. Only relevant if
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index b2c5284..9e25138 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -678,6 +678,13 @@ struct drm_get_cap {
  */
 #define DRM_CLIENT_CAP_ATOMIC	3
 
+/**
+ * DRM_CLIENT_CAP_HDMI2
+ *
+ * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace
+ */
+#define DRM_CLIENT_CAP_HDMI2	4
+
 /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
 struct drm_set_client_cap {
 	__u64 capability;
-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
  2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
  2017-03-22 17:35 ` [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob Jose Abreu
@ 2017-03-22 17:35 ` Jose Abreu
  2017-03-23 15:16   ` Ville Syrjälä
  2017-03-22 17:35 ` [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes Jose Abreu
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 17:35 UTC (permalink / raw)
  To: dri-devel; +Cc: Jose Abreu, Carlos Palminha

Add the HDMI 2.0 aspect ratio flags (64:27 and 256:135) and a new
flag which will signal userspace that this is a HDMI 2.0+ mode. It
is expected that these new flags will not be exported to userspace
unless client asks to.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: dri-devel@lists.freedesktop.org
---
 include/uapi/drm/drm_mode.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 8c67fc0..62e679c 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -89,6 +89,8 @@
 #define DRM_MODE_PICTURE_ASPECT_NONE		0
 #define DRM_MODE_PICTURE_ASPECT_4_3		1
 #define DRM_MODE_PICTURE_ASPECT_16_9		2
+#define DRM_MODE_PICTURE_ASPECT_64_27		3
+#define DRM_MODE_PICTURE_ASPECT_256_135		4
 
 /* Aspect ratio flag bitmask (4 bits 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
@@ -98,6 +100,13 @@
 			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
 #define  DRM_MODE_FLAG_PIC_AR_16_9 \
 			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
+#define  DRM_MODE_FLAG_PIC_AR_64_27 \
+			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
+#define  DRM_MODE_FLAG_PIC_AR_256_135 \
+			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
+
+/* HDMI 2.0+ mode flag: will only be set if client supports it */
+#define DRM_MODE_FLAG_HDMI2			(1<<23)
 
 /* DPMS flags */
 /* bit compatible with the xorg definitions. */
-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
  2017-03-22 17:35 ` [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob Jose Abreu
  2017-03-22 17:35 ` [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag Jose Abreu
@ 2017-03-22 17:35 ` Jose Abreu
  2017-03-23  8:11   ` Andrzej Hajda
  2017-03-22 17:36 ` [RFC 4/5] drm: connector: Add hdmi2_allowed flag Jose Abreu
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 17:35 UTC (permalink / raw)
  To: dri-devel; +Cc: Jose Abreu, Carlos Palminha

This patch completes CEA table of video modes so that VIC 1-107
are now available. Use the HDMI 2.0+ flag to signal these are
modes for HDMI 2.0 onwards.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 258 insertions(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index fad3d44..90080368 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1001,6 +1001,264 @@ struct minimode {
 		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
 		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
 	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
+	/* 65 - 1280x720@24Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
+		   3080, 3300, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 66 - 1280x720@25Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
+		   3740, 3960, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 67 - 1280x720@30Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
+		   3080, 3300, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 68 - 1280x720@50Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
+		   1760, 1980, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 69 - 1280x720@60Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
+		   1430, 1650, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 70 - 1280x720@100Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
+		   1760, 1980, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 71 - 1280x720@120Hz */
+	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
+		   1430, 1650, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 72 - 1920x1080@24Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
+		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 73 - 1920x1080@25Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
+		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 74 - 1920x1080@30Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
+		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 75 - 1920x1080@50Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
+		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 76 - 1920x1080@60Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
+		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 77 - 1920x1080@100Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
+		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 78 - 1920x1080@120Hz */
+	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
+		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 79 - 1680x720@24Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
+		   3080, 3300, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 80 - 1680x720@25Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
+		   2948, 3168, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 81 - 1680x720@30Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
+		   2420, 2640, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 82 - 1680x720@50Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
+		   1980, 2200, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 83 - 1680x720@60Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
+		   1980, 2200, 0, 720, 725, 730, 750, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 84 - 1680x720@100Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
+		   1780, 2000, 0, 720, 725, 730, 825, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 85 - 1680x720@120Hz */
+	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
+		   1780, 2000, 0, 720, 725, 730, 825, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 86 - 2560x1080@24Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
+		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 87 - 2560x1080@25Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
+		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 88 - 2560x1080@30Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
+		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 89 - 2560x1080@50Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
+		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 90 - 2560x1080@60Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
+		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 91 - 2560x1080@100Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
+		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 92 - 2560x1080@120Hz */
+	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
+		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
+	/* 93 - 3840x2160p@24Hz 16:9 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
+		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
+	/* 94 - 3840x2160p@25Hz 16:9 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
+		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
+	/* 95 - 3840x2160p@30Hz 16:9 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
+		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
+	/* 96 - 3840x2160p@50Hz 16:9 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
+		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
+	/* 97 - 3840x2160p@60Hz 16:9 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
+		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
+	/* 98 - 4096x2160p@24Hz 256:135 */
+	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
+		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
+	/* 99 - 4096x2160p@25Hz 256:135 */
+	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
+		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
+	/* 100 - 4096x2160p@30Hz 256:135 */
+	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
+		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
+	/* 101 - 4096x2160p@50Hz 256:135 */
+	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
+		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
+	/* 102 - 4096x2160p@60Hz 256:135 */
+	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
+		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
+	/* 103 - 3840x2160p@24Hz 64:27 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
+		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
+	/* 104 - 3840x2160p@25Hz 64:27 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
+		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
+	/* 105 - 3840x2160p@30Hz 64:27 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
+		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
+	/* 106 - 3840x2160p@50Hz 64:27 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
+		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
+	/* 107 - 3840x2160p@60Hz 64:27 */
+	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
+		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
+		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
+		   DRM_MODE_FLAG_HDMI2),
+	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
 };
 
 /*
-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC 4/5] drm: connector: Add hdmi2_allowed flag
  2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
                   ` (2 preceding siblings ...)
  2017-03-22 17:35 ` [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes Jose Abreu
@ 2017-03-22 17:36 ` Jose Abreu
  2017-03-22 17:36 ` [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to Jose Abreu
  2017-03-22 18:13 ` [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
  5 siblings, 0 replies; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 17:36 UTC (permalink / raw)
  To: dri-devel; +Cc: Jose Abreu, Carlos Palminha

Add a new HDMI 2.0+ flag which will signal core that the
connector can handle HDMI 2.0+ video modes.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: dri-devel@lists.freedesktop.org
---
 include/drm/drm_connector.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index f8b766d..f3db9bd 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -637,6 +637,7 @@ struct drm_cmdline_mode {
  * @interlace_allowed: can this connector handle interlaced modes?
  * @doublescan_allowed: can this connector handle doublescan?
  * @stereo_allowed: can this connector handle stereo modes?
+ * @hdmi2_allowed: can this connector handle HDMI 2.0+ modes?
  * @funcs: connector control functions
  * @edid_blob_ptr: DRM property containing EDID if present
  * @properties: property tracking for this connector
@@ -701,6 +702,7 @@ struct drm_connector {
 	bool interlace_allowed;
 	bool doublescan_allowed;
 	bool stereo_allowed;
+	bool hdmi2_allowed;
 	/**
 	 * @registered: Is this connector exposed (registered) with userspace?
 	 * Protected by @mutex.
-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to
  2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
                   ` (3 preceding siblings ...)
  2017-03-22 17:36 ` [RFC 4/5] drm: connector: Add hdmi2_allowed flag Jose Abreu
@ 2017-03-22 17:36 ` Jose Abreu
  2017-03-23  7:25   ` Daniel Vetter
  2017-03-22 18:13 ` [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
  5 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 17:36 UTC (permalink / raw)
  To: dri-devel; +Cc: Jose Abreu, Carlos Palminha

Perform sanity checks so that HDMI 2.0+ modes are not exported to
drivers or userspace unless asked to.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_connector.c    |  2 ++
 drivers/gpu/drm/drm_probe_helper.c |  9 ++++++++-
 include/drm/drm_modes.h            | 14 ++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 9f84761..430bb2b 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1200,6 +1200,8 @@ static bool drm_mode_expose_to_userspace(const struct drm_display_mode *mode,
 	 */
 	if (!file_priv->stereo_allowed && drm_mode_is_stereo(mode))
 		return false;
+	if (!file_priv->hdmi2_allowed && drm_mode_is_hdmi2(mode))
+		return false;
 
 	return true;
 }
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 85005d5..ddacb5d 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -77,6 +77,10 @@
 	    !(flags & DRM_MODE_FLAG_3D_MASK))
 		return MODE_NO_STEREO;
 
+	if ((mode->flags & DRM_MODE_FLAG_HDMI2) &&
+	    !(flags & DRM_MODE_FLAG_HDMI2))
+		return MODE_NO_HDMI2;
+
 	return MODE_OK;
 }
 
@@ -221,7 +225,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
  *    - drm_mode_validate_size() filters out modes larger than @maxX and @maxY
  *      (if specified)
  *    - drm_mode_validate_flag() checks the modes against basic connector
- *      capabilities (interlace_allowed,doublescan_allowed,stereo_allowed)
+ *      capabilities (interlace_allowed,doublescan_allowed,stereo_allowed,
+ *      hdmi2_allowed)
  *    - the optional &drm_connector_helper_funcs.mode_valid helper can perform
  *      driver and/or hardware specific checks
  *
@@ -336,6 +341,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 		mode_flags |= DRM_MODE_FLAG_DBLSCAN;
 	if (connector->stereo_allowed)
 		mode_flags |= DRM_MODE_FLAG_3D_MASK;
+	if (connector->hdmi2_allowed)
+		mode_flags |= DRM_MODE_FLAG_HDMI2;
 
 	list_for_each_entry(mode, &connector->modes, head) {
 		if (mode->status == MODE_OK)
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 6dd34280..83466ff 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -80,6 +80,7 @@
  * @MODE_ONE_SIZE: only one resolution is supported
  * @MODE_NO_REDUCED: monitor doesn't accept reduced blanking
  * @MODE_NO_STEREO: stereo modes not supported
+ * @MODE_NO_HDMI2: HDMI 2.0+ modes not supported
  * @MODE_STALE: mode has become stale
  * @MODE_BAD: unspecified reason
  * @MODE_ERROR: error condition
@@ -124,6 +125,7 @@ enum drm_mode_status {
 	MODE_ONE_SIZE,
 	MODE_NO_REDUCED,
 	MODE_NO_STEREO,
+	MODE_NO_HDMI2,
 	MODE_STALE = -3,
 	MODE_BAD = -2,
 	MODE_ERROR = -1
@@ -422,6 +424,18 @@ static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
 	return mode->flags & DRM_MODE_FLAG_3D_MASK;
 }
 
+/**
+ * drm_mode_is_hdmi2 - check for HDMI 2.0+ mode flag
+ * @mode: drm_display_mode to check
+ *
+ * Returns:
+ * True if the mode is HDMI 2.0+ mode, false if not
+ */
+static inline bool drm_mode_is_hdmi2(const struct drm_display_mode *mode)
+{
+	return mode->flags & DRM_MODE_FLAG_HDMI2;
+}
+
 struct drm_connector;
 struct drm_cmdline_mode;
 
-- 
1.9.1


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
  2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
                   ` (4 preceding siblings ...)
  2017-03-22 17:36 ` [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to Jose Abreu
@ 2017-03-22 18:13 ` Jose Abreu
  2017-03-22 18:57   ` Sharma, Shashank
  5 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-22 18:13 UTC (permalink / raw)
  To: dri-devel; +Cc: Vetter, Daniel, Carlos Palminha

++ Daniel

++ Ville

++ Shashank


On 22-03-2017 17:35, Jose Abreu wrote:
> Hi all,
>
> This is a RFC series that aims to collect comments regarding the handling
> of HDMI 2.0+ video modes and features in the DRM core.
>
> Some of the HDMI 2.0 features are already implemented and only affect kernel
> drivers (SDCD for example). There are some features, though, which can,
> and will, affect userspace.
>
> It is clear that userspace can't be broken, so, based on previous discussions
> I started implementing a "HDMI 2.0+ knob" which can be set by userspace to
> enable HDMI 2.0+ features.
>
> For now this only limits the exposing of the video modes defined in CEA-861-F,
> but it can be extended adding, for example, YCbCr 4:2:0.
>
> Please do not see this as a formal patch as this wasn't even compiled tested but,
> please, feel free to comment :)
>
> NOTE: The adding of the new video modes timings was originally done by
> Shashank Sharma <shashank.sharma@intel.com> so, credit to him. I modified it a
> little bit (added the HDMI 2.0+ flag) and I don't know if I should add his
> signed-off-by as it was modified.
>
> Best regards,
> Jose Miguel Abreu
>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: dri-devel@lists.freedesktop.org
>
> Jose Abreu (5):
>   drm: Add HDMI 2.0+ features exposing knob
>   drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
>   drm: edid: Add HDMI 2.0 CEA video modes
>   drm: connector: Add hdmi2_allowed flag
>   drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked
>     to
>
>  drivers/gpu/drm/drm_connector.c    |   2 +
>  drivers/gpu/drm/drm_edid.c         | 258 +++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_ioctl.c        |   5 +
>  drivers/gpu/drm/drm_probe_helper.c |   9 +-
>  include/drm/drm_connector.h        |   2 +
>  include/drm/drm_file.h             |   8 ++
>  include/drm/drm_modes.h            |  14 ++
>  include/uapi/drm/drm.h             |   7 +
>  include/uapi/drm/drm_mode.h        |   9 ++
>  9 files changed, 313 insertions(+), 1 deletion(-)
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* RE: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
  2017-03-22 18:13 ` [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
@ 2017-03-22 18:57   ` Sharma, Shashank
  2017-03-23 10:37     ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Sharma, Shashank @ 2017-03-22 18:57 UTC (permalink / raw)
  To: Jose Abreu, dri-devel; +Cc: Vetter, Daniel, Carlos Palminha

Hi Jose, 
I can't find the other patches of this series in dri patchwork, am I missing something ?

Also, I am planning to publish a series for YUV 420 handling, where I have re-used one of your patch to parse YUV 420 block, with some modifications :-).  

Regards
Shashank 
-----Original Message-----
From: Jose Abreu [mailto:Jose.Abreu@synopsys.com] 
Sent: Wednesday, March 22, 2017 8:13 PM
To: dri-devel@lists.freedesktop.org
Cc: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>; Vetter, Daniel <daniel.vetter@intel.com>; Sharma, Shashank <shashank.sharma@intel.com>; ville.syrjala@linux.intel.com
Subject: Re: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core

++ Daniel

++ Ville

++ Shashank


On 22-03-2017 17:35, Jose Abreu wrote:
> Hi all,
>
> This is a RFC series that aims to collect comments regarding the 
> handling of HDMI 2.0+ video modes and features in the DRM core.
>
> Some of the HDMI 2.0 features are already implemented and only affect 
> kernel drivers (SDCD for example). There are some features, though, 
> which can, and will, affect userspace.
>
> It is clear that userspace can't be broken, so, based on previous 
> discussions I started implementing a "HDMI 2.0+ knob" which can be set 
> by userspace to enable HDMI 2.0+ features.
>
> For now this only limits the exposing of the video modes defined in 
> CEA-861-F, but it can be extended adding, for example, YCbCr 4:2:0.
>
> Please do not see this as a formal patch as this wasn't even compiled 
> tested but, please, feel free to comment :)
>
> NOTE: The adding of the new video modes timings was originally done by 
> Shashank Sharma <shashank.sharma@intel.com> so, credit to him. I 
> modified it a little bit (added the HDMI 2.0+ flag) and I don't know 
> if I should add his signed-off-by as it was modified.
>
> Best regards,
> Jose Miguel Abreu
>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: dri-devel@lists.freedesktop.org
>
> Jose Abreu (5):
>   drm: Add HDMI 2.0+ features exposing knob
>   drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
>   drm: edid: Add HDMI 2.0 CEA video modes
>   drm: connector: Add hdmi2_allowed flag
>   drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked
>     to
>
>  drivers/gpu/drm/drm_connector.c    |   2 +
>  drivers/gpu/drm/drm_edid.c         | 258 +++++++++++++++++++++++++++++++++++++
>  drivers/gpu/drm/drm_ioctl.c        |   5 +
>  drivers/gpu/drm/drm_probe_helper.c |   9 +-
>  include/drm/drm_connector.h        |   2 +
>  include/drm/drm_file.h             |   8 ++
>  include/drm/drm_modes.h            |  14 ++
>  include/uapi/drm/drm.h             |   7 +
>  include/uapi/drm/drm_mode.h        |   9 ++
>  9 files changed, 313 insertions(+), 1 deletion(-)
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob
  2017-03-22 17:35 ` [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob Jose Abreu
@ 2017-03-23  7:22   ` Daniel Vetter
  2017-03-23 10:44     ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Daniel Vetter @ 2017-03-23  7:22 UTC (permalink / raw)
  To: Jose Abreu; +Cc: Carlos Palminha, dri-devel

On Wed, Mar 22, 2017 at 05:35:57PM +0000, Jose Abreu wrote:
> We can't expect userspace to have full support for all HDMI 2.0+
> features. Instead of expecting/waiting for userspace to support
> the new features add a knob, much like the stereo knob, so that
> DRM core will only expose the features when asked too.
> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/drm_ioctl.c | 5 +++++
>  include/drm/drm_file.h      | 8 ++++++++
>  include/uapi/drm/drm.h      | 7 +++++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index a7c61c2..2430e2e 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>  		file_priv->atomic = req->value;
>  		file_priv->universal_planes = req->value;
>  		break;
> +	case DRM_CLIENT_CAP_HDMI2:
> +		if (req->value > 1)
> +			return -EINVAL;
> +		file_priv->hdmi2_allowed = req->value;

Needs some userspace to make use of this (like the -modesetting x.org
driver).
-Daniel

> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> index 5dd27ae..7b97d85 100644
> --- a/include/drm/drm_file.h
> +++ b/include/drm/drm_file.h
> @@ -192,6 +192,14 @@ struct drm_file {
>  	unsigned is_master:1;
>  
>  	/**
> +	 * @hdmi2_allowed:
> +	 *
> +	 * True if client understands HDMI 2.0+ features like, for example,
> +	 * extended aspect ratios
> +	 */
> +	unsigned hdmi2_allowed:1;
> +
> +	/**
>  	 * @master:
>  	 *
>  	 * Master this node is currently associated with. Only relevant if
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index b2c5284..9e25138 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -678,6 +678,13 @@ struct drm_get_cap {
>   */
>  #define DRM_CLIENT_CAP_ATOMIC	3
>  
> +/**
> + * DRM_CLIENT_CAP_HDMI2
> + *
> + * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace
> + */
> +#define DRM_CLIENT_CAP_HDMI2	4
> +
>  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
>  struct drm_set_client_cap {
>  	__u64 capability;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to
  2017-03-22 17:36 ` [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to Jose Abreu
@ 2017-03-23  7:25   ` Daniel Vetter
  2017-03-23 11:02     ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Daniel Vetter @ 2017-03-23  7:25 UTC (permalink / raw)
  To: Jose Abreu; +Cc: Carlos Palminha, dri-devel

On Wed, Mar 22, 2017 at 05:36:01PM +0000, Jose Abreu wrote:
> Perform sanity checks so that HDMI 2.0+ modes are not exported to
> drivers or userspace unless asked to.

Why? They're just normal modes, this doesn't make sense. If you want to
filter the aspect ratio stuff, that makes sense, but exposing the modes
with default aspect ratio by default should be doable.

I'm also not sure how exactly this is supposed to interact with the
partially reverted aspect ratio filtering from Shashank. I guess what you
really want is the feature flag for exposing aspect ratio, and then filter
accordingly.
-Daniel
> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/drm_connector.c    |  2 ++
>  drivers/gpu/drm/drm_probe_helper.c |  9 ++++++++-
>  include/drm/drm_modes.h            | 14 ++++++++++++++
>  3 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 9f84761..430bb2b 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1200,6 +1200,8 @@ static bool drm_mode_expose_to_userspace(const struct drm_display_mode *mode,
>  	 */
>  	if (!file_priv->stereo_allowed && drm_mode_is_stereo(mode))
>  		return false;
> +	if (!file_priv->hdmi2_allowed && drm_mode_is_hdmi2(mode))
> +		return false;
>  
>  	return true;
>  }
> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
> index 85005d5..ddacb5d 100644
> --- a/drivers/gpu/drm/drm_probe_helper.c
> +++ b/drivers/gpu/drm/drm_probe_helper.c
> @@ -77,6 +77,10 @@
>  	    !(flags & DRM_MODE_FLAG_3D_MASK))
>  		return MODE_NO_STEREO;
>  
> +	if ((mode->flags & DRM_MODE_FLAG_HDMI2) &&
> +	    !(flags & DRM_MODE_FLAG_HDMI2))
> +		return MODE_NO_HDMI2;
> +
>  	return MODE_OK;
>  }
>  
> @@ -221,7 +225,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
>   *    - drm_mode_validate_size() filters out modes larger than @maxX and @maxY
>   *      (if specified)
>   *    - drm_mode_validate_flag() checks the modes against basic connector
> - *      capabilities (interlace_allowed,doublescan_allowed,stereo_allowed)
> + *      capabilities (interlace_allowed,doublescan_allowed,stereo_allowed,
> + *      hdmi2_allowed)
>   *    - the optional &drm_connector_helper_funcs.mode_valid helper can perform
>   *      driver and/or hardware specific checks
>   *
> @@ -336,6 +341,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>  		mode_flags |= DRM_MODE_FLAG_DBLSCAN;
>  	if (connector->stereo_allowed)
>  		mode_flags |= DRM_MODE_FLAG_3D_MASK;
> +	if (connector->hdmi2_allowed)
> +		mode_flags |= DRM_MODE_FLAG_HDMI2;
>  
>  	list_for_each_entry(mode, &connector->modes, head) {
>  		if (mode->status == MODE_OK)
> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
> index 6dd34280..83466ff 100644
> --- a/include/drm/drm_modes.h
> +++ b/include/drm/drm_modes.h
> @@ -80,6 +80,7 @@
>   * @MODE_ONE_SIZE: only one resolution is supported
>   * @MODE_NO_REDUCED: monitor doesn't accept reduced blanking
>   * @MODE_NO_STEREO: stereo modes not supported
> + * @MODE_NO_HDMI2: HDMI 2.0+ modes not supported
>   * @MODE_STALE: mode has become stale
>   * @MODE_BAD: unspecified reason
>   * @MODE_ERROR: error condition
> @@ -124,6 +125,7 @@ enum drm_mode_status {
>  	MODE_ONE_SIZE,
>  	MODE_NO_REDUCED,
>  	MODE_NO_STEREO,
> +	MODE_NO_HDMI2,
>  	MODE_STALE = -3,
>  	MODE_BAD = -2,
>  	MODE_ERROR = -1
> @@ -422,6 +424,18 @@ static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
>  	return mode->flags & DRM_MODE_FLAG_3D_MASK;
>  }
>  
> +/**
> + * drm_mode_is_hdmi2 - check for HDMI 2.0+ mode flag
> + * @mode: drm_display_mode to check
> + *
> + * Returns:
> + * True if the mode is HDMI 2.0+ mode, false if not
> + */
> +static inline bool drm_mode_is_hdmi2(const struct drm_display_mode *mode)
> +{
> +	return mode->flags & DRM_MODE_FLAG_HDMI2;
> +}
> +
>  struct drm_connector;
>  struct drm_cmdline_mode;
>  
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-22 17:35 ` [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes Jose Abreu
@ 2017-03-23  8:11   ` Andrzej Hajda
  2017-03-23 11:04     ` Jose Abreu
  2017-03-23 11:07     ` Sharma, Shashank
  0 siblings, 2 replies; 28+ messages in thread
From: Andrzej Hajda @ 2017-03-23  8:11 UTC (permalink / raw)
  To: Jose Abreu, dri-devel; +Cc: Carlos Palminha

On 22.03.2017 18:35, Jose Abreu wrote:
> This patch completes CEA table of video modes so that VIC 1-107
> are now available. Use the HDMI 2.0+ flag to signal these are
> modes for HDMI 2.0 onwards.

edid_cea_modes array is used in different contexts, simple extensions of
the array with modes not present in HDMI < 2.0 can result in different
behavior of drivers.
There should be put sentinels somewhere to limit table lookup to old
VICs if device/driver/receiver is not HDMI2.0 compliant.
The only situation I am aware of at the moment is infoframe generation
code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
field in AVI infoframe should be 0 for 4K modes and vendor infoframe
should be generated with proper HDMI-VIC. With current infoframe helpers
and this patch it will not work this way.

Regards
Andrzej
>
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 258 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index fad3d44..90080368 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1001,6 +1001,264 @@ struct minimode {
>  		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>  		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>  	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
> +	/* 65 - 1280x720@24Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 66 - 1280x720@25Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
> +		   3740, 3960, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 67 - 1280x720@30Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 68 - 1280x720@50Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 69 - 1280x720@60Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 70 - 1280x720@100Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 71 - 1280x720@120Hz */
> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 72 - 1920x1080@24Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
> +		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 73 - 1920x1080@25Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 74 - 1920x1080@30Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 75 - 1920x1080@50Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 76 - 1920x1080@60Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 77 - 1920x1080@100Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
> +		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 78 - 1920x1080@120Hz */
> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 79 - 1680x720@24Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 80 - 1680x720@25Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
> +		   2948, 3168, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 81 - 1680x720@30Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
> +		   2420, 2640, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 82 - 1680x720@50Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 83 - 1680x720@60Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 84 - 1680x720@100Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 85 - 1680x720@120Hz */
> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 86 - 2560x1080@24Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
> +		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 87 - 2560x1080@25Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
> +		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 88 - 2560x1080@30Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
> +		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 89 - 2560x1080@50Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
> +		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 90 - 2560x1080@60Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
> +		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 91 - 2560x1080@100Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
> +		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 92 - 2560x1080@120Hz */
> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
> +		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
> +	/* 93 - 3840x2160p@24Hz 16:9 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
> +	/* 94 - 3840x2160p@25Hz 16:9 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
> +	/* 95 - 3840x2160p@30Hz 16:9 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
> +	/* 96 - 3840x2160p@50Hz 16:9 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
> +	/* 97 - 3840x2160p@60Hz 16:9 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
> +	/* 98 - 4096x2160p@24Hz 256:135 */
> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
> +	/* 99 - 4096x2160p@25Hz 256:135 */
> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
> +	/* 100 - 4096x2160p@30Hz 256:135 */
> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
> +	/* 101 - 4096x2160p@50Hz 256:135 */
> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
> +	/* 102 - 4096x2160p@60Hz 256:135 */
> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
> +	/* 103 - 3840x2160p@24Hz 64:27 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
> +	/* 104 - 3840x2160p@25Hz 64:27 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
> +	/* 105 - 3840x2160p@30Hz 64:27 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
> +	/* 106 - 3840x2160p@50Hz 64:27 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
> +	/* 107 - 3840x2160p@60Hz 64:27 */
> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
> +		   DRM_MODE_FLAG_HDMI2),
> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>  };
>  
>  /*


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
  2017-03-22 18:57   ` Sharma, Shashank
@ 2017-03-23 10:37     ` Jose Abreu
  2017-03-23 10:56       ` Sharma, Shashank
  0 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 10:37 UTC (permalink / raw)
  To: Sharma, Shashank, Jose Abreu, dri-devel; +Cc: Vetter, Daniel, Carlos Palminha

Hi Shashank,


On 22-03-2017 18:57, Sharma, Shashank wrote:
> Hi Jose, 
> I can't find the other patches of this series in dri patchwork, am I missing something ?

You can find them now in patchwork (I don't know what happened).

>
> Also, I am planning to publish a series for YUV 420 handling, where I have re-used one of your patch to parse YUV 420 block, with some modifications :-).  

Nice :) Please cc me and I will try to review them.

Best regards,
Jose Miguel Abreu

>
> Regards
> Shashank 
> -----Original Message-----
> From: Jose Abreu [mailto:Jose.Abreu@synopsys.com] 
> Sent: Wednesday, March 22, 2017 8:13 PM
> To: dri-devel@lists.freedesktop.org
> Cc: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>; Vetter, Daniel <daniel.vetter@intel.com>; Sharma, Shashank <shashank.sharma@intel.com>; ville.syrjala@linux.intel.com
> Subject: Re: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
>
> ++ Daniel
>
> ++ Ville
>
> ++ Shashank
>
>
> On 22-03-2017 17:35, Jose Abreu wrote:
>> Hi all,
>>
>> This is a RFC series that aims to collect comments regarding the 
>> handling of HDMI 2.0+ video modes and features in the DRM core.
>>
>> Some of the HDMI 2.0 features are already implemented and only affect 
>> kernel drivers (SDCD for example). There are some features, though, 
>> which can, and will, affect userspace.
>>
>> It is clear that userspace can't be broken, so, based on previous 
>> discussions I started implementing a "HDMI 2.0+ knob" which can be set 
>> by userspace to enable HDMI 2.0+ features.
>>
>> For now this only limits the exposing of the video modes defined in 
>> CEA-861-F, but it can be extended adding, for example, YCbCr 4:2:0.
>>
>> Please do not see this as a formal patch as this wasn't even compiled 
>> tested but, please, feel free to comment :)
>>
>> NOTE: The adding of the new video modes timings was originally done by 
>> Shashank Sharma <shashank.sharma@intel.com> so, credit to him. I 
>> modified it a little bit (added the HDMI 2.0+ flag) and I don't know 
>> if I should add his signed-off-by as it was modified.
>>
>> Best regards,
>> Jose Miguel Abreu
>>
>> Cc: Carlos Palminha <palminha@synopsys.com>
>> Cc: dri-devel@lists.freedesktop.org
>>
>> Jose Abreu (5):
>>   drm: Add HDMI 2.0+ features exposing knob
>>   drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
>>   drm: edid: Add HDMI 2.0 CEA video modes
>>   drm: connector: Add hdmi2_allowed flag
>>   drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked
>>     to
>>
>>  drivers/gpu/drm/drm_connector.c    |   2 +
>>  drivers/gpu/drm/drm_edid.c         | 258 +++++++++++++++++++++++++++++++++++++
>>  drivers/gpu/drm/drm_ioctl.c        |   5 +
>>  drivers/gpu/drm/drm_probe_helper.c |   9 +-
>>  include/drm/drm_connector.h        |   2 +
>>  include/drm/drm_file.h             |   8 ++
>>  include/drm/drm_modes.h            |  14 ++
>>  include/uapi/drm/drm.h             |   7 +
>>  include/uapi/drm/drm_mode.h        |   9 ++
>>  9 files changed, 313 insertions(+), 1 deletion(-)
>>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIGaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=yaVFU4TjGY0gVF8El1uKcisy6TPsyCl9uN7Wsis-qhY&m=2OKRtIbkxjKURLp5pmoJ8lSSpsZfM6cXwik8mwS0U_4&s=oxPm-LzATMtdXVlKmybIHwYKhKvT-eeayLhz7xRtQkg&e= 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob
  2017-03-23  7:22   ` Daniel Vetter
@ 2017-03-23 10:44     ` Jose Abreu
  2017-03-23 11:00       ` Daniel Vetter
  0 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 10:44 UTC (permalink / raw)
  To: Daniel Vetter, Jose Abreu; +Cc: Carlos Palminha, dri-devel

Hi Daniel,


On 23-03-2017 07:22, Daniel Vetter wrote:
> On Wed, Mar 22, 2017 at 05:35:57PM +0000, Jose Abreu wrote:
>> We can't expect userspace to have full support for all HDMI 2.0+
>> features. Instead of expecting/waiting for userspace to support
>> the new features add a knob, much like the stereo knob, so that
>> DRM core will only expose the features when asked too.
>>
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Carlos Palminha <palminha@synopsys.com>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>  drivers/gpu/drm/drm_ioctl.c | 5 +++++
>>  include/drm/drm_file.h      | 8 ++++++++
>>  include/uapi/drm/drm.h      | 7 +++++++
>>  3 files changed, 20 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
>> index a7c61c2..2430e2e 100644
>> --- a/drivers/gpu/drm/drm_ioctl.c
>> +++ b/drivers/gpu/drm/drm_ioctl.c
>> @@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>>  		file_priv->atomic = req->value;
>>  		file_priv->universal_planes = req->value;
>>  		break;
>> +	case DRM_CLIENT_CAP_HDMI2:
>> +		if (req->value > 1)
>> +			return -EINVAL;
>> +		file_priv->hdmi2_allowed = req->value;
> Needs some userspace to make use of this (like the -modesetting x.org
> driver).
> -Daniel

I see your point but shouldn't this be merged before actually
starting to work in userspace?

Best regards,
Jose Miguel Abreu

>
>> +		break;
>>  	default:
>>  		return -EINVAL;
>>  	}
>> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
>> index 5dd27ae..7b97d85 100644
>> --- a/include/drm/drm_file.h
>> +++ b/include/drm/drm_file.h
>> @@ -192,6 +192,14 @@ struct drm_file {
>>  	unsigned is_master:1;
>>  
>>  	/**
>> +	 * @hdmi2_allowed:
>> +	 *
>> +	 * True if client understands HDMI 2.0+ features like, for example,
>> +	 * extended aspect ratios
>> +	 */
>> +	unsigned hdmi2_allowed:1;
>> +
>> +	/**
>>  	 * @master:
>>  	 *
>>  	 * Master this node is currently associated with. Only relevant if
>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>> index b2c5284..9e25138 100644
>> --- a/include/uapi/drm/drm.h
>> +++ b/include/uapi/drm/drm.h
>> @@ -678,6 +678,13 @@ struct drm_get_cap {
>>   */
>>  #define DRM_CLIENT_CAP_ATOMIC	3
>>  
>> +/**
>> + * DRM_CLIENT_CAP_HDMI2
>> + *
>> + * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace
>> + */
>> +#define DRM_CLIENT_CAP_HDMI2	4
>> +
>>  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
>>  struct drm_set_client_cap {
>>  	__u64 capability;
>> -- 
>> 1.9.1
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=4lBpQovdR7O8jeC7mV8SX9xvTypMtV8CBDEDg3bGgzw&s=h-gqFlO62i53pir0j2lJ-upE_bXQxhn3BK1nhdxoB6Y&e= 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
  2017-03-23 10:37     ` Jose Abreu
@ 2017-03-23 10:56       ` Sharma, Shashank
  0 siblings, 0 replies; 28+ messages in thread
From: Sharma, Shashank @ 2017-03-23 10:56 UTC (permalink / raw)
  To: Jose Abreu, dri-devel; +Cc: Vetter, Daniel, Carlos Palminha

I realized it was too early to search that in dri-devel last night, I 
guess it takes some time to sync.

Now I can see them all :)


On 3/23/2017 12:37 PM, Jose Abreu wrote:
> Hi Shashank,
>
>
> On 22-03-2017 18:57, Sharma, Shashank wrote:
>> Hi Jose,
>> I can't find the other patches of this series in dri patchwork, am I missing something ?
> You can find them now in patchwork (I don't know what happened).
>
>> Also, I am planning to publish a series for YUV 420 handling, where I have re-used one of your patch to parse YUV 420 block, with some modifications :-).
> Nice :) Please cc me and I will try to review them.
>
> Best regards,
> Jose Miguel Abreu
>
>> Regards
>> Shashank
>> -----Original Message-----
>> From: Jose Abreu [mailto:Jose.Abreu@synopsys.com]
>> Sent: Wednesday, March 22, 2017 8:13 PM
>> To: dri-devel@lists.freedesktop.org
>> Cc: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>; Vetter, Daniel <daniel.vetter@intel.com>; Sharma, Shashank <shashank.sharma@intel.com>; ville.syrjala@linux.intel.com
>> Subject: Re: [RFC 0/5] HDMI 2.0+ video modes handling in DRM core
>>
>> ++ Daniel
>>
>> ++ Ville
>>
>> ++ Shashank
>>
>>
>> On 22-03-2017 17:35, Jose Abreu wrote:
>>> Hi all,
>>>
>>> This is a RFC series that aims to collect comments regarding the
>>> handling of HDMI 2.0+ video modes and features in the DRM core.
>>>
>>> Some of the HDMI 2.0 features are already implemented and only affect
>>> kernel drivers (SDCD for example). There are some features, though,
>>> which can, and will, affect userspace.
>>>
>>> It is clear that userspace can't be broken, so, based on previous
>>> discussions I started implementing a "HDMI 2.0+ knob" which can be set
>>> by userspace to enable HDMI 2.0+ features.
>>>
>>> For now this only limits the exposing of the video modes defined in
>>> CEA-861-F, but it can be extended adding, for example, YCbCr 4:2:0.
>>>
>>> Please do not see this as a formal patch as this wasn't even compiled
>>> tested but, please, feel free to comment :)
>>>
>>> NOTE: The adding of the new video modes timings was originally done by
>>> Shashank Sharma <shashank.sharma@intel.com> so, credit to him. I
>>> modified it a little bit (added the HDMI 2.0+ flag) and I don't know
>>> if I should add his signed-off-by as it was modified.
>>>
>>> Best regards,
>>> Jose Miguel Abreu
>>>
>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>> Cc: dri-devel@lists.freedesktop.org
>>>
>>> Jose Abreu (5):
>>>    drm: Add HDMI 2.0+ features exposing knob
>>>    drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
>>>    drm: edid: Add HDMI 2.0 CEA video modes
>>>    drm: connector: Add hdmi2_allowed flag
>>>    drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked
>>>      to
>>>
>>>   drivers/gpu/drm/drm_connector.c    |   2 +
>>>   drivers/gpu/drm/drm_edid.c         | 258 +++++++++++++++++++++++++++++++++++++
>>>   drivers/gpu/drm/drm_ioctl.c        |   5 +
>>>   drivers/gpu/drm/drm_probe_helper.c |   9 +-
>>>   include/drm/drm_connector.h        |   2 +
>>>   include/drm/drm_file.h             |   8 ++
>>>   include/drm/drm_modes.h            |  14 ++
>>>   include/uapi/drm/drm.h             |   7 +
>>>   include/uapi/drm/drm_mode.h        |   9 ++
>>>   9 files changed, 313 insertions(+), 1 deletion(-)
>>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIGaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=yaVFU4TjGY0gVF8El1uKcisy6TPsyCl9uN7Wsis-qhY&m=2OKRtIbkxjKURLp5pmoJ8lSSpsZfM6cXwik8mwS0U_4&s=oxPm-LzATMtdXVlKmybIHwYKhKvT-eeayLhz7xRtQkg&e=

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob
  2017-03-23 10:44     ` Jose Abreu
@ 2017-03-23 11:00       ` Daniel Vetter
  2017-03-27 13:47         ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Daniel Vetter @ 2017-03-23 11:00 UTC (permalink / raw)
  To: Jose Abreu; +Cc: dri-devel, Carlos Palminha

On Thu, Mar 23, 2017 at 10:44:16AM +0000, Jose Abreu wrote:
> Hi Daniel,
> 
> 
> On 23-03-2017 07:22, Daniel Vetter wrote:
> > On Wed, Mar 22, 2017 at 05:35:57PM +0000, Jose Abreu wrote:
> >> We can't expect userspace to have full support for all HDMI 2.0+
> >> features. Instead of expecting/waiting for userspace to support
> >> the new features add a knob, much like the stereo knob, so that
> >> DRM core will only expose the features when asked too.
> >>
> >> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> >> Cc: Carlos Palminha <palminha@synopsys.com>
> >> Cc: dri-devel@lists.freedesktop.org
> >> ---
> >>  drivers/gpu/drm/drm_ioctl.c | 5 +++++
> >>  include/drm/drm_file.h      | 8 ++++++++
> >>  include/uapi/drm/drm.h      | 7 +++++++
> >>  3 files changed, 20 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> >> index a7c61c2..2430e2e 100644
> >> --- a/drivers/gpu/drm/drm_ioctl.c
> >> +++ b/drivers/gpu/drm/drm_ioctl.c
> >> @@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
> >>  		file_priv->atomic = req->value;
> >>  		file_priv->universal_planes = req->value;
> >>  		break;
> >> +	case DRM_CLIENT_CAP_HDMI2:
> >> +		if (req->value > 1)
> >> +			return -EINVAL;
> >> +		file_priv->hdmi2_allowed = req->value;
> > Needs some userspace to make use of this (like the -modesetting x.org
> > driver).
> > -Daniel
> 
> I see your point but shouldn't this be merged before actually
> starting to work in userspace?

No, see

https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements

for reasons behind this and the precise flow.

Cheers, Daniel

> 
> Best regards,
> Jose Miguel Abreu
> 
> >
> >> +		break;
> >>  	default:
> >>  		return -EINVAL;
> >>  	}
> >> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> >> index 5dd27ae..7b97d85 100644
> >> --- a/include/drm/drm_file.h
> >> +++ b/include/drm/drm_file.h
> >> @@ -192,6 +192,14 @@ struct drm_file {
> >>  	unsigned is_master:1;
> >>  
> >>  	/**
> >> +	 * @hdmi2_allowed:
> >> +	 *
> >> +	 * True if client understands HDMI 2.0+ features like, for example,
> >> +	 * extended aspect ratios
> >> +	 */
> >> +	unsigned hdmi2_allowed:1;
> >> +
> >> +	/**
> >>  	 * @master:
> >>  	 *
> >>  	 * Master this node is currently associated with. Only relevant if
> >> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> >> index b2c5284..9e25138 100644
> >> --- a/include/uapi/drm/drm.h
> >> +++ b/include/uapi/drm/drm.h
> >> @@ -678,6 +678,13 @@ struct drm_get_cap {
> >>   */
> >>  #define DRM_CLIENT_CAP_ATOMIC	3
> >>  
> >> +/**
> >> + * DRM_CLIENT_CAP_HDMI2
> >> + *
> >> + * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace
> >> + */
> >> +#define DRM_CLIENT_CAP_HDMI2	4
> >> +
> >>  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
> >>  struct drm_set_client_cap {
> >>  	__u64 capability;
> >> -- 
> >> 1.9.1
> >>
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=4lBpQovdR7O8jeC7mV8SX9xvTypMtV8CBDEDg3bGgzw&s=h-gqFlO62i53pir0j2lJ-upE_bXQxhn3BK1nhdxoB6Y&e= 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to
  2017-03-23  7:25   ` Daniel Vetter
@ 2017-03-23 11:02     ` Jose Abreu
  0 siblings, 0 replies; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 11:02 UTC (permalink / raw)
  To: Daniel Vetter, Jose Abreu; +Cc: Carlos Palminha, dri-devel

Hi Daniel,


Thanks for the feedback!


On 23-03-2017 07:25, Daniel Vetter wrote:
> On Wed, Mar 22, 2017 at 05:36:01PM +0000, Jose Abreu wrote:
>> Perform sanity checks so that HDMI 2.0+ modes are not exported to
>> drivers or userspace unless asked to.
> Why? They're just normal modes, this doesn't make sense. If you want to
> filter the aspect ratio stuff, that makes sense, but exposing the modes
> with default aspect ratio by default should be doable.

Yes my initial intention was to hide the new aspect ratio modes
from drivers so that only HDMI 1.4 modes will be available to non
HDMI 2.0+ drivers. I think that we should avoid exposing these
new modes to drivers. They have higher pixel clock values and
sometimes EDID can declare that some modes should use a specific
colorspace (YCbCr 4:2:0), but this is another story.

My argument is not very strong though: Pixel clock must always be
checked by drivers and rejected if not supported as well as
aspect ratio flags. Do you know of any driver that does not do this?

>
> I'm also not sure how exactly this is supposed to interact with the
> partially reverted aspect ratio filtering from Shashank. I guess what you
> really want is the feature flag for exposing aspect ratio, and then filter
> accordingly.

So you propose to change this validation to only check for aspect
ratio flags? Shouldn't we play it safe and allow this flag so
that if anything besides aspect ratio arises we can safely
prevent drivers from getting the mode?

Notice that this flag is not for HDMI 2.0 modes only, it is for
HDMI 2.0+. I'm thinking about HDMI 2.1 which will include new
video modes and possible even new flags.

Best regards,
Jose Miguel Abreu

> -Daniel
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Carlos Palminha <palminha@synopsys.com>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>  drivers/gpu/drm/drm_connector.c    |  2 ++
>>  drivers/gpu/drm/drm_probe_helper.c |  9 ++++++++-
>>  include/drm/drm_modes.h            | 14 ++++++++++++++
>>  3 files changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
>> index 9f84761..430bb2b 100644
>> --- a/drivers/gpu/drm/drm_connector.c
>> +++ b/drivers/gpu/drm/drm_connector.c
>> @@ -1200,6 +1200,8 @@ static bool drm_mode_expose_to_userspace(const struct drm_display_mode *mode,
>>  	 */
>>  	if (!file_priv->stereo_allowed && drm_mode_is_stereo(mode))
>>  		return false;
>> +	if (!file_priv->hdmi2_allowed && drm_mode_is_hdmi2(mode))
>> +		return false;
>>  
>>  	return true;
>>  }
>> diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
>> index 85005d5..ddacb5d 100644
>> --- a/drivers/gpu/drm/drm_probe_helper.c
>> +++ b/drivers/gpu/drm/drm_probe_helper.c
>> @@ -77,6 +77,10 @@
>>  	    !(flags & DRM_MODE_FLAG_3D_MASK))
>>  		return MODE_NO_STEREO;
>>  
>> +	if ((mode->flags & DRM_MODE_FLAG_HDMI2) &&
>> +	    !(flags & DRM_MODE_FLAG_HDMI2))
>> +		return MODE_NO_HDMI2;
>> +
>>  	return MODE_OK;
>>  }
>>  
>> @@ -221,7 +225,8 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
>>   *    - drm_mode_validate_size() filters out modes larger than @maxX and @maxY
>>   *      (if specified)
>>   *    - drm_mode_validate_flag() checks the modes against basic connector
>> - *      capabilities (interlace_allowed,doublescan_allowed,stereo_allowed)
>> + *      capabilities (interlace_allowed,doublescan_allowed,stereo_allowed,
>> + *      hdmi2_allowed)
>>   *    - the optional &drm_connector_helper_funcs.mode_valid helper can perform
>>   *      driver and/or hardware specific checks
>>   *
>> @@ -336,6 +341,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
>>  		mode_flags |= DRM_MODE_FLAG_DBLSCAN;
>>  	if (connector->stereo_allowed)
>>  		mode_flags |= DRM_MODE_FLAG_3D_MASK;
>> +	if (connector->hdmi2_allowed)
>> +		mode_flags |= DRM_MODE_FLAG_HDMI2;
>>  
>>  	list_for_each_entry(mode, &connector->modes, head) {
>>  		if (mode->status == MODE_OK)
>> diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
>> index 6dd34280..83466ff 100644
>> --- a/include/drm/drm_modes.h
>> +++ b/include/drm/drm_modes.h
>> @@ -80,6 +80,7 @@
>>   * @MODE_ONE_SIZE: only one resolution is supported
>>   * @MODE_NO_REDUCED: monitor doesn't accept reduced blanking
>>   * @MODE_NO_STEREO: stereo modes not supported
>> + * @MODE_NO_HDMI2: HDMI 2.0+ modes not supported
>>   * @MODE_STALE: mode has become stale
>>   * @MODE_BAD: unspecified reason
>>   * @MODE_ERROR: error condition
>> @@ -124,6 +125,7 @@ enum drm_mode_status {
>>  	MODE_ONE_SIZE,
>>  	MODE_NO_REDUCED,
>>  	MODE_NO_STEREO,
>> +	MODE_NO_HDMI2,
>>  	MODE_STALE = -3,
>>  	MODE_BAD = -2,
>>  	MODE_ERROR = -1
>> @@ -422,6 +424,18 @@ static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
>>  	return mode->flags & DRM_MODE_FLAG_3D_MASK;
>>  }
>>  
>> +/**
>> + * drm_mode_is_hdmi2 - check for HDMI 2.0+ mode flag
>> + * @mode: drm_display_mode to check
>> + *
>> + * Returns:
>> + * True if the mode is HDMI 2.0+ mode, false if not
>> + */
>> +static inline bool drm_mode_is_hdmi2(const struct drm_display_mode *mode)
>> +{
>> +	return mode->flags & DRM_MODE_FLAG_HDMI2;
>> +}
>> +
>>  struct drm_connector;
>>  struct drm_cmdline_mode;
>>  
>> -- 
>> 1.9.1
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=ZrB1FUUWlSj6zYGBcO_CFTd1XHdKAzijVyu1XqZ5gfc&s=fMJ9nzD0WR6AhnAOZug1j9qT7yb0_i3tu8BC_D6qiGs&e= 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-23  8:11   ` Andrzej Hajda
@ 2017-03-23 11:04     ` Jose Abreu
  2017-03-23 11:17       ` Andrzej Hajda
  2017-03-23 11:07     ` Sharma, Shashank
  1 sibling, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 11:04 UTC (permalink / raw)
  To: Andrzej Hajda, Jose Abreu, dri-devel; +Cc: Carlos Palminha

Hi Andrzej,


Thanks for the feedback!

On 23-03-2017 08:11, Andrzej Hajda wrote:
> On 22.03.2017 18:35, Jose Abreu wrote:
>> This patch completes CEA table of video modes so that VIC 1-107
>> are now available. Use the HDMI 2.0+ flag to signal these are
>> modes for HDMI 2.0 onwards.
> edid_cea_modes array is used in different contexts, simple extensions of
> the array with modes not present in HDMI < 2.0 can result in different
> behavior of drivers.
> There should be put sentinels somewhere to limit table lookup to old
> VICs if device/driver/receiver is not HDMI2.0 compliant.
> The only situation I am aware of at the moment is infoframe generation
> code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
> field in AVI infoframe should be 0 for 4K modes and vendor infoframe
> should be generated with proper HDMI-VIC. With current infoframe helpers
> and this patch it will not work this way.

But this is what I do in patch 5/5 (see
https://patchwork.kernel.org/patch/9640205/), unless drivers ask
to I don't expose the new modes.

Best regards,
Jose Miguel Abreu

>
> Regards
> Andrzej
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Carlos Palminha <palminha@synopsys.com>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>  drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 258 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index fad3d44..90080368 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -1001,6 +1001,264 @@ struct minimode {
>>  		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>  		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>>  	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
>> +	/* 65 - 1280x720@24Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 66 - 1280x720@25Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
>> +		   3740, 3960, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 67 - 1280x720@30Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 68 - 1280x720@50Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 69 - 1280x720@60Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 70 - 1280x720@100Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 71 - 1280x720@120Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 72 - 1920x1080@24Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
>> +		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 73 - 1920x1080@25Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 74 - 1920x1080@30Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 75 - 1920x1080@50Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 76 - 1920x1080@60Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 77 - 1920x1080@100Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
>> +		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 78 - 1920x1080@120Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 79 - 1680x720@24Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 80 - 1680x720@25Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
>> +		   2948, 3168, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 81 - 1680x720@30Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
>> +		   2420, 2640, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 82 - 1680x720@50Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 83 - 1680x720@60Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 84 - 1680x720@100Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 85 - 1680x720@120Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 86 - 2560x1080@24Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
>> +		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 87 - 2560x1080@25Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
>> +		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 88 - 2560x1080@30Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
>> +		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 89 - 2560x1080@50Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
>> +		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 90 - 2560x1080@60Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
>> +		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 91 - 2560x1080@100Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
>> +		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 92 - 2560x1080@120Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
>> +		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 93 - 3840x2160p@24Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
>> +	/* 94 - 3840x2160p@25Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 95 - 3840x2160p@30Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 96 - 3840x2160p@50Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 97 - 3840x2160p@60Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 98 - 4096x2160p@24Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 99 - 4096x2160p@25Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 100 - 4096x2160p@30Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 101 - 4096x2160p@50Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 102 - 4096x2160p@60Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 103 - 3840x2160p@24Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 104 - 3840x2160p@25Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 105 - 3840x2160p@30Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 106 - 3840x2160p@50Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 107 - 3840x2160p@60Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>  };
>>  
>>  /*
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-23  8:11   ` Andrzej Hajda
  2017-03-23 11:04     ` Jose Abreu
@ 2017-03-23 11:07     ` Sharma, Shashank
  2017-03-23 15:26       ` Sharma, Shashank
  1 sibling, 1 reply; 28+ messages in thread
From: Sharma, Shashank @ 2017-03-23 11:07 UTC (permalink / raw)
  To: Andrzej Hajda, Jose Abreu, dri-devel; +Cc: Carlos Palminha

Regards

Shashank


On 3/23/2017 10:11 AM, Andrzej Hajda wrote:
> On 22.03.2017 18:35, Jose Abreu wrote:
>> This patch completes CEA table of video modes so that VIC 1-107
>> are now available. Use the HDMI 2.0+ flag to signal these are
>> modes for HDMI 2.0 onwards.
> edid_cea_modes array is used in different contexts, simple extensions of
> the array with modes not present in HDMI < 2.0 can result in different
> behavior of drivers.
> There should be put sentinels somewhere to limit table lookup to old
> VICs if device/driver/receiver is not HDMI2.0 compliant.
> The only situation I am aware of at the moment is infoframe generation
> code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
> field in AVI infoframe should be 0 for 4K modes and vendor infoframe
> should be generated with proper HDMI-VIC. With current infoframe helpers
> and this patch it will not work this way.
>
> Regards
> Andrzej
I had a small discussion with Ville on this, and we were thinking on 
adding monitor info before
VIC calculation in match_cea_modes() function, so that it should give a 
VIC of 0 for HDMI 1.4 sinks
but appropriate VIC for HDMI 2.0 sink. Consider WIP.

- Shashank
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Carlos Palminha <palminha@synopsys.com>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>   drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 258 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index fad3d44..90080368 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -1001,6 +1001,264 @@ struct minimode {
>>   		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>   		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>>   	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
>> +	/* 65 - 1280x720@24Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 66 - 1280x720@25Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
>> +		   3740, 3960, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 67 - 1280x720@30Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 68 - 1280x720@50Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 69 - 1280x720@60Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 70 - 1280x720@100Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 71 - 1280x720@120Hz */
>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 72 - 1920x1080@24Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
>> +		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 73 - 1920x1080@25Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 74 - 1920x1080@30Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 75 - 1920x1080@50Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 76 - 1920x1080@60Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 77 - 1920x1080@100Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
>> +		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 78 - 1920x1080@120Hz */
>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 79 - 1680x720@24Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 80 - 1680x720@25Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
>> +		   2948, 3168, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 81 - 1680x720@30Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
>> +		   2420, 2640, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 82 - 1680x720@50Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 83 - 1680x720@60Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 84 - 1680x720@100Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 85 - 1680x720@120Hz */
>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 86 - 2560x1080@24Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
>> +		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 87 - 2560x1080@25Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
>> +		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 88 - 2560x1080@30Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
>> +		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 89 - 2560x1080@50Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
>> +		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 90 - 2560x1080@60Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
>> +		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 91 - 2560x1080@100Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
>> +		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 92 - 2560x1080@120Hz */
>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
>> +		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>> +	/* 93 - 3840x2160p@24Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
>> +	/* 94 - 3840x2160p@25Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 95 - 3840x2160p@30Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 96 - 3840x2160p@50Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 97 - 3840x2160p@60Hz 16:9 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>> +	/* 98 - 4096x2160p@24Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 99 - 4096x2160p@25Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 100 - 4096x2160p@30Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 101 - 4096x2160p@50Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 102 - 4096x2160p@60Hz 256:135 */
>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>> +	/* 103 - 3840x2160p@24Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 104 - 3840x2160p@25Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 105 - 3840x2160p@30Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 106 - 3840x2160p@50Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>> +	/* 107 - 3840x2160p@60Hz 64:27 */
>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>> +		   DRM_MODE_FLAG_HDMI2),
>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>   };
>>   
>>   /*
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-23 11:04     ` Jose Abreu
@ 2017-03-23 11:17       ` Andrzej Hajda
  2017-03-23 11:35         ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Andrzej Hajda @ 2017-03-23 11:17 UTC (permalink / raw)
  To: Jose Abreu, dri-devel; +Cc: Carlos Palminha

On 23.03.2017 12:04, Jose Abreu wrote:
> Hi Andrzej,
>
>
> Thanks for the feedback!
>
> On 23-03-2017 08:11, Andrzej Hajda wrote:
>> On 22.03.2017 18:35, Jose Abreu wrote:
>>> This patch completes CEA table of video modes so that VIC 1-107
>>> are now available. Use the HDMI 2.0+ flag to signal these are
>>> modes for HDMI 2.0 onwards.
>> edid_cea_modes array is used in different contexts, simple extensions of
>> the array with modes not present in HDMI < 2.0 can result in different
>> behavior of drivers.
>> There should be put sentinels somewhere to limit table lookup to old
>> VICs if device/driver/receiver is not HDMI2.0 compliant.
>> The only situation I am aware of at the moment is infoframe generation
>> code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
>> field in AVI infoframe should be 0 for 4K modes and vendor infoframe
>> should be generated with proper HDMI-VIC. With current infoframe helpers
>> and this patch it will not work this way.
> But this is what I do in patch 5/5 (see
> https://patchwork.kernel.org/patch/9640205/), unless drivers ask
> to I don't expose the new modes.

I do not see how it is related to infoframe generation. Look at body of
drm_hdmi_avi_infoframe_from_display_mode, it calls drm_match_cea_mode,
which looks for given mode in edid_cea_modes array.
Anyway if there is or will be a patch which deals with it, it should be
applied before extending edid_cea_modes array, not after.


Regards
Andrzej

>
> Best regards,
> Jose Miguel Abreu
>
>> Regards
>> Andrzej
>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>> Cc: dri-devel@lists.freedesktop.org
>>> ---
>>>  drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 258 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>> index fad3d44..90080368 100644
>>> --- a/drivers/gpu/drm/drm_edid.c
>>> +++ b/drivers/gpu/drm/drm_edid.c
>>> @@ -1001,6 +1001,264 @@ struct minimode {
>>>  		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>  		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>>>  	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
>>> +	/* 65 - 1280x720@24Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 66 - 1280x720@25Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
>>> +		   3740, 3960, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 67 - 1280x720@30Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 68 - 1280x720@50Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
>>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 69 - 1280x720@60Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
>>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 70 - 1280x720@100Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
>>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 71 - 1280x720@120Hz */
>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
>>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 72 - 1920x1080@24Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
>>> +		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 73 - 1920x1080@25Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
>>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 74 - 1920x1080@30Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 75 - 1920x1080@50Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
>>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 76 - 1920x1080@60Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 77 - 1920x1080@100Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
>>> +		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 78 - 1920x1080@120Hz */
>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 79 - 1680x720@24Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 80 - 1680x720@25Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
>>> +		   2948, 3168, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 81 - 1680x720@30Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
>>> +		   2420, 2640, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 82 - 1680x720@50Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
>>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 83 - 1680x720@60Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
>>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 84 - 1680x720@100Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
>>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 85 - 1680x720@120Hz */
>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
>>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 86 - 2560x1080@24Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
>>> +		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 87 - 2560x1080@25Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
>>> +		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 88 - 2560x1080@30Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
>>> +		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 89 - 2560x1080@50Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
>>> +		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 90 - 2560x1080@60Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
>>> +		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 91 - 2560x1080@100Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
>>> +		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 92 - 2560x1080@120Hz */
>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
>>> +		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>> +	/* 93 - 3840x2160p@24Hz 16:9 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
>>> +	/* 94 - 3840x2160p@25Hz 16:9 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +	/* 95 - 3840x2160p@30Hz 16:9 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +	/* 96 - 3840x2160p@50Hz 16:9 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +	/* 97 - 3840x2160p@60Hz 16:9 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +	/* 98 - 4096x2160p@24Hz 256:135 */
>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>> +	/* 99 - 4096x2160p@25Hz 256:135 */
>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
>>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>> +	/* 100 - 4096x2160p@30Hz 256:135 */
>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
>>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>> +	/* 101 - 4096x2160p@50Hz 256:135 */
>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
>>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>> +	/* 102 - 4096x2160p@60Hz 256:135 */
>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
>>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>> +	/* 103 - 3840x2160p@24Hz 64:27 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>> +	/* 104 - 3840x2160p@25Hz 64:27 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>> +	/* 105 - 3840x2160p@30Hz 64:27 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>> +	/* 106 - 3840x2160p@50Hz 64:27 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>> +	/* 107 - 3840x2160p@60Hz 64:27 */
>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +		   DRM_MODE_FLAG_HDMI2),
>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>  };
>>>  
>>>  /*
>
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-23 11:17       ` Andrzej Hajda
@ 2017-03-23 11:35         ` Jose Abreu
  2017-03-23 14:50           ` Andrzej Hajda
  0 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 11:35 UTC (permalink / raw)
  To: Andrzej Hajda, Jose Abreu, dri-devel; +Cc: Carlos Palminha

Hi Andrzej,


On 23-03-2017 11:17, Andrzej Hajda wrote:
> On 23.03.2017 12:04, Jose Abreu wrote:
>> Hi Andrzej,
>>
>>
>> Thanks for the feedback!
>>
>> On 23-03-2017 08:11, Andrzej Hajda wrote:
>>> On 22.03.2017 18:35, Jose Abreu wrote:
>>>> This patch completes CEA table of video modes so that VIC 1-107
>>>> are now available. Use the HDMI 2.0+ flag to signal these are
>>>> modes for HDMI 2.0 onwards.
>>> edid_cea_modes array is used in different contexts, simple extensions of
>>> the array with modes not present in HDMI < 2.0 can result in different
>>> behavior of drivers.
>>> There should be put sentinels somewhere to limit table lookup to old
>>> VICs if device/driver/receiver is not HDMI2.0 compliant.
>>> The only situation I am aware of at the moment is infoframe generation
>>> code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
>>> field in AVI infoframe should be 0 for 4K modes and vendor infoframe
>>> should be generated with proper HDMI-VIC. With current infoframe helpers
>>> and this patch it will not work this way.
>> But this is what I do in patch 5/5 (see
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_patch_9640205_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=c7Qf9lk2pdXRbmjFNPSsZsy7LKiZWrqGlE72r-OTA-M&s=37RkfhQjJpjdKmQniKnhZwb1vtwb6HXSxY2Y7HrNlp4&e= ), unless drivers ask
>> to I don't expose the new modes.
> I do not see how it is related to infoframe generation. Look at body of
> drm_hdmi_avi_infoframe_from_display_mode, it calls drm_match_cea_mode,
> which looks for given mode in edid_cea_modes array.

Yes but drm_hdmi_avi_infoframe_from_display_mode is called from
driver context, so the mode bust be previously probed by the drm
core, and it isn't if the hdmi2_allowed flag is not set so the
mode will never reach the driver and the infoframe will never be
built. And also if the receiver is not HDMI 2.0 compliant then
the mode will not also be probed.

But I see a flaw here: If the user specify manually the mode then
it will be passed to driver which will try to match with CEA
table. Is this the scenario you were thinking about? I think with
the new DRM_MODE_FLAG_HDMI2 flag this will not happen, see this:

    - Modesetting X driver (for example) does not set HDMI 2 cap
    - As the flag is not set HDMI 2 modes will not be exposed to
userspace
    - If the user specifies the mode the modesetting driver will
not set HDMI 2 flag
    - As the flag is not set then
drm_mode_equal_no_clocks_no_stereo will not match the mode

Of course this needs patches to modesetting X driver, which are
not in this series. What do you think?

> Anyway if there is or will be a patch which deals with it, it should be
> applied before extending edid_cea_modes array, not after.

Right, I will correct this :)

Best regards,
Jose Miguel Abreu

>
>
> Regards
> Andrzej
>
>> Best regards,
>> Jose Miguel Abreu
>>
>>> Regards
>>> Andrzej
>>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>>> Cc: dri-devel@lists.freedesktop.org
>>>> ---
>>>>  drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
>>>>  1 file changed, 258 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>>> index fad3d44..90080368 100644
>>>> --- a/drivers/gpu/drm/drm_edid.c
>>>> +++ b/drivers/gpu/drm/drm_edid.c
>>>> @@ -1001,6 +1001,264 @@ struct minimode {
>>>>  		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>>  		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>>>>  	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
>>>> +	/* 65 - 1280x720@24Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
>>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 66 - 1280x720@25Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
>>>> +		   3740, 3960, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 67 - 1280x720@30Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
>>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 68 - 1280x720@50Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
>>>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 69 - 1280x720@60Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
>>>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 70 - 1280x720@100Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
>>>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 71 - 1280x720@120Hz */
>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
>>>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 72 - 1920x1080@24Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
>>>> +		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 73 - 1920x1080@25Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
>>>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 74 - 1920x1080@30Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
>>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 75 - 1920x1080@50Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
>>>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 76 - 1920x1080@60Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
>>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 77 - 1920x1080@100Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
>>>> +		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 78 - 1920x1080@120Hz */
>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
>>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 79 - 1680x720@24Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
>>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 80 - 1680x720@25Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
>>>> +		   2948, 3168, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 81 - 1680x720@30Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
>>>> +		   2420, 2640, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 82 - 1680x720@50Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
>>>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 83 - 1680x720@60Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
>>>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 84 - 1680x720@100Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
>>>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 85 - 1680x720@120Hz */
>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
>>>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 86 - 2560x1080@24Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
>>>> +		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 87 - 2560x1080@25Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
>>>> +		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 88 - 2560x1080@30Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
>>>> +		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 89 - 2560x1080@50Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
>>>> +		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 90 - 2560x1080@60Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
>>>> +		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 91 - 2560x1080@100Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
>>>> +		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 92 - 2560x1080@120Hz */
>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
>>>> +		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>> +	/* 93 - 3840x2160p@24Hz 16:9 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
>>>> +	/* 94 - 3840x2160p@25Hz 16:9 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
>>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>> +	/* 95 - 3840x2160p@30Hz 16:9 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>> +	/* 96 - 3840x2160p@50Hz 16:9 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>> +	/* 97 - 3840x2160p@60Hz 16:9 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>> +	/* 98 - 4096x2160p@24Hz 256:135 */
>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
>>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>> +	/* 99 - 4096x2160p@25Hz 256:135 */
>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
>>>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>> +	/* 100 - 4096x2160p@30Hz 256:135 */
>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
>>>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>> +	/* 101 - 4096x2160p@50Hz 256:135 */
>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
>>>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>> +	/* 102 - 4096x2160p@60Hz 256:135 */
>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
>>>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>> +	/* 103 - 3840x2160p@24Hz 64:27 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>> +	/* 104 - 3840x2160p@25Hz 64:27 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>> +	/* 105 - 3840x2160p@30Hz 64:27 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>> +	/* 106 - 3840x2160p@50Hz 64:27 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>> +	/* 107 - 3840x2160p@60Hz 64:27 */
>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>>  };
>>>>  
>>>>  /*
>>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-23 11:35         ` Jose Abreu
@ 2017-03-23 14:50           ` Andrzej Hajda
  0 siblings, 0 replies; 28+ messages in thread
From: Andrzej Hajda @ 2017-03-23 14:50 UTC (permalink / raw)
  To: Jose Abreu, dri-devel; +Cc: Carlos Palminha

On 23.03.2017 12:35, Jose Abreu wrote:
> Hi Andrzej,
>
>
> On 23-03-2017 11:17, Andrzej Hajda wrote:
>> On 23.03.2017 12:04, Jose Abreu wrote:
>>> Hi Andrzej,
>>>
>>>
>>> Thanks for the feedback!
>>>
>>> On 23-03-2017 08:11, Andrzej Hajda wrote:
>>>> On 22.03.2017 18:35, Jose Abreu wrote:
>>>>> This patch completes CEA table of video modes so that VIC 1-107
>>>>> are now available. Use the HDMI 2.0+ flag to signal these are
>>>>> modes for HDMI 2.0 onwards.
>>>> edid_cea_modes array is used in different contexts, simple extensions of
>>>> the array with modes not present in HDMI < 2.0 can result in different
>>>> behavior of drivers.
>>>> There should be put sentinels somewhere to limit table lookup to old
>>>> VICs if device/driver/receiver is not HDMI2.0 compliant.
>>>> The only situation I am aware of at the moment is infoframe generation
>>>> code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
>>>> field in AVI infoframe should be 0 for 4K modes and vendor infoframe
>>>> should be generated with proper HDMI-VIC. With current infoframe helpers
>>>> and this patch it will not work this way.
>>> But this is what I do in patch 5/5 (see
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.kernel.org_patch_9640205_&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=c7Qf9lk2pdXRbmjFNPSsZsy7LKiZWrqGlE72r-OTA-M&s=37RkfhQjJpjdKmQniKnhZwb1vtwb6HXSxY2Y7HrNlp4&e= ), unless drivers ask
>>> to I don't expose the new modes.
>> I do not see how it is related to infoframe generation. Look at body of
>> drm_hdmi_avi_infoframe_from_display_mode, it calls drm_match_cea_mode,
>> which looks for given mode in edid_cea_modes array.
> Yes but drm_hdmi_avi_infoframe_from_display_mode is called from
> driver context, so the mode bust be previously probed by the drm
> core, and it isn't if the hdmi2_allowed flag is not set so the
> mode will never reach the driver and the infoframe will never be
> built. And also if the receiver is not HDMI 2.0 compliant then
> the mode will not also be probed.
>
> But I see a flaw here: If the user specify manually the mode then
> it will be passed to driver which will try to match with CEA
> table. Is this the scenario you were thinking about? I think with
> the new DRM_MODE_FLAG_HDMI2 flag this will not happen, see this:
>
>     - Modesetting X driver (for example) does not set HDMI 2 cap
>     - As the flag is not set HDMI 2 modes will not be exposed to
> userspace
>     - If the user specifies the mode the modesetting driver will
> not set HDMI 2 flag
>     - As the flag is not set then
> drm_mode_equal_no_clocks_no_stereo will not match the mode

OK I see, HDMI2 flag in mode will distinguish between 4K modes in
HDMI1.4 and HDMI2.0, even if all other fields are the same.
For now it looks safe indeed in case of HDMI<2 devices.
I am not sure if this approach will not generate problems with drivers
supporting both HDMI2 and 4K modes, but this 'issue' is already raised
by Daniel.

Regards
Andrzej


>
> Of course this needs patches to modesetting X driver, which are
> not in this series. What do you think?
>
>> Anyway if there is or will be a patch which deals with it, it should be
>> applied before extending edid_cea_modes array, not after.
> Right, I will correct this :)
>
> Best regards,
> Jose Miguel Abreu
>
>>
>> Regards
>> Andrzej
>>
>>> Best regards,
>>> Jose Miguel Abreu
>>>
>>>> Regards
>>>> Andrzej
>>>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>>>> Cc: dri-devel@lists.freedesktop.org
>>>>> ---
>>>>>  drivers/gpu/drm/drm_edid.c | 258 +++++++++++++++++++++++++++++++++++++++++++++
>>>>>  1 file changed, 258 insertions(+)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>>>> index fad3d44..90080368 100644
>>>>> --- a/drivers/gpu/drm/drm_edid.c
>>>>> +++ b/drivers/gpu/drm/drm_edid.c
>>>>> @@ -1001,6 +1001,264 @@ struct minimode {
>>>>>  		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>>>  		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>>>>>  	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9, },
>>>>> +	/* 65 - 1280x720@24Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
>>>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 66 - 1280x720@25Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
>>>>> +		   3740, 3960, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 67 - 1280x720@30Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
>>>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 68 - 1280x720@50Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
>>>>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 69 - 1280x720@60Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
>>>>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 70 - 1280x720@100Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
>>>>> +		   1760, 1980, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 71 - 1280x720@120Hz */
>>>>> +	{ DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
>>>>> +		   1430, 1650, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 72 - 1920x1080@24Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
>>>>> +		   2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 73 - 1920x1080@25Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
>>>>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 74 - 1920x1080@30Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
>>>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 75 - 1920x1080@50Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
>>>>> +		   2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 76 - 1920x1080@60Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
>>>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	  .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 77 - 1920x1080@100Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
>>>>> +		   2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	 .vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 78 - 1920x1080@120Hz */
>>>>> +	{ DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
>>>>> +		   2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	 .vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 79 - 1680x720@24Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
>>>>> +		   3080, 3300, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 80 - 1680x720@25Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
>>>>> +		   2948, 3168, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 81 - 1680x720@30Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
>>>>> +		   2420, 2640, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 82 - 1680x720@50Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
>>>>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 83 - 1680x720@60Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
>>>>> +		   1980, 2200, 0, 720, 725, 730, 750, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 84 - 1680x720@100Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
>>>>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 85 - 1680x720@120Hz */
>>>>> +	{ DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
>>>>> +		   1780, 2000, 0, 720, 725, 730, 825, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 86 - 2560x1080@24Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
>>>>> +		   3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 87 - 2560x1080@25Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
>>>>> +		   3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 88 - 2560x1080@30Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
>>>>> +		   3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 89 - 2560x1080@50Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
>>>>> +		   3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 90 - 2560x1080@60Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
>>>>> +		   2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 91 - 2560x1080@100Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
>>>>> +		   2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 100, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 92 - 2560x1080@120Hz */
>>>>> +	{ DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
>>>>> +		   3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 120, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27, },
>>>>> +	/* 93 - 3840x2160p@24Hz 16:9 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9,},
>>>>> +	/* 94 - 3840x2160p@25Hz 16:9 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
>>>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>>> +	/* 95 - 3840x2160p@30Hz 16:9 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>>> +	/* 96 - 3840x2160p@50Hz 16:9 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>>> +	/* 97 - 3840x2160p@60Hz 16:9 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>>>> +	/* 98 - 4096x2160p@24Hz 256:135 */
>>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
>>>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>>> +	/* 99 - 4096x2160p@25Hz 256:135 */
>>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
>>>>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>>> +	/* 100 - 4096x2160p@30Hz 256:135 */
>>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
>>>>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>>> +	/* 101 - 4096x2160p@50Hz 256:135 */
>>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
>>>>> +		   5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>>> +	/* 102 - 4096x2160p@60Hz 256:135 */
>>>>> +	{ DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
>>>>> +		   4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_256_135},
>>>>> +	/* 103 - 3840x2160p@24Hz 64:27 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>>>> +		   5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 24, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>>> +	/* 104 - 3840x2160p@25Hz 64:27 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>>> +	/* 105 - 3840x2160p@30Hz 64:27 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>>> +	/* 106 - 3840x2160p@50Hz 64:27 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>>>> +		   4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>>> +	/* 107 - 3840x2160p@60Hz 64:27 */
>>>>> +	{ DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>>>> +		   4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>>>> +		   DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>>>> +		   DRM_MODE_FLAG_HDMI2),
>>>>> +	.vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_64_27},
>>>>>  };
>>>>>  
>>>>>  /*
>
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
  2017-03-22 17:35 ` [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag Jose Abreu
@ 2017-03-23 15:16   ` Ville Syrjälä
  2017-03-23 18:54     ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Ville Syrjälä @ 2017-03-23 15:16 UTC (permalink / raw)
  To: Jose Abreu; +Cc: Carlos Palminha, dri-devel

On Wed, Mar 22, 2017 at 05:35:58PM +0000, Jose Abreu wrote:
> Add the HDMI 2.0 aspect ratio flags (64:27 and 256:135) and a new
> flag which will signal userspace that this is a HDMI 2.0+ mode. It
> is expected that these new flags will not be exported to userspace
> unless client asks to.

W.r.t. the aspect ratio userspace story, there was some discussion
on #dri-devel recently about extending the xrandr protocol for 3d stereo
support. If that is going to happen then it might make sense to try
and get the aspect ratio stuff also included at the same time so
that we would only have to deal with one protocol bump.

> 
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  include/uapi/drm/drm_mode.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index 8c67fc0..62e679c 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -89,6 +89,8 @@
>  #define DRM_MODE_PICTURE_ASPECT_NONE		0
>  #define DRM_MODE_PICTURE_ASPECT_4_3		1
>  #define DRM_MODE_PICTURE_ASPECT_16_9		2
> +#define DRM_MODE_PICTURE_ASPECT_64_27		3
> +#define DRM_MODE_PICTURE_ASPECT_256_135		4
>  
>  /* Aspect ratio flag bitmask (4 bits 22:19) */
>  #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
> @@ -98,6 +100,13 @@
>  			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
>  #define  DRM_MODE_FLAG_PIC_AR_16_9 \
>  			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
> +#define  DRM_MODE_FLAG_PIC_AR_64_27 \
> +			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
> +#define  DRM_MODE_FLAG_PIC_AR_256_135 \
> +			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
> +
> +/* HDMI 2.0+ mode flag: will only be set if client supports it */
> +#define DRM_MODE_FLAG_HDMI2			(1<<23)
>  
>  /* DPMS flags */
>  /* bit compatible with the xorg definitions. */
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes
  2017-03-23 11:07     ` Sharma, Shashank
@ 2017-03-23 15:26       ` Sharma, Shashank
  0 siblings, 0 replies; 28+ messages in thread
From: Sharma, Shashank @ 2017-03-23 15:26 UTC (permalink / raw)
  To: Andrzej Hajda, Jose Abreu, dri-devel; +Cc: Carlos Palminha

You guys might wanna use this series, to solve this problem.

https://patchwork.freedesktop.org/series/21773/

Patch 1: completes the CEA modes 1-107

Patch 2: Protects HDMI 1.4 monitors from HDMI 2.0 VICs


Regards
Shashank
On 3/23/2017 1:07 PM, Sharma, Shashank wrote:
> Regards
>
> Shashank
>
>
> On 3/23/2017 10:11 AM, Andrzej Hajda wrote:
>> On 22.03.2017 18:35, Jose Abreu wrote:
>>> This patch completes CEA table of video modes so that VIC 1-107
>>> are now available. Use the HDMI 2.0+ flag to signal these are
>>> modes for HDMI 2.0 onwards.
>> edid_cea_modes array is used in different contexts, simple extensions of
>> the array with modes not present in HDMI < 2.0 can result in different
>> behavior of drivers.
>> There should be put sentinels somewhere to limit table lookup to old
>> VICs if device/driver/receiver is not HDMI2.0 compliant.
>> The only situation I am aware of at the moment is infoframe generation
>> code. For TVs not supporting 4K modes but not HDMI 2.0 compatible, VIC
>> field in AVI infoframe should be 0 for 4K modes and vendor infoframe
>> should be generated with proper HDMI-VIC. With current infoframe helpers
>> and this patch it will not work this way.
>>
>> Regards
>> Andrzej
> I had a small discussion with Ville on this, and we were thinking on 
> adding monitor info before
> VIC calculation in match_cea_modes() function, so that it should give 
> a VIC of 0 for HDMI 1.4 sinks
> but appropriate VIC for HDMI 2.0 sink. Consider WIP.
>
> - Shashank
>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>> Cc: dri-devel@lists.freedesktop.org
>>> ---
>>>   drivers/gpu/drm/drm_edid.c | 258 
>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>   1 file changed, 258 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>> index fad3d44..90080368 100644
>>> --- a/drivers/gpu/drm/drm_edid.c
>>> +++ b/drivers/gpu/drm/drm_edid.c
>>> @@ -1001,6 +1001,264 @@ struct minimode {
>>>              2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>>              DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC),
>>>        .vrefresh = 100, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_16_9, },
>>> +    /* 65 - 1280x720@24Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 59400, 1280, 3040,
>>> +           3080, 3300, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 66 - 1280x720@25Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3700,
>>> +           3740, 3960, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 25, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 67 - 1280x720@30Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 3040,
>>> +           3080, 3300, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 30, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 68 - 1280x720@50Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1720,
>>> +           1760, 1980, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 50, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 69 - 1280x720@60Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 74250, 1280, 1390,
>>> +           1430, 1650, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 60, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 70 - 1280x720@100Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1720,
>>> +           1760, 1980, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 100, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 71 - 1280x720@120Hz */
>>> +    { DRM_MODE("1280x720", DRM_MODE_TYPE_DRIVER, 148500, 1280, 1390,
>>> +           1430, 1650, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 120, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 72 - 1920x1080@24Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2558,
>>> +           2602, 2750, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 73 - 1920x1080@25Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2448,
>>> +           2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 25, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 74 - 1920x1080@30Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 74250, 1920, 2008,
>>> +           2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 30, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 75 - 1920x1080@50Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2448,
>>> +           2492, 2640, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 50, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 76 - 1920x1080@60Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 148500, 1920, 2008,
>>> +           2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +      .vrefresh = 60, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 77 - 1920x1080@100Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2448,
>>> +           2492, 2640, 0, 1080, 1084, 1094, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +     .vrefresh = 100, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 78 - 1920x1080@120Hz */
>>> +    { DRM_MODE("1920x1080", DRM_MODE_TYPE_DRIVER, 297000, 1920, 2008,
>>> +           2052, 2200, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +     .vrefresh = 120, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 79 - 1680x720@24Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 3040,
>>> +           3080, 3300, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 80 - 1680x720@25Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2908,
>>> +           2948, 3168, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 25, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 81 - 1680x720@30Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 59400, 1680, 2380,
>>> +           2420, 2640, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 30, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 82 - 1680x720@50Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 82500, 1680, 1940,
>>> +           1980, 2200, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 50, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 83 - 1680x720@60Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 99000, 1680, 1940,
>>> +           1980, 2200, 0, 720, 725, 730, 750, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 60, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 84 - 1680x720@100Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 165000, 1680, 1740,
>>> +           1780, 2000, 0, 720, 725, 730, 825, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 100, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 85 - 1680x720@120Hz */
>>> +    { DRM_MODE("1680x720", DRM_MODE_TYPE_DRIVER, 198000, 1680, 1740,
>>> +           1780, 2000, 0, 720, 725, 730, 825, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 120, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 86 - 2560x1080@24Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 99000, 2560, 3558,
>>> +           3602, 3750, 0, 1080, 1084, 1089, 1100, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 87 - 2560x1080@25Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 90000, 2560, 3008,
>>> +           3052, 3200, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 25, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 88 - 2560x1080@30Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 118800, 2560, 3328,
>>> +           3372, 3520, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 30, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 89 - 2560x1080@50Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 185625, 2560, 3108,
>>> +           3152, 3300, 0, 1080, 1084, 1089, 1125, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 50, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 90 - 2560x1080@60Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 198000, 2560, 2808,
>>> +           2852, 3000, 0, 1080, 1084, 1089, 1100, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 60, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 91 - 2560x1080@100Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 371250, 2560, 2778,
>>> +           2822, 2970, 0, 1080, 1084, 1089, 1250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 100, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 92 - 2560x1080@120Hz */
>>> +    { DRM_MODE("2560x1080", DRM_MODE_TYPE_DRIVER, 495000, 2560, 3108,
>>> +           3152, 3300, 0, 1080, 1084, 1089, 1250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 120, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27, },
>>> +    /* 93 - 3840x2160p@24Hz 16:9 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>> +           5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_16_9,},
>>> +    /* 94 - 3840x2160p@25Hz 16:9 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4896,
>>> +           4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 25, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +    /* 95 - 3840x2160p@30Hz 16:9 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>> +           4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 30, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +    /* 96 - 3840x2160p@50Hz 16:9 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>> +           4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 50, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +    /* 97 - 3840x2160p@60Hz 16:9 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>> +           4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 60, .picture_aspect_ratio = HDMI_PICTURE_ASPECT_16_9},
>>> +    /* 98 - 4096x2160p@24Hz 256:135 */
>>> +    { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5116,
>>> +           5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_256_135},
>>> +    /* 99 - 4096x2160p@25Hz 256:135 */
>>> +    { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 5064,
>>> +           5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 25, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_256_135},
>>> +    /* 100 - 4096x2160p@30Hz 256:135 */
>>> +    { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 297000, 4096, 4184,
>>> +           4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 30, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_256_135},
>>> +    /* 101 - 4096x2160p@50Hz 256:135 */
>>> +    { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 5064,
>>> +           5152, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 50, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_256_135},
>>> +    /* 102 - 4096x2160p@60Hz 256:135 */
>>> +    { DRM_MODE("4096x2160", DRM_MODE_TYPE_DRIVER, 594000, 4096, 4184,
>>> +           4272, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 60, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_256_135},
>>> +    /* 103 - 3840x2160p@24Hz 64:27 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 5116,
>>> +           5204, 5500, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 24, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27},
>>> +    /* 104 - 3840x2160p@25Hz 64:27 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>> +           4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 25, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27},
>>> +    /* 105 - 3840x2160p@30Hz 64:27 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 297000, 3840, 4016,
>>> +           4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 30, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27},
>>> +    /* 106 - 3840x2160p@50Hz 64:27 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4896,
>>> +           4984, 5280, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 50, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27},
>>> +    /* 107 - 3840x2160p@60Hz 64:27 */
>>> +    { DRM_MODE("3840x2160", DRM_MODE_TYPE_DRIVER, 594000, 3840, 4016,
>>> +           4104, 4400, 0, 2160, 2168, 2178, 2250, 0,
>>> +           DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC |
>>> +           DRM_MODE_FLAG_HDMI2),
>>> +    .vrefresh = 60, .picture_aspect_ratio = 
>>> HDMI_PICTURE_ASPECT_64_27},
>>>   };
>>>     /*
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
  2017-03-23 15:16   ` Ville Syrjälä
@ 2017-03-23 18:54     ` Jose Abreu
  2017-03-23 19:00       ` Ville Syrjälä
  0 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 18:54 UTC (permalink / raw)
  To: Ville Syrjälä, Jose Abreu; +Cc: Carlos Palminha, dri-devel

Hi Ville,


On 23-03-2017 15:16, Ville Syrjälä wrote:
> On Wed, Mar 22, 2017 at 05:35:58PM +0000, Jose Abreu wrote:
>> Add the HDMI 2.0 aspect ratio flags (64:27 and 256:135) and a new
>> flag which will signal userspace that this is a HDMI 2.0+ mode. It
>> is expected that these new flags will not be exported to userspace
>> unless client asks to.
> W.r.t. the aspect ratio userspace story, there was some discussion
> on #dri-devel recently about extending the xrandr protocol for 3d stereo
> support. If that is going to happen then it might make sense to try
> and get the aspect ratio stuff also included at the same time so
> that we would only have to deal with one protocol bump.

Hmm, are you saying to just use one knob for 3d and the aspect
ratios? Aren't there already userspace consumers of the 3d knob?

Best regards,
Jose Miguel Abreu

>
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Carlos Palminha <palminha@synopsys.com>
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>>  include/uapi/drm/drm_mode.h | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
>> index 8c67fc0..62e679c 100644
>> --- a/include/uapi/drm/drm_mode.h
>> +++ b/include/uapi/drm/drm_mode.h
>> @@ -89,6 +89,8 @@
>>  #define DRM_MODE_PICTURE_ASPECT_NONE		0
>>  #define DRM_MODE_PICTURE_ASPECT_4_3		1
>>  #define DRM_MODE_PICTURE_ASPECT_16_9		2
>> +#define DRM_MODE_PICTURE_ASPECT_64_27		3
>> +#define DRM_MODE_PICTURE_ASPECT_256_135		4
>>  
>>  /* Aspect ratio flag bitmask (4 bits 22:19) */
>>  #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
>> @@ -98,6 +100,13 @@
>>  			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
>>  #define  DRM_MODE_FLAG_PIC_AR_16_9 \
>>  			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
>> +#define  DRM_MODE_FLAG_PIC_AR_64_27 \
>> +			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
>> +#define  DRM_MODE_FLAG_PIC_AR_256_135 \
>> +			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
>> +
>> +/* HDMI 2.0+ mode flag: will only be set if client supports it */
>> +#define DRM_MODE_FLAG_HDMI2			(1<<23)
>>  
>>  /* DPMS flags */
>>  /* bit compatible with the xorg definitions. */
>> -- 
>> 1.9.1
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIDAw&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=BBAO8Rra0sW4KcCLB5lMOfONxg0v9pfUSaDNr5WDh2w&s=p6tAeWYwiSDL7BonKeijv2zmweBF9eW7xV7OX5e5gG4&e= 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
  2017-03-23 18:54     ` Jose Abreu
@ 2017-03-23 19:00       ` Ville Syrjälä
  2017-03-23 19:09         ` Jose Abreu
  0 siblings, 1 reply; 28+ messages in thread
From: Ville Syrjälä @ 2017-03-23 19:00 UTC (permalink / raw)
  To: Jose Abreu; +Cc: Carlos Palminha, dri-devel

On Thu, Mar 23, 2017 at 06:54:52PM +0000, Jose Abreu wrote:
> Hi Ville,
> 
> 
> On 23-03-2017 15:16, Ville Syrjälä wrote:
> > On Wed, Mar 22, 2017 at 05:35:58PM +0000, Jose Abreu wrote:
> >> Add the HDMI 2.0 aspect ratio flags (64:27 and 256:135) and a new
> >> flag which will signal userspace that this is a HDMI 2.0+ mode. It
> >> is expected that these new flags will not be exported to userspace
> >> unless client asks to.
> > W.r.t. the aspect ratio userspace story, there was some discussion
> > on #dri-devel recently about extending the xrandr protocol for 3d stereo
> > support. If that is going to happen then it might make sense to try
> > and get the aspect ratio stuff also included at the same time so
> > that we would only have to deal with one protocol bump.
> 
> Hmm, are you saying to just use one knob for 3d and the aspect
> ratios?

No. I'm saying that extending xrandr with either means a protocol bump.
But if we do both at the same time we just need one bump.

> Aren't there already userspace consumers of the 3d knob?

Not that I know of. And there's definitely nothing in xrandr for this
stuff, so any consumer would have to be something non-x11 based.

> 
> Best regards,
> Jose Miguel Abreu
> 
> >
> >> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> >> Cc: Carlos Palminha <palminha@synopsys.com>
> >> Cc: dri-devel@lists.freedesktop.org
> >> ---
> >>  include/uapi/drm/drm_mode.h | 9 +++++++++
> >>  1 file changed, 9 insertions(+)
> >>
> >> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> >> index 8c67fc0..62e679c 100644
> >> --- a/include/uapi/drm/drm_mode.h
> >> +++ b/include/uapi/drm/drm_mode.h
> >> @@ -89,6 +89,8 @@
> >>  #define DRM_MODE_PICTURE_ASPECT_NONE		0
> >>  #define DRM_MODE_PICTURE_ASPECT_4_3		1
> >>  #define DRM_MODE_PICTURE_ASPECT_16_9		2
> >> +#define DRM_MODE_PICTURE_ASPECT_64_27		3
> >> +#define DRM_MODE_PICTURE_ASPECT_256_135		4
> >>  
> >>  /* Aspect ratio flag bitmask (4 bits 22:19) */
> >>  #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
> >> @@ -98,6 +100,13 @@
> >>  			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
> >>  #define  DRM_MODE_FLAG_PIC_AR_16_9 \
> >>  			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
> >> +#define  DRM_MODE_FLAG_PIC_AR_64_27 \
> >> +			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
> >> +#define  DRM_MODE_FLAG_PIC_AR_256_135 \
> >> +			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
> >> +
> >> +/* HDMI 2.0+ mode flag: will only be set if client supports it */
> >> +#define DRM_MODE_FLAG_HDMI2			(1<<23)
> >>  
> >>  /* DPMS flags */
> >>  /* bit compatible with the xorg definitions. */
> >> -- 
> >> 1.9.1
> >>
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIDAw&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=BBAO8Rra0sW4KcCLB5lMOfONxg0v9pfUSaDNr5WDh2w&s=p6tAeWYwiSDL7BonKeijv2zmweBF9eW7xV7OX5e5gG4&e= 

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag
  2017-03-23 19:00       ` Ville Syrjälä
@ 2017-03-23 19:09         ` Jose Abreu
  0 siblings, 0 replies; 28+ messages in thread
From: Jose Abreu @ 2017-03-23 19:09 UTC (permalink / raw)
  To: Ville Syrjälä, Jose Abreu; +Cc: Carlos Palminha, dri-devel

Hi Ville,


On 23-03-2017 19:00, Ville Syrjälä wrote:
> On Thu, Mar 23, 2017 at 06:54:52PM +0000, Jose Abreu wrote:
>> Hi Ville,
>>
>>
>> On 23-03-2017 15:16, Ville Syrjälä wrote:
>>> On Wed, Mar 22, 2017 at 05:35:58PM +0000, Jose Abreu wrote:
>>>> Add the HDMI 2.0 aspect ratio flags (64:27 and 256:135) and a new
>>>> flag which will signal userspace that this is a HDMI 2.0+ mode. It
>>>> is expected that these new flags will not be exported to userspace
>>>> unless client asks to.
>>> W.r.t. the aspect ratio userspace story, there was some discussion
>>> on #dri-devel recently about extending the xrandr protocol for 3d stereo
>>> support. If that is going to happen then it might make sense to try
>>> and get the aspect ratio stuff also included at the same time so
>>> that we would only have to deal with one protocol bump.
>> Hmm, are you saying to just use one knob for 3d and the aspect
>> ratios?
> No. I'm saying that extending xrandr with either means a protocol bump.
> But if we do both at the same time we just need one bump.

Ok. Anything in this series that you think can start helping
contribute for that?

Best regards,
Jose Miguel Abreu

>
>> Aren't there already userspace consumers of the 3d knob?
> Not that I know of. And there's definitely nothing in xrandr for this
> stuff, so any consumer would have to be something non-x11 based.
>
>> Best regards,
>> Jose Miguel Abreu
>>
>>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>>> Cc: dri-devel@lists.freedesktop.org
>>>> ---
>>>>  include/uapi/drm/drm_mode.h | 9 +++++++++
>>>>  1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
>>>> index 8c67fc0..62e679c 100644
>>>> --- a/include/uapi/drm/drm_mode.h
>>>> +++ b/include/uapi/drm/drm_mode.h
>>>> @@ -89,6 +89,8 @@
>>>>  #define DRM_MODE_PICTURE_ASPECT_NONE		0
>>>>  #define DRM_MODE_PICTURE_ASPECT_4_3		1
>>>>  #define DRM_MODE_PICTURE_ASPECT_16_9		2
>>>> +#define DRM_MODE_PICTURE_ASPECT_64_27		3
>>>> +#define DRM_MODE_PICTURE_ASPECT_256_135		4
>>>>  
>>>>  /* Aspect ratio flag bitmask (4 bits 22:19) */
>>>>  #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
>>>> @@ -98,6 +100,13 @@
>>>>  			(DRM_MODE_PICTURE_ASPECT_4_3<<19)
>>>>  #define  DRM_MODE_FLAG_PIC_AR_16_9 \
>>>>  			(DRM_MODE_PICTURE_ASPECT_16_9<<19)
>>>> +#define  DRM_MODE_FLAG_PIC_AR_64_27 \
>>>> +			(DRM_MODE_PICTURE_ASPECT_64_27<<19)
>>>> +#define  DRM_MODE_FLAG_PIC_AR_256_135 \
>>>> +			(DRM_MODE_PICTURE_ASPECT_256_135<<19)
>>>> +
>>>> +/* HDMI 2.0+ mode flag: will only be set if client supports it */
>>>> +#define DRM_MODE_FLAG_HDMI2			(1<<23)
>>>>  
>>>>  /* DPMS flags */
>>>>  /* bit compatible with the xorg definitions. */
>>>> -- 
>>>> 1.9.1
>>>>
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIDAw&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=BBAO8Rra0sW4KcCLB5lMOfONxg0v9pfUSaDNr5WDh2w&s=p6tAeWYwiSDL7BonKeijv2zmweBF9eW7xV7OX5e5gG4&e= 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob
  2017-03-23 11:00       ` Daniel Vetter
@ 2017-03-27 13:47         ` Jose Abreu
  2017-03-28  6:17           ` Daniel Vetter
  0 siblings, 1 reply; 28+ messages in thread
From: Jose Abreu @ 2017-03-27 13:47 UTC (permalink / raw)
  To: Daniel Vetter, Jose Abreu; +Cc: Carlos Palminha, dri-devel

Hi Daniel,


On 23-03-2017 11:00, Daniel Vetter wrote:
> On Thu, Mar 23, 2017 at 10:44:16AM +0000, Jose Abreu wrote:
>> Hi Daniel,
>>
>>
>> On 23-03-2017 07:22, Daniel Vetter wrote:
>>> On Wed, Mar 22, 2017 at 05:35:57PM +0000, Jose Abreu wrote:
>>>> We can't expect userspace to have full support for all HDMI 2.0+
>>>> features. Instead of expecting/waiting for userspace to support
>>>> the new features add a knob, much like the stereo knob, so that
>>>> DRM core will only expose the features when asked too.
>>>>
>>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>>>> Cc: Carlos Palminha <palminha@synopsys.com>
>>>> Cc: dri-devel@lists.freedesktop.org
>>>> ---
>>>>  drivers/gpu/drm/drm_ioctl.c | 5 +++++
>>>>  include/drm/drm_file.h      | 8 ++++++++
>>>>  include/uapi/drm/drm.h      | 7 +++++++
>>>>  3 files changed, 20 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
>>>> index a7c61c2..2430e2e 100644
>>>> --- a/drivers/gpu/drm/drm_ioctl.c
>>>> +++ b/drivers/gpu/drm/drm_ioctl.c
>>>> @@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
>>>>  		file_priv->atomic = req->value;
>>>>  		file_priv->universal_planes = req->value;
>>>>  		break;
>>>> +	case DRM_CLIENT_CAP_HDMI2:
>>>> +		if (req->value > 1)
>>>> +			return -EINVAL;
>>>> +		file_priv->hdmi2_allowed = req->value;
>>> Needs some userspace to make use of this (like the -modesetting x.org
>>> driver).
>>> -Daniel
>> I see your point but shouldn't this be merged before actually
>> starting to work in userspace?
> No, see
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__dri.freedesktop.org_docs_drm_gpu_drm-2Duapi.html-23open-2Dsource-2Duserspace-2Drequirements&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=tcc2TQFpF7ats3OIzYgmFrHaeymBrPtqHphO4Ui4AUY&s=qWySmgpGaOwxC8Jl3A5qZVf4aS2qz3LXshVdv3FehJc&e= 
>
> for reasons behind this and the precise flow.
>
> Cheers, Daniel

Thanks, I will do that. I can leave the flag and just limit the
export of aspect ratios for now, we can limit more stuff later if
needed. What do you think?

Another thing: Is it safe to enable this in the modesetting
driver, shouldn't the modesetting clients also know about the
flag or does modesetting handles this correctly? (I'm not very
familiar with this driver, sorry).

Best regards,
Jose Miguel Abreu

>
>> Best regards,
>> Jose Miguel Abreu
>>
>>>> +		break;
>>>>  	default:
>>>>  		return -EINVAL;
>>>>  	}
>>>> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
>>>> index 5dd27ae..7b97d85 100644
>>>> --- a/include/drm/drm_file.h
>>>> +++ b/include/drm/drm_file.h
>>>> @@ -192,6 +192,14 @@ struct drm_file {
>>>>  	unsigned is_master:1;
>>>>  
>>>>  	/**
>>>> +	 * @hdmi2_allowed:
>>>> +	 *
>>>> +	 * True if client understands HDMI 2.0+ features like, for example,
>>>> +	 * extended aspect ratios
>>>> +	 */
>>>> +	unsigned hdmi2_allowed:1;
>>>> +
>>>> +	/**
>>>>  	 * @master:
>>>>  	 *
>>>>  	 * Master this node is currently associated with. Only relevant if
>>>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>>>> index b2c5284..9e25138 100644
>>>> --- a/include/uapi/drm/drm.h
>>>> +++ b/include/uapi/drm/drm.h
>>>> @@ -678,6 +678,13 @@ struct drm_get_cap {
>>>>   */
>>>>  #define DRM_CLIENT_CAP_ATOMIC	3
>>>>  
>>>> +/**
>>>> + * DRM_CLIENT_CAP_HDMI2
>>>> + *
>>>> + * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace
>>>> + */
>>>> +#define DRM_CLIENT_CAP_HDMI2	4
>>>> +
>>>>  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
>>>>  struct drm_set_client_cap {
>>>>  	__u64 capability;
>>>> -- 
>>>> 1.9.1
>>>>
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=4lBpQovdR7O8jeC7mV8SX9xvTypMtV8CBDEDg3bGgzw&s=h-gqFlO62i53pir0j2lJ-upE_bXQxhn3BK1nhdxoB6Y&e= 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob
  2017-03-27 13:47         ` Jose Abreu
@ 2017-03-28  6:17           ` Daniel Vetter
  0 siblings, 0 replies; 28+ messages in thread
From: Daniel Vetter @ 2017-03-28  6:17 UTC (permalink / raw)
  To: Jose Abreu; +Cc: dri-devel, Carlos Palminha

On Mon, Mar 27, 2017 at 02:47:08PM +0100, Jose Abreu wrote:
> Hi Daniel,
> 
> 
> On 23-03-2017 11:00, Daniel Vetter wrote:
> > On Thu, Mar 23, 2017 at 10:44:16AM +0000, Jose Abreu wrote:
> >> Hi Daniel,
> >>
> >>
> >> On 23-03-2017 07:22, Daniel Vetter wrote:
> >>> On Wed, Mar 22, 2017 at 05:35:57PM +0000, Jose Abreu wrote:
> >>>> We can't expect userspace to have full support for all HDMI 2.0+
> >>>> features. Instead of expecting/waiting for userspace to support
> >>>> the new features add a knob, much like the stereo knob, so that
> >>>> DRM core will only expose the features when asked too.
> >>>>
> >>>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> >>>> Cc: Carlos Palminha <palminha@synopsys.com>
> >>>> Cc: dri-devel@lists.freedesktop.org
> >>>> ---
> >>>>  drivers/gpu/drm/drm_ioctl.c | 5 +++++
> >>>>  include/drm/drm_file.h      | 8 ++++++++
> >>>>  include/uapi/drm/drm.h      | 7 +++++++
> >>>>  3 files changed, 20 insertions(+)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> >>>> index a7c61c2..2430e2e 100644
> >>>> --- a/drivers/gpu/drm/drm_ioctl.c
> >>>> +++ b/drivers/gpu/drm/drm_ioctl.c
> >>>> @@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_
> >>>>  		file_priv->atomic = req->value;
> >>>>  		file_priv->universal_planes = req->value;
> >>>>  		break;
> >>>> +	case DRM_CLIENT_CAP_HDMI2:
> >>>> +		if (req->value > 1)
> >>>> +			return -EINVAL;
> >>>> +		file_priv->hdmi2_allowed = req->value;
> >>> Needs some userspace to make use of this (like the -modesetting x.org
> >>> driver).
> >>> -Daniel
> >> I see your point but shouldn't this be merged before actually
> >> starting to work in userspace?
> > No, see
> >
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__dri.freedesktop.org_docs_drm_gpu_drm-2Duapi.html-23open-2Dsource-2Duserspace-2Drequirements&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=tcc2TQFpF7ats3OIzYgmFrHaeymBrPtqHphO4Ui4AUY&s=qWySmgpGaOwxC8Jl3A5qZVf4aS2qz3LXshVdv3FehJc&e= 
> >
> > for reasons behind this and the precise flow.
> >
> > Cheers, Daniel
> 
> Thanks, I will do that. I can leave the flag and just limit the
> export of aspect ratios for now, we can limit more stuff later if
> needed. What do you think?
> 
> Another thing: Is it safe to enable this in the modesetting
> driver, shouldn't the modesetting clients also know about the
> flag or does modesetting handles this correctly? (I'm not very
> familiar with this driver, sorry).

Probably needs an xrandr revision too.
-Daniel

> 
> Best regards,
> Jose Miguel Abreu
> 
> >
> >> Best regards,
> >> Jose Miguel Abreu
> >>
> >>>> +		break;
> >>>>  	default:
> >>>>  		return -EINVAL;
> >>>>  	}
> >>>> diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
> >>>> index 5dd27ae..7b97d85 100644
> >>>> --- a/include/drm/drm_file.h
> >>>> +++ b/include/drm/drm_file.h
> >>>> @@ -192,6 +192,14 @@ struct drm_file {
> >>>>  	unsigned is_master:1;
> >>>>  
> >>>>  	/**
> >>>> +	 * @hdmi2_allowed:
> >>>> +	 *
> >>>> +	 * True if client understands HDMI 2.0+ features like, for example,
> >>>> +	 * extended aspect ratios
> >>>> +	 */
> >>>> +	unsigned hdmi2_allowed:1;
> >>>> +
> >>>> +	/**
> >>>>  	 * @master:
> >>>>  	 *
> >>>>  	 * Master this node is currently associated with. Only relevant if
> >>>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> >>>> index b2c5284..9e25138 100644
> >>>> --- a/include/uapi/drm/drm.h
> >>>> +++ b/include/uapi/drm/drm.h
> >>>> @@ -678,6 +678,13 @@ struct drm_get_cap {
> >>>>   */
> >>>>  #define DRM_CLIENT_CAP_ATOMIC	3
> >>>>  
> >>>> +/**
> >>>> + * DRM_CLIENT_CAP_HDMI2
> >>>> + *
> >>>> + * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace
> >>>> + */
> >>>> +#define DRM_CLIENT_CAP_HDMI2	4
> >>>> +
> >>>>  /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
> >>>>  struct drm_set_client_cap {
> >>>>  	__u64 capability;
> >>>> -- 
> >>>> 1.9.1
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> dri-devel mailing list
> >>>> dri-devel@lists.freedesktop.org
> >>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_dri-2Ddevel&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=WHDsc6kcWAl4i96Vm5hJ_19IJiuxx_p_Rzo2g-uHDKw&m=4lBpQovdR7O8jeC7mV8SX9xvTypMtV8CBDEDg3bGgzw&s=h-gqFlO62i53pir0j2lJ-upE_bXQxhn3BK1nhdxoB6Y&e= 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-03-28  6:17 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-22 17:35 [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
2017-03-22 17:35 ` [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob Jose Abreu
2017-03-23  7:22   ` Daniel Vetter
2017-03-23 10:44     ` Jose Abreu
2017-03-23 11:00       ` Daniel Vetter
2017-03-27 13:47         ` Jose Abreu
2017-03-28  6:17           ` Daniel Vetter
2017-03-22 17:35 ` [RFC 2/5] drm: uapi: Add HDMI 2.0 aspect ratio flags and HDMI 2.0+ mode flag Jose Abreu
2017-03-23 15:16   ` Ville Syrjälä
2017-03-23 18:54     ` Jose Abreu
2017-03-23 19:00       ` Ville Syrjälä
2017-03-23 19:09         ` Jose Abreu
2017-03-22 17:35 ` [RFC 3/5] drm: edid: Add HDMI 2.0 CEA video modes Jose Abreu
2017-03-23  8:11   ` Andrzej Hajda
2017-03-23 11:04     ` Jose Abreu
2017-03-23 11:17       ` Andrzej Hajda
2017-03-23 11:35         ` Jose Abreu
2017-03-23 14:50           ` Andrzej Hajda
2017-03-23 11:07     ` Sharma, Shashank
2017-03-23 15:26       ` Sharma, Shashank
2017-03-22 17:36 ` [RFC 4/5] drm: connector: Add hdmi2_allowed flag Jose Abreu
2017-03-22 17:36 ` [RFC 5/5] drm: Do not expose HDMI 2.0+ modes to userspace/drivers unless asked to Jose Abreu
2017-03-23  7:25   ` Daniel Vetter
2017-03-23 11:02     ` Jose Abreu
2017-03-22 18:13 ` [RFC 0/5] HDMI 2.0+ video modes handling in DRM core Jose Abreu
2017-03-22 18:57   ` Sharma, Shashank
2017-03-23 10:37     ` Jose Abreu
2017-03-23 10:56       ` Sharma, Shashank

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.