From 7685f48ece721960f6cbb105fca9ea60d256d200 Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Tue, 28 Jan 2020 16:37:19 +0200 Subject: [PATCH] intel/bufmgr: Cast bitshift to unsigned ../src/mesa/drivers/dri/i965/intel_buffer_objects.c:405:4: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' #0 0x7f9404ac4ae1 in brw_map_buffer_range ../src/mesa/drivers/dri/i965/intel_buffer_objects.c:405 #1 0x7f9405a9cb13 in vbo_save_map_vertex_store ../src/mesa/vbo/vbo_save_api.c:261 #2 0x7f9405b6a89d in vbo_save_NewList ../src/mesa/vbo/vbo_save_api.c:1774 #3 0x7f94051aba3d in _mesa_NewList ../src/mesa/main/dlist.c:14172 ../src/gallium/drivers/iris/iris_resource.c:1725:61: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' #0 0x7fe51c820c8e in iris_map_direct ../src/gallium/drivers/iris/iris_resource.c:1725 #1 0x7fe51c82322c in iris_transfer_map ../src/gallium/drivers/iris/iris_resource.c:1895 #2 0x7fe5202628be in u_transfer_helper_transfer_map ../src/gallium/auxiliary/util/u_transfer_helper.c:243 #3 0x7fe51997c508 in pipe_buffer_map_range ../src/gallium/auxiliary/util/u_inlines.h:344 #4 0x7fe51997ec8d in u_upload_alloc_buffer ../src/gallium/auxiliary/util/u_upload_mgr.c:221 #5 0x7fe51997f24f in u_upload_alloc ../src/gallium/auxiliary/util/u_upload_mgr.c:254 #6 0x7fe51ccf43af in upload_state ../src/gallium/drivers/iris/iris_state.c:323 #7 0x7fe51d06963a in gen9_init_state ../src/gallium/drivers/iris/iris_state.c:7516 #8 0x7fe51c7c2ea0 in iris_create_context ../src/gallium/drivers/iris/iris_context.c:294 #9 0x7fe519dc729b in st_api_create_context ../src/mesa/state_tracker/st_manager.c:921 #10 0x7fe5198c47ea in dri_create_context ../src/gallium/state_trackers/dri/dri_context.c:161 #11 0x7fe519898aac in driCreateContextAttribs ../src/mesa/drivers/dri/common/dri_util.c:475 Signed-off-by: Danylo Piliaiev Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/iris/iris_bufmgr.h | 2 +- src/mesa/drivers/dri/i965/brw_bufmgr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h index 3d23bca208d..1d6ef975559 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.h +++ b/src/gallium/drivers/iris/iris_bufmgr.h @@ -255,7 +255,7 @@ void iris_bo_unreference(struct iris_bo *bo); #define MAP_PERSISTENT PIPE_TRANSFER_PERSISTENT #define MAP_COHERENT PIPE_TRANSFER_COHERENT /* internal */ -#define MAP_INTERNAL_MASK (0xff << 24) +#define MAP_INTERNAL_MASK (0xffu << 24) #define MAP_RAW (0x01 << 24) #define MAP_FLAGS (MAP_READ | MAP_WRITE | MAP_ASYNC | \ diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.h b/src/mesa/drivers/dri/i965/brw_bufmgr.h index a85c8f37bef..5dc342cf8c6 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.h +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.h @@ -270,7 +270,7 @@ void brw_bo_unreference(struct brw_bo *bo); #define MAP_PERSISTENT GL_MAP_PERSISTENT_BIT #define MAP_COHERENT GL_MAP_COHERENT_BIT /* internal */ -#define MAP_INTERNAL_MASK (0xff << 24) +#define MAP_INTERNAL_MASK (0xffu << 24) #define MAP_RAW (0x01 << 24) /** -- 2.30.2