video: driver: update basic functionality controls
- update basic functionality controls with their parents and children list. - deprecate MPEG2 related code. - rename driver internal color formats. Change-Id: I918d6fd238486098f10c5b9ce40c895bcd9468e5 Signed-off-by: Akshata Sahukar <asahukar@codeaurora.org>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -139,7 +139,7 @@ static u32 msm_vidc_decoder_line_size_iris2(struct msm_vidc_inst *inst)
|
|||||||
|
|
||||||
pixelformat = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
|
pixelformat = inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat;
|
||||||
if (pixelformat == MSM_VIDC_FMT_NV12 ||
|
if (pixelformat == MSM_VIDC_FMT_NV12 ||
|
||||||
pixelformat == MSM_VIDC_FMT_NV12_P010)
|
pixelformat == MSM_VIDC_FMT_P010)
|
||||||
is_opb = true;
|
is_opb = true;
|
||||||
else
|
else
|
||||||
is_opb = false;
|
is_opb = false;
|
||||||
@@ -304,8 +304,8 @@ static u32 msm_vidc_encoder_line_size_iris2(struct msm_vidc_inst *inst)
|
|||||||
width = f->fmt.pix_mp.width;
|
width = f->fmt.pix_mp.width;
|
||||||
height = f->fmt.pix_mp.height;
|
height = f->fmt.pix_mp.height;
|
||||||
pixelformat = f->fmt.pix_mp.pixelformat;
|
pixelformat = f->fmt.pix_mp.pixelformat;
|
||||||
if (pixelformat == MSM_VIDC_FMT_NV12_P010 ||
|
if (pixelformat == MSM_VIDC_FMT_P010 ||
|
||||||
pixelformat == MSM_VIDC_FMT_NV12_TP10_UBWC)
|
pixelformat == MSM_VIDC_FMT_TP10C)
|
||||||
is_tenbit = true;
|
is_tenbit = true;
|
||||||
else
|
else
|
||||||
is_tenbit = false;
|
is_tenbit = false;
|
||||||
@@ -335,8 +335,8 @@ static u32 msm_vidc_encoder_dpb_size_iris2(struct msm_vidc_inst *inst)
|
|||||||
width = f->fmt.pix_mp.width;
|
width = f->fmt.pix_mp.width;
|
||||||
height = f->fmt.pix_mp.height;
|
height = f->fmt.pix_mp.height;
|
||||||
pixelformat = f->fmt.pix_mp.pixelformat;
|
pixelformat = f->fmt.pix_mp.pixelformat;
|
||||||
if (pixelformat == MSM_VIDC_FMT_NV12_P010 ||
|
if (pixelformat == MSM_VIDC_FMT_P010 ||
|
||||||
pixelformat == MSM_VIDC_FMT_NV12_TP10_UBWC)
|
pixelformat == MSM_VIDC_FMT_TP10C)
|
||||||
is_tenbit = true;
|
is_tenbit = true;
|
||||||
else
|
else
|
||||||
is_tenbit = false;
|
is_tenbit = false;
|
||||||
@@ -384,8 +384,8 @@ static u32 msm_vidc_encoder_vpss_size_iris2(struct msm_vidc_inst* inst)
|
|||||||
width = f->fmt.pix_mp.width;
|
width = f->fmt.pix_mp.width;
|
||||||
height = f->fmt.pix_mp.height;
|
height = f->fmt.pix_mp.height;
|
||||||
pixelformat = f->fmt.pix_mp.pixelformat;
|
pixelformat = f->fmt.pix_mp.pixelformat;
|
||||||
if (pixelformat == MSM_VIDC_FMT_NV12_P010 ||
|
if (pixelformat == MSM_VIDC_FMT_P010 ||
|
||||||
pixelformat == MSM_VIDC_FMT_NV12_TP10_UBWC)
|
pixelformat == MSM_VIDC_FMT_TP10C)
|
||||||
is_tenbit = true;
|
is_tenbit = true;
|
||||||
else
|
else
|
||||||
is_tenbit = false;
|
is_tenbit = false;
|
||||||
|
@@ -473,7 +473,7 @@ static u64 __calculate_encoder(struct vidc_bus_vote_data *d)
|
|||||||
|
|
||||||
b_frames_enabled = d->b_frames_enabled;
|
b_frames_enabled = d->b_frames_enabled;
|
||||||
original_color_format = d->num_formats >= 1 ?
|
original_color_format = d->num_formats >= 1 ?
|
||||||
d->color_formats[0] : MSM_VIDC_FMT_NV12_UBWC;
|
d->color_formats[0] : MSM_VIDC_FMT_NV12C;
|
||||||
|
|
||||||
original_compression_enabled = __ubwc(original_color_format);
|
original_compression_enabled = __ubwc(original_color_format);
|
||||||
|
|
||||||
|
@@ -220,8 +220,8 @@ void __dump(struct dump dump[], int len);
|
|||||||
static inline bool __ubwc(enum msm_vidc_colorformat_type f)
|
static inline bool __ubwc(enum msm_vidc_colorformat_type f)
|
||||||
{
|
{
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case MSM_VIDC_FMT_NV12_UBWC:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case MSM_VIDC_FMT_NV12_TP10_UBWC:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -233,11 +233,11 @@ static inline int __bpp(enum msm_vidc_colorformat_type f)
|
|||||||
switch (f) {
|
switch (f) {
|
||||||
case MSM_VIDC_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case MSM_VIDC_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case MSM_VIDC_FMT_NV12_UBWC:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case MSM_VIDC_FMT_RGBA8888_UBWC:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
return 8;
|
return 8;
|
||||||
case MSM_VIDC_FMT_NV12_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
case MSM_VIDC_FMT_NV12_TP10_UBWC:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
return 10;
|
return 10;
|
||||||
default:
|
default:
|
||||||
d_vpr_e("Unsupported colorformat (%x)", f);
|
d_vpr_e("Unsupported colorformat (%x)", f);
|
||||||
|
@@ -28,10 +28,17 @@ int msm_vidc_ctrl_deinit(struct msm_vidc_inst *inst);
|
|||||||
int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl);
|
int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl);
|
||||||
int msm_vidc_adjust_bitrate(void *instance, struct v4l2_ctrl *ctrl);
|
int msm_vidc_adjust_bitrate(void *instance, struct v4l2_ctrl *ctrl);
|
||||||
int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl);
|
int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl);
|
||||||
|
int msm_vidc_adjust_profile(void *instance, struct v4l2_ctrl *ctrl);
|
||||||
int msm_vidc_adjust_ltr_count(void *instance, struct v4l2_ctrl *ctrl);
|
int msm_vidc_adjust_ltr_count(void *instance, struct v4l2_ctrl *ctrl);
|
||||||
int msm_vidc_adjust_v4l2_properties(struct msm_vidc_inst *inst);
|
int msm_vidc_adjust_v4l2_properties(struct msm_vidc_inst *inst);
|
||||||
|
int msm_vidc_set_header_mode(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
|
int msm_vidc_set_bitrate_mode(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
int msm_vidc_set_u32(void *instance,
|
int msm_vidc_set_u32(void *instance,
|
||||||
enum msm_vidc_inst_capability_type cap_id);
|
enum msm_vidc_inst_capability_type cap_id);
|
||||||
|
int msm_vidc_set_u32_enum(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_array(void *instance,
|
int msm_vidc_set_array(void *instance,
|
||||||
@@ -41,5 +48,7 @@ int msm_vidc_set_q16(void *instance,
|
|||||||
int msm_vidc_set_v4l2_properties(struct msm_vidc_inst *inst);
|
int msm_vidc_set_v4l2_properties(struct msm_vidc_inst *inst);
|
||||||
int msm_vidc_v4l2_menu_to_hfi(struct msm_vidc_inst *inst,
|
int msm_vidc_v4l2_menu_to_hfi(struct msm_vidc_inst *inst,
|
||||||
enum msm_vidc_inst_capability_type cap_id, u32 *value);
|
enum msm_vidc_inst_capability_type cap_id, u32 *value);
|
||||||
|
int msm_vidc_v4l2_to_hfi_enum(struct msm_vidc_inst *inst,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id, u32 *value);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -114,13 +114,13 @@ static inline bool is_linear_colorformat(enum msm_vidc_colorformat_type colorfor
|
|||||||
{
|
{
|
||||||
return colorformat == MSM_VIDC_FMT_NV12 ||
|
return colorformat == MSM_VIDC_FMT_NV12 ||
|
||||||
colorformat == MSM_VIDC_FMT_NV21 ||
|
colorformat == MSM_VIDC_FMT_NV21 ||
|
||||||
colorformat == MSM_VIDC_FMT_NV12_P010;
|
colorformat == MSM_VIDC_FMT_P010;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool is_10bit_colorformat(enum msm_vidc_colorformat_type colorformat)
|
static inline bool is_10bit_colorformat(enum msm_vidc_colorformat_type colorformat)
|
||||||
{
|
{
|
||||||
return colorformat == MSM_VIDC_FMT_NV12_P010 ||
|
return colorformat == MSM_VIDC_FMT_P010 ||
|
||||||
colorformat == MSM_VIDC_FMT_NV12_TP10_UBWC;
|
colorformat == MSM_VIDC_FMT_TP10C;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool is_secondary_output_mode(struct msm_vidc_inst *inst)
|
static inline bool is_secondary_output_mode(struct msm_vidc_inst *inst)
|
||||||
|
@@ -108,18 +108,17 @@ enum msm_vidc_codec_type {
|
|||||||
MSM_VIDC_H264 = BIT(0),
|
MSM_VIDC_H264 = BIT(0),
|
||||||
MSM_VIDC_HEVC = BIT(1),
|
MSM_VIDC_HEVC = BIT(1),
|
||||||
MSM_VIDC_VP9 = BIT(2),
|
MSM_VIDC_VP9 = BIT(2),
|
||||||
MSM_VIDC_MPEG2 = BIT(3),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum msm_vidc_colorformat_type {
|
enum msm_vidc_colorformat_type {
|
||||||
MSM_VIDC_FMT_NONE = 0,
|
MSM_VIDC_FMT_NONE = 0,
|
||||||
MSM_VIDC_FMT_NV12,
|
MSM_VIDC_FMT_NV12,
|
||||||
MSM_VIDC_FMT_NV21,
|
MSM_VIDC_FMT_NV21,
|
||||||
MSM_VIDC_FMT_NV12_UBWC,
|
MSM_VIDC_FMT_NV12C,
|
||||||
MSM_VIDC_FMT_NV12_P010,
|
MSM_VIDC_FMT_P010,
|
||||||
MSM_VIDC_FMT_NV12_TP10_UBWC,
|
MSM_VIDC_FMT_TP10C,
|
||||||
MSM_VIDC_FMT_RGBA8888,
|
MSM_VIDC_FMT_RGBA8888,
|
||||||
MSM_VIDC_FMT_RGBA8888_UBWC,
|
MSM_VIDC_FMT_RGBA8888C,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum msm_vidc_buffer_type {
|
enum msm_vidc_buffer_type {
|
||||||
@@ -229,47 +228,50 @@ enum msm_vidc_core_capability_type {
|
|||||||
enum msm_vidc_inst_capability_type {
|
enum msm_vidc_inst_capability_type {
|
||||||
INST_CAP_NONE = 0,
|
INST_CAP_NONE = 0,
|
||||||
FRAME_WIDTH,
|
FRAME_WIDTH,
|
||||||
|
LOSSLESS_FRAME_WIDTH,
|
||||||
|
SECURE_FRAME_WIDTH,
|
||||||
|
HEVC_IMAGE_FRAME_WIDTH,
|
||||||
|
HEIC_IMAGE_FRAME_WIDTH,
|
||||||
FRAME_HEIGHT,
|
FRAME_HEIGHT,
|
||||||
|
LOSSLESS_FRAME_HEIGHT,
|
||||||
|
SECURE_FRAME_HEIGHT,
|
||||||
|
HEVC_IMAGE_FRAME_HEIGHT,
|
||||||
|
HEIC_IMAGE_FRAME_HEIGHT,
|
||||||
PIX_FMTS,
|
PIX_FMTS,
|
||||||
MIN_BUFFERS_INPUT,
|
MIN_BUFFERS_INPUT,
|
||||||
MIN_BUFFERS_OUTPUT,
|
MIN_BUFFERS_OUTPUT,
|
||||||
MBPF,
|
MBPF,
|
||||||
|
LOSSLESS_MBPF,
|
||||||
|
BATCH_MBPF,
|
||||||
|
SECURE_MBPF,
|
||||||
MBPS,
|
MBPS,
|
||||||
|
POWER_SAVE_MBPS,
|
||||||
FRAME_RATE,
|
FRAME_RATE,
|
||||||
|
OPERATING_RATE,
|
||||||
SCALE_X,
|
SCALE_X,
|
||||||
SCALE_Y,
|
SCALE_Y,
|
||||||
B_FRAME,
|
B_FRAME,
|
||||||
POWER_SAVE_MBPS,
|
|
||||||
BATCH_MBPF,
|
|
||||||
BATCH_FRAME_RATE,
|
|
||||||
LOSSLESS_FRAME_WIDTH,
|
|
||||||
LOSSLESS_FRAME_HEIGHT,
|
|
||||||
LOSSLESS_MBPF,
|
|
||||||
ALL_INTRA_FRAME_RATE,
|
|
||||||
HEVC_IMAGE_FRAME_WIDTH,
|
|
||||||
HEVC_IMAGE_FRAME_HEIGHT,
|
|
||||||
HEIC_IMAGE_FRAME_WIDTH,
|
|
||||||
HEIC_IMAGE_FRAME_HEIGHT,
|
|
||||||
MB_CYCLES_VSP,
|
MB_CYCLES_VSP,
|
||||||
MB_CYCLES_VPP,
|
MB_CYCLES_VPP,
|
||||||
MB_CYCLES_LP,
|
MB_CYCLES_LP,
|
||||||
MB_CYCLES_FW,
|
MB_CYCLES_FW,
|
||||||
MB_CYCLES_FW_VPP,
|
MB_CYCLES_FW_VPP,
|
||||||
|
SECURE_MODE,
|
||||||
HFLIP,
|
HFLIP,
|
||||||
VFLIP,
|
VFLIP,
|
||||||
PREPEND_SPSPPS_TO_IDR,
|
ROTATION,
|
||||||
REQUEST_I_FRAME,
|
|
||||||
SLICE_INTERFACE,
|
SLICE_INTERFACE,
|
||||||
FRAME_RC,
|
|
||||||
BITRATE_MODE,
|
|
||||||
HEADER_MODE,
|
HEADER_MODE,
|
||||||
|
PREPEND_SPSPPS_TO_IDR,
|
||||||
|
META_SEQ_HDR_NAL,
|
||||||
|
REQUEST_I_FRAME,
|
||||||
|
BIT_RATE,
|
||||||
|
BITRATE_MODE,
|
||||||
|
LOSSLESS,
|
||||||
|
FRAME_SKIP_MODE,
|
||||||
|
FRAME_RC_ENABLE,
|
||||||
GOP_SIZE,
|
GOP_SIZE,
|
||||||
GOP_CLOSURE,
|
GOP_CLOSURE,
|
||||||
BIT_RATE,
|
|
||||||
SECURE_FRAME_WIDTH,
|
|
||||||
SECURE_FRAME_HEIGHT,
|
|
||||||
SECURE_MBPF,
|
|
||||||
SECURE_MODE,
|
|
||||||
BLUR_TYPES,
|
BLUR_TYPES,
|
||||||
BLUR_RESOLUTION,
|
BLUR_RESOLUTION,
|
||||||
CSC_CUSTOM_MATRIX,
|
CSC_CUSTOM_MATRIX,
|
||||||
@@ -284,28 +286,36 @@ enum msm_vidc_inst_capability_type {
|
|||||||
TIME_DELTA_BASED_RC,
|
TIME_DELTA_BASED_RC,
|
||||||
CONTENT_ADAPTIVE_CODING,
|
CONTENT_ADAPTIVE_CODING,
|
||||||
BITRATE_BOOST,
|
BITRATE_BOOST,
|
||||||
ROTATION,
|
|
||||||
VBV_DELAY,
|
VBV_DELAY,
|
||||||
MIN_FRAME_QP,
|
MIN_FRAME_QP,
|
||||||
|
I_FRAME_MIN_QP,
|
||||||
|
P_FRAME_MIN_QP,
|
||||||
|
B_FRAME_MIN_QP,
|
||||||
MAX_FRAME_QP,
|
MAX_FRAME_QP,
|
||||||
|
I_FRAME_MAX_QP,
|
||||||
|
P_FRAME_MAX_QP,
|
||||||
|
B_FRAME_MAX_QP,
|
||||||
HEVC_HIER_QP,
|
HEVC_HIER_QP,
|
||||||
I_FRAME_QP,
|
I_FRAME_QP,
|
||||||
P_FRAME_QP,
|
P_FRAME_QP,
|
||||||
I_FRAME_MIN_QP,
|
|
||||||
I_FRAME_MAX_QP,
|
|
||||||
P_FRAME_MIN_QP,
|
|
||||||
P_FRAME_MAX_QP,
|
|
||||||
B_FRAME_QP,
|
B_FRAME_QP,
|
||||||
B_FRAME_MIN_QP,
|
|
||||||
B_FRAME_MAX_QP,
|
|
||||||
HIER_CODING_TYPE,
|
|
||||||
HIER_CODING_LAYER,
|
|
||||||
L0_QP,
|
L0_QP,
|
||||||
L1_QP,
|
L1_QP,
|
||||||
L2_QP,
|
L2_QP,
|
||||||
L3_QP,
|
L3_QP,
|
||||||
L4_QP,
|
L4_QP,
|
||||||
L5_QP,
|
L5_QP,
|
||||||
|
HIER_LAYER_QP,
|
||||||
|
HIER_CODING_TYPE,
|
||||||
|
HIER_CODING,
|
||||||
|
HIER_CODING_LAYER,
|
||||||
|
L0_BR,
|
||||||
|
L1_BR,
|
||||||
|
L2_BR,
|
||||||
|
L3_BR,
|
||||||
|
L4_BR,
|
||||||
|
L5_BR,
|
||||||
|
ENTROPY_MODE,
|
||||||
PROFILE,
|
PROFILE,
|
||||||
LEVEL,
|
LEVEL,
|
||||||
HEVC_TIER,
|
HEVC_TIER,
|
||||||
@@ -313,22 +323,11 @@ enum msm_vidc_inst_capability_type {
|
|||||||
LF_ALPHA,
|
LF_ALPHA,
|
||||||
LF_BETA,
|
LF_BETA,
|
||||||
LF_TC,
|
LF_TC,
|
||||||
LOSSLESS,
|
|
||||||
L0_BR,
|
|
||||||
L1_BR,
|
|
||||||
L2_BR,
|
|
||||||
L3_BR,
|
|
||||||
L4_BR,
|
|
||||||
L5_BR,
|
|
||||||
SLICE_MAX_BYTES,
|
SLICE_MAX_BYTES,
|
||||||
SLICE_MAX_MB,
|
SLICE_MAX_MB,
|
||||||
SLICE_MODE,
|
SLICE_MODE,
|
||||||
CABAC_BITRATE,
|
|
||||||
MB_RC,
|
MB_RC,
|
||||||
TRANSFORM_8X8,
|
TRANSFORM_8X8,
|
||||||
ENTROPY_MODE,
|
|
||||||
HIER_CODING,
|
|
||||||
HIER_LAYER_QP,
|
|
||||||
CHROMA_QP_INDEX_OFFSET,
|
CHROMA_QP_INDEX_OFFSET,
|
||||||
DISPLAY_DELAY_ENABLE,
|
DISPLAY_DELAY_ENABLE,
|
||||||
DISPLAY_DELAY,
|
DISPLAY_DELAY,
|
||||||
@@ -341,7 +340,6 @@ enum msm_vidc_inst_capability_type {
|
|||||||
BIT_DEPTH,
|
BIT_DEPTH,
|
||||||
CODEC_CONFIG,
|
CODEC_CONFIG,
|
||||||
META_LTR_MARK_USE,
|
META_LTR_MARK_USE,
|
||||||
META_SEQ_HDR_NAL,
|
|
||||||
META_DPB_MISR,
|
META_DPB_MISR,
|
||||||
META_OPB_MISR,
|
META_OPB_MISR,
|
||||||
META_INTERLACE,
|
META_INTERLACE,
|
||||||
|
@@ -221,8 +221,8 @@ void __dump(struct dump dump[], int len);
|
|||||||
static inline bool __ubwc(enum msm_vidc_colorformat_type f)
|
static inline bool __ubwc(enum msm_vidc_colorformat_type f)
|
||||||
{
|
{
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case MSM_VIDC_FMT_NV12_UBWC:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case MSM_VIDC_FMT_NV12_TP10_UBWC:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -234,11 +234,11 @@ static inline int __bpp(enum msm_vidc_colorformat_type f)
|
|||||||
switch (f) {
|
switch (f) {
|
||||||
case MSM_VIDC_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
case MSM_VIDC_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
case MSM_VIDC_FMT_NV12_UBWC:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
case MSM_VIDC_FMT_RGBA8888_UBWC:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
return 8;
|
return 8;
|
||||||
case MSM_VIDC_FMT_NV12_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
case MSM_VIDC_FMT_NV12_TP10_UBWC:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
return 10;
|
return 10;
|
||||||
default:
|
default:
|
||||||
d_vpr_e("Unsupported colorformat (%x)", f);
|
d_vpr_e("Unsupported colorformat (%x)", f);
|
||||||
|
@@ -166,8 +166,6 @@ u32 get_hfi_codec(struct msm_vidc_inst *inst)
|
|||||||
return HFI_CODEC_DECODE_HEVC;
|
return HFI_CODEC_DECODE_HEVC;
|
||||||
case MSM_VIDC_VP9:
|
case MSM_VIDC_VP9:
|
||||||
return HFI_CODEC_DECODE_VP9;
|
return HFI_CODEC_DECODE_VP9;
|
||||||
case MSM_VIDC_MPEG2:
|
|
||||||
return HFI_CODEC_DECODE_MPEG2;
|
|
||||||
default:
|
default:
|
||||||
d_vpr_e("invalid codec %d, domain %d\n",
|
d_vpr_e("invalid codec %d, domain %d\n",
|
||||||
inst->codec, inst->domain);
|
inst->codec, inst->domain);
|
||||||
@@ -184,19 +182,19 @@ u32 get_hfi_colorformat(struct msm_vidc_inst *inst,
|
|||||||
case MSM_VIDC_FMT_NV12:
|
case MSM_VIDC_FMT_NV12:
|
||||||
hfi_colorformat = HFI_COLOR_FMT_NV12;
|
hfi_colorformat = HFI_COLOR_FMT_NV12;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV12_UBWC:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
hfi_colorformat = HFI_COLOR_FMT_NV12_UBWC;
|
hfi_colorformat = HFI_COLOR_FMT_NV12_UBWC;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV12_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
hfi_colorformat = HFI_COLOR_FMT_P010;
|
hfi_colorformat = HFI_COLOR_FMT_P010;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV12_TP10_UBWC:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
hfi_colorformat = HFI_COLOR_FMT_TP10_UBWC;
|
hfi_colorformat = HFI_COLOR_FMT_TP10_UBWC;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_RGBA8888:
|
case MSM_VIDC_FMT_RGBA8888:
|
||||||
hfi_colorformat = HFI_COLOR_FMT_RGBA8888;
|
hfi_colorformat = HFI_COLOR_FMT_RGBA8888;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_RGBA8888_UBWC:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
hfi_colorformat = HFI_COLOR_FMT_RGBA8888_UBWC;
|
hfi_colorformat = HFI_COLOR_FMT_RGBA8888_UBWC;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
|
@@ -896,6 +896,7 @@ error:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: use PIX_FMTS caps to check supported color format
|
||||||
int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
int msm_venc_s_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
@@ -70,9 +70,6 @@ u32 msm_vidc_output_min_count(struct msm_vidc_inst *inst)
|
|||||||
case MSM_VIDC_VP9:
|
case MSM_VIDC_VP9:
|
||||||
output_min_count = 9;
|
output_min_count = 9;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_MPEG2:
|
|
||||||
output_min_count = 6;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
output_min_count = 4;
|
output_min_count = 4;
|
||||||
}
|
}
|
||||||
|
@@ -172,6 +172,32 @@ static const char *msm_vidc_get_priv_ctrl_name(u32 sid, u32 control_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int msm_vidc_packetize_control(struct msm_vidc_inst *inst,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id, u32 payload_type,
|
||||||
|
void *hfi_val, u32 payload_size, const char *func)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
s_vpr_l(inst->sid,
|
||||||
|
"%s: hfi_id: %#x, value: %#x\n", func,
|
||||||
|
inst->capabilities->cap[cap_id].hfi_id,
|
||||||
|
*(s64 *)hfi_val);
|
||||||
|
|
||||||
|
rc = venus_hfi_session_property(inst,
|
||||||
|
inst->capabilities->cap[cap_id].hfi_id,
|
||||||
|
HFI_HOST_FLAGS_NONE,
|
||||||
|
msm_vidc_get_port_info(inst, cap_id),
|
||||||
|
payload_type,
|
||||||
|
hfi_val,
|
||||||
|
sizeof(payload_size));
|
||||||
|
if (rc)
|
||||||
|
s_vpr_e(inst->sid,
|
||||||
|
"%s: failed to set cap_id: %d to fw\n",
|
||||||
|
__func__, cap_id);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static enum msm_vidc_inst_capability_type msm_vidc_get_cap_id(
|
static enum msm_vidc_inst_capability_type msm_vidc_get_cap_id(
|
||||||
struct msm_vidc_inst *inst, u32 id)
|
struct msm_vidc_inst *inst, u32 id)
|
||||||
{
|
{
|
||||||
@@ -589,10 +615,8 @@ exit:
|
|||||||
int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl)
|
int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int i = 0;
|
|
||||||
struct msm_vidc_inst_capability *capability;
|
struct msm_vidc_inst_capability *capability;
|
||||||
s32 adjusted_value;
|
s32 adjusted_value;
|
||||||
enum msm_vidc_inst_capability_type parent_id;
|
|
||||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||||
s32 profile = -1;
|
s32 profile = -1;
|
||||||
|
|
||||||
@@ -609,12 +633,60 @@ int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
else
|
else
|
||||||
adjusted_value = capability->cap[ENTROPY_MODE].value;
|
adjusted_value = capability->cap[ENTROPY_MODE].value;
|
||||||
|
|
||||||
/* check parents and adjust cabac session value */
|
if (inst->codec != MSM_VIDC_H264) {
|
||||||
|
s_vpr_e(inst->sid,
|
||||||
|
"%s: incorrect entry in database. fix the database\n",
|
||||||
|
__func__);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
profile = capability->cap[PROFILE].value;
|
||||||
|
|
||||||
|
if (profile == V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE ||
|
||||||
|
profile == V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE)
|
||||||
|
adjusted_value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
|
||||||
|
|
||||||
|
if (capability->cap[ENTROPY_MODE].value != adjusted_value) {
|
||||||
|
s_vpr_h(inst->sid, "%s: updated from %#x to adjusted %#x\n", __func__,
|
||||||
|
capability->cap[ENTROPY_MODE].value, adjusted_value);
|
||||||
|
capability->cap[ENTROPY_MODE].value = adjusted_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int msm_vidc_adjust_profile(void *instance, struct v4l2_ctrl *ctrl)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
int i = 0;
|
||||||
|
struct msm_vidc_inst_capability *capability;
|
||||||
|
s32 adjusted_value;
|
||||||
|
enum msm_vidc_inst_capability_type parent_id;
|
||||||
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||||
|
s32 pix_fmt = -1;
|
||||||
|
|
||||||
|
if (!inst || !inst->capabilities) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
capability = inst->capabilities;
|
||||||
|
|
||||||
|
/* ctrl is always NULL in streamon case */
|
||||||
|
if (ctrl)
|
||||||
|
adjusted_value = ctrl->val;
|
||||||
|
else
|
||||||
|
adjusted_value = capability->cap[PROFILE].value;
|
||||||
|
|
||||||
|
/* TODO(AS): Create a utility for this while loop and add
|
||||||
|
* detailed comments within for utility functionality
|
||||||
|
*/
|
||||||
while (i < MAX_CAP_PARENTS &&
|
while (i < MAX_CAP_PARENTS &&
|
||||||
capability->cap[ENTROPY_MODE].parents[i]) {
|
capability->cap[PROFILE].parents[i]) {
|
||||||
parent_id = capability->cap[ENTROPY_MODE].parents[i];
|
parent_id = capability->cap[PROFILE].parents[i];
|
||||||
if (parent_id == PROFILE)
|
if (parent_id == PIX_FMTS) {
|
||||||
profile = capability->cap[PROFILE].value;
|
pix_fmt = capability->cap[PIX_FMTS].value;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
s_vpr_e(inst->sid,
|
s_vpr_e(inst->sid,
|
||||||
"%s: invalid parent %d\n",
|
"%s: invalid parent %d\n",
|
||||||
@@ -622,22 +694,32 @@ int msm_vidc_adjust_entropy_mode(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (profile == -1) {
|
/* PIX_FMTS dependency is common across all chipsets.
|
||||||
|
* Hence, PIX_FMTS must be specified as Parent for HEVC profile.
|
||||||
|
* Otherwise it would be a database error that should be fixed.
|
||||||
|
*/
|
||||||
|
if (pix_fmt == -1) {
|
||||||
s_vpr_e(inst->sid,
|
s_vpr_e(inst->sid,
|
||||||
"%s: missing parents %d %d\n",
|
"%s: missing parent: %d, please correct database\n",
|
||||||
__func__, profile);
|
__func__, PIX_FMTS);
|
||||||
return 0;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((profile == V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE ||
|
/* 10 bit profile for 10 bit color format */
|
||||||
profile == V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) &&
|
if (pix_fmt == MSM_VIDC_FMT_TP10C ||
|
||||||
adjusted_value == V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC)
|
pix_fmt == MSM_VIDC_FMT_P010) {
|
||||||
adjusted_value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
|
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10;
|
||||||
|
} else {
|
||||||
|
/* 8 bit profile for 8 bit color format */
|
||||||
|
if (adjusted_value == V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10)
|
||||||
|
adjusted_value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN;
|
||||||
|
}
|
||||||
|
|
||||||
if (capability->cap[ENTROPY_MODE].value != adjusted_value) {
|
if (capability->cap[PROFILE].value != adjusted_value) {
|
||||||
s_vpr_h(inst->sid, "%s: updated from %#x to adjusted %#x\n", __func__,
|
s_vpr_h(inst->sid,
|
||||||
capability->cap[ENTROPY_MODE].value, adjusted_value);
|
"%s: updated from %#x to adjusted %#x\n", __func__,
|
||||||
capability->cap[ENTROPY_MODE].value = adjusted_value;
|
capability->cap[PROFILE].value, adjusted_value);
|
||||||
|
capability->cap[PROFILE].value = adjusted_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@@ -687,30 +769,6 @@ int msm_vidc_adjust_ltr_count(void *instance, struct v4l2_ctrl *ctrl)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int msm_vidc_adjust_bitrate(void *instance, struct v4l2_ctrl *ctrl)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
// u32 cabac_max_bitrate;
|
|
||||||
struct msm_vidc_inst_capability *capability;
|
|
||||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
|
||||||
s32 new_value;
|
|
||||||
|
|
||||||
if (!inst || !inst->capabilities) {
|
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
capability = inst->capabilities;
|
|
||||||
|
|
||||||
if (ctrl)
|
|
||||||
new_value = ctrl->val;
|
|
||||||
else
|
|
||||||
new_value = capability->cap[BIT_RATE].value;
|
|
||||||
|
|
||||||
/* TO DO */
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop over instance capabilities with CAP_FLAG_ROOT
|
* Loop over instance capabilities with CAP_FLAG_ROOT
|
||||||
* and call adjust function, where
|
* and call adjust function, where
|
||||||
@@ -766,6 +824,93 @@ exit:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int msm_vidc_set_bitrate_mode(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||||
|
int lossless, frame_rc, bitrate_mode, frame_skip;
|
||||||
|
u32 hfi_value;
|
||||||
|
struct msm_vidc_inst_capability *capability;
|
||||||
|
|
||||||
|
if (!inst || !inst->capabilities) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
capability = inst->capabilities;
|
||||||
|
|
||||||
|
bitrate_mode = capability->cap[cap_id].value;
|
||||||
|
lossless = capability->cap[LOSSLESS].value;
|
||||||
|
frame_rc = capability->cap[FRAME_RC_ENABLE].value;
|
||||||
|
frame_skip = capability->cap[FRAME_SKIP_MODE].value;
|
||||||
|
|
||||||
|
if (lossless) {
|
||||||
|
hfi_value = HFI_RC_LOSSLESS;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!frame_rc) {
|
||||||
|
hfi_value = HFI_RC_OFF;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_VBR) {
|
||||||
|
hfi_value = HFI_RC_VBR_CFR;
|
||||||
|
} else if (bitrate_mode == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR) {
|
||||||
|
if (frame_skip)
|
||||||
|
hfi_value = HFI_RC_CBR_VFR;
|
||||||
|
else
|
||||||
|
hfi_value = HFI_RC_CBR_CFR;
|
||||||
|
}/* TODO: CQ mode
|
||||||
|
else if (bitrate_mode == CQ) {
|
||||||
|
hfi_value = HFI_RC_CQ;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||||
|
&hfi_value, sizeof(u32), __func__);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
int msm_vidc_set_header_mode(void *instance,
|
||||||
|
enum msm_vidc_inst_capability_type cap_id)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||||
|
int header_mode, prepend_sps_pps, hdr_metadata;
|
||||||
|
u32 hfi_value = 0;
|
||||||
|
struct msm_vidc_inst_capability *capability;
|
||||||
|
|
||||||
|
if (!inst || !inst->capabilities) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
capability = inst->capabilities;
|
||||||
|
|
||||||
|
header_mode = capability->cap[cap_id].value;
|
||||||
|
prepend_sps_pps = capability->cap[PREPEND_SPSPPS_TO_IDR].value;
|
||||||
|
hdr_metadata = capability->cap[META_SEQ_HDR_NAL].value;
|
||||||
|
|
||||||
|
if (header_mode == V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE)
|
||||||
|
hfi_value |= HFI_SEQ_HEADER_SEPERATE_FRAME;
|
||||||
|
else if (header_mode == V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME)
|
||||||
|
hfi_value |= HFI_SEQ_HEADER_JOINED_WITH_1ST_FRAME;
|
||||||
|
|
||||||
|
if (prepend_sps_pps) {
|
||||||
|
hfi_value |= HFI_SEQ_HEADER_PREFIX_WITH_SYNC_FRAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hdr_metadata) {
|
||||||
|
hfi_value |= HFI_SEQ_HEADER_METADATA;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||||
|
&hfi_value, sizeof(u32), __func__);
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
int msm_vidc_set_q16(void *instance,
|
int msm_vidc_set_q16(void *instance,
|
||||||
enum msm_vidc_inst_capability_type cap_id)
|
enum msm_vidc_inst_capability_type cap_id)
|
||||||
{
|
{
|
||||||
@@ -779,21 +924,9 @@ int msm_vidc_set_q16(void *instance,
|
|||||||
}
|
}
|
||||||
|
|
||||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||||
s_vpr_h(inst->sid,
|
|
||||||
"%s: hfi_id: %#x, value: %#x\n", __func__,
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_Q16,
|
||||||
inst->capabilities->cap[cap_id].hfi_id,
|
&hfi_value, sizeof(u32), __func__);
|
||||||
hfi_value);
|
|
||||||
rc = venus_hfi_session_property(inst,
|
|
||||||
inst->capabilities->cap[cap_id].hfi_id,
|
|
||||||
HFI_HOST_FLAGS_NONE,
|
|
||||||
msm_vidc_get_port_info(inst, cap_id),
|
|
||||||
HFI_PAYLOAD_Q16,
|
|
||||||
&hfi_value,
|
|
||||||
sizeof(u32));
|
|
||||||
if (rc)
|
|
||||||
s_vpr_e(inst->sid,
|
|
||||||
"%s: failed to set cap_id: %d to fw\n",
|
|
||||||
__func__, cap_id);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -803,7 +936,7 @@ int msm_vidc_set_u32(void *instance,
|
|||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
||||||
u32 hfi_value, hfi_payload;
|
u32 hfi_value;
|
||||||
|
|
||||||
if (!inst || !inst->capabilities) {
|
if (!inst || !inst->capabilities) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
@@ -814,27 +947,34 @@ int msm_vidc_set_u32(void *instance,
|
|||||||
rc = msm_vidc_v4l2_menu_to_hfi(inst, cap_id, &hfi_value);
|
rc = msm_vidc_v4l2_menu_to_hfi(inst, cap_id, &hfi_value);
|
||||||
if (rc)
|
if (rc)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
hfi_payload = HFI_PAYLOAD_U32_ENUM;
|
|
||||||
} else {
|
} else {
|
||||||
hfi_value = inst->capabilities->cap[cap_id].value;
|
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||||
hfi_payload = HFI_PAYLOAD_U32;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s_vpr_h(inst->sid,
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32,
|
||||||
"%s: hfi_id: %#x, value: %u\n", __func__,
|
&hfi_value, sizeof(u32), __func__);
|
||||||
inst->capabilities->cap[cap_id].hfi_id,
|
|
||||||
hfi_value);
|
return rc;
|
||||||
rc = venus_hfi_session_property(inst,
|
}
|
||||||
inst->capabilities->cap[cap_id].hfi_id,
|
|
||||||
HFI_HOST_FLAGS_NONE,
|
int msm_vidc_set_u32_enum(void *instance,
|
||||||
msm_vidc_get_port_info(inst, cap_id),
|
enum msm_vidc_inst_capability_type cap_id)
|
||||||
hfi_payload,
|
{
|
||||||
&hfi_value,
|
int rc = 0;
|
||||||
sizeof(u32));
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
||||||
|
u32 hfi_value;
|
||||||
|
|
||||||
|
if (!inst || !inst->capabilities) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = msm_vidc_v4l2_to_hfi_enum(inst, cap_id, &hfi_value);
|
||||||
if (rc)
|
if (rc)
|
||||||
s_vpr_e(inst->sid,
|
return -EINVAL;
|
||||||
"%s: failed to set cap_id: %d to fw\n",
|
|
||||||
__func__, cap_id);
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32_ENUM,
|
||||||
|
&hfi_value, sizeof(u32), __func__);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -844,26 +984,16 @@ int msm_vidc_set_s32(void *instance,
|
|||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
|
||||||
|
s32 hfi_value = 0;
|
||||||
|
|
||||||
if (!inst || !inst->capabilities) {
|
if (!inst || !inst->capabilities) {
|
||||||
d_vpr_e("%s: invalid params\n", __func__);
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_vpr_h(inst->sid,
|
hfi_value = inst->capabilities->cap[cap_id].value;
|
||||||
"%s: hfi_id: %#x, value: %d\n", __func__,
|
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_S32,
|
||||||
inst->capabilities->cap[cap_id].hfi_id,
|
&hfi_value, sizeof(u32), __func__);
|
||||||
inst->capabilities->cap[cap_id].value);
|
|
||||||
rc = venus_hfi_session_property(inst,
|
|
||||||
inst->capabilities->cap[cap_id].hfi_id,
|
|
||||||
HFI_HOST_FLAGS_NONE, HFI_PORT_NONE,
|
|
||||||
HFI_PAYLOAD_S32,
|
|
||||||
&inst->capabilities->cap[cap_id].value,
|
|
||||||
sizeof(s32));
|
|
||||||
if (rc)
|
|
||||||
s_vpr_e(inst->sid,
|
|
||||||
"%s: failed to set cap_id: %d to fw\n",
|
|
||||||
__func__, cap_id);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -954,15 +1084,6 @@ int msm_vidc_v4l2_menu_to_hfi(struct msm_vidc_inst *inst,
|
|||||||
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
||||||
|
|
||||||
switch (capability->cap[cap_id].v4l2_id) {
|
switch (capability->cap[cap_id].v4l2_id) {
|
||||||
case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
|
|
||||||
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
|
|
||||||
case V4L2_CID_MPEG_VIDEO_VP9_PROFILE:
|
|
||||||
case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
|
|
||||||
case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
|
|
||||||
case V4L2_CID_MPEG_VIDEO_HEVC_TIER:
|
|
||||||
case V4L2_CID_MPEG_VIDC_VIDEO_BLUR_TYPES:
|
|
||||||
*value = capability->cap[cap_id].value;
|
|
||||||
return 0;
|
|
||||||
case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
|
case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
|
||||||
switch (capability->cap[cap_id].value) {
|
switch (capability->cap[cap_id].value) {
|
||||||
case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC:
|
case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC:
|
||||||
@@ -976,50 +1097,50 @@ int msm_vidc_v4l2_menu_to_hfi(struct msm_vidc_inst *inst,
|
|||||||
goto set_default;
|
goto set_default;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
|
default:
|
||||||
switch (capability->cap[cap_id].value) {
|
s_vpr_e(inst->sid,
|
||||||
case V4L2_MPEG_VIDEO_BITRATE_MODE_VBR:
|
"%s: mapping not specified for ctrl_id: %#x\n",
|
||||||
*value = HFI_RC_VBR_CFR;
|
__func__, capability->cap[cap_id].v4l2_id);
|
||||||
break;
|
return -EINVAL;
|
||||||
case V4L2_MPEG_VIDEO_BITRATE_MODE_CBR:
|
}
|
||||||
*value = HFI_RC_CBR_CFR;
|
|
||||||
break;
|
set_default:
|
||||||
default:
|
s_vpr_e(inst->sid,
|
||||||
*value = HFI_RC_VBR_CFR;
|
"%s: invalid value %d for ctrl id: %#x. Set default: %u\n",
|
||||||
goto set_default;
|
__func__, capability->cap[cap_id].value,
|
||||||
}
|
capability->cap[cap_id].v4l2_id, *value);
|
||||||
return 0;
|
return 0;
|
||||||
case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE:
|
}
|
||||||
switch (capability->cap[cap_id].value) {
|
|
||||||
case V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B:
|
int msm_vidc_v4l2_to_hfi_enum(struct msm_vidc_inst *inst,
|
||||||
*value = HFI_HIER_B;
|
enum msm_vidc_inst_capability_type cap_id, u32 *value)
|
||||||
break;
|
{
|
||||||
case V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P:
|
struct msm_vidc_inst_capability *capability = inst->capabilities;
|
||||||
//TODO (AS): check if this is right mapping
|
|
||||||
*value = HFI_HIER_P_SLIDING_WINDOW;
|
switch (capability->cap[cap_id].v4l2_id) {
|
||||||
break;
|
case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
|
||||||
default:
|
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
|
||||||
*value = HFI_HIER_P_SLIDING_WINDOW;
|
case V4L2_CID_MPEG_VIDEO_VP9_PROFILE:
|
||||||
goto set_default;
|
case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
|
||||||
}
|
case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
|
||||||
return 0;
|
case V4L2_CID_MPEG_VIDEO_HEVC_TIER:
|
||||||
case V4L2_CID_MPEG_VIDEO_HEADER_MODE:
|
case V4L2_CID_MPEG_VIDC_VIDEO_BLUR_TYPES:
|
||||||
switch (capability->cap[cap_id].value) {
|
*value = capability->cap[cap_id].value;
|
||||||
case V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE:
|
return 0;
|
||||||
*value = HFI_SEQ_HEADER_SEPERATE_FRAME;
|
case V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE:
|
||||||
break;
|
switch (capability->cap[cap_id].value) {
|
||||||
case V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME:
|
case V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_B:
|
||||||
*value = HFI_SEQ_HEADER_JOINED_WITH_1ST_FRAME;
|
*value = HFI_HIER_B;
|
||||||
break;
|
break;
|
||||||
/*
|
case V4L2_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_P:
|
||||||
* TODO (AS): other HFI values are missing corresponding
|
//TODO (AS): check if this is right mapping
|
||||||
* V4l2 values. Add them once available.
|
*value = HFI_HIER_P_SLIDING_WINDOW;
|
||||||
*/
|
break;
|
||||||
default:
|
default:
|
||||||
*value = HFI_SEQ_HEADER_SEPERATE_FRAME;
|
*value = HFI_HIER_P_SLIDING_WINDOW;
|
||||||
goto set_default;
|
goto set_default;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
s_vpr_e(inst->sid,
|
s_vpr_e(inst->sid,
|
||||||
"%s: mapping not specified for ctrl_id: %#x\n",
|
"%s: mapping not specified for ctrl_id: %#x\n",
|
||||||
|
@@ -129,9 +129,6 @@ enum msm_vidc_codec_type v4l2_codec_to_driver(u32 v4l2_codec, const char *func)
|
|||||||
case V4L2_PIX_FMT_VP9:
|
case V4L2_PIX_FMT_VP9:
|
||||||
codec = MSM_VIDC_VP9;
|
codec = MSM_VIDC_VP9;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_MPEG2:
|
|
||||||
codec = MSM_VIDC_MPEG2;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
d_vpr_e("%s: invalid v4l2 codec %#x\n", func, v4l2_codec);
|
d_vpr_e("%s: invalid v4l2 codec %#x\n", func, v4l2_codec);
|
||||||
break;
|
break;
|
||||||
@@ -153,9 +150,6 @@ u32 v4l2_codec_from_driver(enum msm_vidc_codec_type codec, const char *func)
|
|||||||
case MSM_VIDC_VP9:
|
case MSM_VIDC_VP9:
|
||||||
v4l2_codec = V4L2_PIX_FMT_VP9;
|
v4l2_codec = V4L2_PIX_FMT_VP9;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_MPEG2:
|
|
||||||
v4l2_codec = V4L2_PIX_FMT_MPEG2;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
d_vpr_e("%s: invalid driver codec %#x\n", func, codec);
|
d_vpr_e("%s: invalid driver codec %#x\n", func, codec);
|
||||||
break;
|
break;
|
||||||
@@ -176,16 +170,16 @@ enum msm_vidc_colorformat_type v4l2_colorformat_to_driver(u32 v4l2_colorformat,
|
|||||||
colorformat = MSM_VIDC_FMT_NV21;
|
colorformat = MSM_VIDC_FMT_NV21;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_NV12C:
|
case V4L2_PIX_FMT_VIDC_NV12C:
|
||||||
colorformat = MSM_VIDC_FMT_NV12_UBWC;
|
colorformat = MSM_VIDC_FMT_NV12C;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_TP10C:
|
case V4L2_PIX_FMT_VIDC_TP10C:
|
||||||
colorformat = MSM_VIDC_FMT_NV12_TP10_UBWC;
|
colorformat = MSM_VIDC_FMT_TP10C;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
case V4L2_PIX_FMT_VIDC_ARGB32C:
|
||||||
colorformat = MSM_VIDC_FMT_RGBA8888_UBWC;
|
colorformat = MSM_VIDC_FMT_RGBA8888C;
|
||||||
break;
|
break;
|
||||||
case V4L2_PIX_FMT_VIDC_P010:
|
case V4L2_PIX_FMT_VIDC_P010:
|
||||||
colorformat = MSM_VIDC_FMT_NV12_P010;
|
colorformat = MSM_VIDC_FMT_P010;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
d_vpr_e("%s: invalid v4l2 color format %#x\n",
|
d_vpr_e("%s: invalid v4l2 color format %#x\n",
|
||||||
@@ -207,16 +201,16 @@ u32 v4l2_colorformat_from_driver(enum msm_vidc_colorformat_type colorformat,
|
|||||||
case MSM_VIDC_FMT_NV21:
|
case MSM_VIDC_FMT_NV21:
|
||||||
v4l2_colorformat = V4L2_PIX_FMT_NV21;
|
v4l2_colorformat = V4L2_PIX_FMT_NV21;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV12_UBWC:
|
case MSM_VIDC_FMT_NV12C:
|
||||||
v4l2_colorformat = V4L2_PIX_FMT_VIDC_NV12C;
|
v4l2_colorformat = V4L2_PIX_FMT_VIDC_NV12C;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV12_TP10_UBWC:
|
case MSM_VIDC_FMT_TP10C:
|
||||||
v4l2_colorformat = V4L2_PIX_FMT_VIDC_TP10C;
|
v4l2_colorformat = V4L2_PIX_FMT_VIDC_TP10C;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_RGBA8888_UBWC:
|
case MSM_VIDC_FMT_RGBA8888C:
|
||||||
v4l2_colorformat = V4L2_PIX_FMT_VIDC_ARGB32C;
|
v4l2_colorformat = V4L2_PIX_FMT_VIDC_ARGB32C;
|
||||||
break;
|
break;
|
||||||
case MSM_VIDC_FMT_NV12_P010:
|
case MSM_VIDC_FMT_P010:
|
||||||
v4l2_colorformat = V4L2_PIX_FMT_VIDC_P010;
|
v4l2_colorformat = V4L2_PIX_FMT_VIDC_P010;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@@ -283,7 +283,7 @@ int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
|
|||||||
* 1 index - opb colorformat
|
* 1 index - opb colorformat
|
||||||
*/
|
*/
|
||||||
if (is_10bit_colorformat(color_format)) {
|
if (is_10bit_colorformat(color_format)) {
|
||||||
vote_data->color_formats[0] = MSM_VIDC_FMT_NV12_TP10_UBWC;
|
vote_data->color_formats[0] = MSM_VIDC_FMT_TP10C;
|
||||||
} else {
|
} else {
|
||||||
vote_data->color_formats[0] = MSM_VIDC_FMT_NV12;
|
vote_data->color_formats[0] = MSM_VIDC_FMT_NV12;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user