mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-30 23:28:06 +02:00
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:
parent
a302de9a43
commit
1a8dcfc74c
2 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
* valid on the CPU and the GPU.
|
||||
*/
|
||||
buffer->address = (uint64_t)user_ptr;
|
||||
buffer->address = (uintptr_t)user_ptr;
|
||||
buffer->data = user_ptr;
|
||||
buffer->status = NOUVEAU_BUFFER_STATUS_USER_PTR;
|
||||
buffer->base.screen = pscreen;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
|
|||
}
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue