Commit 8c91dc08 authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Mauro Carvalho Chehab
Browse files

media: venus: Make debug infrastructure more flexible



Here we introduce debug prefixes for dev_dbg groups by level of
importance - Venus{Low,Med,High,FW} Enabling the particular level
will be done by dynamic debug.

For example to enable debug messages with low level:
echo 'format "VenusLow" +p' > debugfs/dynamic_debug/control

If you want to enable all levels:
echo 'format "Venus" +p' > debugfs/dynamic_debug/control

All the features which dynamic debugging provide are preserved.

Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f08abe6a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@
#include "dbgfs.h"
#include "hfi.h"

#define VDBGL	"VenusLow : "
#define VDBGM	"VenusMed : "
#define VDBGH	"VenusHigh: "
#define VDBGFW	"VenusFW  : "

#define VIDC_CLKS_NUM_MAX		4
#define VIDC_VCODEC_CLKS_NUM_MAX	2
#define VIDC_PMDOMAINS_NUM_MAX		3
+1 −1
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ put_ts_metadata(struct venus_inst *inst, struct vb2_v4l2_buffer *vbuf)
	}

	if (slot == -1) {
		dev_dbg(inst->core->dev, "%s: no free slot\n", __func__);
		dev_dbg(inst->core->dev, VDBGL "no free slot\n");
		return;
	}

+9 −9
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ static void event_sys_error(struct venus_core *core, u32 event,
			    struct hfi_msg_event_notify_pkt *pkt)
{
	if (pkt)
		dev_dbg(core->dev,
		dev_dbg(core->dev, VDBGH
			"sys error (session id:%x, data1:%x, data2:%x)\n",
			pkt->shdr.session_id, pkt->event_data1,
			pkt->event_data2);
@@ -152,7 +152,7 @@ event_session_error(struct venus_core *core, struct venus_inst *inst,
{
	struct device *dev = core->dev;

	dev_dbg(dev, "session error: event id:%x, session id:%x\n",
	dev_dbg(dev, VDBGH "session error: event id:%x, session id:%x\n",
		pkt->event_data1, pkt->shdr.session_id);

	if (!inst)
@@ -247,7 +247,7 @@ sys_get_prop_image_version(struct device *dev,
		/* bad packet */
		return;

	dev_dbg(dev, "F/W version: %s\n", (u8 *)&pkt->data[1]);
	dev_dbg(dev, VDBGL "F/W version: %s\n", (u8 *)&pkt->data[1]);
}

static void hfi_sys_property_info(struct venus_core *core,
@@ -257,7 +257,7 @@ static void hfi_sys_property_info(struct venus_core *core,
	struct device *dev = core->dev;

	if (!pkt->num_properties) {
		dev_dbg(dev, "%s: no properties\n", __func__);
		dev_dbg(dev, VDBGL "no properties\n");
		return;
	}

@@ -266,7 +266,7 @@ static void hfi_sys_property_info(struct venus_core *core,
		sys_get_prop_image_version(dev, pkt);
		break;
	default:
		dev_dbg(dev, "%s: unknown property data\n", __func__);
		dev_dbg(dev, VDBGL "unknown property data\n");
		break;
	}
}
@@ -297,7 +297,7 @@ static void hfi_sys_ping_done(struct venus_core *core, struct venus_inst *inst,
static void hfi_sys_idle_done(struct venus_core *core, struct venus_inst *inst,
			      void *packet)
{
	dev_dbg(core->dev, "sys idle\n");
	dev_dbg(core->dev, VDBGL "sys idle\n");
}

static void hfi_sys_pc_prepare_done(struct venus_core *core,
@@ -305,7 +305,8 @@ static void hfi_sys_pc_prepare_done(struct venus_core *core,
{
	struct hfi_msg_sys_pc_prep_done_pkt *pkt = packet;

	dev_dbg(core->dev, "pc prepare done (error %x)\n", pkt->error_type);
	dev_dbg(core->dev, VDBGL "pc prepare done (error %x)\n",
		pkt->error_type);
}

static unsigned int
@@ -387,8 +388,7 @@ static void hfi_session_prop_info(struct venus_core *core,
	case HFI_PROPERTY_CONFIG_VDEC_ENTROPY:
		break;
	default:
		dev_dbg(dev, "%s: unknown property id:%x\n", __func__,
			pkt->data[0]);
		dev_dbg(dev, VDBGM "unknown property id:%x\n", pkt->data[0]);
		return;
	}

+2 −2
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ static u32 venus_hwversion(struct venus_hfi_device *hdev)
	minor = minor >> WRAPPER_HW_VERSION_MINOR_VERSION_SHIFT;
	step = ver & WRAPPER_HW_VERSION_STEP_VERSION_MASK;

	dev_dbg(dev, "venus hw version %x.%x.%x\n", major, minor, step);
	dev_dbg(dev, VDBGL "venus hw version %x.%x.%x\n", major, minor, step);

	return major;
}
@@ -906,7 +906,7 @@ static void venus_flush_debug_queue(struct venus_hfi_device *hdev)
		if (pkt->hdr.pkt_type != HFI_MSG_SYS_COV) {
			struct hfi_msg_sys_debug_pkt *pkt = packet;

			dev_dbg(dev, "%s", pkt->msg_data);
			dev_dbg(dev, VDBGFW "%s", pkt->msg_data);
		}
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ static int load_scale_bw(struct venus_core *core)
	}
	mutex_unlock(&core->lock);

	dev_dbg(core->dev, "total: avg_bw: %u, peak_bw: %u\n",
	dev_dbg(core->dev, VDBGL "total: avg_bw: %u, peak_bw: %u\n",
		total_avg, total_peak);

	return icc_set_bw(core->video_path, total_avg, total_peak);
Loading