nouveau: pacify gcc on ILP32

The gcc we're using (and quite possibly newer ones) throws a really
stupid error:

   ../src/gallium/drivers/nouveau/nouveau_buffer.c:765:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      buffer->address = (uint64_t)user_ptr;

Which... address is a uint64_t, and user_ptr is a void *, so this is
completely unambiguously safe to do. Apparently casting to uintptr_t
squelches this, so do that instead.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8394>
This commit is contained in:
Adam Jackson 2021-01-08 11:59:12 -05:00 committed by Marge Bot
parent a302de9a43
commit 1a8dcfc74c
2 changed files with 2 additions and 2 deletions

View File

@ -762,7 +762,7 @@ nouveau_buffer_create_from_user(struct pipe_screen *pscreen,
* existing code. It's correct nonetheless as the same pointer is equally * existing code. It's correct nonetheless as the same pointer is equally
* valid on the CPU and the GPU. * valid on the CPU and the GPU.
*/ */
buffer->address = (uint64_t)user_ptr; buffer->address = (uintptr_t)user_ptr;
buffer->data = user_ptr; buffer->data = user_ptr;
buffer->status = NOUVEAU_BUFFER_STATUS_USER_PTR; buffer->status = NOUVEAU_BUFFER_STATUS_USER_PTR;
buffer->base.screen = pscreen; buffer->base.screen = pscreen;

View File

@ -262,7 +262,7 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
} }
struct drm_nouveau_svm_init svm_args = { struct drm_nouveau_svm_init svm_args = {
.unmanaged_addr = (uint64_t)screen->svm_cutout, .unmanaged_addr = (uintptr_t)screen->svm_cutout,
.unmanaged_size = screen->svm_cutout_size, .unmanaged_size = screen->svm_cutout_size,
}; };