Merge 1eddbdadbd on remote branch

Change-Id: I9eedca281f4d4d33376030be3bf61cc9adc836f4
This commit is contained in:
Linux Build Service Account 2020-12-14 00:30:28 -08:00
commit f84b4da8a5
3 changed files with 68 additions and 69 deletions

View file

@ -1337,6 +1337,7 @@ static int msm_vidc_comm_update_ctrl(struct msm_vidc_inst *inst,
{
struct v4l2_ctrl *ctrl = NULL;
int rc = 0;
bool is_menu = false;
ctrl = v4l2_ctrl_find(&inst->ctrl_handler, id);
if (!ctrl) {
@ -1345,33 +1346,32 @@ static int msm_vidc_comm_update_ctrl(struct msm_vidc_inst *inst,
return -EINVAL;
}
/* For menu type, keep original menu_skip_mask(step) */
if (ctrl->type == V4L2_CTRL_TYPE_MENU)
cap->step_size = (u32)ctrl->step;
is_menu = true;
/**
* For menu controls the step value is interpreted
* as a menu_skip_mask.
*/
rc = v4l2_ctrl_modify_range(ctrl, cap->min, cap->max,
cap->step_size, cap->default_value);
is_menu ? ctrl->menu_skip_mask : cap->step_size,
cap->default_value);
if (rc) {
s_vpr_e(inst->sid,
"%s: failed: control name %s, min %d, max %d, step %d, default_value %d\n",
"%s: failed: control name %s, min %d, max %d, %s %x, default_value %d\n",
__func__, ctrl->name, cap->min, cap->max,
cap->step_size, cap->default_value);
goto error;
}
/*
* v4l2_ctrl_modify_range() is not updating default_value,
* so use v4l2_ctrl_s_ctrl() to update it.
*/
rc = v4l2_ctrl_s_ctrl(ctrl, cap->default_value);
if (rc) {
s_vpr_e(inst->sid, "%s: failed s_ctrl: %s with value %d\n",
__func__, ctrl->name, cap->default_value);
is_menu ? "menu_skip_mask" : "step",
is_menu ? ctrl->menu_skip_mask : cap->step_size,
cap->default_value);
goto error;
}
s_vpr_h(inst->sid,
"Updated control: %s: min %lld, max %lld, step %lld, default value = %lld\n",
"Updated control: %s: min %lld, max %lld, %s %x, default value = %lld\n",
ctrl->name, ctrl->minimum, ctrl->maximum,
ctrl->step, ctrl->default_value);
is_menu ? "menu_skip_mask" : "step",
is_menu ? ctrl->menu_skip_mask : ctrl->step,
ctrl->default_value);
error:
return rc;

View file

@ -31,7 +31,7 @@ int msm_vidc_vpp_delay;
atomic_read(&__binfo->ref_count) >= 2 ? "video driver" : "firmware";\
})
static struct log_cookie ctxt[MAX_SUPPORTED_INSTANCES];
struct log_cookie ctxt[MAX_SUPPORTED_INSTANCES];
struct core_inst_pair {
struct msm_vidc_core *core;
@ -626,17 +626,6 @@ int get_sid(u32 *sid, u32 session_type)
return (i == MAX_SUPPORTED_INSTANCES);
}
void put_sid(u32 sid)
{
if (!sid || sid > MAX_SUPPORTED_INSTANCES) {
d_vpr_e("%s: invalid sid %#x\n",
__func__, sid);
return;
}
if (ctxt[sid-1].used)
ctxt[sid-1].used = 0;
}
inline void update_log_ctxt(u32 sid, u32 session_type, u32 fourcc)
{
const char *codec;
@ -697,36 +686,6 @@ inline void update_log_ctxt(u32 sid, u32 session_type, u32 fourcc)
ctxt[sid-1].name[5] = '\0';
}
inline char *get_codec_name(u32 sid)
{
if (!sid || sid > MAX_SUPPORTED_INSTANCES)
return ".....";
return ctxt[sid-1].name;
}
/**
* 0xx -> allow prints for all sessions
* 1xx -> allow only encoder prints
* 2xx -> allow only decoder prints
*/
inline bool is_print_allowed(u32 sid, u32 level)
{
if (!(msm_vidc_debug & level))
return false;
if (!((msm_vidc_debug >> 8) & 0xF))
return true;
if (!sid || sid > MAX_SUPPORTED_INSTANCES)
return true;
if (ctxt[sid-1].session_type & msm_vidc_debug)
return true;
return false;
}
/* Mock all the missing parts for successful compilation starts here */
void do_gettimeofday(struct timeval *__ddl_tv)
{

View file

@ -92,6 +92,13 @@ enum vidc_err_recovery_disable {
VIDC_DISABLE_NON_NOC_ERR_RECOV = 0x0002
};
struct log_cookie {
u32 used;
u32 session_type;
u32 codec_type;
char name[20];
};
extern int msm_vidc_debug;
extern int msm_vidc_fw_debug_mode;
extern bool msm_vidc_fw_coverage;
@ -102,13 +109,7 @@ extern bool msm_vidc_lossless_encode;
extern bool msm_vidc_cvp_usage;
extern int msm_vidc_err_recovery_disable;
extern int msm_vidc_vpp_delay;
struct log_cookie {
u32 used;
u32 session_type;
u32 codec_type;
char name[20];
};
extern struct log_cookie ctxt[MAX_SUPPORTED_INSTANCES];
#define dprintk(__level, sid, __fmt, ...) \
do { \
@ -200,9 +201,6 @@ void msm_vidc_debugfs_update(struct msm_vidc_inst *inst,
int msm_vidc_check_ratelimit(void);
int get_sid(u32 *sid, u32 session_type);
void update_log_ctxt(u32 sid, u32 session_type, u32 fourcc);
inline char *get_codec_name(u32 sid);
inline void put_sid(u32 sid);
inline bool is_print_allowed(u32 sid, u32 level);
static inline char *get_debug_level_str(int level)
{
@ -225,6 +223,48 @@ static inline char *get_debug_level_str(int level)
}
}
/**
* 0xx -> allow prints for all sessions
* 1xx -> allow only encoder prints
* 2xx -> allow only decoder prints
* 4xx -> allow only cvp prints
*/
static inline bool is_print_allowed(u32 sid, u32 level)
{
if (!(msm_vidc_debug & level))
return false;
if (!((msm_vidc_debug >> 8) & 0xF))
return true;
if (!sid || sid > MAX_SUPPORTED_INSTANCES)
return true;
if (ctxt[sid-1].session_type & msm_vidc_debug)
return true;
return false;
}
static inline char *get_codec_name(u32 sid)
{
if (!sid || sid > MAX_SUPPORTED_INSTANCES)
return ".....";
return ctxt[sid-1].name;
}
static inline void put_sid(u32 sid)
{
if (!sid || sid > MAX_SUPPORTED_INSTANCES) {
d_vpr_e("%s: invalid sid %#x\n",
__func__, sid);
return;
}
if (ctxt[sid-1].used)
ctxt[sid-1].used = 0;
}
static inline void tic(struct msm_vidc_inst *i, enum profiling_points p,
char *b)
{