summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-08-06 15:39:01 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-10-15 12:30:22 +0100
commit34b61beba9b1ac560db888a8190e461edf600a9a (patch)
tree91528a678b86b508cc129a23d50731e47c51a1b9 /lib
parent148b00789bd4fce4476f9360187c1cdb18a4e90c (diff)
lib: Use unsigned gen for forward compatible tests
Unknown, so future, gen are marked as -1 which we want to treat as -1u so that always pass >= gen checks. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2298 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/intel_batchbuffer.c10
-rw-r--r--lib/intel_batchbuffer.h10
2 files changed, 11 insertions, 9 deletions
diff --git a/lib/intel_batchbuffer.c b/lib/intel_batchbuffer.c
index 60dbfe26..fc73495c 100644
--- a/lib/intel_batchbuffer.c
+++ b/lib/intel_batchbuffer.c
@@ -414,7 +414,7 @@ intel_blt_copy(struct intel_batchbuffer *batch,
drm_intel_bo *dst_bo, int dst_x1, int dst_y1, int dst_pitch,
int width, int height, int bpp)
{
- const int gen = batch->gen;
+ const unsigned int gen = batch->gen;
uint32_t src_tiling, dst_tiling, swizzle;
uint32_t cmd_bits = 0;
uint32_t br13_bits;
@@ -553,7 +553,7 @@ unsigned igt_buf_height(const struct igt_buf *buf)
* Returns:
* The width of the ccs buffer data.
*/
-unsigned int igt_buf_intel_ccs_width(int gen, const struct igt_buf *buf)
+unsigned int igt_buf_intel_ccs_width(unsigned int gen, const struct igt_buf *buf)
{
/*
* GEN12+: The CCS unit size is 64 bytes mapping 4 main surface
@@ -576,7 +576,7 @@ unsigned int igt_buf_intel_ccs_width(int gen, const struct igt_buf *buf)
* Returns:
* The height of the ccs buffer data.
*/
-unsigned int igt_buf_intel_ccs_height(int gen, const struct igt_buf *buf)
+unsigned int igt_buf_intel_ccs_height(unsigned int gen, const struct igt_buf *buf)
{
/*
* GEN12+: The CCS unit size is 64 bytes mapping 4 main surface
@@ -703,7 +703,7 @@ fill_object(struct drm_i915_gem_exec_object2 *obj, uint32_t gem_handle,
static void exec_blit(int fd,
struct drm_i915_gem_exec_object2 *objs, uint32_t count,
- int gen)
+ unsigned int gen)
{
struct drm_i915_gem_execbuffer2 exec = {
.buffers_ptr = to_user_pointer(objs),
@@ -2416,7 +2416,7 @@ void intel_bb_emit_blt_copy(struct intel_bb *ibb,
int dst_x1, int dst_y1, int dst_pitch,
int width, int height, int bpp)
{
- const int gen = ibb->gen;
+ const unsigned int gen = ibb->gen;
uint32_t cmd_bits = 0;
uint32_t br13_bits;
uint32_t mask;
diff --git a/lib/intel_batchbuffer.h b/lib/intel_batchbuffer.h
index d20b4e66..ab1b0c28 100644
--- a/lib/intel_batchbuffer.h
+++ b/lib/intel_batchbuffer.h
@@ -15,7 +15,7 @@
struct intel_batchbuffer {
drm_intel_bufmgr *bufmgr;
uint32_t devid;
- int gen;
+ unsigned int gen;
drm_intel_context *ctx;
drm_intel_bo *bo;
@@ -263,8 +263,10 @@ static inline bool igt_buf_compressed(const struct igt_buf *buf)
unsigned igt_buf_width(const struct igt_buf *buf);
unsigned igt_buf_height(const struct igt_buf *buf);
-unsigned int igt_buf_intel_ccs_width(int gen, const struct igt_buf *buf);
-unsigned int igt_buf_intel_ccs_height(int gen, const struct igt_buf *buf);
+unsigned int igt_buf_intel_ccs_width(unsigned int gen,
+ const struct igt_buf *buf);
+unsigned int igt_buf_intel_ccs_height(unsigned int gen,
+ const struct igt_buf *buf);
void igt_blitter_src_copy(int fd,
/* src */
@@ -434,7 +436,7 @@ igt_media_spinfunc_t igt_get_media_spinfunc(int devid);
*/
struct intel_bb {
int i915;
- int gen;
+ unsigned int gen;
bool debug;
bool dump_base64;
bool enforce_relocs;