drm/amd/display: Linux Set/Read link rate and lane count through debugfs
authorHersen Wu <hersenxs.wu@amd.com>
Fri, 15 Jun 2018 13:28:34 +0000 (09:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Jul 2018 19:47:14 +0000 (14:47 -0500)
expose dc function to be called by linux dm

Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Reviewed-by: Sun peng Li <Sunpeng.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc_link.h

index 2a785bbf2b8f1de5011ede286cfee2d229556c36..815656a5b6bddba200a80599bd69900b8f62c6f4 100644 (file)
@@ -384,6 +384,71 @@ void dc_stream_set_static_screen_events(struct dc *dc,
        dc->hwss.set_static_screen_control(pipes_affected, num_pipes_affected, events);
 }
 
+void dc_link_set_drive_settings(struct dc *dc,
+                               struct link_training_settings *lt_settings,
+                               const struct dc_link *link)
+{
+
+       int i;
+
+       for (i = 0; i < dc->link_count; i++) {
+               if (dc->links[i] == link)
+                       break;
+       }
+
+       if (i >= dc->link_count)
+               ASSERT_CRITICAL(false);
+
+       dc_link_dp_set_drive_settings(dc->links[i], lt_settings);
+}
+
+void dc_link_perform_link_training(struct dc *dc,
+                                  struct dc_link_settings *link_setting,
+                                  bool skip_video_pattern)
+{
+       int i;
+
+       for (i = 0; i < dc->link_count; i++)
+               dc_link_dp_perform_link_training(
+                       dc->links[i],
+                       link_setting,
+                       skip_video_pattern);
+}
+
+void dc_link_set_preferred_link_settings(struct dc *dc,
+                                        struct dc_link_settings *link_setting,
+                                        struct dc_link *link)
+{
+       link->preferred_link_setting = *link_setting;
+       dp_retrain_link_dp_test(link, link_setting, false);
+}
+
+void dc_link_enable_hpd(const struct dc_link *link)
+{
+       dc_link_dp_enable_hpd(link);
+}
+
+void dc_link_disable_hpd(const struct dc_link *link)
+{
+       dc_link_dp_disable_hpd(link);
+}
+
+
+void dc_link_set_test_pattern(struct dc_link *link,
+                             enum dp_test_pattern test_pattern,
+                             const struct link_training_settings *p_link_settings,
+                             const unsigned char *p_custom_pattern,
+                             unsigned int cust_pattern_size)
+{
+       if (link != NULL)
+               dc_link_dp_set_test_pattern(
+                       link,
+                       test_pattern,
+                       p_link_settings,
+                       p_custom_pattern,
+                       cust_pattern_size);
+}
+
 static void destruct(struct dc *dc)
 {
        dc_release_state(dc->current_state);
index 8a716baa1203bdcd7b85f912aa6a22d523f57a5e..83eea42452b5105d1c9894d746c680fddca78665 100644 (file)
@@ -214,6 +214,23 @@ void dc_link_enable_hpd_filter(struct dc_link *link, bool enable);
  * DPCD access interfaces
  */
 
+void dc_link_set_drive_settings(struct dc *dc,
+                               struct link_training_settings *lt_settings,
+                               const struct dc_link *link);
+void dc_link_perform_link_training(struct dc *dc,
+                                  struct dc_link_settings *link_setting,
+                                  bool skip_video_pattern);
+void dc_link_set_preferred_link_settings(struct dc *dc,
+                                        struct dc_link_settings *link_setting,
+                                        struct dc_link *link);
+void dc_link_enable_hpd(const struct dc_link *link);
+void dc_link_disable_hpd(const struct dc_link *link);
+void dc_link_set_test_pattern(struct dc_link *link,
+                       enum dp_test_pattern test_pattern,
+                       const struct link_training_settings *p_link_settings,
+                       const unsigned char *p_custom_pattern,
+                       unsigned int cust_pattern_size);
+
 bool dc_submit_i2c(
                struct dc *dc,
                uint32_t link_index,