nil: Rename nil_tiling::gob_height_8 to gob_height_is_8

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>
This commit is contained in:
Faith Ekstrand 2024-04-05 19:01:50 -05:00 committed by Marge Bot
parent c13e7b01f9
commit 9fdcd217a4
4 changed files with 14 additions and 14 deletions

View File

@ -105,13 +105,13 @@ nil_offset4d_px_to_el(struct nil_offset4d offset_px,
enum nil_sample_layout sample_layout);
#define NIL_GOB_WIDTH_B 64
#define NIL_GOB_HEIGHT(gob_height_8) ((gob_height_8) ? 8 : 4)
#define NIL_GOB_HEIGHT(gob_height_is_8) ((gob_height_is_8) ? 8 : 4)
#define NIL_GOB_DEPTH 1
#define NIL_MAX_LEVELS 16
struct nil_tiling {
bool is_tiled:1;
bool gob_height_8:1; /**< GOB height is 4 or 8 */
bool gob_height_is_8:1; /**< GOB height is 4 or 8 */
uint8_t x_log2:3; /**< log2 of the Y tile dimension in GOBs */
uint8_t y_log2:3; /**< log2 of the Y tile dimension in GOBs */
uint8_t z_log2:3; /**< log2 of the Z tile dimension in GOBs */

View File

@ -177,11 +177,11 @@ nil_offset4d_px_to_B(struct nil_offset4d offset_px,
static struct nil_extent4d
nil_extent4d_B_to_GOB(struct nil_extent4d extent_B,
bool gob_height_8)
bool gob_height_is_8)
{
const struct nil_extent4d gob_extent_B = {
.w = NIL_GOB_WIDTH_B,
.h = NIL_GOB_HEIGHT(gob_height_8),
.h = NIL_GOB_HEIGHT(gob_height_is_8),
.d = NIL_GOB_DEPTH,
.a = 1,
};
@ -195,7 +195,7 @@ nil_tiling_extent_B(struct nil_tiling tiling)
if (tiling.is_tiled) {
return (struct nil_extent4d) {
.w = NIL_GOB_WIDTH_B << tiling.x_log2,
.h = NIL_GOB_HEIGHT(tiling.gob_height_8) << tiling.y_log2,
.h = NIL_GOB_HEIGHT(tiling.gob_height_is_8) << tiling.y_log2,
.d = NIL_GOB_DEPTH << tiling.z_log2,
.a = 1,
};
@ -224,7 +224,7 @@ nil_tiling_clamp(struct nil_tiling tiling, struct nil_extent4d extent_B)
tiling.x_log2 = 0;
const struct nil_extent4d extent_GOB =
nil_extent4d_B_to_GOB(extent_B, tiling.gob_height_8);
nil_extent4d_B_to_GOB(extent_B, tiling.gob_height_is_8);
tiling.y_log2 = MIN2(tiling.y_log2, util_logbase2_ceil(extent_GOB.h));
tiling.z_log2 = MIN2(tiling.z_log2, util_logbase2_ceil(extent_GOB.d));
@ -263,7 +263,7 @@ choose_tiling(struct nil_extent4d extent_px,
struct nil_tiling tiling = {
.is_tiled = true,
.gob_height_8 = true,
.gob_height_is_8 = true,
.y_log2 = 5,
.z_log2 = 5,
};
@ -343,13 +343,13 @@ sparse_tiling(enum pipe_format format, enum nil_image_dim dim)
assert(util_is_power_of_two_or_zero(sparse_block_extent_B.h));
assert(util_is_power_of_two_or_zero(sparse_block_extent_B.d));
const bool gob_height_8 = true;
const bool gob_height_is_8 = true;
const struct nil_extent4d sparse_block_extent_GOB =
nil_extent4d_B_to_GOB(sparse_block_extent_B, gob_height_8);
nil_extent4d_B_to_GOB(sparse_block_extent_B, gob_height_is_8);
return (struct nil_tiling) {
.is_tiled = true,
.gob_height_8 = gob_height_8,
.gob_height_is_8 = gob_height_is_8,
.x_log2 = util_logbase2(sparse_block_extent_GOB.w),
.y_log2 = util_logbase2(sparse_block_extent_GOB.h),
.z_log2 = util_logbase2(sparse_block_extent_GOB.d),

View File

@ -348,7 +348,7 @@ nv9097_nil_image_fill_tic(const struct nil_image *image,
if (tiling->is_tiled) {
TH_NV9097_SET_E(th, 2, MEMORY_LAYOUT, BLOCKLINEAR);
assert(tiling->gob_height_8);
assert(tiling->gob_height_is_8);
assert(tiling->x_log2 == 0);
TH_NV9097_SET_E(th, 2, GOBS_PER_BLOCK_WIDTH, ONE_GOB);
TH_NV9097_SET_U(th, 2, GOBS_PER_BLOCK_HEIGHT, tiling->y_log2);
@ -448,7 +448,7 @@ nvb097_nil_image_fill_tic(struct nv_device_info *dev,
TH_NVB097_SET_U(th, BL, ADDRESS_BITS31TO9, (uint32_t)layer_address >> 9);
TH_NVB097_SET_U(th, BL, ADDRESS_BITS47TO32, layer_address >> 32);
assert(tiling->gob_height_8);
assert(tiling->gob_height_is_8);
TH_NVB097_SET_E(th, BL, GOBS_PER_BLOCK_WIDTH, ONE_GOB);
TH_NVB097_SET_U(th, BL, GOBS_PER_BLOCK_HEIGHT, tiling->y_log2);
TH_NVB097_SET_U(th, BL, GOBS_PER_BLOCK_DEPTH, tiling->z_log2);

View File

@ -237,7 +237,7 @@ nouveau_copy_rect(struct nvk_cmd_buffer *cmd, struct nouveau_copy *copy)
.width = 0, /* Tiles are always 1 GOB wide */
.height = copy->src.tiling.y_log2,
.depth = copy->src.tiling.z_log2,
.gob_height = copy->src.tiling.gob_height_8 ?
.gob_height = copy->src.tiling.gob_height_is_8 ?
GOB_HEIGHT_GOB_HEIGHT_FERMI_8 :
GOB_HEIGHT_GOB_HEIGHT_TESLA_4,
});
@ -278,7 +278,7 @@ nouveau_copy_rect(struct nvk_cmd_buffer *cmd, struct nouveau_copy *copy)
.width = 0, /* Tiles are always 1 GOB wide */
.height = copy->dst.tiling.y_log2,
.depth = copy->dst.tiling.z_log2,
.gob_height = copy->dst.tiling.gob_height_8 ?
.gob_height = copy->dst.tiling.gob_height_is_8 ?
GOB_HEIGHT_GOB_HEIGHT_FERMI_8 :
GOB_HEIGHT_GOB_HEIGHT_TESLA_4,
});