[RFC PATCH 10/11] media: verisilicon: split read/write debug
Marco Felsch
m.felsch at pengutronix.de
Fri May 2 08:05:13 PDT 2025
Allow a more fine grain read/write debug control. This is very useful in
case of hantro_reg_write() is used to not interfere the write debug
prints with read debug prints.
While on it, make the reg/swreg value clear for new developers.
Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
drivers/media/platform/verisilicon/hantro.h | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h
index e464bec47b11..7b031df5b0a1 100644
--- a/drivers/media/platform/verisilicon/hantro.h
+++ b/drivers/media/platform/verisilicon/hantro.h
@@ -367,7 +367,8 @@ struct hantro_decoded_buffer {
* bit 3 - contents of big controls from userspace
* bit 4 - detail fmt, ctrl, buffer q/dq information
* bit 5 - detail function enter/leave trace information
- * bit 6 - register write/read information
+ * bit 6 - register write information
+ * bit 7 - register read information
*/
extern int hantro_debug;
@@ -391,13 +392,13 @@ static __always_inline struct hantro_ctx *fh_to_ctx(struct v4l2_fh *fh)
static __always_inline void vepu_write_relaxed(struct hantro_dev *vpu,
u32 val, u32 reg)
{
- vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val);
+ vpu_debug(6, "0x%04x (swreg%u) = 0x%08x\n", reg, reg / 4, val);
writel_relaxed(val, vpu->enc_base + reg);
}
static __always_inline void vepu_write(struct hantro_dev *vpu, u32 val, u32 reg)
{
- vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val);
+ vpu_debug(6, "0x%04x (swreg%u) = 0x%08x\n", reg, reg / 4, val);
writel(val, vpu->enc_base + reg);
}
@@ -405,20 +406,20 @@ static __always_inline u32 vepu_read(struct hantro_dev *vpu, u32 reg)
{
u32 val = readl(vpu->enc_base + reg);
- vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val);
+ vpu_debug(7, "0x%04x (swreg%u) = 0x%08x\n", reg, reg / 4, val);
return val;
}
static __always_inline void vdpu_write_relaxed(struct hantro_dev *vpu,
u32 val, u32 reg)
{
- vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val);
+ vpu_debug(6, "0x%04x (swreg%u) = 0x%08x\n", reg, reg / 4, val);
writel_relaxed(val, vpu->dec_base + reg);
}
static __always_inline void vdpu_write(struct hantro_dev *vpu, u32 val, u32 reg)
{
- vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val);
+ vpu_debug(6, "0x%04x (swreg%u) = 0x%08x\n", reg, reg / 4, val);
writel(val, vpu->dec_base + reg);
}
@@ -433,7 +434,7 @@ static __always_inline u32 vdpu_read(struct hantro_dev *vpu, u32 reg)
{
u32 val = readl(vpu->dec_base + reg);
- vpu_debug(6, "0x%04x = 0x%08x\n", reg / 4, val);
+ vpu_debug(7, "0x%04x (swreg%u) = 0x%08x\n", reg, reg / 4, val);
return val;
}
--
2.39.5
More information about the linux-arm-kernel
mailing list