diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2024-05-15 14:19:42 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2024-05-16 06:14:58 +0200 |
commit | c6ebaf8f9f620f4ae4cd0beb0072ff536d3c2588 (patch) | |
tree | 56eed9248dbca479b73df9338c09f3ab49610048 /lib | |
parent | 46211eeb76b330bc4994b2213eb57991e4c991bd (diff) |
lib/intel_bufops: Restrict tilings on non-flatccs platforms
JP noticed after last changes introduced in bufops we keep unnecessary
two conditions instead of pack them to single one. This is refactor,
no functional change.
Suggested-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Link: https://lore.kernel.org/r/20240515121949.245280-3-zbigniew.kempczynski@intel.com
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/intel_bufops.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c index 43d6dd5b4..7118272e5 100644 --- a/lib/intel_bufops.c +++ b/lib/intel_bufops.c @@ -896,7 +896,9 @@ static void __intel_buf_init(struct buf_ops *bops, size = buf->surface[0].size = buf->surface[0].stride * aligned_height; - if (compression) { + if (compression && !HAS_FLATCCS(buf_ops_get_devid(bops))) { + int aux_width, aux_height; + igt_require(bops->intel_gen >= 9); igt_assert(req_tiling == I915_TILING_Y || req_tiling == I915_TILING_Yf || @@ -907,17 +909,12 @@ static void __intel_buf_init(struct buf_ops *bops, * CCS units, that is 4 * 64 bytes. These 4 CCS units are in * turn mapped by one L1 AUX page table entry. */ + aux_width = intel_buf_ccs_width(bops->intel_gen, buf); + aux_height = intel_buf_ccs_height(bops->intel_gen, buf); - if (!HAS_FLATCCS(intel_get_drm_devid(bops->fd))) { - int aux_width, aux_height; - - aux_width = intel_buf_ccs_width(bops->intel_gen, buf); - aux_height = intel_buf_ccs_height(bops->intel_gen, buf); - - buf->ccs[0].offset = buf->surface[0].stride * ALIGN(height, 32); - buf->ccs[0].stride = aux_width; - size = buf->ccs[0].offset + aux_width * aux_height; - } + buf->ccs[0].offset = buf->surface[0].stride * ALIGN(height, 32); + buf->ccs[0].stride = aux_width; + size = buf->ccs[0].offset + aux_width * aux_height; } /* Store buffer size to avoid mistakes in calculating it again */ |