]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/fbc: Handle 16bpp compression limit better
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 10 Jun 2021 18:32:33 +0000 (21:32 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 24 Jun 2021 18:48:02 +0000 (21:48 +0300)
The limit++ for the 16bpp case is nonsense since the
compression limit is always supposed to be power of two.
Replace it with <<=1.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210610183237.3920-6-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
drivers/gpu/drm/i915/display/intel_fbc.c

index 55bc708e87122e9cdf2f6e103ba0961cd11e548a..1c220cea89779cb463b91e06c85f9c50aee41180 100644 (file)
@@ -239,11 +239,10 @@ static void ilk_fbc_activate(struct drm_i915_private *dev_priv)
 
        dpfc_ctl = DPFC_CTL_PLANE(params->crtc.i9xx_plane);
        if (params->fb.format->cpp[0] == 2)
-               limit++;
+               limit <<= 1;
 
        switch (limit) {
        case 4:
-       case 3:
                dpfc_ctl |= DPFC_CTL_LIMIT_4X;
                break;
        case 2:
@@ -319,11 +318,10 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv)
                dpfc_ctl |= IVB_DPFC_CTL_PLANE(params->crtc.i9xx_plane);
 
        if (params->fb.format->cpp[0] == 2)
-               limit++;
+               limit <<= 1;
 
        switch (limit) {
        case 4:
-       case 3:
                dpfc_ctl |= DPFC_CTL_LIMIT_4X;
                break;
        case 2: