1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2 /* Copyright (c) 2023 Imagination Technologies Ltd. */
7 #include <drm/drm_file.h>
8 #include <linux/types.h>
10 #include "pvr_rogue_fwif.h"
12 /* Forward declaration from pvr_device.h. */
15 /* Forward declaration from pvr_gem.h. */
18 /* Forward declarations from pvr_rogue_fwif.h */
19 struct rogue_fwif_tracebuf;
20 struct rogue_fwif_tracebuf_space;
23 * struct pvr_fw_trace_buffer - Structure representing a trace buffer
25 struct pvr_fw_trace_buffer {
26 /** @buf_obj: FW buffer object representing trace buffer. */
27 struct pvr_fw_object *buf_obj;
29 /** @buf: Pointer to CPU mapping of trace buffer. */
33 * @tracebuf_space: Pointer to FW tracebuf_space structure for this
36 struct rogue_fwif_tracebuf_space *tracebuf_space;
40 * struct pvr_fw_trace - Device firmware trace data
44 * @tracebuf_ctrl_obj: Object representing FW trace buffer control
47 struct pvr_fw_object *tracebuf_ctrl_obj;
50 * @tracebuf_ctrl: Pointer to CPU mapping of FW trace buffer control
53 struct rogue_fwif_tracebuf *tracebuf_ctrl;
56 * @buffers: Array representing the actual trace buffers owned by this
59 struct pvr_fw_trace_buffer buffers[ROGUE_FW_THREAD_MAX];
61 /** @group_mask: Mask of enabled trace groups. */
65 int pvr_fw_trace_init(struct pvr_device *pvr_dev);
66 void pvr_fw_trace_fini(struct pvr_device *pvr_dev);
68 #if defined(CONFIG_DEBUG_FS)
69 /* Forward declaration from <linux/dcache.h>. */
72 void pvr_fw_trace_mask_update(struct pvr_device *pvr_dev, u32 old_mask,
75 void pvr_fw_trace_debugfs_init(struct pvr_device *pvr_dev, struct dentry *dir);
76 #endif /* defined(CONFIG_DEBUG_FS) */
78 #endif /* PVR_FW_TRACE_H */