summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-04-17 21:54:05 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-04-18 21:13:45 +0300
commit0dc1d6e4d4305a62c64242ec65709e44f5036cf4 (patch)
treec7a1f9601f72ef0659d2e18ea161d9838d3b0183
parent9b63498756875e8166e10d728056e5f4ac036da6 (diff)
lib/igt_fb: Fix blitter limit checks
The earlier approach of checking the higher tiled stride limit has backfired. All out blits are between tiled and linear, but we only ever check this for the tiled fb. Thus we are taking the blitter path even though the linear fb exceeds the blitter limits. So let's just check the limits as if we are operating on linear fbs. And let's toss in some width/height checks, and let's do the checks for all the color planes as well. v2: Reword the comment a bit to hopefully make it legible (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--lib/igt_fb.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 292c19d2..8664d1af 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1580,29 +1580,37 @@ struct fb_blit_upload {
struct intel_batchbuffer *batch;
};
-static int max_blitter_stride(int fd, uint64_t modifier)
+static bool blitter_ok(const struct igt_fb *fb)
{
- int stride = 32768;
-
- if (intel_gen(intel_get_drm_devid(fd)) >= 4 &&
- modifier != DRM_FORMAT_MOD_NONE)
- stride *= 4;
+ for (int i = 0; i < fb->num_planes; i++) {
+ /*
+ * gen4+ stride limit is 4x this with tiling,
+ * but since our blits are always between tiled
+ * and linear surfaces (and we do this check just
+ * for the tiled surface) we must use the lower
+ * linear stride limit here.
+ */
+ if (fb->plane_width[i] > 32767 ||
+ fb->plane_height[i] > 32767 ||
+ fb->strides[i] > 32767)
+ return false;
+ }
- return stride;
+ return true;
}
static bool use_rendercopy(const struct igt_fb *fb)
{
return is_ccs_modifier(fb->modifier) ||
(fb->modifier == I915_FORMAT_MOD_Yf_TILED &&
- fb->strides[0] >= max_blitter_stride(fb->fd, fb->modifier));
+ !blitter_ok(fb));
}
static bool use_blitter(const struct igt_fb *fb)
{
return (fb->modifier == I915_FORMAT_MOD_Y_TILED ||
fb->modifier == I915_FORMAT_MOD_Yf_TILED) &&
- fb->strides[0] < max_blitter_stride(fb->fd, fb->modifier);
+ blitter_ok(fb);
}
static void init_buf(struct fb_blit_upload *blit,