This set of patches adds support in isl for the various types of auxiliary surfaces. Chad and I have been fiercely arguing back and forth for about the last two weeks on how we want to handle all of the different aspects of auxiliary surfaces. This little series is the result of that discussion. At this point, I think both of us are happy with the solution proposed here.
The basic idea is that an auxiliary surface stores the data in a sort of compressed format. The auxiliary surface is its own surface that has a carefully chosen format and tiling that both accurately represents what is going on in the compression and yields the correct surface layout calculations. For instance, with SKL color compression, every two bits in the CCS corresponds to a cache-line pair in main surface and each cache line in the CCS corresponds to a 16x16 block of cache line pairs. Therefore, the CCS surface has a 2bpb compressed format that covers one cache line pair and a tiling that has a logical size of 128el x 128el. One of the primary changes required to make this work is to alter the concept of the size of a tile. Instead of a single tile size, we now have both a logical size in surface elements and a physical size in bytes and rows. The logical size is used when carving the image up into tiles, but the physical size is what is used when calculating the surface pitch. This seems to much better model how the hardware works where different types of surfaces have different tile dimensions but most tiles are 128B x 32rows. Not only does this help when defining auxiliary surfaces but it also takes care of the oddity of W-tiled surfaces where you have to multiply the pitch by 2. Instead, we simply say that a W-tile is logically 64el x 64el but has a physical size of 128B x 32rows. Because CCS surfaces are 1 or 2 bits per block, we have to bring back the isl_format_layout::bpb field. There are 4 patches in this series to do so. I'd like to commit the first three, but the other one (patch 9) I don't much care about. I included it in case we really want to get rid of redundant information, but I'm ok with having both fields. This series can be found on my freedesktop.org cgit here: https://cgit.freedesktop.org/~jekstrand/mesa/?h=wip/hiz-v1 Jason Ekstrand (14): isl: Get rid of tiling_get_extent isl: Stop multiplying height by block size isl: Rework the way we handle surface padding isl: Rework the way we define tile sizes. isl: Change the physical size of a W-tile to 128x32 isl: Bring back isl_format_layout::bpb isl: Use bpb in a few places where it's more natural than bs isl: Take bpb rather than bs in get_format_layout isl: Kill off isl_format_layout::bs isl: Add support for HiZ surfaces isl: Add support for multisample compression surfaces isl: Add support for color control surfaces isl: Add an auxiliary surface usage enum isl/state: Add support for handling color control surfaces src/intel/isl/gen_format_layout.py | 4 +- src/intel/isl/isl.c | 286 ++++++++++++--------- src/intel/isl/isl.h | 116 ++++++++- src/intel/isl/isl_format_layout.csv | 14 + src/intel/isl/isl_gen6.c | 10 +- src/intel/isl/isl_gen7.c | 23 +- src/intel/isl/isl_gen8.c | 16 +- src/intel/isl/isl_gen9.c | 26 +- src/intel/isl/isl_storage_image.c | 8 +- src/intel/isl/isl_surface_state.c | 54 +++- src/intel/vulkan/anv_formats.c | 4 +- src/intel/vulkan/anv_image.c | 4 +- src/intel/vulkan/anv_meta_blit2d.c | 2 +- src/intel/vulkan/anv_meta_copy.c | 4 +- src/intel/vulkan/genX_cmd_buffer.c | 7 +- .../drivers/dri/i965/brw_fs_surface_builder.cpp | 4 +- 16 files changed, 406 insertions(+), 176 deletions(-) -- 2.5.0.400.gff86faf _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev