OSDN Git Service

drm/amd/display: Rearchitecture HDMI HPD
authorJohn Barberiz <jbarberi@amd.com>
Fri, 26 Jan 2018 22:39:19 +0000 (17:39 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:19:57 +0000 (14:19 -0500)
- Disabled HPD filter and used HPD software timer instead
- Allows DM to disable HPD filtering

Signed-off-by: John Barberiz <jbarberi@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@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_link.c
drivers/gpu/drm/amd/display/dc/dc_link.h

index 50aa9a4..02e1c3b 100644 (file)
@@ -127,6 +127,8 @@ static bool program_hpd_filter(
        int delay_on_connect_in_ms = 0;
        int delay_on_disconnect_in_ms = 0;
 
+       if (link->is_hpd_filter_disabled)
+               return false;
        /* Verify feature is supported */
        switch (link->connector_signal) {
        case SIGNAL_TYPE_DVI_SINGLE_LINK:
@@ -2346,3 +2348,33 @@ void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
        core_dc->hwss.set_avmute(pipe_ctx, enable);
 }
 
+void dc_link_disable_hpd_filter(struct dc_link *link)
+{
+       struct gpio *hpd;
+
+       if (!link->is_hpd_filter_disabled) {
+               link->is_hpd_filter_disabled = true;
+               /* Obtain HPD handle */
+               hpd = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
+
+               if (!hpd)
+                       return;
+
+               /* Setup HPD filtering */
+               if (dal_gpio_open(hpd, GPIO_MODE_INTERRUPT) == GPIO_RESULT_OK) {
+                       struct gpio_hpd_config config;
+
+                       config.delay_on_connect = 0;
+                       config.delay_on_disconnect = 0;
+
+                       dal_irq_setup_hpd_filter(hpd, &config);
+
+                       dal_gpio_close(hpd);
+               } else {
+                       ASSERT_CRITICAL(false);
+               }
+               /* Release HPD handle */
+               dal_gpio_destroy_irq(&hpd);
+       }
+}
+
index f11a734..ac0f617 100644 (file)
@@ -64,6 +64,8 @@ struct dc_link {
        enum signal_type connector_signal;
        enum dc_irq_source irq_source_hpd;
        enum dc_irq_source irq_source_hpd_rx;/* aka DP Short Pulse  */
+       bool is_hpd_filter_disabled;
+
        /* caps is the same as reported_link_cap. link_traing use
         * reported_link_cap. Will clean up.  TODO
         */
@@ -195,6 +197,8 @@ bool dc_link_dp_set_test_pattern(
        const unsigned char *p_custom_pattern,
        unsigned int cust_pattern_size);
 
+void dc_link_disable_hpd_filter(struct dc_link *link);
+
 /*
  * DPCD access interfaces
  */