summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@intel.com>2015-12-10 16:54:40 +0200
committerMika Kuoppala <mika.kuoppala@intel.com>2015-12-14 10:23:58 +0200
commit5a8d063e42c7b5843a0f069d4c2216f8f4fb81fe (patch)
tree8dda0ec720ca4a2d1a28bdb2f7fd205a1c44ab2c
parent14f70a861b66f8a62a53911cf587fadeebca5957 (diff)
tests/gem_softpin: Fix compiler warning on 32bit systems
We get build error as we try to cast from ptr to integer of different size on 32 bit platforms. Use unsigned long as the cast, it will work with both 32 and 64 bit systems. Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
-rw-r--r--tests/gem_softpin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c
index 7bee16b4..0919716e 100644
--- a/tests/gem_softpin.c
+++ b/tests/gem_softpin.c
@@ -155,7 +155,7 @@ static uint32_t init_userptr(int fd, i915_gem_userptr *userptr, void *ptr,
memset((void*)userptr, 0, sizeof(i915_gem_userptr));
- userptr->user_ptr = (uint64_t)ptr; /* Need the cast to overcome compiler warning */
+ userptr->user_ptr = (unsigned long)ptr; /* Need the cast to overcome compiler warning */
userptr->user_size = size;
userptr->flags = 0; /* use synchronized operation */
@@ -270,7 +270,7 @@ static void setup_execbuffer(struct drm_i915_gem_execbuffer2 *execbuf,
struct drm_i915_gem_exec_object2 *exec_object,
int ring, int buffer_count, int batch_length)
{
- execbuf->buffers_ptr = (uint64_t)exec_object;
+ execbuf->buffers_ptr = (unsigned long)exec_object;
execbuf->buffer_count = buffer_count;
execbuf->batch_start_offset = 0;
execbuf->batch_len = batch_length;
@@ -417,7 +417,7 @@ static void gem_pin_bo_test(void)
EXEC_OBJECT_PINNED, pinning_offset);
setup_exec_obj(&exec_object2[1], batch_buf_handle, 0, 0);
exec_object2[1].relocation_count = 1;
- exec_object2[1].relocs_ptr = (uint64_t)reloc;
+ exec_object2[1].relocs_ptr = (unsigned long)reloc;
ring = I915_EXEC_RENDER;