Merge "video: driver: define hfi setter for configuring pipe"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
cdda26a16e
@@ -465,12 +465,19 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
|||||||
HFI_PROP_CSC_MATRIX,
|
HFI_PROP_CSC_MATRIX,
|
||||||
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT}, */
|
CAP_FLAG_ROOT | CAP_FLAG_OUTPUT_PORT}, */
|
||||||
|
|
||||||
{LOWLATENCY_MODE, ENC|DEC, H264|HEVC|VP9,
|
{LOWLATENCY_MODE, ENC, H264 | HEVC,
|
||||||
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
|
V4L2_CID_MPEG_VIDC_LOWLATENCY_REQUEST},
|
||||||
|
|
||||||
|
{LOWLATENCY_MODE, DEC, H264|HEVC|VP9,
|
||||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||||
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||||
V4L2_CID_MPEG_VIDC_LOWLATENCY_REQUEST,
|
V4L2_CID_MPEG_VIDC_LOWLATENCY_REQUEST,
|
||||||
HFI_PROP_STAGE,
|
HFI_PROP_STAGE,
|
||||||
CAP_FLAG_ROOT},
|
CAP_FLAG_DYNAMIC_ALLOWED,
|
||||||
|
{0}, {0},
|
||||||
|
NULL, msm_vidc_set_stage},
|
||||||
|
|
||||||
{LTR_COUNT, ENC, H264|HEVC,
|
{LTR_COUNT, ENC, H264|HEVC,
|
||||||
0, 2, 1, 0,
|
0, 2, 1, 0,
|
||||||
@@ -1142,11 +1149,21 @@ static struct msm_platform_inst_capability instance_data_waipio[] = {
|
|||||||
{STAGE, DEC|ENC, CODECS_ALL,
|
{STAGE, DEC|ENC, CODECS_ALL,
|
||||||
MSM_VIDC_STAGE_1,
|
MSM_VIDC_STAGE_1,
|
||||||
MSM_VIDC_STAGE_2, 1,
|
MSM_VIDC_STAGE_2, 1,
|
||||||
MSM_VIDC_STAGE_2},
|
MSM_VIDC_STAGE_2,
|
||||||
|
0,
|
||||||
|
HFI_PROP_STAGE,
|
||||||
|
CAP_FLAG_ROOT,
|
||||||
|
{0}, {0},
|
||||||
|
NULL, msm_vidc_set_stage},
|
||||||
{PIPE, DEC|ENC, CODECS_ALL,
|
{PIPE, DEC|ENC, CODECS_ALL,
|
||||||
MSM_VIDC_PIPE_1,
|
MSM_VIDC_PIPE_1,
|
||||||
MSM_VIDC_PIPE_4, 1,
|
MSM_VIDC_PIPE_4, 1,
|
||||||
MSM_VIDC_PIPE_4},
|
MSM_VIDC_PIPE_4,
|
||||||
|
0,
|
||||||
|
HFI_PROP_PIPE,
|
||||||
|
CAP_FLAG_ROOT,
|
||||||
|
{0}, {0},
|
||||||
|
NULL, msm_vidc_set_pipe},
|
||||||
{POC, DEC, H264, 0, 18, 1, 1},
|
{POC, DEC, H264, 0, 18, 1, 1},
|
||||||
{QUALITY_MODE, ENC, CODECS_ALL,
|
{QUALITY_MODE, ENC, CODECS_ALL,
|
||||||
MSM_VIDC_MAX_QUALITY_MODE,
|
MSM_VIDC_MAX_QUALITY_MODE,
|
||||||
|
@@ -86,6 +86,10 @@ int msm_vidc_set_blur_type(void *instance,
|
|||||||
enum msm_vidc_inst_capability_type cap_id);
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
int msm_vidc_set_blur_resolution(void *instance,
|
int msm_vidc_set_blur_resolution(void *instance,
|
||||||
enum msm_vidc_inst_capability_type cap_id);
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
|
int msm_vidc_set_stage(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
|
int msm_vidc_set_pipe(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
int msm_vidc_set_s32(void *instance,
|
int msm_vidc_set_s32(void *instance,
|
||||||
enum msm_vidc_inst_capability_type cap_id);
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
int msm_vidc_set_q16(void *instance,
|
int msm_vidc_set_q16(void *instance,
|
||||||
|
@@ -528,64 +528,6 @@ static int msm_vdec_set_colorformat(struct msm_vidc_inst *inst)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_vdec_set_stage(struct msm_vidc_inst *inst)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
u32 stage = 0;
|
|
||||||
struct msm_vidc_core *core = inst->core;
|
|
||||||
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
|
||||||
|
|
||||||
rc = call_session_op(core, decide_work_mode, inst);
|
|
||||||
if (rc) {
|
|
||||||
i_vpr_e(inst, "%s: decide_work_mode failed %d\n",
|
|
||||||
__func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = capability->cap[STAGE].value;
|
|
||||||
i_vpr_h(inst, "%s: stage: %d", __func__, stage);
|
|
||||||
rc = venus_hfi_session_property(inst,
|
|
||||||
HFI_PROP_STAGE,
|
|
||||||
HFI_HOST_FLAGS_NONE,
|
|
||||||
HFI_PORT_NONE,
|
|
||||||
HFI_PAYLOAD_U32,
|
|
||||||
&stage,
|
|
||||||
sizeof(u32));
|
|
||||||
if (rc)
|
|
||||||
i_vpr_e(inst, "%s: set property failed\n", __func__);
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int msm_vdec_set_pipe(struct msm_vidc_inst *inst)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
u32 pipe;
|
|
||||||
struct msm_vidc_core *core = inst->core;
|
|
||||||
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
|
||||||
|
|
||||||
rc = call_session_op(core, decide_work_route, inst);
|
|
||||||
if (rc) {
|
|
||||||
i_vpr_e(inst, "%s: decide_work_route failed\n",
|
|
||||||
__func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pipe = capability->cap[PIPE].value;
|
|
||||||
i_vpr_h(inst, "%s: pipe: %d", __func__, pipe);
|
|
||||||
rc = venus_hfi_session_property(inst,
|
|
||||||
HFI_PROP_PIPE,
|
|
||||||
HFI_HOST_FLAGS_NONE,
|
|
||||||
HFI_PORT_NONE,
|
|
||||||
HFI_PAYLOAD_U32,
|
|
||||||
&pipe,
|
|
||||||
sizeof(u32));
|
|
||||||
if (rc)
|
|
||||||
i_vpr_e(inst, "%s: set property failed\n", __func__);
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int msm_vdec_set_output_order(struct msm_vidc_inst *inst,
|
static int msm_vdec_set_output_order(struct msm_vidc_inst *inst,
|
||||||
enum msm_vidc_port_type port)
|
enum msm_vidc_port_type port)
|
||||||
{
|
{
|
||||||
@@ -816,11 +758,11 @@ static int msm_vdec_set_output_properties(struct msm_vidc_inst *inst)
|
|||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = msm_vdec_set_stage(inst);
|
rc = msm_vidc_set_stage(inst, STAGE);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = msm_vdec_set_pipe(inst);
|
rc = msm_vidc_set_pipe(inst, PIPE);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
|
@@ -399,62 +399,6 @@ static int msm_venc_set_csc(struct msm_vidc_inst* inst,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int msm_venc_set_stage(struct msm_vidc_inst *inst)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
struct msm_vidc_core *core = inst->core;
|
|
||||||
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
|
||||||
u32 stage;
|
|
||||||
|
|
||||||
rc = call_session_op(core, decide_work_mode, inst);
|
|
||||||
if (rc) {
|
|
||||||
i_vpr_e(inst, "%s: decide_work_mode failed\n",
|
|
||||||
__func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
stage = capability->cap[STAGE].value;
|
|
||||||
i_vpr_h(inst, "%s: stage: %u\n", __func__, stage);
|
|
||||||
rc = venus_hfi_session_property(inst,
|
|
||||||
HFI_PROP_STAGE,
|
|
||||||
HFI_HOST_FLAGS_NONE,
|
|
||||||
HFI_PORT_NONE,
|
|
||||||
HFI_PAYLOAD_U32,
|
|
||||||
&stage,
|
|
||||||
sizeof(u32));
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int msm_venc_set_pipe(struct msm_vidc_inst *inst)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
struct msm_vidc_core *core = inst->core;
|
|
||||||
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
|
||||||
u32 pipe;
|
|
||||||
|
|
||||||
rc = call_session_op(core, decide_work_route, inst);
|
|
||||||
if (rc) {
|
|
||||||
i_vpr_e(inst, "%s: decide_work_route failed\n",
|
|
||||||
__func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pipe = capability->cap[PIPE].value;
|
|
||||||
i_vpr_h(inst, "%s: pipe: %u\n", __func__, pipe);
|
|
||||||
rc = venus_hfi_session_property(inst,
|
|
||||||
HFI_PROP_PIPE,
|
|
||||||
HFI_HOST_FLAGS_NONE,
|
|
||||||
HFI_PORT_NONE,
|
|
||||||
HFI_PAYLOAD_U32,
|
|
||||||
&pipe,
|
|
||||||
sizeof(u32));
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int msm_venc_set_quality_mode(struct msm_vidc_inst *inst)
|
static int msm_venc_set_quality_mode(struct msm_vidc_inst *inst)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@@ -568,15 +512,6 @@ static int msm_venc_set_internal_properties(struct msm_vidc_inst *inst)
|
|||||||
}
|
}
|
||||||
i_vpr_h(inst, "%s()\n", __func__);
|
i_vpr_h(inst, "%s()\n", __func__);
|
||||||
|
|
||||||
//TODO: set HFI_PORT_NONE properties at master port streamon.
|
|
||||||
rc = msm_venc_set_stage(inst);
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
rc = msm_venc_set_pipe(inst);
|
|
||||||
if (rc)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
rc = msm_venc_set_quality_mode(inst);
|
rc = msm_venc_set_quality_mode(inst);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -3113,3 +3113,63 @@ set_default:
|
|||||||
capability->cap[cap_id].v4l2_id, *value);
|
capability->cap[cap_id].v4l2_id, *value);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int msm_vidc_set_stage(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
u32 stage = 0;
|
||||||
|
struct msm_vidc_core *core;
|
||||||
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
||||||
|
|
||||||
|
if (!inst || !inst->capabilities || !inst->core) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
core = inst->core;
|
||||||
|
|
||||||
|
rc = call_session_op(core, decide_work_mode, inst);
|
||||||
|
if (rc) {
|
||||||
|
i_vpr_e(inst, "%s: decide_work_mode failed\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
stage = inst->capabilities->cap[STAGE].value;
|
||||||
|
|
||||||
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32,
|
||||||
|
&stage, sizeof(u32), __func__);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int msm_vidc_set_pipe(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
u32 pipe;
|
||||||
|
struct msm_vidc_core *core;
|
||||||
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
||||||
|
|
||||||
|
if (!inst || !inst->capabilities || !inst->core) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
core = inst->core;
|
||||||
|
|
||||||
|
rc = call_session_op(core, decide_work_route, inst);
|
||||||
|
if (rc) {
|
||||||
|
i_vpr_e(inst, "%s: decide_work_route failed\n",
|
||||||
|
__func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
pipe = inst->capabilities->cap[PIPE].value;
|
||||||
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32,
|
||||||
|
&pipe, sizeof(u32), __func__);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
@@ -1109,6 +1109,7 @@ bool msm_vidc_allow_s_ctrl(struct msm_vidc_inst *inst, u32 id)
|
|||||||
switch (id) {
|
switch (id) {
|
||||||
case V4L2_CID_MPEG_VIDC_CODEC_CONFIG:
|
case V4L2_CID_MPEG_VIDC_CODEC_CONFIG:
|
||||||
case V4L2_CID_MPEG_VIDC_PRIORITY:
|
case V4L2_CID_MPEG_VIDC_PRIORITY:
|
||||||
|
case V4L2_CID_MPEG_VIDC_LOWLATENCY_REQUEST:
|
||||||
allow = true;
|
allow = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user