Re: [PATCH 29/31] drm/i915: Stop tracking last calculated Sink CRC.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2015-11-05 16:50 GMT-02:00 Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>:
> It was created at 'commit aabc95dcf20 (drm/i915: Dont -ETIMEDOUT
> on identical new and previous (count, crc).")' becase the counter
> wasn't reliable.
>
> Now that we properly wait for the counter to be reset we can rely
> a bit more in the counter.
>
> Also that patch stopped to return -ETIMEDOUT so the test case is
> unable to skip when it is unreliable and end up in many fails
> that should be skip instead.
>
> So, with the counter more reliable we can remove
> this hack that just makes things more confusing when test cases
> are really expecting the same CRC and let test case skip if that's
> not the case.
>

Much better this way.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>

> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_dp.c  | 39 +++++++++------------------------------
>  drivers/gpu/drm/i915/intel_drv.h |  2 --
>  2 files changed, 9 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 5d810cd..24d2bff 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3864,8 +3864,6 @@ static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
>         if (!(buf & DP_TEST_CRC_SUPPORTED))
>                 return -ENOTTY;
>
> -       intel_dp->sink_crc.last_count = buf & DP_TEST_COUNT_MASK;
> -
>         if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0)
>                 return -EIO;
>
> @@ -3890,7 +3888,6 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
>         u8 buf;
>         int count, ret;
>         int attempts = 6;
> -       bool old_equal_new;
>
>         ret = intel_dp_sink_crc_start(intel_dp);
>         if (ret)
> @@ -3906,35 +3903,17 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
>                 }
>                 count = buf & DP_TEST_COUNT_MASK;
>
> -               /*
> -                * Count might be reset during the loop. In this case
> -                * last known count needs to be reset as well.
> -                */
> -               if (count == 0)
> -                       intel_dp->sink_crc.last_count = 0;
> -
> -               if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) {
> -                       ret = -EIO;
> -                       goto stop;
> -               }
> -
> -               old_equal_new = (count == intel_dp->sink_crc.last_count &&
> -                                !memcmp(intel_dp->sink_crc.last_crc, crc,
> -                                        6 * sizeof(u8)));
> -
> -       } while (--attempts && (count == 0 || old_equal_new));
> -
> -       intel_dp->sink_crc.last_count = buf & DP_TEST_COUNT_MASK;
> -       memcpy(intel_dp->sink_crc.last_crc, crc, 6 * sizeof(u8));
> +       } while (--attempts && count == 0);
>
>         if (attempts == 0) {
> -               if (old_equal_new) {
> -                       DRM_DEBUG_KMS("Unreliable Sink CRC counter: Current returned CRC is identical to the previous one\n");
> -               } else {
> -                       DRM_ERROR("Panel is unable to calculate any CRC after 6 vblanks\n");
> -                       ret = -ETIMEDOUT;
> -                       goto stop;
> -               }
> +               DRM_ERROR("Panel is unable to calculate any CRC after 6 vblanks\n");
> +               ret = -ETIMEDOUT;
> +               goto stop;
> +       }
> +
> +       if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) {
> +               ret = -EIO;
> +               goto stop;
>         }
>
>  stop:
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index baa560c..de2a8ff 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -746,8 +746,6 @@ enum link_m_n_set {
>
>  struct sink_crc {
>         bool started;
> -       u8 last_crc[6];
> -       int last_count;
>  };
>
>  struct intel_dp {
> --
> 2.4.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux