diff mbox

[xf86-video-intel,1/6] sna: Add SAMPLER_OFFSET() compile time asserts for gen6/7

Message ID 20180704185919.30946-1-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä July 4, 2018, 6:59 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

gen8/9 has some compile time asserts to verify the SAMPLER_OFFSET() bits
don't exceed their quota of the flags. Add similar asserts for gen6/7.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 src/sna/gen6_render.c | 1 +
 src/sna/gen7_render.c | 1 +
 2 files changed, 2 insertions(+)
diff mbox

Patch

diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 0a53ef562540..1558750325f0 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -3725,6 +3725,7 @@  static bool gen6_render_setup(struct sna *sna, int devid)
 		}
 	}
 
+	COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff);
 	ss = sna_static_stream_map(&general,
 				   2 * sizeof(*ss) *
 				   (2 +
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 0a3bda768100..671f60e07679 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -3958,6 +3958,7 @@  static bool gen7_render_setup(struct sna *sna, int devid)
 		assert(state->wm_kernel[m][0]|state->wm_kernel[m][1]|state->wm_kernel[m][2]);
 	}
 
+	COMPILE_TIME_ASSERT(SAMPLER_OFFSET(FILTER_COUNT, EXTEND_COUNT, FILTER_COUNT, EXTEND_COUNT) <= 0xfff);
 	ss = sna_static_stream_map(&general,
 				   2 * sizeof(*ss) *
 				   (2 +