mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
video/rockchip: rga2: Add RGA debugger.
1. Support procfs, both debugfs and procfs. 2. Modify the debug node name: /sys/kernel/debug/rga2_debug/rga2 -> /sys/kernel/debug/rkrga/debug -> /proc/rkrga/debug (add) 3. Add a node to view the driver version number: driver_version. 4. Add CONFIG_ROCKCHIP_RGA2_PROC_FS/ROCKCHIP_RGA2_DEBUG_FS/ ROCKCHIP_RGA2_DEBUGGER, Where CONFIG_ROCKCHIP_RGA2_PROC_FS defaults to n, CONFIG_ROCKCHIP_RGA2_DEBUGGER defaults to y. Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com> Change-Id: I89a971f18301ffa9cc7ac1962ebeee5e97d209aa
This commit is contained in:
@@ -1,10 +1,30 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
menu "RGA2"
|
||||
menuconfig ROCKCHIP_RGA2
|
||||
tristate "RGA2"
|
||||
depends on ARCH_ROCKCHIP
|
||||
|
||||
config ROCKCHIP_RGA2
|
||||
tristate "ROCKCHIP_RGA2"
|
||||
help
|
||||
rk32 rga2 module.
|
||||
|
||||
endmenu
|
||||
if ROCKCHIP_RGA2
|
||||
|
||||
config ROCKCHIP_RGA2_PROC_FS
|
||||
bool "Enable RGA2 procfs"
|
||||
select ROCKCHIP_RGA2_DEBUGGER
|
||||
depends on PROC_FS
|
||||
help
|
||||
Enable procfs to debug RGA driver.
|
||||
|
||||
config ROCKCHIP_RGA2_DEBUG_FS
|
||||
bool "Enable RGA2 debugfs"
|
||||
select ROCKCHIP_RGA2_DEBUGGER
|
||||
depends on DEBUG_FS
|
||||
default y
|
||||
help
|
||||
Enable debugfs to debug RGA driver.
|
||||
|
||||
config ROCKCHIP_RGA2_DEBUGGER
|
||||
bool
|
||||
help
|
||||
Enabling the debugger of RGA2, you can use procfs and debugfs for debugging.
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
rga2-y := rga2_drv.o rga2_mmu_info.o rga2_reg_info.o RGA2_API.o
|
||||
rga2-$(CONFIG_ROCKCHIP_RGA2_DEBUGGER) += rga2_debugger.o
|
||||
|
||||
obj-$(CONFIG_ROCKCHIP_RGA2) += rga2.o
|
||||
|
||||
@@ -6,8 +6,28 @@
|
||||
#include <linux/wakelock.h>
|
||||
|
||||
#include "rga2_reg_info.h"
|
||||
#include "rga2_debugger.h"
|
||||
#include "rga2.h"
|
||||
|
||||
/* Driver information */
|
||||
#define DRIVER_DESC "RGA2 Device Driver"
|
||||
#define DRIVER_NAME "rga2"
|
||||
#define DRIVER_VERSION "2.1.0"
|
||||
|
||||
/* Logging */
|
||||
#define RGA_DEBUG 1
|
||||
#if RGA_DEBUG
|
||||
#define DBG(format, args...) printk(KERN_DEBUG "%s: " format, DRIVER_NAME, ## args)
|
||||
#define ERR(format, args...) printk(KERN_ERR "%s: " format, DRIVER_NAME, ## args)
|
||||
#define WARNING(format, args...) printk(KERN_WARN "%s: " format, DRIVER_NAME, ## args)
|
||||
#define INFO(format, args...) printk(KERN_INFO "%s: " format, DRIVER_NAME, ## args)
|
||||
#else
|
||||
#define DBG(format, args...)
|
||||
#define ERR(format, args...)
|
||||
#define WARNING(format, args...)
|
||||
#define INFO(format, args...)
|
||||
#endif
|
||||
|
||||
struct rga2_drvdata_t {
|
||||
struct miscdevice miscdev;
|
||||
struct device *dev;
|
||||
@@ -25,6 +45,10 @@ struct rga2_drvdata_t {
|
||||
|
||||
struct ion_client *ion_client;
|
||||
char version[16];
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
struct rga_debugger *debugger;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define ENABLE 1
|
||||
|
||||
@@ -764,7 +764,6 @@ struct rga2_service_info {
|
||||
};
|
||||
|
||||
#define RGA2_TEST_CASE 0
|
||||
#define RGA2_DEBUGFS 1
|
||||
|
||||
//General Registers
|
||||
#define RGA2_SYS_CTRL 0x000
|
||||
|
||||
396
drivers/video/rockchip/rga2/rga2_debugger.c
Normal file
396
drivers/video/rockchip/rga2/rga2_debugger.c
Normal file
@@ -0,0 +1,396 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* Copyright (C) 2020 Rockchip Electronics Co., Ltd.
|
||||
* Author: Cerf Yu <cerf.yu@rock-chips.com>
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/seq_file.h>
|
||||
|
||||
#include "rga2.h"
|
||||
#include "RGA2_API.h"
|
||||
#include "rga2_mmu_info.h"
|
||||
#include "rga2_debugger.h"
|
||||
|
||||
#define RGA_DEBUGGER_ROOT_NAME "rkrga"
|
||||
|
||||
#define STR_ENABLE(en) (en ? "EN" : "DIS")
|
||||
|
||||
extern struct rga2_drvdata_t *rga2_drvdata;
|
||||
|
||||
void rga2_slt(void);
|
||||
|
||||
int RGA2_TEST_REG;
|
||||
int RGA2_TEST_MSG;
|
||||
int RGA2_TEST_TIME;
|
||||
int RGA2_CHECK_MODE;
|
||||
int RGA2_NONUSE;
|
||||
int RGA2_INT_FLAG;
|
||||
|
||||
static int rga_debug_show(struct seq_file *m, void *data)
|
||||
{
|
||||
seq_printf(m, "REG [%s]\n"
|
||||
"MSG [%s]\n"
|
||||
"TIME [%s]\n"
|
||||
"INT [%s]\n"
|
||||
"CHECK [%s]\n"
|
||||
"STOP [%s]\n",
|
||||
STR_ENABLE(RGA2_TEST_REG), STR_ENABLE(RGA2_TEST_MSG),
|
||||
STR_ENABLE(RGA2_TEST_TIME), STR_ENABLE(RGA2_CHECK_MODE),
|
||||
STR_ENABLE(RGA2_NONUSE), STR_ENABLE(RGA2_INT_FLAG));
|
||||
|
||||
seq_puts(m, "\nhelp:\n");
|
||||
seq_puts(m, " 'echo reg > debug' to enable/disable register log printing.\n");
|
||||
seq_puts(m, " 'echo msg > debug' to enable/disable message log printing.\n");
|
||||
seq_puts(m, " 'echo time > debug' to enable/disable time log printing.\n");
|
||||
seq_puts(m, " 'echo int > debug' to enable/disable interruppt log printing.\n");
|
||||
seq_puts(m, " 'echo check > debug' to enable/disable check mode.\n");
|
||||
seq_puts(m, " 'echo stop > debug' to enable/disable stop using hardware\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t rga_debug_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp)
|
||||
{
|
||||
char buf[14];
|
||||
|
||||
if (len > sizeof(buf) - 1)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(buf, ubuf, len))
|
||||
return -EFAULT;
|
||||
buf[len - 1] = '\0';
|
||||
|
||||
if (strncmp(buf, "reg", 4) == 0) {
|
||||
if (RGA2_TEST_REG) {
|
||||
RGA2_TEST_REG = 0;
|
||||
INFO("close rga2 reg!\n");
|
||||
} else {
|
||||
RGA2_TEST_REG = 1;
|
||||
INFO("open rga2 reg!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "msg", 3) == 0) {
|
||||
if (RGA2_TEST_MSG) {
|
||||
RGA2_TEST_MSG = 0;
|
||||
INFO("close rga2 test MSG!\n");
|
||||
} else {
|
||||
RGA2_TEST_MSG = 1;
|
||||
INFO("open rga2 test MSG!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "time", 4) == 0) {
|
||||
if (RGA2_TEST_TIME) {
|
||||
RGA2_TEST_TIME = 0;
|
||||
INFO("close rga2 test time!\n");
|
||||
} else {
|
||||
RGA2_TEST_TIME = 1;
|
||||
INFO("open rga2 test time!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "check", 5) == 0) {
|
||||
if (RGA2_CHECK_MODE) {
|
||||
RGA2_CHECK_MODE = 0;
|
||||
INFO("close rga2 check flag!\n");
|
||||
} else {
|
||||
RGA2_CHECK_MODE = 1;
|
||||
INFO("open rga2 check flag!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "stop", 4) == 0) {
|
||||
if (RGA2_NONUSE) {
|
||||
RGA2_NONUSE = 0;
|
||||
INFO("stop using rga hardware!\n");
|
||||
} else {
|
||||
RGA2_NONUSE = 1;
|
||||
INFO("use rga hardware!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "int", 3) == 0) {
|
||||
if (RGA2_INT_FLAG) {
|
||||
RGA2_INT_FLAG = 0;
|
||||
INFO("close inturrupt MSG!\n");
|
||||
} else {
|
||||
RGA2_INT_FLAG = 1;
|
||||
INFO("open inturrupt MSG!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "slt", 3) == 0) {
|
||||
rga2_slt();
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static int rga_version_show(struct seq_file *m, void *data)
|
||||
{
|
||||
seq_printf(m, "%s: v%s\n", DRIVER_DESC, DRIVER_VERSION);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct rga_debugger_list rga_root_list[] = {
|
||||
{ "debug", rga_debug_show, rga_debug_write, NULL },
|
||||
{ "driver_version", rga_version_show, NULL, NULL },
|
||||
};
|
||||
|
||||
static ssize_t rga_debugger_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp)
|
||||
{
|
||||
struct seq_file *priv = file->private_data;
|
||||
struct rga_debugger_node *node = priv->private;
|
||||
|
||||
if (node->info_ent->write)
|
||||
return node->info_ent->write(file, ubuf, len, offp);
|
||||
else
|
||||
return len;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS
|
||||
static int rga_debugfs_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct rga_debugger_node *node = inode->i_private;
|
||||
|
||||
return single_open(file, node->info_ent->show, node);
|
||||
}
|
||||
|
||||
static const struct file_operations rga_debugfs_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rga_debugfs_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
.write = rga_debugger_write,
|
||||
};
|
||||
|
||||
static int rga_debugfs_remove_files(struct rga_debugger *debugger)
|
||||
{
|
||||
struct rga_debugger_node *pos, *q;
|
||||
struct list_head *entry_list;
|
||||
|
||||
mutex_lock(&debugger->debugfs_lock);
|
||||
|
||||
/* Delete debugfs entry list */
|
||||
entry_list = &debugger->debugfs_entry_list;
|
||||
list_for_each_entry_safe(pos, q, entry_list, list) {
|
||||
if (pos->dent == NULL)
|
||||
continue;
|
||||
list_del(&pos->list);
|
||||
kfree(pos);
|
||||
pos = NULL;
|
||||
}
|
||||
|
||||
/* Delete all debugfs node in this directory */
|
||||
debugfs_remove_recursive(debugger->debugfs_dir);
|
||||
debugger->debugfs_dir = NULL;
|
||||
|
||||
mutex_unlock(&debugger->debugfs_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rga_debugfs_create_files(const struct rga_debugger_list *files, int count,
|
||||
struct dentry *root, struct rga_debugger *debugger)
|
||||
{
|
||||
int i;
|
||||
struct dentry *ent;
|
||||
struct rga_debugger_node *tmp;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
tmp = kmalloc(sizeof(struct rga_debugger_node), GFP_KERNEL);
|
||||
if (tmp == NULL) {
|
||||
ERR("Cannot alloc rga_debugger_node for /sys/kernel/debug/%pd/%s\n",
|
||||
root, files[i].name);
|
||||
goto MALLOC_FAIL;
|
||||
}
|
||||
|
||||
tmp->info_ent = &files[i];
|
||||
tmp->debugger = debugger;
|
||||
|
||||
ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO,
|
||||
root, tmp, &rga_debugfs_fops);
|
||||
if (!ent) {
|
||||
ERR("Cannot create /sys/kernel/debug/%pd/%s\n", root, files[i].name);
|
||||
goto CREATE_FAIL;
|
||||
}
|
||||
|
||||
tmp->dent = ent;
|
||||
|
||||
mutex_lock(&debugger->debugfs_lock);
|
||||
list_add_tail(&tmp->list, &debugger->debugfs_entry_list);
|
||||
mutex_unlock(&debugger->debugfs_lock);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
CREATE_FAIL:
|
||||
kfree(tmp);
|
||||
MALLOC_FAIL:
|
||||
rga_debugfs_remove_files(debugger);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rga2_debugfs_remove(void)
|
||||
{
|
||||
struct rga_debugger *debugger;
|
||||
|
||||
debugger = rga2_drvdata->debugger;
|
||||
|
||||
rga_debugfs_remove_files(debugger);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rga2_debugfs_init(void)
|
||||
{
|
||||
int ret;
|
||||
struct rga_debugger *debugger;
|
||||
|
||||
debugger = rga2_drvdata->debugger;
|
||||
|
||||
debugger->debugfs_dir = debugfs_create_dir(RGA_DEBUGGER_ROOT_NAME, NULL);
|
||||
if (IS_ERR_OR_NULL(debugger->debugfs_dir)) {
|
||||
ERR("failed on mkdir /sys/kernel/debug/%s\n", RGA_DEBUGGER_ROOT_NAME);
|
||||
debugger->debugfs_dir = NULL;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
ret = rga_debugfs_create_files(rga_root_list, ARRAY_SIZE(rga_root_list),
|
||||
debugger->debugfs_dir, debugger);
|
||||
if (ret) {
|
||||
ERR("Could not install rga_root_list debugfs\n");
|
||||
goto CREATE_FAIL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
CREATE_FAIL:
|
||||
rga2_debugfs_remove();
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* #ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS */
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS
|
||||
static int rga_procfs_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct rga_debugger_node *node = PDE_DATA(inode);
|
||||
|
||||
return single_open(file, node->info_ent->show, node);
|
||||
}
|
||||
|
||||
static const struct file_operations rga_procfs_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rga_procfs_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
.write = rga_debugger_write,
|
||||
};
|
||||
|
||||
static int rga_procfs_remove_files(struct rga_debugger *debugger)
|
||||
{
|
||||
struct rga_debugger_node *pos, *q;
|
||||
struct list_head *entry_list;
|
||||
|
||||
mutex_lock(&debugger->procfs_lock);
|
||||
|
||||
/* Delete procfs entry list */
|
||||
entry_list = &debugger->procfs_entry_list;
|
||||
list_for_each_entry_safe(pos, q, entry_list, list) {
|
||||
if (pos->pent == NULL)
|
||||
continue;
|
||||
list_del(&pos->list);
|
||||
kfree(pos);
|
||||
pos = NULL;
|
||||
}
|
||||
|
||||
/* Delete all procfs node in this directory */
|
||||
proc_remove(debugger->procfs_dir);
|
||||
debugger->procfs_dir = NULL;
|
||||
|
||||
mutex_unlock(&debugger->procfs_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rga_procfs_create_files(const struct rga_debugger_list *files, int count,
|
||||
struct proc_dir_entry *root, struct rga_debugger *debugger)
|
||||
{
|
||||
int i;
|
||||
struct proc_dir_entry *ent;
|
||||
struct rga_debugger_node *tmp;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
tmp = kmalloc(sizeof(struct rga_debugger_node), GFP_KERNEL);
|
||||
if (tmp == NULL) {
|
||||
ERR("Cannot alloc rga_debugger_node for /proc/%s/%s\n",
|
||||
RGA_DEBUGGER_ROOT_NAME, files[i].name);
|
||||
goto MALLOC_FAIL;
|
||||
}
|
||||
|
||||
tmp->info_ent = &files[i];
|
||||
tmp->debugger = debugger;
|
||||
|
||||
ent = proc_create_data(files[i].name, S_IFREG | S_IRUGO,
|
||||
root, &rga_procfs_fops, tmp);
|
||||
if (!ent) {
|
||||
ERR("Cannot create /proc/%s/%s\n", RGA_DEBUGGER_ROOT_NAME, files[i].name);
|
||||
goto CREATE_FAIL;
|
||||
}
|
||||
|
||||
tmp->pent = ent;
|
||||
|
||||
mutex_lock(&debugger->procfs_lock);
|
||||
list_add_tail(&tmp->list, &debugger->procfs_entry_list);
|
||||
mutex_unlock(&debugger->procfs_lock);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
CREATE_FAIL:
|
||||
kfree(tmp);
|
||||
MALLOC_FAIL:
|
||||
rga_procfs_remove_files(debugger);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rga2_procfs_remove(void)
|
||||
{
|
||||
struct rga_debugger *debugger;
|
||||
|
||||
debugger = rga2_drvdata->debugger;
|
||||
|
||||
rga_procfs_remove_files(debugger);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rga2_procfs_init(void)
|
||||
{
|
||||
int ret;
|
||||
struct rga_debugger *debugger;
|
||||
|
||||
debugger = rga2_drvdata->debugger;
|
||||
|
||||
debugger->procfs_dir = proc_mkdir(RGA_DEBUGGER_ROOT_NAME, NULL);
|
||||
if (IS_ERR_OR_NULL(debugger->procfs_dir)) {
|
||||
ERR("failed on mkdir /proc/%s\n", RGA_DEBUGGER_ROOT_NAME);
|
||||
debugger->procfs_dir = NULL;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
ret = rga_procfs_create_files(rga_root_list, ARRAY_SIZE(rga_root_list),
|
||||
debugger->procfs_dir, debugger);
|
||||
if (ret) {
|
||||
ERR("Could not install rga_root_list procfs\n");
|
||||
goto CREATE_FAIL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
CREATE_FAIL:
|
||||
rga2_procfs_remove();
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif /* #ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS */
|
||||
120
drivers/video/rockchip/rga2/rga2_debugger.h
Normal file
120
drivers/video/rockchip/rga2/rga2_debugger.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2020 Rockchip Electronics Co., Ltd.
|
||||
* Author: Cerf Yu <cerf.yu@rock-chips.com>
|
||||
*/
|
||||
|
||||
#ifndef _RGA_DEBUGGER_H_
|
||||
#define _RGA_DEBUGGER_H_
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
extern int RGA2_TEST_REG;
|
||||
extern int RGA2_TEST_MSG;
|
||||
extern int RGA2_TEST_TIME;
|
||||
extern int RGA2_CHECK_MODE;
|
||||
extern int RGA2_NONUSE;
|
||||
extern int RGA2_INT_FLAG;
|
||||
|
||||
/*
|
||||
* struct rga_debugger - RGA debugger information
|
||||
*
|
||||
* This structure represents a debugger to be created by the rga driver
|
||||
* or core.
|
||||
*/
|
||||
struct rga_debugger {
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS
|
||||
/* Directory of debugfs file */
|
||||
struct dentry *debugfs_dir;
|
||||
struct list_head debugfs_entry_list;
|
||||
struct mutex debugfs_lock;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS
|
||||
/* Directory of procfs file */
|
||||
struct proc_dir_entry *procfs_dir;
|
||||
struct list_head procfs_entry_list;
|
||||
struct mutex procfs_lock;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* struct rga_debugger_list - debugfs/procfs info list entry
|
||||
*
|
||||
* This structure represents a debugfs/procfs file to be created by the rga
|
||||
* driver or core.
|
||||
*/
|
||||
struct rga_debugger_list {
|
||||
/* File name */
|
||||
const char *name;
|
||||
/*
|
||||
* Show callback. &seq_file->private will be set to the &struct
|
||||
* rga_debugger_node corresponding to the instance of this info on a given
|
||||
* &struct rga_debugger.
|
||||
*/
|
||||
int (*show)(struct seq_file *seq, void *data);
|
||||
/*
|
||||
* Write callback. &seq_file->private will be set to the &struct
|
||||
* rga_debugger_node corresponding to the instance of this info on a given
|
||||
* &struct rga_debugger.
|
||||
*/
|
||||
ssize_t (*write)(struct file *file, const char __user *ubuf, size_t len, loff_t *offp);
|
||||
/* Procfs/Debugfs private data. */
|
||||
void *data;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct rga_debugger_node - Nodes for debugfs/procfs
|
||||
*
|
||||
* This structure represents each instance of procfs/debugfs created from the
|
||||
* template.
|
||||
*/
|
||||
struct rga_debugger_node {
|
||||
struct rga_debugger *debugger;
|
||||
|
||||
/* template for this node. */
|
||||
const struct rga_debugger_list *info_ent;
|
||||
|
||||
/* Each Procfs/Debugfs file. */
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS
|
||||
struct dentry *dent;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS
|
||||
struct proc_dir_entry *pent;
|
||||
#endif
|
||||
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS
|
||||
int rga2_debugfs_init(void);
|
||||
int rga2_debugfs_remove(void);
|
||||
#else
|
||||
static inline int rga2_debugfs_remove(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int rga2_debugfs_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* #ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS */
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS
|
||||
int rga2_procfs_remove(void);
|
||||
int rga2_procfs_init(void);
|
||||
#else
|
||||
static inline int rga2_procfs_remove(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline int rga2_procfs_init(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* #ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS */
|
||||
|
||||
#endif /* #ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER */
|
||||
|
||||
#endif /* #ifndef _RGA_DEBUGGER_H_ */
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#include <linux/wakelock.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/debugfs.h>
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
#include <linux/pm_runtime.h>
|
||||
@@ -53,6 +52,7 @@
|
||||
#include "rga2_reg_info.h"
|
||||
#include "rga2_mmu_info.h"
|
||||
#include "RGA2_API.h"
|
||||
#include "rga2_debugger.h"
|
||||
|
||||
#if IS_ENABLED(CONFIG_ION_ROCKCHIP) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))
|
||||
#include <linux/rockchip_ion.h>
|
||||
@@ -75,25 +75,11 @@
|
||||
*/
|
||||
#define RGA2_PHY_PAGE_SIZE (((8192 * 8192 * 4) / 4096) + 1)
|
||||
|
||||
|
||||
/* Driver information */
|
||||
#define DRIVER_DESC "RGA2 Device Driver"
|
||||
#define DRIVER_NAME "rga2"
|
||||
#define RGA2_VERSION "2.000"
|
||||
|
||||
ktime_t rga2_start;
|
||||
ktime_t rga2_end;
|
||||
int rga2_flag;
|
||||
int first_RGA2_proc;
|
||||
static int rk3368;
|
||||
#if RGA2_DEBUGFS
|
||||
int RGA2_TEST_REG;
|
||||
int RGA2_TEST_MSG;
|
||||
int RGA2_TEST_TIME;
|
||||
int RGA2_CHECK_MODE;
|
||||
int RGA2_NONUSE;
|
||||
int RGA2_INT_FLAG;
|
||||
#endif
|
||||
|
||||
rga2_session rga2_session_global;
|
||||
long (*rga2_ioctl_kernel_p)(struct rga_req *);
|
||||
@@ -111,22 +97,7 @@ static void rga2_del_running_list(void);
|
||||
static void rga2_del_running_list_timeout(void);
|
||||
static void rga2_try_set_reg(void);
|
||||
|
||||
|
||||
/* Logging */
|
||||
#define RGA_DEBUG 1
|
||||
#if RGA_DEBUG
|
||||
#define DBG(format, args...) printk(KERN_DEBUG "%s: " format, DRIVER_NAME, ## args)
|
||||
#define ERR(format, args...) printk(KERN_ERR "%s: " format, DRIVER_NAME, ## args)
|
||||
#define WARNING(format, args...) printk(KERN_WARN "%s: " format, DRIVER_NAME, ## args)
|
||||
#define INFO(format, args...) printk(KERN_INFO "%s: " format, DRIVER_NAME, ## args)
|
||||
#else
|
||||
#define DBG(format, args...)
|
||||
#define ERR(format, args...)
|
||||
#define WARNING(format, args...)
|
||||
#define INFO(format, args...)
|
||||
#endif
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
static const char *rga2_get_cmd_mode_str(u32 cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
@@ -711,7 +682,7 @@ static int rga2_flush(rga2_session *session, unsigned long arg)
|
||||
int ret = 0;
|
||||
int ret_timeout;
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
ktime_t start = ktime_set(0, 0);
|
||||
ktime_t end = ktime_set(0, 0);
|
||||
|
||||
@@ -760,7 +731,7 @@ static int rga2_flush(rga2_session *session, unsigned long arg)
|
||||
ret = -ETIMEDOUT;
|
||||
}
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_TIME) {
|
||||
end = ktime_get();
|
||||
end = ktime_sub(end, start);
|
||||
@@ -977,7 +948,7 @@ static void rga2_try_set_reg(void)
|
||||
rga2_write(reg->csc_reg[i], RGA2_CSC_COE_BASE + i * 4);
|
||||
}
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_REG) {
|
||||
if (rga2_flag) {
|
||||
int32_t *p;
|
||||
@@ -1005,7 +976,7 @@ static void rga2_try_set_reg(void)
|
||||
/* All CMD finish int */
|
||||
rga2_write(rga2_read(RGA2_INT)|(0x1<<10)|(0x1<<9)|(0x1<<8), RGA2_INT);
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_TIME)
|
||||
rga2_start = ktime_get();
|
||||
#endif
|
||||
@@ -1013,7 +984,7 @@ static void rga2_try_set_reg(void)
|
||||
/* Start proc */
|
||||
atomic_set(®->session->done, 0);
|
||||
rga2_write(0x1, RGA2_CMD_CTRL);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_REG) {
|
||||
if (rga2_flag) {
|
||||
INFO("CMD_READ_BACK_REG\n");
|
||||
@@ -1187,7 +1158,7 @@ static int rga2_get_img_info(rga_img_info_t *img,
|
||||
pr_err("Failed to attach dma_buf\n");
|
||||
return ret;
|
||||
}
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE) {
|
||||
void *vaddr = dma_buf_vmap(dma_buf);
|
||||
if (vaddr)
|
||||
@@ -1344,7 +1315,7 @@ static int rga2_convert_dma_buf(struct rga2_req *req)
|
||||
pr_err("RGA2 SRC ERROR ion buf handle\n");
|
||||
return ret;
|
||||
}
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE) {
|
||||
vaddr = ion_map_kernel(rga2_drvdata->ion_client, hdl);
|
||||
if (vaddr)
|
||||
@@ -1386,7 +1357,7 @@ static int rga2_convert_dma_buf(struct rga2_req *req)
|
||||
pr_err("RGA2 DST ERROR ion buf handle\n");
|
||||
return ret;
|
||||
}
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE) {
|
||||
vaddr = ion_map_kernel(rga2_drvdata->ion_client, hdl);
|
||||
if (vaddr)
|
||||
@@ -1569,7 +1540,7 @@ err_put_dma_buf:
|
||||
static int rga2_blit_async(rga2_session *session, struct rga2_req *req)
|
||||
{
|
||||
int ret = -1;
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_MSG) {
|
||||
if (1) {
|
||||
print_debug_info(req);
|
||||
@@ -1597,7 +1568,7 @@ static int rga2_blit_sync(rga2_session *session, struct rga2_req *req)
|
||||
memcpy(&req_bak, req, sizeof(req_bak));
|
||||
retry:
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_MSG) {
|
||||
if (1) {
|
||||
print_debug_info(req);
|
||||
@@ -1669,7 +1640,7 @@ retry:
|
||||
ret = -ETIMEDOUT;
|
||||
}
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_TIME) {
|
||||
rga2_end = ktime_get();
|
||||
rga2_end = ktime_sub(rga2_end, rga2_start);
|
||||
@@ -1731,7 +1702,7 @@ static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
|
||||
}
|
||||
|
||||
memset(&req, 0x0, sizeof(req));
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_MSG)
|
||||
INFO("cmd is %s\n", rga2_get_cmd_mode_str(cmd));
|
||||
if (RGA2_NONUSE) {
|
||||
@@ -1913,7 +1884,7 @@ static long compat_rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
|
||||
|
||||
session = (rga2_session *)file->private_data;
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_TEST_MSG)
|
||||
INFO("using %s\n", __func__);
|
||||
#endif
|
||||
@@ -2145,7 +2116,7 @@ static void RGA2_flush_page(void)
|
||||
|
||||
static irqreturn_t rga2_irq_thread(int irq, void *dev_id)
|
||||
{
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_INT_FLAG)
|
||||
INFO("irqthread INT[%x],STATS[%x]\n", rga2_read(RGA2_INT),
|
||||
rga2_read(RGA2_STATUS));
|
||||
@@ -2163,7 +2134,7 @@ static irqreturn_t rga2_irq_thread(int irq, void *dev_id)
|
||||
|
||||
static irqreturn_t rga2_irq(int irq, void *dev_id)
|
||||
{
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_INT_FLAG)
|
||||
INFO("irq INT[%x], STATS[%x]\n", rga2_read(RGA2_INT),
|
||||
rga2_read(RGA2_STATUS));
|
||||
@@ -2201,6 +2172,47 @@ static const struct of_device_id rockchip_rga_dt_ids[] = {
|
||||
{},
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
static int rga2_debugger_init(struct rga_debugger **debugger_p)
|
||||
{
|
||||
struct rga_debugger *debugger;
|
||||
|
||||
*debugger_p = kzalloc(sizeof(struct rga_debugger), GFP_KERNEL);
|
||||
if (*debugger_p == NULL) {
|
||||
ERR("can not alloc for rga2 debugger\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
debugger = *debugger_p;
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUG_FS
|
||||
mutex_init(&debugger->debugfs_lock);
|
||||
INIT_LIST_HEAD(&debugger->debugfs_entry_list);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_PROC_FS
|
||||
mutex_init(&debugger->procfs_lock);
|
||||
INIT_LIST_HEAD(&debugger->procfs_entry_list);
|
||||
#endif
|
||||
|
||||
rga2_debugfs_init();
|
||||
rga2_procfs_init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rga2_debugger_remove(struct rga_debugger **debugger_p)
|
||||
{
|
||||
rga2_debugfs_remove();
|
||||
rga2_procfs_remove();
|
||||
|
||||
kfree(*debugger_p);
|
||||
*debugger_p = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int rga2_drv_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct rga2_drvdata_t *data;
|
||||
@@ -2284,6 +2296,11 @@ static int rga2_drv_probe(struct platform_device *pdev)
|
||||
ERR("cannot register miscdev (%d)\n", ret);
|
||||
goto err_misc_register;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
rga2_debugger_init(&rga2_drvdata->debugger);
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0))
|
||||
rga2_init_version();
|
||||
INFO("Driver loaded successfully ver:%s\n", rga2_drvdata->version);
|
||||
@@ -2308,6 +2325,10 @@ static int rga2_drv_remove(struct platform_device *pdev)
|
||||
struct rga2_drvdata_t *data = platform_get_drvdata(pdev);
|
||||
DBG("%s [%d]\n",__FUNCTION__,__LINE__);
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
rga2_debugger_remove(&data->debugger);
|
||||
#endif
|
||||
|
||||
wake_lock_destroy(&data->wake_lock);
|
||||
misc_deregister(&(data->miscdev));
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
@@ -2336,116 +2357,7 @@ static struct platform_driver rga2_driver = {
|
||||
},
|
||||
};
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
void rga2_slt(void);
|
||||
|
||||
static int rga2_debug_show(struct seq_file *m, void *data)
|
||||
{
|
||||
seq_puts(m, "echo reg > rga2 to open rga reg MSG\n");
|
||||
seq_puts(m, "echo msg > rga2 to open rga msg MSG\n");
|
||||
seq_puts(m, "echo time > rga2 to open rga time MSG\n");
|
||||
seq_puts(m, "echo check > rga2 to open rga check flag\n");
|
||||
seq_puts(m, "echo stop > rga2 to stop using hardware\n");
|
||||
seq_puts(m, "echo int > rga2 to open interruppt MSG\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t rga2_debug_write(struct file *file, const char __user *ubuf,
|
||||
size_t len, loff_t *offp)
|
||||
{
|
||||
char buf[14];
|
||||
|
||||
if (len > sizeof(buf) - 1)
|
||||
return -EINVAL;
|
||||
if (copy_from_user(buf, ubuf, len))
|
||||
return -EFAULT;
|
||||
buf[len - 1] = '\0';
|
||||
|
||||
if (strncmp(buf, "reg", 4) == 0) {
|
||||
if (RGA2_TEST_REG) {
|
||||
RGA2_TEST_REG = 0;
|
||||
INFO("close rga2 reg!\n");
|
||||
} else {
|
||||
RGA2_TEST_REG = 1;
|
||||
INFO("open rga2 reg!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "msg", 3) == 0) {
|
||||
if (RGA2_TEST_MSG) {
|
||||
RGA2_TEST_MSG = 0;
|
||||
INFO("close rga2 test MSG!\n");
|
||||
} else {
|
||||
RGA2_TEST_MSG = 1;
|
||||
INFO("open rga2 test MSG!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "time", 4) == 0) {
|
||||
if (RGA2_TEST_TIME) {
|
||||
RGA2_TEST_TIME = 0;
|
||||
INFO("close rga2 test time!\n");
|
||||
} else {
|
||||
RGA2_TEST_TIME = 1;
|
||||
INFO("open rga2 test time!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "check", 5) == 0) {
|
||||
if (RGA2_CHECK_MODE) {
|
||||
RGA2_CHECK_MODE = 0;
|
||||
INFO("close rga2 check flag!\n");
|
||||
} else {
|
||||
RGA2_CHECK_MODE = 1;
|
||||
INFO("open rga2 check flag!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "stop", 4) == 0) {
|
||||
if (RGA2_NONUSE) {
|
||||
RGA2_NONUSE = 0;
|
||||
INFO("stop using rga hardware!\n");
|
||||
} else {
|
||||
RGA2_NONUSE = 1;
|
||||
INFO("use rga hardware!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "int", 3) == 0) {
|
||||
if (RGA2_INT_FLAG) {
|
||||
RGA2_INT_FLAG = 0;
|
||||
INFO("close inturrupt MSG!\n");
|
||||
} else {
|
||||
RGA2_INT_FLAG = 1;
|
||||
INFO("open inturrupt MSG!\n");
|
||||
}
|
||||
} else if (strncmp(buf, "slt", 3) == 0) {
|
||||
rga2_slt();
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static int rga2_debug_open(struct inode *inode, struct file *file)
|
||||
|
||||
{
|
||||
return single_open(file, rga2_debug_show, NULL);
|
||||
}
|
||||
|
||||
static const struct file_operations rga2_debug_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = rga2_debug_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
.write = rga2_debug_write,
|
||||
};
|
||||
|
||||
static void rga2_debugfs_add(void)
|
||||
{
|
||||
struct dentry *rga2_debug_root;
|
||||
struct dentry *ent;
|
||||
|
||||
rga2_debug_root = debugfs_create_dir("rga2_debug", NULL);
|
||||
|
||||
ent = debugfs_create_file("rga2", 0644, rga2_debug_root,
|
||||
NULL, &rga2_debug_fops);
|
||||
if (!ent) {
|
||||
pr_err("create rga2_debugfs err\n");
|
||||
debugfs_remove_recursive(rga2_debug_root);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
void rga2_slt(void)
|
||||
{
|
||||
int i;
|
||||
@@ -2641,9 +2553,6 @@ static int __init rga2_init(void)
|
||||
|
||||
#if RGA2_TEST_CASE
|
||||
rga2_test_0();
|
||||
#endif
|
||||
#if RGA2_DEBUGFS
|
||||
rga2_debugfs_add();
|
||||
#endif
|
||||
INFO("Module initialized.\n");
|
||||
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
#include <asm/atomic.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include "rga2_mmu_info.h"
|
||||
#if RGA2_DEBUGFS
|
||||
extern int RGA2_CHECK_MODE;
|
||||
#endif
|
||||
#include "rga2_debugger.h"
|
||||
|
||||
extern struct rga2_service_info rga2_service;
|
||||
extern struct rga2_mmu_buf_t rga2_mmu_buf;
|
||||
|
||||
@@ -345,7 +344,7 @@ static int rga2_buf_size_cal(unsigned long yrgb_addr, unsigned long uv_addr, uns
|
||||
return pageCount;
|
||||
}
|
||||
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
static int rga2_UserMemory_cheeck(struct page **pages, u32 w, u32 h, u32 format, int flag)
|
||||
{
|
||||
int bits;
|
||||
@@ -646,7 +645,7 @@ static int rga2_mmu_flush_cache(struct rga2_reg *reg, struct rga2_req *req)
|
||||
MMU_Base,
|
||||
DstStart, DstPageCount, 1,
|
||||
MMU_MAP_CLEAN | MMU_MAP_INVALID);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE)
|
||||
rga2_UserMemory_cheeck(&pages[0],
|
||||
req->dst.vir_w,
|
||||
@@ -757,7 +756,7 @@ static int rga2_mmu_info_BitBlt_mode(struct rga2_reg *reg, struct rga2_req *req)
|
||||
ret = rga2_MapUserMemory(&pages[0], &MMU_Base[0],
|
||||
Src0Start, Src0PageCount,
|
||||
0, MMU_MAP_CLEAN);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE)
|
||||
rga2_UserMemory_cheeck(&pages[0],
|
||||
req->src.vir_w,
|
||||
@@ -823,7 +822,7 @@ static int rga2_mmu_info_BitBlt_mode(struct rga2_reg *reg, struct rga2_req *req)
|
||||
+ Src0MemSize + Src1MemSize,
|
||||
DstStart, DstPageCount, 1,
|
||||
MMU_MAP_CLEAN | MMU_MAP_INVALID);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE)
|
||||
rga2_UserMemory_cheeck(&pages[0],
|
||||
req->dst.vir_w,
|
||||
@@ -840,7 +839,7 @@ static int rga2_mmu_info_BitBlt_mode(struct rga2_reg *reg, struct rga2_req *req)
|
||||
+ Src0MemSize + Src1MemSize,
|
||||
DstStart, DstPageCount,
|
||||
1, MMU_MAP_INVALID);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE)
|
||||
rga2_UserMemory_cheeck(&pages[0],
|
||||
req->dst.vir_w,
|
||||
@@ -968,7 +967,7 @@ static int rga2_mmu_info_color_palette_mode(struct rga2_reg *reg, struct rga2_re
|
||||
} else {
|
||||
ret = rga2_MapUserMemory(&pages[0], &MMU_Base[0],
|
||||
SrcStart, SrcPageCount, 0, MMU_MAP_CLEAN);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE)
|
||||
rga2_UserMemory_cheeck(&pages[0], req->src.vir_w,
|
||||
req->src.vir_h, req->src.format,
|
||||
@@ -997,7 +996,7 @@ static int rga2_mmu_info_color_palette_mode(struct rga2_reg *reg, struct rga2_re
|
||||
} else {
|
||||
ret = rga2_MapUserMemory(&pages[0], MMU_Base + SrcMemSize,
|
||||
DstStart, DstPageCount, 1, MMU_MAP_INVALID);
|
||||
#if RGA2_DEBUGFS
|
||||
#ifdef CONFIG_ROCKCHIP_RGA2_DEBUGGER
|
||||
if (RGA2_CHECK_MODE)
|
||||
rga2_UserMemory_cheeck(&pages[0], req->dst.vir_w,
|
||||
req->dst.vir_h, req->dst.format,
|
||||
|
||||
Reference in New Issue
Block a user