2024-12-19 21:34:44 +00:00
|
|
|
From 04b6319f042925cc574721a0b940a387a37cd6e7 Mon Sep 17 00:00:00 2001
|
2024-12-15 18:29:23 +00:00
|
|
|
From: zouxiaojun <zouxiaojun@eswincomputing.com>
|
|
|
|
Date: Thu, 15 Aug 2024 10:02:04 +0800
|
|
|
|
Subject: [PATCH 153/219] fix(enc):opt log in enc driver
|
|
|
|
|
|
|
|
Changelogs:
|
|
|
|
opt log in enc driver.
|
|
|
|
|
|
|
|
Signed-off-by: zouxiaojun <zouxiaojun@eswincomputing.com>
|
|
|
|
---
|
|
|
|
.../media/eswin/venc/vc8000_vcmd_driver.c | 18 +++++++-------
|
|
|
|
.../staging/media/eswin/venc/vc8000e_driver.c | 24 +++++++++----------
|
|
|
|
2 files changed, 21 insertions(+), 21 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/drivers/staging/media/eswin/venc/vc8000_vcmd_driver.c b/drivers/staging/media/eswin/venc/vc8000_vcmd_driver.c
|
|
|
|
index 0d6ac28f9981..33137277dda6 100644
|
|
|
|
--- a/drivers/staging/media/eswin/venc/vc8000_vcmd_driver.c
|
|
|
|
+++ b/drivers/staging/media/eswin/venc/vc8000_vcmd_driver.c
|
|
|
|
@@ -4064,16 +4064,16 @@ int vc8000e_vcmd_cleanup(void)
|
|
|
|
|
|
|
|
static int check_dev_idle(struct hantrovcmd_dev *dev)
|
|
|
|
{
|
|
|
|
- /** the devices must not be power down now.*/
|
|
|
|
+ /** the devices must not be power down now.*/
|
|
|
|
int idle = 0;
|
|
|
|
u8 vcmd_state = vcmd_get_register_value((const void *)dev->hwregs,
|
|
|
|
dev->reg_mirror, HWIF_VCMD_WORK_STATE);
|
|
|
|
|
|
|
|
if (WORKING_STATE_STALL != vcmd_state
|
|
|
|
- && WORKING_STATE_WORKING != vcmd_state) {
|
|
|
|
- idle = 1;
|
|
|
|
- }
|
|
|
|
- LOG_INFO("check_dev_idle, vcmd_state = %u\n", vcmd_state);
|
|
|
|
+ && WORKING_STATE_WORKING != vcmd_state) {
|
|
|
|
+ idle = 1;
|
|
|
|
+ }
|
|
|
|
+ LOG_DBG("check_dev_idle, vcmd_state = %u\n", vcmd_state);
|
|
|
|
|
|
|
|
return idle;
|
|
|
|
}
|
|
|
|
@@ -4081,18 +4081,18 @@ static int check_dev_idle(struct hantrovcmd_dev *dev)
|
|
|
|
int vc8000e_vcmd_wait_core_idle(u32 core_id)
|
|
|
|
{
|
|
|
|
struct hantrovcmd_dev *dev = NULL;
|
|
|
|
- int ret;
|
|
|
|
+ int ret;
|
|
|
|
|
|
|
|
if (core_id >= venc_vcmd_core_num) {
|
|
|
|
LOG_ERR("invalid core_id = %u, venc_vcmd_core_num = %u\n", core_id, venc_vcmd_core_num);
|
|
|
|
return -ERESTARTSYS;
|
|
|
|
}
|
|
|
|
dev = &hantrovcmd_data[core_id];
|
|
|
|
- LOG_INFO("enc wait core idle, core_id = %u\n", core_id);
|
|
|
|
+ LOG_DBG("enc wait core idle, core_id = %u\n", core_id);
|
|
|
|
|
|
|
|
ret = wait_event_interruptible_timeout(*dev->wait_queue, check_dev_idle(dev), ENC_DEV_IDLEWAIT_TIME);
|
|
|
|
|
|
|
|
- LOG_INFO("enc wait core idle exit, core_id = %u, ret = %d\n", core_id, ret);
|
|
|
|
+ LOG_DBG("enc wait core idle exit, core_id = %u, ret = %d\n", core_id, ret);
|
|
|
|
|
|
|
|
- return ret;
|
|
|
|
+ return ret;
|
|
|
|
}
|
|
|
|
diff --git a/drivers/staging/media/eswin/venc/vc8000e_driver.c b/drivers/staging/media/eswin/venc/vc8000e_driver.c
|
|
|
|
index 008166eeb8cc..5ed832b39132 100644
|
|
|
|
--- a/drivers/staging/media/eswin/venc/vc8000e_driver.c
|
|
|
|
+++ b/drivers/staging/media/eswin/venc/vc8000e_driver.c
|
|
|
|
@@ -781,7 +781,7 @@ static int venc_dev_open(struct device *dev)
|
|
|
|
int ret = -1;
|
|
|
|
|
|
|
|
if (atomic_dec_return(&prvdata->dev_open_gate) < 0) {
|
|
|
|
- LOG_INFO("The device is opening\n");
|
|
|
|
+ LOG_DBG("The device is opening\n");
|
|
|
|
atomic_inc(&prvdata->dev_open_gate);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
@@ -802,7 +802,7 @@ static int venc_dev_open(struct device *dev)
|
|
|
|
prvdata->dev_closed = 0;
|
|
|
|
|
|
|
|
end:
|
|
|
|
- LOG_INFO("dev open, numa_id = %u, ret = %d\n", prvdata->numa_id, ret);
|
|
|
|
+ LOG_DBG("dev open, numa_id = %u, ret = %d\n", prvdata->numa_id, ret);
|
|
|
|
atomic_inc(&prvdata->dev_open_gate);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
@@ -815,7 +815,7 @@ static int venc_dev_close(struct device *dev)
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (atomic_dec_return(&prvdata->dev_close_gate) < 0) {
|
|
|
|
- LOG_INFO("The device is opening\n");
|
|
|
|
+ LOG_DBG("The device is closing\n");
|
|
|
|
atomic_inc(&prvdata->dev_close_gate);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
@@ -825,9 +825,9 @@ static int venc_dev_close(struct device *dev)
|
|
|
|
// }
|
|
|
|
|
|
|
|
/** check the device be idle*/
|
|
|
|
- LOG_INFO("venc device closing, waiting device idle\n");
|
|
|
|
+ LOG_DBG("venc device closing, waiting device idle\n");
|
|
|
|
ret = venc_wait_device_idle(pdev);
|
|
|
|
- LOG_INFO("enc device closing, waiting device idle ret=%d\n", ret);
|
|
|
|
+ LOG_DBG("enc device closing, waiting device idle ret=%d\n", ret);
|
|
|
|
if (0 == ret) {
|
|
|
|
/** timeout*/
|
|
|
|
LOG_ERR("Timeout for venc_suspend\n");
|
|
|
|
@@ -853,34 +853,34 @@ static int venc_dev_close(struct device *dev)
|
|
|
|
prvdata->dev_closed = 1;
|
|
|
|
|
|
|
|
end:
|
|
|
|
- LOG_INFO("dev closed, numa_id = %u, ret = %d\n", prvdata->numa_id, ret);
|
|
|
|
+ LOG_DBG("dev closed, numa_id = %u, ret = %d\n", prvdata->numa_id, ret);
|
|
|
|
atomic_inc(&prvdata->dev_close_gate);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int venc_runtime_suspend(struct device *dev) {
|
|
|
|
- LOG_INFO("runtime suspend\n");
|
|
|
|
+ LOG_DBG("runtime suspend\n");
|
|
|
|
return venc_dev_close(dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int venc_runtime_resume(struct device *dev) {
|
|
|
|
- LOG_INFO("runtime resume\n");
|
|
|
|
+ LOG_DBG("runtime resume\n");
|
|
|
|
return venc_dev_open(dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int venc_suspend(struct device *dev) {
|
|
|
|
- LOG_INFO("generic suspend\n");
|
|
|
|
+ LOG_DBG("generic suspend\n");
|
|
|
|
if (pm_runtime_status_suspended(dev)) {
|
|
|
|
- LOG_INFO("generic suspend, venc is suspended already\n");
|
|
|
|
+ LOG_DBG("generic suspend, venc is suspended already\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return venc_dev_close(dev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int venc_resume(struct device *dev) {
|
|
|
|
- LOG_INFO("generic resume\n");
|
|
|
|
+ LOG_DBG("generic resume\n");
|
|
|
|
if (pm_runtime_status_suspended(dev)) {
|
|
|
|
- LOG_INFO("generic resume, venc is resumed already\n");
|
|
|
|
+ LOG_DBG("generic resume, venc is resumed already\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return venc_dev_open(dev);
|
|
|
|
--
|
|
|
|
2.47.0
|
|
|
|
|