Skip to contentSkip to conversation

drm/i915: content-type property for HDMI connector

PATCH In review StanLis 3 participants 6 messages Apr 13, 2018

Subsystems (3)
lore
Share & tools
lore

StanLis

author
#0 lore raw

PATCH 1/1 drm/i915: content-type property for HDMI connector

From: Stanislav Lisovskiy <[email protected]>

Added content_type property to
drm_connector_state in order to properly handle
external HDMI TV content-type setting.

---
 drivers/gpu/drm/drm_atomic.c        |  4 ++++
 drivers/gpu/drm/drm_connector.c     | 34 +++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c          |  1 +
 drivers/gpu/drm/i915/intel_atomic.c |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c   |  4 ++++
 drivers/gpu/drm/i915/intel_modes.c  | 10 +++++++++
 include/drm/drm_connector.h         |  2 ++
 include/drm/drm_mode_config.h       |  5 +++++
 include/uapi/drm/drm_mode.h         |  5 +++++
 10 files changed, 67 insertions(+)
drivers/gpu/drm/drm_atomic.c +4 -0
index 7d25c42f22db..72fd2a1c801f 100644
@@ -1266,6 +1266,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 			state->link_status = val;
 	} else if (property == config->aspect_ratio_property) {
 		state->picture_aspect_ratio = val;
+	} else if (property == config->content_type_property) {
+		state->content_type = val;
 	} else if (property == connector->scaling_mode_property) {
 		state->scaling_mode = val;
 	} else if (property == connector->content_protection_property) {
@@ -1351,6 +1353,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 		*val = state->link_status;
 	} else if (property == config->aspect_ratio_property) {
 		*val = state->picture_aspect_ratio;
+	} else if (property == config->content_type_property) {
+		*val = state->content_type;
 	} else if (property == connector->scaling_mode_property) {
 		*val = state->scaling_mode;
 	} else if (property == connector->content_protection_property) {
drivers/gpu/drm/drm_connector.c +34 -0
index b3cde897cd80..d03586edd483 100644
@@ -720,6 +720,13 @@ static const struct drm_prop_enum_list drm_aspect_ratio_enum_list[] = {
 	{ DRM_MODE_PICTURE_ASPECT_16_9, "16:9" },
 };
 
+static const struct drm_prop_enum_list drm_content_type_enum_list[] = {
+	{ DRM_MODE_CONTENT_TYPE_GRAPHICS, "GRAPHICS" },
+	{ DRM_MODE_CONTENT_TYPE_PHOTO, "PHOTO" },
+	{ DRM_MODE_CONTENT_TYPE_CINEMA, "CINEMA" },
+	{ DRM_MODE_CONTENT_TYPE_GAME, "GAME" },
+};
+
 static const struct drm_prop_enum_list drm_panel_orientation_enum_list[] = {
 	{ DRM_MODE_PANEL_ORIENTATION_NORMAL,	"Normal"	},
 	{ DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP,	"Upside Down"	},
@@ -1260,6 +1267,33 @@ int drm_mode_create_aspect_ratio_property(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property);
 
+/**
+ * drm_mode_create_content_type_property - create content type property
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to desired
+ * connectors.
+ *
+ * Returns:
+ * Zero on success, negative errno on failure.
+ */
+int drm_mode_create_content_type_property(struct drm_device *dev)
+{
+	if (dev->mode_config.content_type_property)
+		return 0;
+
+	dev->mode_config.content_type_property =
+		drm_property_create_enum(dev, 0, "content type",
+				drm_content_type_enum_list,
+				ARRAY_SIZE(drm_content_type_enum_list));
+
+	if (dev->mode_config.content_type_property == NULL)
+		return -ENOMEM;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_content_type_property);
+
 /**
  * drm_mode_create_suggested_offset_properties - create suggests offset properties
  * @dev: DRM device
drivers/gpu/drm/drm_edid.c +1 -0
index 134069f36482..946a182e0201 100644
@@ -4867,6 +4867,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 	}
 
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
+	frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
 
 	/*
 	 * Populate picture aspect ratio from either
drivers/gpu/drm/i915/intel_atomic.c +1 -0
index 40285d1b91b7..61ddb5871d8a 100644
@@ -124,6 +124,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
 	if (new_conn_state->force_audio != old_conn_state->force_audio ||
 	    new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb ||
 	    new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
+	    new_conn_state->base.content_type != old_conn_state->base.content_type ||
 	    new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
 		crtc_state->mode_changed = true;
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 5bd2263407b2..07fd7ba21f38 100644
@@ -1818,6 +1818,7 @@ int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
 void intel_attach_force_audio_property(struct drm_connector *connector);
 void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
 void intel_attach_aspect_ratio_property(struct drm_connector *connector);
+void intel_attach_content_type_property(struct drm_connector *connector);
 
 
 /* intel_overlay.c */
drivers/gpu/drm/i915/intel_hdmi.c +4 -0
index ee929f31f7db..cd484276e9b0 100644
@@ -491,6 +491,8 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
 					   intel_hdmi->rgb_quant_range_selectable,
 					   is_hdmi2_sink);
 
+	frame.avi.content_type = connector->state->content_type;
+
 	/* TODO: handle pixel repetition for YCBCR420 outputs */
 	intel_write_infoframe(encoder, crtc_state, &frame);
 }
@@ -2065,7 +2067,9 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
 	intel_attach_force_audio_property(connector);
 	intel_attach_broadcast_rgb_property(connector);
 	intel_attach_aspect_ratio_property(connector);
+	intel_attach_content_type_property(connector);
 	connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
+	connector->state->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
 }
 
 /*
drivers/gpu/drm/i915/intel_modes.c +10 -0
index b39846613e3c..232811ab71a3 100644
@@ -133,3 +133,13 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector)
 			connector->dev->mode_config.aspect_ratio_property,
 			DRM_MODE_PICTURE_ASPECT_NONE);
 }
+
+void
+intel_attach_content_type_property(struct drm_connector *connector)
+{
+	if (!drm_mode_create_content_type_property(connector->dev))
+		drm_object_attach_property(&connector->base,
+			connector->dev->mode_config.content_type_property,
+			DRM_MODE_CONTENT_TYPE_GRAPHICS);
+}
+
include/drm/drm_connector.h +2 -0
index 675cc3f8cf85..b656d6ffdca0 100644
@@ -417,6 +417,7 @@ struct drm_connector_state {
 	 * values for &enum hdmi_picture_aspect
 	 */
 	enum hdmi_picture_aspect picture_aspect_ratio;
+	enum hdmi_content_type   content_type;
 
 	/**
 	 * @scaling_mode: Connector property to control the
@@ -1094,6 +1095,7 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
 int drm_connector_attach_content_protection_property(
 		struct drm_connector *connector);
 int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
+int drm_mode_create_content_type_property(struct drm_device *dev);
 int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
 
 int drm_mode_connector_set_path_property(struct drm_connector *connector,
include/drm/drm_mode_config.h +5 -0
index 33b3a96d66d0..fb45839179dd 100644
@@ -726,6 +726,11 @@ struct drm_mode_config {
 	 * HDMI infoframe aspect ratio setting.
 	 */
 	struct drm_property *aspect_ratio_property;
+	/**
+	 * @content_type_property: Optional connector property to control the
+	 * HDMI infoframe content type setting.
+	 */
+	struct drm_property *content_type_property;
 	/**
 	 * @degamma_lut_property: Optional CRTC property to set the LUT used to
 	 * convert the framebuffer's colors to linear gamma.
include/uapi/drm/drm_mode.h +5 -0
index 50bcf4214ff9..d9f1b290d2a6 100644
@@ -94,6 +94,11 @@ extern "C" {
 #define DRM_MODE_PICTURE_ASPECT_4_3		1
 #define DRM_MODE_PICTURE_ASPECT_16_9		2
 
+#define DRM_MODE_CONTENT_TYPE_GRAPHICS		0
+#define DRM_MODE_CONTENT_TYPE_PHOTO		1
+#define DRM_MODE_CONTENT_TYPE_CINEMA		2
+#define DRM_MODE_CONTENT_TYPE_GAME		3
+
 /* Aspect ratio flag bitmask (4 bits 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
 #define  DRM_MODE_FLAG_PIC_AR_NONE \
Signature · 17 lines
2.17.0

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: content-type property for HDMI connector

== Series Details ==

== Series Details ==

Series: drm/i915: content-type property for HDMI connector
URL : https://patchwork.freedesktop.org/series/41677/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
3e378ba61f9d drm/i915: content-type property for HDMI connector
-:72: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#72: FILE: drivers/gpu/drm/drm_connector.c:1287:
+		drm_property_create_enum(dev, 0, "content type",
+				drm_content_type_enum_list,

-:75: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!dev->mode_config.content_type_property" #75: FILE: drivers/gpu/drm/drm_connector.c:1290:
+ if (dev->mode_config.content_type_property == NULL)

-:159: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #159: FILE: drivers/gpu/drm/i915/intel_modes.c:142:
+ drm_object_attach_property(&connector->base,
+ connector->dev->mode_config.content_type_property,

total: 0 errors, 0 warnings, 3 checks, 149 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.BAT: success for drm/i915: content-type property for HDMI connector

In reply to StanLis
== Series Details ==

== Series Details ==

Series: drm/i915: content-type property for HDMI connector
URL : https://patchwork.freedesktop.org/series/41677/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4053 -> Patchwork_8687 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/41677/revisions/1/mbox/

== Known issues ==

Here are the changes found in Patchwork_8687 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         PASS -> FAIL (fdo#102575)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         PASS -> INCOMPLETE (fdo#103927)

    
    ==== Possible fixes ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       INCOMPLETE (fdo#103713) -> PASS

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927

== Participating hosts (35 -> 33) ==

Missing (2): fi-ilk-m540 fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4053 -> Patchwork_8687

CI_DRM_4053: e2599f775a9c1c27f702e90e6432e555764edcd8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4429: 80e4910581c7310258375a003a5de9a57ed24546 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8687: 3e378ba61f9d60d5b6d6b9c48cd00b66fad32c21 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4429: 93b35926a150e318439d2505901288594b3548f5 @ git://anongit.freedesktop.org/piglit

== Linux commits ==

3e378ba61f9d drm/i915: content-type property for HDMI connector

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8687/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

✓ Fi.CI.IGT: success for drm/i915: content-type property for HDMI connector

In reply to StanLis
== Series Details ==

== Series Details ==

Series: drm/i915: content-type property for HDMI connector
URL : https://patchwork.freedesktop.org/series/41677/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4053_full -> Patchwork_8687_full =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/41677/revisions/1/mbox/

== Known issues ==

Here are the changes found in Patchwork_8687_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@2x-plain-flip-fb-recreate:
      shard-hsw:          PASS -> FAIL (fdo#100368) +1

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-gtt:
      shard-kbl:          PASS -> DMESG-WARN (fdo#103558, fdo#105602) +25

    igt@kms_plane@plane-position-hole-dpms-pipe-b-planes:
      shard-apl:          PASS -> FAIL (fdo#103166)

    
    ==== Possible fixes ====

    igt@kms_sysfs_edid_timing:
      shard-apl:          WARN (fdo#100047) -> PASS

fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602

== Participating hosts (6 -> 4) ==

Missing (2): shard-glk shard-glkb

== Build changes ==

* Linux: CI_DRM_4053 -> Patchwork_8687

CI_DRM_4053: e2599f775a9c1c27f702e90e6432e555764edcd8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4429: 80e4910581c7310258375a003a5de9a57ed24546 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8687: 3e378ba61f9d60d5b6d6b9c48cd00b66fad32c21 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4429: 93b35926a150e318439d2505901288594b3548f5 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8687/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.IGT: success for drm/i915: content-type property for HDMI connector

In reply to StanLis
== Series Details ==

== Series Details ==

Series: drm/i915: content-type property for HDMI connector
URL : https://patchwork.freedesktop.org/series/41677/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4053_full -> Patchwork_8687_full =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/41677/revisions/1/mbox/

== Known issues ==

Here are the changes found in Patchwork_8687_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@2x-plain-flip-fb-recreate:
      shard-hsw:          PASS -> FAIL (fdo#100368) +1

    igt@kms_frontbuffer_tracking@fbc-1p-offscren-pri-indfb-draw-mmap-gtt:
      shard-kbl:          PASS -> DMESG-WARN (fdo#103558, fdo#105602) +25

    igt@kms_plane@plane-position-hole-dpms-pipe-b-planes:
      shard-apl:          PASS -> FAIL (fdo#103166)

    
    ==== Possible fixes ====

    igt@kms_sysfs_edid_timing:
      shard-apl:          WARN (fdo#100047) -> PASS

fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602

== Participating hosts (6 -> 4) ==

Missing (2): shard-glk shard-glkb

== Build changes ==

* Linux: CI_DRM_4053 -> Patchwork_8687

CI_DRM_4053: e2599f775a9c1c27f702e90e6432e555764edcd8 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4429: 80e4910581c7310258375a003a5de9a57ed24546 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8687: 3e378ba61f9d60d5b6d6b9c48cd00b66fad32c21 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4429: 93b35926a150e318439d2505901288594b3548f5 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8687/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw
In reply to StanLis
Quoted 7 lines · StanLis

From: Stanislav Lisovskiy <[email protected]>

Added content_type property to
drm_connector_state in order to properly handle
external HDMI TV content-type setting.

Quoted 11 lines
---
 drivers/gpu/drm/drm_atomic.c        |  4 ++++
 drivers/gpu/drm/drm_connector.c     | 34 +++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_edid.c          |  1 +
 drivers/gpu/drm/i915/intel_atomic.c |  1 +
 drivers/gpu/drm/i915/intel_drv.h    |  1 +
 drivers/gpu/drm/i915/intel_hdmi.c   |  4 ++++
 drivers/gpu/drm/i915/intel_modes.c  | 10 +++++++++
 include/drm/drm_connector.h         |  2 ++
 include/drm/drm_mode_config.h       |  5 +++++
 include/uapi/drm/drm_mode.h         |  5 +++++

Pls split the patch into two parts: one for drm core, the other for i915. Then post to dri-devel, with intel-gfx cc:d.

Quoted 158 lines
 10 files changed, 67 insertions(+)
drivers/gpu/drm/drm_atomic.c +4 -0
index 7d25c42f22db..72fd2a1c801f 100644
@@ -1266,6 +1266,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
 			state->link_status = val;
 	} else if (property == config->aspect_ratio_property) {
 		state->picture_aspect_ratio = val;
+	} else if (property == config->content_type_property) {
+		state->content_type = val;
 	} else if (property == connector->scaling_mode_property) {
 		state->scaling_mode = val;
 	} else if (property == connector->content_protection_property) {
@@ -1351,6 +1353,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 		*val = state->link_status;
 	} else if (property == config->aspect_ratio_property) {
 		*val = state->picture_aspect_ratio;
+	} else if (property == config->content_type_property) {
+		*val = state->content_type;
 	} else if (property == connector->scaling_mode_property) {
 		*val = state->scaling_mode;
 	} else if (property == connector->content_protection_property) {
drivers/gpu/drm/drm_connector.c +34 -0
index b3cde897cd80..d03586edd483 100644
@@ -720,6 +720,13 @@ static const struct drm_prop_enum_list drm_aspect_ratio_enum_list[] = {
 	{ DRM_MODE_PICTURE_ASPECT_16_9, "16:9" },
 };
 
+static const struct drm_prop_enum_list drm_content_type_enum_list[] = {
+	{ DRM_MODE_CONTENT_TYPE_GRAPHICS, "GRAPHICS" },
+	{ DRM_MODE_CONTENT_TYPE_PHOTO, "PHOTO" },
+	{ DRM_MODE_CONTENT_TYPE_CINEMA, "CINEMA" },
+	{ DRM_MODE_CONTENT_TYPE_GAME, "GAME" },
+};
+
 static const struct drm_prop_enum_list drm_panel_orientation_enum_list[] = {
 	{ DRM_MODE_PANEL_ORIENTATION_NORMAL,	"Normal"	},
 	{ DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP,	"Upside Down"	},
@@ -1260,6 +1267,33 @@ int drm_mode_create_aspect_ratio_property(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property);
 
+/**
+ * drm_mode_create_content_type_property - create content type property
+ * @dev: DRM device
+ *
+ * Called by a driver the first time it's needed, must be attached to desired
+ * connectors.
+ *
+ * Returns:
+ * Zero on success, negative errno on failure.
+ */
+int drm_mode_create_content_type_property(struct drm_device *dev)
+{
+	if (dev->mode_config.content_type_property)
+		return 0;
+
+	dev->mode_config.content_type_property =
+		drm_property_create_enum(dev, 0, "content type",
+				drm_content_type_enum_list,
+				ARRAY_SIZE(drm_content_type_enum_list));
+
+	if (dev->mode_config.content_type_property == NULL)
+		return -ENOMEM;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_mode_create_content_type_property);
+
 /**
  * drm_mode_create_suggested_offset_properties - create suggests offset properties
  * @dev: DRM device
drivers/gpu/drm/drm_edid.c +1 -0
index 134069f36482..946a182e0201 100644
@@ -4867,6 +4867,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 	}
 
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
+	frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
 
 	/*
 	 * Populate picture aspect ratio from either
drivers/gpu/drm/i915/intel_atomic.c +1 -0
index 40285d1b91b7..61ddb5871d8a 100644
@@ -124,6 +124,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
 	if (new_conn_state->force_audio != old_conn_state->force_audio ||
 	    new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb ||
 	    new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
+	    new_conn_state->base.content_type != old_conn_state->base.content_type ||
 	    new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
 		crtc_state->mode_changed = true;
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 5bd2263407b2..07fd7ba21f38 100644
@@ -1818,6 +1818,7 @@ int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter);
 void intel_attach_force_audio_property(struct drm_connector *connector);
 void intel_attach_broadcast_rgb_property(struct drm_connector *connector);
 void intel_attach_aspect_ratio_property(struct drm_connector *connector);
+void intel_attach_content_type_property(struct drm_connector *connector);
 
 
 /* intel_overlay.c */
drivers/gpu/drm/i915/intel_hdmi.c +4 -0
index ee929f31f7db..cd484276e9b0 100644
@@ -491,6 +491,8 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
 					   intel_hdmi->rgb_quant_range_selectable,
 					   is_hdmi2_sink);
 
+	frame.avi.content_type = connector->state->content_type;
+
 	/* TODO: handle pixel repetition for YCBCR420 outputs */
 	intel_write_infoframe(encoder, crtc_state, &frame);
 }
@@ -2065,7 +2067,9 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
 	intel_attach_force_audio_property(connector);
 	intel_attach_broadcast_rgb_property(connector);
 	intel_attach_aspect_ratio_property(connector);
+	intel_attach_content_type_property(connector);
 	connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
+	connector->state->content_type = HDMI_CONTENT_TYPE_GRAPHICS;
 }
 
 /*
drivers/gpu/drm/i915/intel_modes.c +10 -0
index b39846613e3c..232811ab71a3 100644
@@ -133,3 +133,13 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector)
 			connector->dev->mode_config.aspect_ratio_property,
 			DRM_MODE_PICTURE_ASPECT_NONE);
 }
+
+void
+intel_attach_content_type_property(struct drm_connector *connector)
+{
+	if (!drm_mode_create_content_type_property(connector->dev))
+		drm_object_attach_property(&connector->base,
+			connector->dev->mode_config.content_type_property,
+			DRM_MODE_CONTENT_TYPE_GRAPHICS);
+}
+
include/drm/drm_connector.h +0 -0
index 675cc3f8cf85..b656d6ffdca0 100644

include/drm/drm_connector.h struct drm_connector_state { · line 420

Quoted 4 lines
include/drm/drm_connector.h +1 -0
@@ -417,6 +417,7 @@ struct drm_connector_state {
 	 * values for &enum hdmi_picture_aspect
 	 */
 	enum hdmi_picture_aspect picture_aspect_ratio;
+	enum hdmi_content_type   content_type;

Missing kernel-doc here?

I didn't look at things too closely yet, but on a high level this is looking quite good.

Quoted 45 lines
include/drm/drm_connector.h +1 -0
 	/**
 	 * @scaling_mode: Connector property to control the
@@ -1094,6 +1095,7 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
 int drm_connector_attach_content_protection_property(
 		struct drm_connector *connector);
 int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
+int drm_mode_create_content_type_property(struct drm_device *dev);
 int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
 
 int drm_mode_connector_set_path_property(struct drm_connector *connector,
include/drm/drm_mode_config.h +5 -0
index 33b3a96d66d0..fb45839179dd 100644
@@ -726,6 +726,11 @@ struct drm_mode_config {
 	 * HDMI infoframe aspect ratio setting.
 	 */
 	struct drm_property *aspect_ratio_property;
+	/**
+	 * @content_type_property: Optional connector property to control the
+	 * HDMI infoframe content type setting.
+	 */
+	struct drm_property *content_type_property;
 	/**
 	 * @degamma_lut_property: Optional CRTC property to set the LUT used to
 	 * convert the framebuffer's colors to linear gamma.
include/uapi/drm/drm_mode.h +5 -0
index 50bcf4214ff9..d9f1b290d2a6 100644
@@ -94,6 +94,11 @@ extern "C" {
 #define DRM_MODE_PICTURE_ASPECT_4_3		1
 #define DRM_MODE_PICTURE_ASPECT_16_9		2
 
+#define DRM_MODE_CONTENT_TYPE_GRAPHICS		0
+#define DRM_MODE_CONTENT_TYPE_PHOTO		1
+#define DRM_MODE_CONTENT_TYPE_CINEMA		2
+#define DRM_MODE_CONTENT_TYPE_GAME		3
+
 /* Aspect ratio flag bitmask (4 bits 22:19) */
 #define DRM_MODE_FLAG_PIC_AR_MASK		(0x0F<<19)
 #define  DRM_MODE_FLAG_PIC_AR_NONE \
Signature · 1 line
2.17.0
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx