mbox series

[v2,0/7] add fixes to pass DP Link Layer compliance test cases

Message ID 1626191647-13901-1-git-send-email-khsieh@codeaurora.org
Headers show
Series add fixes to pass DP Link Layer compliance test cases | expand

Message

Kuogee Hsieh July 13, 2021, 3:54 p.m. UTC
add fixes to pass DP Link Layer compliance test cases

Kuogee Hsieh (7):
  drm/msm/dp: use dp_ctrl_off_link_stream during PHY compliance test run
  drm/msm/dp: reduce link rate if failed at link training 1
  drm/msm/dp: reset aux controller after dp_aux_cmd_fifo_tx() failed.
  drm/msm/dp: replug event is converted into an unplug followed by an
    plug events
  drm/msm/dp: return correct edid checksum after corrupted edid checksum
    read
  drm/msm/dp: do not end dp link training until video is ready
  drm/msm/dp: retrain link when loss of symbol lock detected

 drivers/gpu/drm/msm/dp/dp_aux.c     |   3 +
 drivers/gpu/drm/msm/dp/dp_ctrl.c    | 145 +++++++++++++++++++++++-------------
 drivers/gpu/drm/msm/dp/dp_display.c |  13 ++--
 drivers/gpu/drm/msm/dp/dp_panel.c   |   9 ++-
 4 files changed, 110 insertions(+), 60 deletions(-)

Comments

Stephen Boyd July 22, 2021, 7:05 p.m. UTC | #1
Quoting Kuogee Hsieh (2021-07-13 08:54:02)
> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c

> index 27fb0f0..92cf331 100644

> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c

> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c

> @@ -1634,6 +1617,24 @@ void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl)

>         }

>  }

>

> +static bool dp_ctrl_clock_recovery_any_ok(

> +                       const u8 link_status[DP_LINK_STATUS_SIZE],

> +                       int lane_count)

> +{

> +       int lane_cnt;

> +

> +       /*

> +        * only interested in the lane number after reduced

> +        * lane_cnt = 4, then only interested in 2 lanes

> +        * lane_cnt = 2, then only interested in 1 lane

> +        */

> +       lane_cnt = lane_count >> 1;

> +       if (lane_cnt == 0)

> +               return false;

> +

> +       return drm_dp_clock_recovery_ok(link_status, lane_count);


This doesn't work? Because drm_dp_clock_recovery_ok() requires every
lane to be OK whereas this function wants any lane to be OK? It may make
sense to have drm_dp_clock_recovery_ok() return false if lane_count == 0
too.

> +}

> +

>  int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl)

>  {

>         int rc = 0;
Stephen Boyd July 22, 2021, 7:14 p.m. UTC | #2
Quoting Kuogee Hsieh (2021-07-13 08:54:07)
> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> index 6a013b0..20951c8 100644
> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> @@ -1638,6 +1638,25 @@ static bool dp_ctrl_clock_recovery_any_ok(
>         return drm_dp_clock_recovery_ok(link_status, lane_count);
>  }
>
> +static bool dp_ctrl_loss_symbol_lock(struct dp_ctrl_private *ctrl)
> +{
> +       u8 link_status[DP_LINK_STATUS_SIZE];
> +       u8 status;
> +       int i;
> +       int num_lanes = ctrl->link->link_params.num_lanes;
> +
> +       dp_ctrl_read_link_status(ctrl, link_status);
> +
> +       for (i = 0; i < num_lanes; i++) {
> +               status = link_status[i / 2];
> +               status >>= ((i % 2) * 4);
> +               if (!(status & DP_LANE_SYMBOL_LOCKED))
> +                       return true;
> +       }
> +
> +       return false;
> +}

Can this function move to drivers/gpu/drm/drm_dp_helper.c and be called
drm_dp_symbol_locked()?

> +
>  int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl)
>  {
>         int rc = 0;
Stephen Boyd July 22, 2021, 7:15 p.m. UTC | #3
Quoting Kuogee Hsieh (2021-07-13 08:54:06)
> Initialize both pre-emphasis and voltage swing level to 0 before

> start link training and do not end link training until video is

> ready to reduce the period between end of link training and video

> start to meet Link Layer CTS requirement.  This fixes Link Layer

> CTS cases 4.3.2.1, 4.3.2.2, 4.3.2.3 and 4.3.2.4.

>

> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

> ---


Any fixes tag?

Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Stephen Boyd July 22, 2021, 7:24 p.m. UTC | #4
Quoting Kuogee Hsieh (2021-07-13 08:54:04)
> Remove special handling of replug interrupt and instead treat replug event
> as a sequential unplug followed by a plugin event. This is needed to meet
> the requirements of DP Link Layer CTS test case 4.2.1.3.
>
> Changes in V2:
> -- add fixes statement
>
> Fixes: f21c8a276c2d ("drm/msm/dp: handle irq_hpd with sink_count = 0 correctly")
>
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---
>  drivers/gpu/drm/msm/dp/dp_display.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 78c5301..d089ada 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1146,9 +1146,6 @@ static int hpd_event_thread(void *data)
>                 case EV_IRQ_HPD_INT:
>                         dp_irq_hpd_handle(dp_priv, todo->data);
>                         break;
> -               case EV_HPD_REPLUG_INT:

Please remove the enum as well.

> -                       /* do nothing */
> -                       break;
>                 case EV_USER_NOTIFICATION:
>                         dp_display_send_hpd_notification(dp_priv,
>                                                 todo->data);