[Mesa-dev] [PATCH 09/14] isl: Kill off isl_format_layout::bs
Chad Versace
chad.versace at intel.com
Tue Jul 12 21:11:17 UTC 2016
On Sat 09 Jul 2016, Jason Ekstrand wrote:
> ---
> src/intel/isl/gen_format_layout.py | 1 -
> src/intel/isl/isl.c | 11 ++++++-----
> src/intel/isl/isl.h | 5 ++---
> src/intel/isl/isl_gen9.c | 14 +++++++-------
> src/intel/isl/isl_storage_image.c | 4 ++--
> src/intel/vulkan/anv_image.c | 4 ++--
> src/intel/vulkan/anv_meta_copy.c | 4 ++--
> 7 files changed, 21 insertions(+), 22 deletions(-)
I like this change. It prevents accidental misuse of isl_format::bs when
the bs is not a multiple of 8.
>
> diff --git a/src/intel/isl/gen_format_layout.py b/src/intel/isl/gen_format_layout.py
> index 803967e..c9163fe 100644
> --- a/src/intel/isl/gen_format_layout.py
> +++ b/src/intel/isl/gen_format_layout.py
> @@ -68,7 +68,6 @@ TEMPLATE = template.Template(
> .format = ISL_FORMAT_${format.name},
> .name = "ISL_FORMAT_${format.name}",
> .bpb = ${format.bpb},
> - .bs = ${format.bpb // 8},
> .bw = ${format.bw},
> .bh = ${format.bh},
> .bd = ${format.bd},
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> index e0e67e2..8c114a2 100644
> --- a/src/intel/isl/isl.c
> +++ b/src/intel/isl/isl.c
> @@ -904,7 +904,8 @@ isl_calc_linear_row_pitch(const struct isl_device *dev,
> * being used to determine whether additional pages need to be defined.
> */
> assert(phys_slice0_sa->w % fmtl->bw == 0);
> - row_pitch = MAX(row_pitch, fmtl->bs * (phys_slice0_sa->w / fmtl->bw));
> + uint32_t bs = fmtl->bpb / 8;
> + row_pitch = MAX(row_pitch, bs * (phys_slice0_sa->w / fmtl->bw));
Like Topi said, bs should be const.
Either way,
Reviewed-by: Chad Versace <chad.versace at intel.com>
More information about the mesa-dev
mailing list