From 873a044cb3d6c99e6fc749fa7c5d2afc5e904f4b Mon Sep 17 00:00:00 2001 From: Mohamed Ahmed Date: Fri, 12 Apr 2024 21:42:50 +0200 Subject: [PATCH] nil: Add a nil_image::compressed bit Reviewed-by: Dave Airlie Part-of: --- src/nouveau/nil/image.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/nouveau/nil/image.rs b/src/nouveau/nil/image.rs index 1b37fe4197c..ebcc3bf13f5 100644 --- a/src/nouveau/nil/image.rs +++ b/src/nouveau/nil/image.rs @@ -104,6 +104,7 @@ pub struct Image { pub array_stride_B: u64, pub align_B: u32, pub size_B: u64, + pub compressed: bool, pub tile_mode: u16, pub pte_kind: u8, } @@ -159,6 +160,7 @@ impl Image { array_stride_B: 0, align_B: 0, size_B: 0, + compressed: false, tile_mode: 0, pte_kind: 0, mip_tail_first_lod: 0, @@ -235,9 +237,12 @@ impl Image { image.tile_mode = u16::from(image.levels[0].tiling.y_log2) << 4 | u16::from(image.levels[0].tiling.z_log2) << 8; - // TODO: compressed - image.pte_kind = - Self::choose_pte_kind(dev, info.format, info.samples, false); + image.pte_kind = Self::choose_pte_kind( + dev, + info.format, + info.samples, + image.compressed, + ); image.align_B = std::cmp::max(image.align_B, 4096); if image.pte_kind >= 0xb && image.pte_kind <= 0xe {