freedreno/layout: Move hard-coded minimum width for UBWC to a macro

This will also allow reuse of the value later in this series.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>
This commit is contained in:
Eduardo Lima Mitev 2020-05-13 12:51:36 +02:00 committed by Marge Bot
parent 536ec9d7f5
commit 03fdf418a5
1 changed files with 4 additions and 1 deletions

View File

@ -195,6 +195,9 @@ fdl_ubwc_offset(const struct fdl_layout *layout, unsigned level, unsigned layer)
return slice->offset + layer * layout->ubwc_layer_size;
}
/* Minimum layout width to enable UBWC. */
#define FDL_MIN_UBWC_WIDTH 16
static inline bool
fdl_level_linear(const struct fdl_layout *layout, int level)
{
@ -202,7 +205,7 @@ fdl_level_linear(const struct fdl_layout *layout, int level)
return false;
unsigned w = u_minify(layout->width0, level);
if (w < 16)
if (w < FDL_MIN_UBWC_WIDTH)
return true;
return false;