diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c index 58e87166a6f..e8d7de31030 100644 --- a/src/panfrost/lib/pan_layout.c +++ b/src/panfrost/lib/pan_layout.c @@ -485,7 +485,7 @@ pan_image_layout_init(unsigned arch, struct pan_image_layout *layout, bool linear = layout->modifier == DRM_FORMAT_MOD_LINEAR; bool is_3d = layout->dim == MALI_TEXTURE_DIMENSION_3D; - unsigned offset = explicit_layout ? explicit_layout->offset : 0; + uint64_t offset = explicit_layout ? explicit_layout->offset : 0; struct pan_block_size block_size = panfrost_block_size(layout->modifier, layout->format); @@ -543,8 +543,8 @@ pan_image_layout_init(unsigned arch, struct pan_image_layout *layout, row_stride = ALIGN_POT(row_stride, 64); } - unsigned slice_one_size = - row_stride * (effective_height / block_size.height); + uint64_t slice_one_size = + (uint64_t)row_stride * (effective_height / block_size.height); /* Compute AFBC sizes if necessary */ if (afbc) { @@ -583,7 +583,7 @@ pan_image_layout_init(unsigned arch, struct pan_image_layout *layout, slice->row_stride = row_stride; } - unsigned slice_full_size = slice_one_size * depth * layout->nr_samples; + uint64_t slice_full_size = slice_one_size * depth * layout->nr_samples; slice->surface_stride = slice_one_size; diff --git a/src/panfrost/lib/pan_texture.h b/src/panfrost/lib/pan_texture.h index 13235b06990..9f382fdf1f7 100644 --- a/src/panfrost/lib/pan_texture.h +++ b/src/panfrost/lib/pan_texture.h @@ -112,7 +112,7 @@ struct pan_image_layout { struct pan_image_slice_layout slices[MAX_MIP_LEVELS]; uint64_t data_size; - unsigned array_stride; + uint64_t array_stride; }; struct pan_image_mem {