]> Git Repo - linux.git/commitdiff
drm/i915: WA for zero memory channel
authorJosé Roberto de Souza <[email protected]>
Mon, 24 May 2021 21:48:03 +0000 (14:48 -0700)
committerJosé Roberto de Souza <[email protected]>
Tue, 25 May 2021 17:30:26 +0000 (10:30 -0700)
Commit c457d9cf256e ("drm/i915: Make sure we have enough memory
bandwidth on ICL") assumes that we always have a non-zero
dram_info->channels and uses it as a divisor.
We need num memory channels to be at least 1 for sane bw limits
checking, even when PCode returns 0 or there is a error reading it, so
lets force it to 1 in this case.

Cc: Stanislav Lisovskiy <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Ville Syrjälä <[email protected]>
Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: Lucas De Marchi <[email protected]>
Signed-off-by: José Roberto de Souza <[email protected]>
Reviewed-by: Clint Taylor <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/display/intel_bw.c

index 3a1ba52266a7cd0258d29d100ec180d82e3f9486..bfb398f0432e6ca305f2a785752d333f5adb8809 100644 (file)
@@ -162,7 +162,7 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
 {
        struct intel_qgv_info qi = {};
        bool is_y_tile = true; /* assume y tile may be used */
-       int num_channels = dev_priv->dram_info.num_channels;
+       int num_channels = max_t(u8, 1, dev_priv->dram_info.num_channels);
        int deinterleave;
        int ipqdepth, ipqdepthpch;
        int dclk_max;
This page took 0.100076 seconds and 4 git commands to generate.