diff mbox

[v5,2/2] i915: content-type property for HDMI connector

Message ID 20180419123854.32356-3-stanislav.lisovskiy@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stanislav Lisovskiy April 19, 2018, 12:38 p.m. UTC
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

Added encoding of drm content_type property from drm_connector_state
within AVI infoframe in order to properly handle external HDMI TV
content-type setting.

This requires also manipulationg ITC bit, as stated in
HDMI spec.

v2:
 * Moved helper function which attaches content type property
   to the drm core, as was suggested.
   Removed redundant connector state initialization.

v3:
 * Removed caps in drm_content_type_enum_list.
   After some discussion it turned out that HDMI Spec 1.4
   was wrongly assuming that IT Content(itc) bit doesn't affect
   Content type states, however itc bit needs to be manupulated
   as well. In order to not expose additional property for itc,
   for sake of simplicity it was decided to bind those together
   in same "content type" property.

v4:
 * Added it_content checking in intel_digital_connector_atomic_check.
   Fixed documentation for new content type enum.

v5:
 * Moved patch revision's description to commit messages.

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/intel_atomic.c | 2 ++
 drivers/gpu/drm/i915/intel_hdmi.c   | 4 ++++
 2 files changed, 6 insertions(+)

Comments

Hans Verkuil April 19, 2018, 12:46 p.m. UTC | #1
On 04/19/18 14:38, StanLis wrote:
> From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> 
> Added encoding of drm content_type property from drm_connector_state
> within AVI infoframe in order to properly handle external HDMI TV
> content-type setting.
> 
> This requires also manipulationg ITC bit, as stated in
> HDMI spec.
> 
> v2:
>  * Moved helper function which attaches content type property
>    to the drm core, as was suggested.
>    Removed redundant connector state initialization.
> 
> v3:
>  * Removed caps in drm_content_type_enum_list.
>    After some discussion it turned out that HDMI Spec 1.4
>    was wrongly assuming that IT Content(itc) bit doesn't affect
>    Content type states, however itc bit needs to be manupulated
>    as well. In order to not expose additional property for itc,
>    for sake of simplicity it was decided to bind those together
>    in same "content type" property.
> 
> v4:
>  * Added it_content checking in intel_digital_connector_atomic_check.
>    Fixed documentation for new content type enum.
> 
> v5:
>  * Moved patch revision's description to commit messages.
> 
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Regards,

	Hans

> ---
>  drivers/gpu/drm/i915/intel_atomic.c | 2 ++
>  drivers/gpu/drm/i915/intel_hdmi.c   | 4 ++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 40285d1b91b7..96a42eb457c5 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -124,6 +124,8 @@ 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.it_content != old_conn_state->base.it_content ||
>  	    new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
>  		crtc_state->mode_changed = true;
>  
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index ee929f31f7db..078200908b7a 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -491,6 +491,9 @@ 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;
> +	frame.avi.itc = connector->state->it_content;
> +
>  	/* TODO: handle pixel repetition for YCBCR420 outputs */
>  	intel_write_infoframe(encoder, crtc_state, &frame);
>  }
> @@ -2065,6 +2068,7 @@ 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);
> +	drm_connector_attach_content_type_property(connector);
>  	connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
>  }
>  
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 40285d1b91b7..96a42eb457c5 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -124,6 +124,8 @@  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.it_content != old_conn_state->base.it_content ||
 	    new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
 		crtc_state->mode_changed = true;
 
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index ee929f31f7db..078200908b7a 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -491,6 +491,9 @@  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;
+	frame.avi.itc = connector->state->it_content;
+
 	/* TODO: handle pixel repetition for YCBCR420 outputs */
 	intel_write_infoframe(encoder, crtc_state, &frame);
 }
@@ -2065,6 +2068,7 @@  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);
+	drm_connector_attach_content_type_property(connector);
 	connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
 }