diff --git a/src/freedreno/common/freedreno_lrz.h b/src/freedreno/common/freedreno_lrz.h index fcb08b4d12e..14ba94dcf25 100644 --- a/src/freedreno/common/freedreno_lrz.h +++ b/src/freedreno/common/freedreno_lrz.h @@ -8,6 +8,30 @@ #include "adreno_common.xml.h" +enum fd_lrz_gpu_dir : uint8_t { + FD_LRZ_GPU_DIR_DISABLED = 0, + FD_LRZ_GPU_DIR_LESS = 1, + FD_LRZ_GPU_DIR_GREATER = 2, + FD_LRZ_GPU_DIR_NOT_SET = 3, +}; + +UNUSED static const char * +fd_lrz_gpu_dir_to_str(enum fd_lrz_gpu_dir dir) +{ + switch (dir) { + case FD_LRZ_GPU_DIR_DISABLED: + return "DISABLED"; + case FD_LRZ_GPU_DIR_LESS: + return "DIR_LESS"; + case FD_LRZ_GPU_DIR_GREATER: + return "DIR_GREATER"; + case FD_LRZ_GPU_DIR_NOT_SET: + return "DIR_NOT_SET"; + default: + return "INVALID"; + } +} + /* Layout of LRZ fast-clear buffer templated on the generation, the * members are as follows: * - fc1: The first FC buffer, always present. This may contain multiple @@ -30,7 +54,7 @@ struct PACKED fd_lrzfc_layout { uint8_t fc1[FC_SIZE]; union { struct { - uint8_t dir_track; + enum fd_lrz_gpu_dir dir_track; uint8_t _pad_; uint32_t gras_lrz_depth_view; }; @@ -51,7 +75,14 @@ struct PACKED fd_lrzfc_layout { }; uint8_t fc1[FC_SIZE * 2]; }; - uint8_t metadata[512]; + union { + struct { + enum fd_lrz_gpu_dir dir_track; + uint8_t _pad_; + uint32_t gras_lrz_depth_view; + }; + uint8_t metadata[512]; + }; union { struct { uint8_t fc2_a[FC_SIZE];