Mesa (master): freedreno/layout: Move hard-coded minimum width for UBWC to a macro

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 18 20:57:08 UTC 2020


Module: Mesa
Branch: master
Commit: 03fdf418a58c60fcbe1d010f400d3a4692146101
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03fdf418a58c60fcbe1d010f400d3a4692146101

Author: Eduardo Lima Mitev <elima at igalia.com>
Date:   Wed May 13 12:51:36 2020 +0200

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 at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4565>

---

 src/freedreno/fdl/freedreno_layout.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/fdl/freedreno_layout.h b/src/freedreno/fdl/freedreno_layout.h
index bae4be585b0..dc65138be98 100644
--- a/src/freedreno/fdl/freedreno_layout.h
+++ b/src/freedreno/fdl/freedreno_layout.h
@@ -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;



More information about the mesa-commit mailing list