video: driver: add support to register custom handler.
Need to increase debug timeout incase more debug logs were enabled. This is to avoid sync cmd timeout. module_param_cb supports to register custom set/get callbacks. So using this feature to increase various timeout values, incase more logs were enabled. Change-Id: I194c077c2ba00af2403d487a3dcfbb48f119b478 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -64,10 +64,10 @@ static struct msm_platform_core_capability core_data_waipio[] = {
|
||||
{MAX_ENH_LAYER_COUNT, 5},
|
||||
{NUM_VPP_PIPE, 4},
|
||||
{SW_PC, 1},
|
||||
{SW_PC_DELAY, 20000}, /* 20000 ms (>HW_RESPONSE_TIMEOUT)*/
|
||||
{FW_UNLOAD, 0},
|
||||
{FW_UNLOAD_DELAY, 25000}, /* 25000 ms (>PC_DELAY)*/
|
||||
{HW_RESPONSE_TIMEOUT, 15000}, /* 1000 ms */
|
||||
{HW_RESPONSE_TIMEOUT, HW_RESPONSE_TIMEOUT_VALUE}, /* 1000 ms */
|
||||
{SW_PC_DELAY, SW_PC_DELAY_VALUE }, /* 1500 ms (>HW_RESPONSE_TIMEOUT)*/
|
||||
{FW_UNLOAD_DELAY, FW_UNLOAD_DELAY_VALUE }, /* 3000 ms (>SW_PC_DELAY)*/
|
||||
{DEBUG_TIMEOUT, 0},
|
||||
// TODO: review below entries, and if required rename as PREFETCH
|
||||
{PREFIX_BUF_COUNT_PIX, 18},
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#define MSM_VIDC_EMPTY_BRACE {},
|
||||
#endif
|
||||
|
||||
extern int msm_vidc_debug;
|
||||
extern unsigned int msm_vidc_debug;
|
||||
extern bool msm_vidc_lossless_encode;
|
||||
extern bool msm_vidc_syscache_disable;
|
||||
extern int msm_vidc_clock_voting;
|
||||
|
@@ -108,6 +108,11 @@
|
||||
#define Q16_INT(q) ((q) >> 16)
|
||||
#define Q16_FRAC(q) ((((q) & 0xFFFF) * 100) >> 16)
|
||||
|
||||
/* define timeout values */
|
||||
#define HW_RESPONSE_TIMEOUT_VALUE (1000)
|
||||
#define SW_PC_DELAY_VALUE (HW_RESPONSE_TIMEOUT_VALUE + 500)
|
||||
#define FW_UNLOAD_DELAY_VALUE (SW_PC_DELAY_VALUE + 1500)
|
||||
|
||||
enum msm_vidc_domain_type {
|
||||
MSM_VIDC_ENCODER = BIT(0),
|
||||
MSM_VIDC_DECODER = BIT(1),
|
||||
|
@@ -11,11 +11,69 @@
|
||||
#include "msm_vidc_inst.h"
|
||||
#include "msm_vidc_internal.h"
|
||||
|
||||
extern struct msm_vidc_core *g_core;
|
||||
|
||||
#define MAX_SSR_STRING_LEN 64
|
||||
#define MAX_DEBUG_LEVEL_STRING_LEN 15
|
||||
|
||||
int msm_vidc_debug = VIDC_ERR | VIDC_PRINTK | FW_ERROR | FW_FATAL;
|
||||
module_param(msm_vidc_debug, int, 0644);
|
||||
unsigned int msm_vidc_debug = VIDC_ERR | VIDC_PRINTK | FW_ERROR | FW_FATAL;
|
||||
|
||||
static int debug_level_set(const char *val,
|
||||
const struct kernel_param *kp)
|
||||
{
|
||||
struct msm_vidc_core *core = NULL;
|
||||
unsigned int dvalue;
|
||||
int ret;
|
||||
|
||||
if (!kp || !kp->arg || !val) {
|
||||
d_vpr_e("%s: Invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
core = *(struct msm_vidc_core **)kp->arg;
|
||||
|
||||
if (!core || !core->capabilities) {
|
||||
d_vpr_e("%s: Invalid core/capabilities\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = kstrtouint(val, 0, &dvalue);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
msm_vidc_debug = dvalue;
|
||||
|
||||
/* check only driver logmask */
|
||||
if ((dvalue & 0xFF) > (VIDC_ERR | VIDC_HIGH)) {
|
||||
core->capabilities[HW_RESPONSE_TIMEOUT].value = 2 * HW_RESPONSE_TIMEOUT_VALUE;
|
||||
core->capabilities[SW_PC_DELAY].value = 2 * SW_PC_DELAY_VALUE;
|
||||
core->capabilities[FW_UNLOAD_DELAY].value = 2 * FW_UNLOAD_DELAY_VALUE;
|
||||
} else {
|
||||
/* reset timeout values, if user reduces the logging */
|
||||
core->capabilities[HW_RESPONSE_TIMEOUT].value = HW_RESPONSE_TIMEOUT_VALUE;
|
||||
core->capabilities[SW_PC_DELAY].value = SW_PC_DELAY_VALUE;
|
||||
core->capabilities[FW_UNLOAD_DELAY].value = FW_UNLOAD_DELAY_VALUE;
|
||||
}
|
||||
|
||||
d_vpr_h("timeout updated: hw_response %u, sw_pc %u, fw_unload %u, debug_level %#x\n",
|
||||
core->capabilities[HW_RESPONSE_TIMEOUT].value,
|
||||
core->capabilities[SW_PC_DELAY].value,
|
||||
core->capabilities[FW_UNLOAD_DELAY].value,
|
||||
msm_vidc_debug);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int debug_level_get(char *buffer, const struct kernel_param *kp)
|
||||
{
|
||||
return scnprintf(buffer, PAGE_SIZE, "%#x", msm_vidc_debug);
|
||||
}
|
||||
|
||||
static const struct kernel_param_ops msm_vidc_debug_fops = {
|
||||
.set = debug_level_set,
|
||||
.get = debug_level_get,
|
||||
};
|
||||
|
||||
module_param_cb(msm_vidc_debug, &msm_vidc_debug_fops, &g_core, 0644);
|
||||
|
||||
bool msm_vidc_lossless_encode = !true;
|
||||
EXPORT_SYMBOL(msm_vidc_lossless_encode);
|
||||
|
Reference in New Issue
Block a user