Skip to content

Commit 6553b12

Browse files
StanFox1984vsyrjala
authored andcommitted
i915: content-type property for HDMI connector
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. v6: * Minor naming fix for the content type enumeration string. v7: * Fix parameter name for documentation and parameter alignment in order not to get warning. Added Content Type description to new HDMI connector properties section. v8: * Thrown away unneeded numbers from HDMI content-type property description. Switch to strings desription instead of plain definitions. v9: * Moved away hdmi specific content-type enum from drm_connector_state. Content type property should probably not be bound to any specific connector interface in drm_connector_state. Same probably should be done to hdmi_picture_aspect_ration enum which is also contained in drm_connector_state. Added special helper function to get derive hdmi specific relevant infoframe fields. v10: * Added usage description to HDMI properties kernel doc. v11: * Created centralized function for filling HDMI AVI infoframe, based on correspondent DRM property value. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180515135928.31092-3-stanislav.lisovskiy@intel.com [vsyrjala: clean up checkpatch multiple blank lines warnings] Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
1 parent 50525c3 commit 6553b12

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

drivers/gpu/drm/i915/intel_atomic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn,
124124
if (new_conn_state->force_audio != old_conn_state->force_audio ||
125125
new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb ||
126126
new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
127+
new_conn_state->base.content_type != old_conn_state->base.content_type ||
127128
new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode)
128129
crtc_state->mode_changed = true;
129130

drivers/gpu/drm/i915/intel_hdmi.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ static void intel_write_infoframe(struct drm_encoder *encoder,
461461
}
462462

463463
static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
464-
const struct intel_crtc_state *crtc_state)
464+
const struct intel_crtc_state *crtc_state,
465+
const struct drm_connector_state *conn_state)
465466
{
466467
struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
467468
const struct drm_display_mode *adjusted_mode =
@@ -491,6 +492,9 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
491492
intel_hdmi->rgb_quant_range_selectable,
492493
is_hdmi2_sink);
493494

495+
drm_hdmi_avi_infoframe_content_type(&frame.avi,
496+
conn_state);
497+
494498
/* TODO: handle pixel repetition for YCBCR420 outputs */
495499
intel_write_infoframe(encoder, crtc_state, &frame);
496500
}
@@ -586,7 +590,7 @@ static void g4x_set_infoframes(struct drm_encoder *encoder,
586590
I915_WRITE(reg, val);
587591
POSTING_READ(reg);
588592

589-
intel_hdmi_set_avi_infoframe(encoder, crtc_state);
593+
intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
590594
intel_hdmi_set_spd_infoframe(encoder, crtc_state);
591595
intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
592596
}
@@ -727,7 +731,7 @@ static void ibx_set_infoframes(struct drm_encoder *encoder,
727731
I915_WRITE(reg, val);
728732
POSTING_READ(reg);
729733

730-
intel_hdmi_set_avi_infoframe(encoder, crtc_state);
734+
intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
731735
intel_hdmi_set_spd_infoframe(encoder, crtc_state);
732736
intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
733737
}
@@ -770,7 +774,7 @@ static void cpt_set_infoframes(struct drm_encoder *encoder,
770774
I915_WRITE(reg, val);
771775
POSTING_READ(reg);
772776

773-
intel_hdmi_set_avi_infoframe(encoder, crtc_state);
777+
intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
774778
intel_hdmi_set_spd_infoframe(encoder, crtc_state);
775779
intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
776780
}
@@ -823,7 +827,7 @@ static void vlv_set_infoframes(struct drm_encoder *encoder,
823827
I915_WRITE(reg, val);
824828
POSTING_READ(reg);
825829

826-
intel_hdmi_set_avi_infoframe(encoder, crtc_state);
830+
intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
827831
intel_hdmi_set_spd_infoframe(encoder, crtc_state);
828832
intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
829833
}
@@ -856,7 +860,7 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,
856860
I915_WRITE(reg, val);
857861
POSTING_READ(reg);
858862

859-
intel_hdmi_set_avi_infoframe(encoder, crtc_state);
863+
intel_hdmi_set_avi_infoframe(encoder, crtc_state, conn_state);
860864
intel_hdmi_set_spd_infoframe(encoder, crtc_state);
861865
intel_hdmi_set_hdmi_infoframe(encoder, crtc_state, conn_state);
862866
}
@@ -2065,6 +2069,7 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
20652069
intel_attach_force_audio_property(connector);
20662070
intel_attach_broadcast_rgb_property(connector);
20672071
intel_attach_aspect_ratio_property(connector);
2072+
drm_connector_attach_content_type_property(connector);
20682073
connector->state->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
20692074
}
20702075

0 commit comments

Comments
 (0)