drm/i915/fbc: Use the correct plane stride
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 2 Jul 2020 15:37:20 +0000 (18:37 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 3 Jul 2020 11:50:16 +0000 (14:50 +0300)
commite5ec1f95486957f9668da4e1f2b1666c085d307f
tree3b53ee5eeeff5867920352506e157ba9e759c11c
parent3fe4818e5dbcad466d4f70dba8790a9fc978b9c5
drm/i915/fbc: Use the correct plane stride

Consult the actual plane stride instead of the fb stride. The two
will disagree when we remap the gtt. The plane stride is what the
hw will be fed so that's what we should look at for the FBC
retrictions/cfb allocation.

Since we no longer require a fence we are going to attempt using
FBC with remapping, and so we should look at correct stride.

With 90/270 degree rotation the plane stride is stored in units
of pixels, so we need to conver it to bytes for the purposes
of calculating the cfb stride. Not entirely sure if this matches
the hw behaviour though. Need to reverse engineer that at some
point...

We also need to reorder the pixel format check vs. stride check
to avoid triggering a spurious WARN(stride & 63) with cpp==1 and
plane stride==32.

v2: Try to deal with rotated stride and related WARN

Cc: José Roberto de Souza <jose.souza@intel.com>
Fixes: 691f7ba58d52 ("drm/i915/display/fbc: Make fences a nice-to-have for GEN9+")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200702153723.24327-2-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
drivers/gpu/drm/i915/display/intel_fbc.c