]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/kms/nv50-: Fix clock checking algorithm in nv50_dp_mode_valid()
authorLyude Paul <lyude@redhat.com>
Tue, 29 Sep 2020 22:31:32 +0000 (18:31 -0400)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 29 Oct 2020 23:34:13 +0000 (09:34 +1000)
commitf679d5814e8a4035e2713fd67b6e17b301de1a75
treefde9d2982ad000b26bca3d453f7fe999589ddc56
parent2d53db620ef7ac735ed20292d88b04f42c4adc63
drm/nouveau/kms/nv50-: Fix clock checking algorithm in nv50_dp_mode_valid()

While I thought I had this correct (since it actually did reject modes
like I expected during testing), Ville Syrjala from Intel pointed out
that the logic here isn't correct. max_clock refers to the max data rate
supported by the DP encoder. So, limiting it to the output of ds_clock (which
refers to the maximum dotclock of the downstream DP device) doesn't make any
sense. Additionally, since we're using the connector's bpc as the canonical BPC
we should use this in mode_valid until we support dynamically setting the bpp
based on bandwidth constraints.

https://lists.freedesktop.org/archives/dri-devel/2020-September/280276.html

For more info.

So, let's rewrite this using Ville's advice.

v2:
* Ville pointed out I mixed up the dotclock and the link rate. So fix that...
* ...and also rename all the variables in this function to be more appropriately
  labeled so I stop mixing them up.
* Reuse the bpp from the connector for now until we have dynamic bpp selection.
* Use use DIV_ROUND_UP for calculating the mode rate like i915 does, which we
  should also have been doing from the start

Signed-off-by: Lyude Paul <lyude@redhat.com>
Fixes: f560af997469 ("drm/nouveau/kms/nv50-: Use downstream DP clock limits for mode validation")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_dp.c