Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: host1x: Use struct host1x_bo pointers in traces

Rather than cast to a u32 use the struct host1x_bo pointers directly.
This avoid annoying warnings for 64-bit builds.

Signed-off-by: Thierry Reding <treding@nvidia.com>

+23 -16
+8 -4
drivers/gpu/host1x/hw/channel_hw.c
··· 32 32 static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo, 33 33 u32 offset, u32 words) 34 34 { 35 + struct device *dev = cdma_to_channel(cdma)->dev; 35 36 void *mem = NULL; 36 37 37 38 if (host1x_debug_trace_cmdbuf) ··· 45 44 * of how much you can output to ftrace at once. 46 45 */ 47 46 for (i = 0; i < words; i += TRACE_MAX_LENGTH) { 48 - trace_host1x_cdma_push_gather( 49 - dev_name(cdma_to_channel(cdma)->dev), 50 - (u32)bo, min(words - i, TRACE_MAX_LENGTH), 51 - offset + i * sizeof(u32), mem); 47 + u32 num_words = min(words - i, TRACE_MAX_LENGTH); 48 + offset += i * sizeof(u32); 49 + 50 + trace_host1x_cdma_push_gather(dev_name(dev), bo, 51 + num_words, offset, 52 + mem); 52 53 } 54 + 53 55 host1x_bo_munmap(bo, mem); 54 56 } 55 57 }
+15 -12
include/trace/events/host1x.h
··· 29 29 #include <linux/ktime.h> 30 30 #include <linux/tracepoint.h> 31 31 32 + struct host1x_bo; 33 + 32 34 DECLARE_EVENT_CLASS(host1x, 33 35 TP_PROTO(const char *name), 34 36 TP_ARGS(name), ··· 81 79 ); 82 80 83 81 TRACE_EVENT(host1x_cdma_push_gather, 84 - TP_PROTO(const char *name, u32 mem_id, 82 + TP_PROTO(const char *name, struct host1x_bo *bo, 85 83 u32 words, u32 offset, void *cmdbuf), 86 84 87 - TP_ARGS(name, mem_id, words, offset, cmdbuf), 85 + TP_ARGS(name, bo, words, offset, cmdbuf), 88 86 89 87 TP_STRUCT__entry( 90 88 __field(const char *, name) 91 - __field(u32, mem_id) 89 + __field(struct host1x_bo *, bo) 92 90 __field(u32, words) 93 91 __field(u32, offset) 94 92 __field(bool, cmdbuf) ··· 102 100 } 103 101 __entry->cmdbuf = cmdbuf; 104 102 __entry->name = name; 105 - __entry->mem_id = mem_id; 103 + __entry->bo = bo; 106 104 __entry->words = words; 107 105 __entry->offset = offset; 108 106 ), 109 107 110 - TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]", 111 - __entry->name, __entry->mem_id, 108 + TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]", 109 + __entry->name, __entry->bo, 112 110 __entry->words, __entry->offset, 113 111 __print_hex(__get_dynamic_array(cmdbuf), 114 112 __entry->cmdbuf ? __entry->words * 4 : 0)) ··· 223 221 ); 224 222 225 223 TRACE_EVENT(host1x_syncpt_wait_check, 226 - TP_PROTO(void *mem_id, u32 offset, u32 syncpt_id, u32 thresh, u32 min), 224 + TP_PROTO(struct host1x_bo *bo, u32 offset, u32 syncpt_id, u32 thresh, 225 + u32 min), 227 226 228 - TP_ARGS(mem_id, offset, syncpt_id, thresh, min), 227 + TP_ARGS(bo, offset, syncpt_id, thresh, min), 229 228 230 229 TP_STRUCT__entry( 231 - __field(void *, mem_id) 230 + __field(struct host1x_bo *, bo) 232 231 __field(u32, offset) 233 232 __field(u32, syncpt_id) 234 233 __field(u32, thresh) ··· 237 234 ), 238 235 239 236 TP_fast_assign( 240 - __entry->mem_id = mem_id; 237 + __entry->bo = bo; 241 238 __entry->offset = offset; 242 239 __entry->syncpt_id = syncpt_id; 243 240 __entry->thresh = thresh; 244 241 __entry->min = min; 245 242 ), 246 243 247 - TP_printk("mem_id=%p, offset=%05x, id=%d, thresh=%d, current=%d", 248 - __entry->mem_id, __entry->offset, 244 + TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d", 245 + __entry->bo, __entry->offset, 249 246 __entry->syncpt_id, __entry->thresh, 250 247 __entry->min) 251 248 );