aubdump: Don't bail if a GEM handle of 0 is passed into execbuf
PATCH 1/1 aubdump: Don't bail if a GEM handle of 0 is passed into execbuf
A gem handle of 0 can be used to check for whether or not 48-bit addressing is available. This keeps aubdump from failing on you if you try to do the check.
--- tools/aubdump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
tools/aubdump.c +2 -3
@@ -131,7 +131,6 @@ get_bo(uint32_t handle)fail_if (handle >=MAX_BO_COUNT ,"bo handle too large\n" ); bo = &bos[handle]; -fail_if (bo->size ==0 ,"invalid bo handle (%d) in execbuf\n" , handle);return bo; }
@@ -442,7 +441,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) offset =align_u32 (offset + bo->size +4095 ,4096 ); } -if (bo->map ==NULL ) +if (bo->map ==NULL && bo->size >0 ) bo->map =gem_mmap (fd, obj->handle,0 , bo->size);fail_if (bo->map ==MAP_FAILED ,"intel_aubdump: bo mmap failed\n" ); }
@@ -583,7 +582,7 @@ maybe_init(void) }fclose (config); - bos =malloc (MAX_BO_COUNT *sizeof (bos[0 ])); + bos =calloc (MAX_BO_COUNT ,sizeof (bos[0 ]));fail_if (bos ==NULL ,"intel_aubdump: out of memory\n" ); }
Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patch is
Quoted 44 lines · Jason Ekstrand
A gem handle of 0 can be used to check for whether or not 48-bit addressing is available. This keeps aubdump from failing on you if you try to do the check.
--- tools/aubdump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)tools/aubdump.c +2
-3@@ -131,7 +131,6 @@ get_bo(uint32_t handle)fail_if (handle >=MAX_BO_COUNT ,"bo handle too large\n" ); bo = &bos[handle]; -fail_if (bo->size ==0 ,"invalid bo handle (%d) in execbuf\n" , handle);return bo; }@@ -442,7 +441,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) offset =align_u32 (offset + bo->size +4095 ,4096 ); } -if (bo->map ==NULL ) +if (bo->map ==NULL && bo->size >0 ) bo->map =gem_mmap (fd, obj->handle,0 , bo->size);fail_if (bo->map ==MAP_FAILED ,"intel_aubdump: bo mmap failed\n" ); }@@ -583,7 +582,7 @@ maybe_init(void) }fclose (config); - bos =malloc (MAX_BO_COUNT *sizeof (bos[0 ])); + bos =calloc (MAX_BO_COUNT ,sizeof (bos[0 ]));fail_if (bos ==NULL ,"intel_aubdump: out of memory\n" ); }Signature · 6 lines
2.5.0.400.gff86faf _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 3 lines · Rafael Antognolli
Patch is
Reviewed-by Rafael Antognolli <[email protected]>
Thanks! Pushed.
Quoted 41 lines · Jason Ekstrand
Quoted 12 lines
A gem handle of 0 can be used to check for whether or not 48-bit addressing is available. This keeps aubdump from failing on you if you try to do the check.
--- tools/aubdump.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)tools/aubdump.c +0
-0tools/aubdump.c get_bo(uint32_t handle) · line 134
Quoted 4 lines
tools/aubdump.c +0
-1@@ -131,7 +131,6 @@ get_bo(uint32_t handle)fail_if (handle >=MAX_BO_COUNT ,"bo handle too large\n" ); bo = &bos[handle]; - fail_if(bo->size == 0, "invalid bo handle (%d) in execbuf\n",handle);
tools/aubdump.c dump_execbuffer2(int fd, struct
Quoted 4 lines
tools/aubdump.c +0
-0return bo; }@@ -442,7 +441,7 @@ dump_execbuffer2(int fd, struct
drm_i915_gem_execbuffer2*execbuffer2)tools/aubdump.c dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
Quoted 7 lines
tools/aubdump.c +1
-1offset =align_u32 (offset + bo->size +4095 ,4096 ); } -if (bo->map ==NULL ) +if (bo->map ==NULL && bo->size >0 ) bo->map =gem_mmap (fd, obj->handle,0 , bo->size); fail_if(bo->map == MAP_FAILED, "intel_aubdump: bo mmapfailed\n");
Quoted 10 lines
tools/aubdump.c +1
-1}@@ -583,7 +582,7 @@ maybe_init(void) }fclose (config); - bos =malloc (MAX_BO_COUNT *sizeof (bos[0 ])); + bos =calloc (MAX_BO_COUNT ,sizeof (bos[0 ]));fail_if (bos ==NULL ,"intel_aubdump: out of memory\n" ); }
Quoted 8 lines
Quoted 7 lines
--
2.5.0.400.gff86faf_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx