Lines Matching full:connector
13 * @connector: DRM connector
14 * @new_conn_state: connector state to reset
21 void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector, in __drm_atomic_helper_connector_hdmi_reset() argument
24 unsigned int max_bpc = connector->max_bpc; in __drm_atomic_helper_connector_hdmi_reset()
54 static bool hdmi_is_limited_range(const struct drm_connector *connector, in hdmi_is_limited_range() argument
57 const struct drm_display_info *info = &connector->display_info; in hdmi_is_limited_range()
82 sink_supports_format_bpc(const struct drm_connector *connector, in sink_supports_format_bpc() argument
87 struct drm_device *dev = connector->dev; in sink_supports_format_bpc()
111 if (!(connector->hdmi.supported_formats & BIT(format))) { in sink_supports_format_bpc()
112 drm_dbg_kms(dev, "%s format unsupported by the connector.\n", in sink_supports_format_bpc()
202 hdmi_clock_valid(const struct drm_connector *connector, in hdmi_clock_valid() argument
206 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; in hdmi_clock_valid()
207 const struct drm_display_info *info = &connector->display_info; in hdmi_clock_valid()
215 status = funcs->tmds_char_rate_valid(connector, mode, clock); in hdmi_clock_valid()
224 hdmi_compute_clock(const struct drm_connector *connector, in hdmi_compute_clock() argument
236 status = hdmi_clock_valid(connector, mode, clock); in hdmi_compute_clock()
246 hdmi_try_format_bpc(const struct drm_connector *connector, in hdmi_try_format_bpc() argument
251 const struct drm_display_info *info = &connector->display_info; in hdmi_try_format_bpc()
252 struct drm_device *dev = connector->dev; in hdmi_try_format_bpc()
258 if (!sink_supports_format_bpc(connector, info, mode, fmt, bpc)) { in hdmi_try_format_bpc()
265 ret = hdmi_compute_clock(connector, conn_state, mode, bpc, fmt); in hdmi_try_format_bpc()
281 hdmi_compute_format(const struct drm_connector *connector, in hdmi_compute_format() argument
286 struct drm_device *dev = connector->dev; in hdmi_compute_format()
292 if (hdmi_try_format_bpc(connector, conn_state, mode, bpc, HDMI_COLORSPACE_RGB)) { in hdmi_compute_format()
303 hdmi_compute_config(const struct drm_connector *connector, in hdmi_compute_config() argument
307 struct drm_device *dev = connector->dev; in hdmi_compute_config()
310 8, connector->max_bpc); in hdmi_compute_config()
317 ret = hdmi_compute_format(connector, conn_state, mode, bpc); in hdmi_compute_config()
336 static int hdmi_generate_avi_infoframe(const struct drm_connector *connector, in hdmi_generate_avi_infoframe() argument
350 ret = drm_hdmi_avi_infoframe_from_display_mode(frame, connector, mode); in hdmi_generate_avi_infoframe()
361 drm_hdmi_avi_infoframe_quant_range(frame, connector, mode, rgb_quant_range); in hdmi_generate_avi_infoframe()
370 static int hdmi_generate_spd_infoframe(const struct drm_connector *connector, in hdmi_generate_spd_infoframe() argument
380 connector->hdmi.vendor, in hdmi_generate_spd_infoframe()
381 connector->hdmi.product); in hdmi_generate_spd_infoframe()
392 static int hdmi_generate_hdr_infoframe(const struct drm_connector *connector, in hdmi_generate_hdr_infoframe() argument
401 if (connector->max_bpc < 10) in hdmi_generate_hdr_infoframe()
416 static int hdmi_generate_hdmi_vendor_infoframe(const struct drm_connector *connector, in hdmi_generate_hdmi_vendor_infoframe() argument
419 const struct drm_display_info *info = &connector->display_info; in hdmi_generate_hdmi_vendor_infoframe()
431 ret = drm_hdmi_vendor_infoframe_from_display_mode(frame, connector, mode); in hdmi_generate_hdmi_vendor_infoframe()
441 hdmi_generate_infoframes(const struct drm_connector *connector, in hdmi_generate_infoframes() argument
444 const struct drm_display_info *info = &connector->display_info; in hdmi_generate_infoframes()
450 ret = hdmi_generate_avi_infoframe(connector, conn_state); in hdmi_generate_infoframes()
454 ret = hdmi_generate_spd_infoframe(connector, conn_state); in hdmi_generate_infoframes()
463 ret = hdmi_generate_hdr_infoframe(connector, conn_state); in hdmi_generate_infoframes()
467 ret = hdmi_generate_hdmi_vendor_infoframe(connector, conn_state); in hdmi_generate_infoframes()
475 * drm_atomic_helper_connector_hdmi_check() - Helper to check HDMI connector atomic state
476 * @connector: DRM Connector
479 * Provides a default connector state check handler for HDMI connectors.
480 * Checks that a desired connector update is valid, and updates various
486 int drm_atomic_helper_connector_hdmi_check(struct drm_connector *connector, in drm_atomic_helper_connector_hdmi_check() argument
490 drm_atomic_get_old_connector_state(state, connector); in drm_atomic_helper_connector_hdmi_check()
492 drm_atomic_get_new_connector_state(state, connector); in drm_atomic_helper_connector_hdmi_check()
497 new_conn_state->hdmi.is_limited_range = hdmi_is_limited_range(connector, new_conn_state); in drm_atomic_helper_connector_hdmi_check()
499 ret = hdmi_compute_config(connector, new_conn_state, mode); in drm_atomic_helper_connector_hdmi_check()
503 ret = hdmi_generate_infoframes(connector, new_conn_state); in drm_atomic_helper_connector_hdmi_check()
524 static int clear_device_infoframe(struct drm_connector *connector, in clear_device_infoframe() argument
527 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; in clear_device_infoframe()
528 struct drm_device *dev = connector->dev; in clear_device_infoframe()
538 ret = funcs->clear_infoframe(connector, type); in clear_device_infoframe()
547 static int clear_infoframe(struct drm_connector *connector, in clear_infoframe() argument
552 ret = clear_device_infoframe(connector, old_frame->data.any.type); in clear_infoframe()
559 static int write_device_infoframe(struct drm_connector *connector, in write_device_infoframe() argument
562 const struct drm_connector_hdmi_funcs *funcs = connector->hdmi.funcs; in write_device_infoframe()
563 struct drm_device *dev = connector->dev; in write_device_infoframe()
579 ret = funcs->write_infoframe(connector, frame->any.type, buffer, len); in write_device_infoframe()
588 static int write_infoframe(struct drm_connector *connector, in write_infoframe() argument
593 ret = write_device_infoframe(connector, &new_frame->data); in write_infoframe()
600 static int write_or_clear_infoframe(struct drm_connector *connector, in write_or_clear_infoframe() argument
605 return write_infoframe(connector, new_frame); in write_or_clear_infoframe()
608 return clear_infoframe(connector, old_frame); in write_or_clear_infoframe()
615 * @connector: A pointer to the HDMI connector
616 * @state: The HDMI connector state to generate the infoframe from
618 * This function is meant for HDMI connector drivers to write their
625 int drm_atomic_helper_connector_hdmi_update_infoframes(struct drm_connector *connector, in drm_atomic_helper_connector_hdmi_update_infoframes() argument
629 drm_atomic_get_old_connector_state(state, connector); in drm_atomic_helper_connector_hdmi_update_infoframes()
631 drm_atomic_get_new_connector_state(state, connector); in drm_atomic_helper_connector_hdmi_update_infoframes()
632 struct drm_display_info *info = &connector->display_info; in drm_atomic_helper_connector_hdmi_update_infoframes()
638 mutex_lock(&connector->hdmi.infoframes.lock); in drm_atomic_helper_connector_hdmi_update_infoframes()
640 ret = write_or_clear_infoframe(connector, in drm_atomic_helper_connector_hdmi_update_infoframes()
646 if (connector->hdmi.infoframes.audio.set) { in drm_atomic_helper_connector_hdmi_update_infoframes()
647 ret = write_infoframe(connector, in drm_atomic_helper_connector_hdmi_update_infoframes()
648 &connector->hdmi.infoframes.audio); in drm_atomic_helper_connector_hdmi_update_infoframes()
653 ret = write_or_clear_infoframe(connector, in drm_atomic_helper_connector_hdmi_update_infoframes()
659 ret = write_or_clear_infoframe(connector, in drm_atomic_helper_connector_hdmi_update_infoframes()
666 ret = write_or_clear_infoframe(connector, in drm_atomic_helper_connector_hdmi_update_infoframes()
674 mutex_unlock(&connector->hdmi.infoframes.lock); in drm_atomic_helper_connector_hdmi_update_infoframes()
681 * @connector: A pointer to the HDMI connector
684 * This function is meant for HDMI connector drivers to update their
692 drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *connector, in drm_atomic_helper_connector_hdmi_update_audio_infoframe() argument
696 &connector->hdmi.infoframes.audio; in drm_atomic_helper_connector_hdmi_update_audio_infoframe()
697 struct drm_display_info *info = &connector->display_info; in drm_atomic_helper_connector_hdmi_update_audio_infoframe()
703 mutex_lock(&connector->hdmi.infoframes.lock); in drm_atomic_helper_connector_hdmi_update_audio_infoframe()
708 ret = write_infoframe(connector, infoframe); in drm_atomic_helper_connector_hdmi_update_audio_infoframe()
710 mutex_unlock(&connector->hdmi.infoframes.lock); in drm_atomic_helper_connector_hdmi_update_audio_infoframe()
718 * @connector: A pointer to the HDMI connector
720 * This function is meant for HDMI connector drivers to stop sending their
728 drm_atomic_helper_connector_hdmi_clear_audio_infoframe(struct drm_connector *connector) in drm_atomic_helper_connector_hdmi_clear_audio_infoframe() argument
731 &connector->hdmi.infoframes.audio; in drm_atomic_helper_connector_hdmi_clear_audio_infoframe()
732 struct drm_display_info *info = &connector->display_info; in drm_atomic_helper_connector_hdmi_clear_audio_infoframe()
738 mutex_lock(&connector->hdmi.infoframes.lock); in drm_atomic_helper_connector_hdmi_clear_audio_infoframe()
742 ret = clear_infoframe(connector, infoframe); in drm_atomic_helper_connector_hdmi_clear_audio_infoframe()
746 mutex_unlock(&connector->hdmi.infoframes.lock); in drm_atomic_helper_connector_hdmi_clear_audio_infoframe()