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

media: venus: Add debugfs interface to set firmware log level



This will be useful when debugging specific issues related to
firmware HFI interface.

Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 8b6a1010
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

venus-core-objs += core.o helpers.o firmware.o \
		   hfi_venus.o hfi_msgs.o hfi_cmds.o hfi.o \
		   hfi_parser.o pm_helpers.o
		   hfi_parser.o pm_helpers.o dbgfs.o

venus-dec-objs += vdec.o vdec_ctrls.o
venus-enc-objs += venc.o venc_ctrls.o
+3 −0
Original line number Diff line number Diff line
@@ -295,6 +295,8 @@ static int venus_probe(struct platform_device *pdev)
		goto err_dev_unregister;
	}

	venus_dbgfs_init(core);

	return 0;

err_dev_unregister:
@@ -346,6 +348,7 @@ static int venus_remove(struct platform_device *pdev)
	v4l2_device_unregister(&core->v4l2_dev);
	mutex_destroy(&core->pm_lock);
	mutex_destroy(&core->lock);
	venus_dbgfs_deinit(core);

	return ret;
}
+3 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>

#include "dbgfs.h"
#include "hfi.h"

#define VIDC_CLKS_NUM_MAX		4
@@ -137,6 +138,7 @@ struct venus_caps {
 * @priv:	a private filed for HFI operations
 * @ops:		the core HFI operations
 * @work:	a delayed work for handling system fatal error
 * @root:	debugfs root directory
 */
struct venus_core {
	void __iomem *base;
@@ -190,6 +192,7 @@ struct venus_core {
	unsigned int codecs_count;
	unsigned int core0_usage_count;
	unsigned int core1_usage_count;
	struct dentry *root;
};

struct vdec_controls {
+21 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2020 Linaro Ltd.
 */

#include <linux/debugfs.h>

#include "core.h"

extern int venus_fw_debug;

void venus_dbgfs_init(struct venus_core *core)
{
	core->root = debugfs_create_dir("venus", NULL);
	debugfs_create_x32("fw_level", 0644, core->root, &venus_fw_debug);
}

void venus_dbgfs_deinit(struct venus_core *core)
{
	debugfs_remove_recursive(core->root);
}
+12 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2020 Linaro Ltd. */

#ifndef __VENUS_DBGFS_H__
#define __VENUS_DBGFS_H__

struct venus_core;

void venus_dbgfs_init(struct venus_core *core);
void venus_dbgfs_deinit(struct venus_core *core);

#endif
Loading