To test the POT stride padding functionality until it's taken into use by the actual platform needing it, enable the padding whenever the FB remapping is possible. An exception is to pad linear FBs when this would be otherwise possible (stride is page size aligned), because this won't be anyway needed. Padding of linear FBs will be still tested whenever a big stride requires remapping (so by igt/kms_big_fb). By this both the FB creation time and commit time remapping setup will be tested. v3: - Test now without forcing the remapping on, which is the actual case for all platforms before ADL_P. Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_fb.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c index a8fced4570e30..175a1271e7db9 100644 --- a/drivers/gpu/drm/i915/display/intel_fb.c +++ b/drivers/gpu/drm/i915/display/intel_fb.c @@ -446,17 +446,25 @@ static int intel_fb_check_ccs_xy(const struct drm_framebuffer *fb, int ccs_plane return 0; } +static bool intel_fb_can_remap(const struct drm_framebuffer *fb); + static bool intel_plane_can_remap(const struct intel_plane_state *plane_state) { struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); - struct drm_i915_private *i915 = to_i915(plane->base.dev); const struct drm_framebuffer *fb = plane_state->hw.fb; - int i; /* We don't want to deal with remapping with cursors */ if (plane->id == PLANE_CURSOR) return false; + return intel_fb_can_remap(fb); +} + +static bool intel_fb_can_remap(const struct drm_framebuffer *fb) +{ + struct drm_i915_private *i915 = to_i915(fb->dev); + int i; + /* * The display engine limits already match/exceed the * render engine limits, so not much point in remapping. @@ -486,9 +494,13 @@ static bool intel_plane_can_remap(const struct intel_plane_state *plane_state) return true; } +#define FORCE_POT_STRIDE_REMAP false + static bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb) { - return false; + return FORCE_POT_STRIDE_REMAP && + fb->base.modifier != DRM_FORMAT_MOD_LINEAR && + intel_fb_can_remap(&fb->base); } static int intel_fb_pitch(const struct intel_framebuffer *fb, int color_plane, unsigned int rotation) -- 2.25.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx