isl: add a tool to query surface parameters
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 13 Jul 2023 09:27:06 +0000 (12:27 +0300)
committerMarge Bot <emma+marge@anholt.net>
Mon, 17 Jul 2023 08:05:21 +0000 (08:05 +0000)
commita303ff668471058cb9c317a9b7c7d50fa4b875d8
tree0b3c16060c05ccfcc1361beed55bc78d7302381c
parentdfd96fac41418ac85fd64ffb2973ff1a7ca2a363
isl: add a tool to query surface parameters

$ ./build/src/intel/isl/isl_query -p dg2 -w 128 -h 64 -l 4
Surface parameters:
  dim:                 2d
  dim_layout:          0
  msaa_layout:         0
  tiling:              64
  format:              R8G8B8A8_UNORM
  img_align_el:        128x128x1
  logical_level0_px:   128x64x1x1
  phys_level0_sa:      128x64x1x1
  levels:              4
  samples:             1x
  size_B:              131072
  alignment_B:         65536
  row_pitch_B:         512
  array_pitch_el_rows: 256
  tile_info:
    tiling:             64
    format_bpb:         32
    logical_extent_el:  128x128x1x1
    phys_extent_B:      512x128 = 65536

$./build/src/intel/isl/isl_query -p skl -w 128 -h 64 -l 4 -f R8G8B8_UINT
Surface parameters:
  dim:                 2d
  dim_layout:          0
  msaa_layout:         0
  tiling:              Y0
  format:              R8G8B8_UINT
  img_align_el:        16x4x1
  logical_level0_px:   128x64x1x1
  phys_level0_sa:      128x64x1x1
  levels:              4
  samples:             1x
  size_B:              36864
  alignment_B:         4096
  row_pitch_B:         384
  array_pitch_el_rows: 96
  tile_info:
    tiling:             Y0
    format_bpb:         8
    logical_extent_el:  128x32x1x1
    phys_extent_B:      128x32 = 4096

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24142>
src/intel/isl/isl.c
src/intel/isl/isl.h
src/intel/isl/isl_query.c [new file with mode: 0644]
src/intel/isl/meson.build