msm: vidc: Process newly added event parameters
Profile, Level and Entropy are passed through event from HW to
driver. Add code in driver to parse them and update internal
structs.
With this change, driver no need to make synchronous calls to HW
to get above parameters. Hence remove that code.
Along with this, remove redundant conversion of enum values from
V4l2 to HAL and vice-versa.
CRs-Fixed: 2019606
Change-Id: If07170a00dc16007590fb36d4e12176f0807ef23
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
diff --git a/drivers/media/platform/msm/vidc/hfi_response_handler.c b/drivers/media/platform/msm/vidc/hfi_response_handler.c
index 90bb4b0..4760723a 100644
--- a/drivers/media/platform/msm/vidc/hfi_response_handler.c
+++ b/drivers/media/platform/msm/vidc/hfi_response_handler.c
@@ -110,6 +110,7 @@
struct hfi_profile_level *profile_level;
struct hfi_bit_depth *pixel_depth;
struct hfi_pic_struct *pic_struct;
+ u32 entropy_mode = 0;
u8 *data_ptr;
int prop_id;
enum msm_vidc_pixel_depth luma_bit_depth, chroma_bit_depth;
@@ -158,6 +159,8 @@
data_ptr = data_ptr + sizeof(u32);
profile_level =
(struct hfi_profile_level *) data_ptr;
+ event_notify.profile = profile_level->profile;
+ event_notify.level = profile_level->level;
dprintk(VIDC_DBG, "profile: %d level: %d\n",
profile_level->profile,
profile_level->level);
@@ -219,6 +222,15 @@
data_ptr +=
sizeof(struct hfi_colour_space);
break;
+ case HFI_PROPERTY_CONFIG_VDEC_ENTROPY:
+ data_ptr = data_ptr + sizeof(u32);
+ entropy_mode = *(u32 *)data_ptr;
+ event_notify.entropy_mode = entropy_mode;
+ dprintk(VIDC_DBG,
+ "Entropy Mode: 0x%x\n", entropy_mode);
+ data_ptr +=
+ sizeof(u32);
+ break;
default:
dprintk(VIDC_ERR,
"%s cmd: %#x not supported\n",
@@ -1001,59 +1013,6 @@
return status;
}
-static void hfi_process_sess_get_prop_dec_entropy(
- struct hfi_msg_session_property_info_packet *prop,
- enum hal_h264_entropy *entropy)
-{
- u32 req_bytes, hfi_entropy;
-
- req_bytes = prop->size - sizeof(
- struct hfi_msg_session_property_info_packet);
-
- if (!req_bytes || req_bytes % sizeof(hfi_entropy)) {
- dprintk(VIDC_ERR, "%s: bad packet: %d\n", __func__, req_bytes);
- return;
- }
-
- hfi_entropy = prop->rg_property_data[1];
- *entropy =
- hfi_entropy == HFI_H264_ENTROPY_CAVLC ? HAL_H264_ENTROPY_CAVLC :
- hfi_entropy == HFI_H264_ENTROPY_CABAC ? HAL_H264_ENTROPY_CABAC :
- HAL_UNUSED_ENTROPY;
-}
-
-static void hfi_process_sess_get_prop_profile_level(
- struct hfi_msg_session_property_info_packet *prop,
- struct hfi_profile_level *profile_level)
-{
- struct hfi_profile_level *hfi_profile_level;
- u32 req_bytes;
-
- dprintk(VIDC_DBG, "Entered %s\n", __func__);
- if (!prop) {
- dprintk(VIDC_ERR,
- "hal_process_sess_get_profile_level: bad_prop: %pK\n",
- prop);
- return;
- }
- req_bytes = prop->size - sizeof(
- struct hfi_msg_session_property_info_packet);
-
- if (!req_bytes || req_bytes % sizeof(struct hfi_profile_level)) {
- dprintk(VIDC_ERR,
- "hal_process_sess_get_profile_level: bad_pkt: %d\n",
- req_bytes);
- return;
- }
- hfi_profile_level = (struct hfi_profile_level *)
- &prop->rg_property_data[1];
- profile_level->profile = hfi_profile_level->profile;
- profile_level->level = hfi_profile_level->level;
- dprintk(VIDC_DBG, "%s profile: %d level: %d\n",
- __func__, profile_level->profile,
- profile_level->level);
-}
-
static void hfi_process_sess_get_prop_buf_req(
struct hfi_msg_session_property_info_packet *prop,
struct buffer_requirements *buffreq)
@@ -1179,8 +1138,6 @@
struct msm_vidc_cb_info *info)
{
struct msm_vidc_cb_cmd_done cmd_done = {0};
- struct hfi_profile_level profile_level = {0};
- enum hal_h264_entropy entropy = {0};
struct buffer_requirements buff_req = { { {0} } };
dprintk(VIDC_DBG, "Received SESSION_PROPERTY_INFO[%#x]\n",
@@ -1211,36 +1168,6 @@
};
return 0;
- case HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT:
- hfi_process_sess_get_prop_profile_level(pkt, &profile_level);
- cmd_done.device_id = device_id;
- cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
- cmd_done.status = VIDC_ERR_NONE;
- cmd_done.data.property.profile_level =
- (struct hal_profile_level) {
- .profile = profile_level.profile,
- .level = profile_level.level,
- };
- cmd_done.size = sizeof(struct hal_profile_level);
-
- *info = (struct msm_vidc_cb_info) {
- .response_type = HAL_SESSION_PROPERTY_INFO,
- .response.cmd = cmd_done,
- };
- return 0;
- case HFI_PROPERTY_CONFIG_VDEC_ENTROPY:
- hfi_process_sess_get_prop_dec_entropy(pkt, &entropy);
- cmd_done.device_id = device_id;
- cmd_done.session_id = (void *)(uintptr_t)pkt->session_id;
- cmd_done.status = VIDC_ERR_NONE;
- cmd_done.data.property.h264_entropy = entropy;
- cmd_done.size = sizeof(enum hal_h264_entropy);
-
- *info = (struct msm_vidc_cb_info) {
- .response_type = HAL_SESSION_PROPERTY_INFO,
- .response.cmd = cmd_done,
- };
- return 0;
default:
dprintk(VIDC_DBG,
"hal_process_session_prop_info: unknown_prop_id: %x\n",
diff --git a/drivers/media/platform/msm/vidc/msm_vdec.c b/drivers/media/platform/msm/vidc/msm_vdec.c
index 68848a8..33821c7 100644
--- a/drivers/media/platform/msm/vidc/msm_vdec.c
+++ b/drivers/media/platform/msm/vidc/msm_vdec.c
@@ -1418,76 +1418,6 @@
return NULL;
}
-static int vdec_v4l2_to_hal(int id, int value)
-{
- switch (id) {
- /* H264 */
- case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
- switch (value) {
- case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE:
- return HAL_H264_PROFILE_BASELINE;
- case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
- return HAL_H264_PROFILE_CONSTRAINED_BASE;
- case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH:
- return HAL_H264_PROFILE_CONSTRAINED_HIGH;
- case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN:
- return HAL_H264_PROFILE_MAIN;
- case V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED:
- return HAL_H264_PROFILE_EXTENDED;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH:
- return HAL_H264_PROFILE_HIGH;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10:
- return HAL_H264_PROFILE_HIGH10;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422:
- return HAL_H264_PROFILE_HIGH422;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE:
- return HAL_H264_PROFILE_HIGH444;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
- switch (value) {
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_0:
- return HAL_H264_LEVEL_1;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1B:
- return HAL_H264_LEVEL_1b;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_1:
- return HAL_H264_LEVEL_11;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_2:
- return HAL_H264_LEVEL_12;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_3:
- return HAL_H264_LEVEL_13;
- case V4L2_MPEG_VIDEO_H264_LEVEL_2_0:
- return HAL_H264_LEVEL_2;
- case V4L2_MPEG_VIDEO_H264_LEVEL_2_1:
- return HAL_H264_LEVEL_21;
- case V4L2_MPEG_VIDEO_H264_LEVEL_2_2:
- return HAL_H264_LEVEL_22;
- case V4L2_MPEG_VIDEO_H264_LEVEL_3_0:
- return HAL_H264_LEVEL_3;
- case V4L2_MPEG_VIDEO_H264_LEVEL_3_1:
- return HAL_H264_LEVEL_31;
- case V4L2_MPEG_VIDEO_H264_LEVEL_3_2:
- return HAL_H264_LEVEL_32;
- case V4L2_MPEG_VIDEO_H264_LEVEL_4_0:
- return HAL_H264_LEVEL_4;
- case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
- return HAL_H264_LEVEL_41;
- case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
- return HAL_H264_LEVEL_42;
- case V4L2_MPEG_VIDEO_H264_LEVEL_5_0:
- return HAL_H264_LEVEL_5;
- case V4L2_MPEG_VIDEO_H264_LEVEL_5_1:
- return HAL_H264_LEVEL_51;
- default:
- goto unknown_value;
- }
- }
-unknown_value:
- dprintk(VIDC_WARN, "Unknown control (%x, %d)\n", id, value);
- return -EINVAL;
-}
-
int msm_vdec_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
{
int rc = 0;
@@ -1670,9 +1600,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_H264_LEVEL);
property_id =
HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.profile = vdec_v4l2_to_hal(ctrl->id,
+ profile_level.profile = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.level = vdec_v4l2_to_hal(
+ profile_level.level = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_LEVEL,
temp_ctrl->val);
pdata = &profile_level;
@@ -1681,9 +1611,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_H264_PROFILE);
property_id =
HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.level = vdec_v4l2_to_hal(ctrl->id,
+ profile_level.level = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.profile = vdec_v4l2_to_hal(
+ profile_level.profile = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_PROFILE,
temp_ctrl->val);
pdata = &profile_level;
diff --git a/drivers/media/platform/msm/vidc/msm_venc.c b/drivers/media/platform/msm/vidc/msm_venc.c
index 0dacc05..7526fb7 100644
--- a/drivers/media/platform/msm/vidc/msm_venc.c
+++ b/drivers/media/platform/msm/vidc/msm_venc.c
@@ -1621,218 +1621,6 @@
return NULL;
}
-/* Helper function to translate V4L2_* to HAL_* */
-static inline int venc_v4l2_to_hal(int id, int value)
-{
- switch (id) {
- /* H264 */
- case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
- switch (value) {
- case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE:
- return HAL_H264_PROFILE_BASELINE;
- case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
- return HAL_H264_PROFILE_CONSTRAINED_BASE;
- case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN:
- return HAL_H264_PROFILE_MAIN;
- case V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED:
- return HAL_H264_PROFILE_EXTENDED;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH:
- return HAL_H264_PROFILE_HIGH;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10:
- return HAL_H264_PROFILE_HIGH10;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422:
- return HAL_H264_PROFILE_HIGH422;
- case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE:
- return HAL_H264_PROFILE_HIGH444;
- case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH:
- return HAL_H264_PROFILE_CONSTRAINED_HIGH;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
- switch (value) {
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_0:
- return HAL_H264_LEVEL_1;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1B:
- return HAL_H264_LEVEL_1b;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_1:
- return HAL_H264_LEVEL_11;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_2:
- return HAL_H264_LEVEL_12;
- case V4L2_MPEG_VIDEO_H264_LEVEL_1_3:
- return HAL_H264_LEVEL_13;
- case V4L2_MPEG_VIDEO_H264_LEVEL_2_0:
- return HAL_H264_LEVEL_2;
- case V4L2_MPEG_VIDEO_H264_LEVEL_2_1:
- return HAL_H264_LEVEL_21;
- case V4L2_MPEG_VIDEO_H264_LEVEL_2_2:
- return HAL_H264_LEVEL_22;
- case V4L2_MPEG_VIDEO_H264_LEVEL_3_0:
- return HAL_H264_LEVEL_3;
- case V4L2_MPEG_VIDEO_H264_LEVEL_3_1:
- return HAL_H264_LEVEL_31;
- case V4L2_MPEG_VIDEO_H264_LEVEL_3_2:
- return HAL_H264_LEVEL_32;
- case V4L2_MPEG_VIDEO_H264_LEVEL_4_0:
- return HAL_H264_LEVEL_4;
- case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
- return HAL_H264_LEVEL_41;
- case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
- return HAL_H264_LEVEL_42;
- case V4L2_MPEG_VIDEO_H264_LEVEL_5_0:
- return HAL_H264_LEVEL_5;
- case V4L2_MPEG_VIDEO_H264_LEVEL_5_1:
- return HAL_H264_LEVEL_51;
- case V4L2_MPEG_VIDEO_H264_LEVEL_5_2:
- return HAL_H264_LEVEL_52;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
- switch (value) {
- case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC:
- return HAL_H264_ENTROPY_CAVLC;
- case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC:
- return HAL_H264_ENTROPY_CABAC;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL:
- switch (value) {
- case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0:
- return HAL_H264_CABAC_MODEL_0;
- case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_1:
- return HAL_H264_CABAC_MODEL_1;
- case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_2:
- return HAL_H264_CABAC_MODEL_2;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL:
- switch (value) {
- case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0:
- return HAL_VPX_PROFILE_VERSION_0;
- case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_1:
- return HAL_VPX_PROFILE_VERSION_1;
- case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_2:
- return HAL_VPX_PROFILE_VERSION_2;
- case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_3:
- return HAL_VPX_PROFILE_VERSION_3;
- case V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED:
- return HAL_VPX_PROFILE_UNUSED;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE:
- switch (value) {
- case V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN:
- return HAL_HEVC_PROFILE_MAIN;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN10:
- return HAL_HEVC_PROFILE_MAIN10;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN_STILL_PIC:
- return HAL_HEVC_PROFILE_MAIN_STILL_PIC;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL:
- switch (value) {
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_1:
- return HAL_HEVC_MAIN_TIER_LEVEL_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_2:
- return HAL_HEVC_MAIN_TIER_LEVEL_2;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_2_1:
- return HAL_HEVC_MAIN_TIER_LEVEL_2_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_3:
- return HAL_HEVC_MAIN_TIER_LEVEL_3;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_3_1:
- return HAL_HEVC_MAIN_TIER_LEVEL_3_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_4:
- return HAL_HEVC_MAIN_TIER_LEVEL_4;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_4_1:
- return HAL_HEVC_MAIN_TIER_LEVEL_4_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5:
- return HAL_HEVC_MAIN_TIER_LEVEL_5;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5_1:
- return HAL_HEVC_MAIN_TIER_LEVEL_5_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5_2:
- return HAL_HEVC_MAIN_TIER_LEVEL_5_2;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6:
- return HAL_HEVC_MAIN_TIER_LEVEL_6;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_1:
- return HAL_HEVC_MAIN_TIER_LEVEL_6_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_2:
- return HAL_HEVC_MAIN_TIER_LEVEL_6_2;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_1:
- return HAL_HEVC_HIGH_TIER_LEVEL_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_2:
- return HAL_HEVC_HIGH_TIER_LEVEL_2;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_2_1:
- return HAL_HEVC_HIGH_TIER_LEVEL_2_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_3:
- return HAL_HEVC_HIGH_TIER_LEVEL_3;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_3_1:
- return HAL_HEVC_HIGH_TIER_LEVEL_3_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_4:
- return HAL_HEVC_HIGH_TIER_LEVEL_4;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_4_1:
- return HAL_HEVC_HIGH_TIER_LEVEL_4_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5:
- return HAL_HEVC_HIGH_TIER_LEVEL_5;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5_1:
- return HAL_HEVC_HIGH_TIER_LEVEL_5_1;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5_2:
- return HAL_HEVC_HIGH_TIER_LEVEL_5_2;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6:
- return HAL_HEVC_HIGH_TIER_LEVEL_6;
- case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6_1:
- return HAL_HEVC_HIGH_TIER_LEVEL_6_1;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION:
- switch (value) {
- case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_NONE:
- return HAL_ROTATE_NONE;
- case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90:
- return HAL_ROTATE_90;
- case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_180:
- return HAL_ROTATE_180;
- case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270:
- return HAL_ROTATE_270;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
- switch (value) {
- case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED:
- return HAL_H264_DB_MODE_DISABLE;
- case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED:
- return HAL_H264_DB_MODE_ALL_BOUNDARY;
- case L_MODE:
- return HAL_H264_DB_MODE_SKIP_SLICE_BOUNDARY;
- default:
- goto unknown_value;
- }
- case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_TYPE:
- switch (value) {
- case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_DEFAULT:
- return HAL_IFRAMESIZE_TYPE_DEFAULT;
- case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_MEDIUM:
- return HAL_IFRAMESIZE_TYPE_MEDIUM;
- case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_HUGE:
- return HAL_IFRAMESIZE_TYPE_HUGE;
- case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_UNLIMITED:
- return HAL_IFRAMESIZE_TYPE_UNLIMITED;
- default:
- goto unknown_value;
- }
- }
-
-unknown_value:
- dprintk(VIDC_WARN, "Unknown control (%x, %d)\n", id, value);
- return -EINVAL;
-}
-
int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
{
int rc = 0;
@@ -2055,9 +1843,9 @@
V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL);
property_id = HAL_PARAM_VENC_H264_ENTROPY_CONTROL;
- h264_entropy_control.entropy_mode = venc_v4l2_to_hal(
+ h264_entropy_control.entropy_mode = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE, ctrl->val);
- h264_entropy_control.cabac_model = venc_v4l2_to_hal(
+ h264_entropy_control.cabac_model = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL,
temp_ctrl->val);
pdata = &h264_entropy_control;
@@ -2066,9 +1854,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE);
property_id = HAL_PARAM_VENC_H264_ENTROPY_CONTROL;
- h264_entropy_control.cabac_model = venc_v4l2_to_hal(
+ h264_entropy_control.cabac_model = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE, ctrl->val);
- h264_entropy_control.entropy_mode = venc_v4l2_to_hal(
+ h264_entropy_control.entropy_mode = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL,
temp_ctrl->val);
pdata = &h264_entropy_control;
@@ -2077,9 +1865,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL);
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.profile = venc_v4l2_to_hal(ctrl->id,
+ profile_level.profile = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.level = venc_v4l2_to_hal(
+ profile_level.level = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL,
temp_ctrl->val);
pdata = &profile_level;
@@ -2088,9 +1876,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE);
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.level = venc_v4l2_to_hal(ctrl->id,
+ profile_level.level = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.profile = venc_v4l2_to_hal(
+ profile_level.profile = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE,
temp_ctrl->val);
pdata = &profile_level;
@@ -2099,9 +1887,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_H264_LEVEL);
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.profile = venc_v4l2_to_hal(ctrl->id,
+ profile_level.profile = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.level = venc_v4l2_to_hal(
+ profile_level.level = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_LEVEL,
temp_ctrl->val);
pdata = &profile_level;
@@ -2112,9 +1900,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDEO_H264_PROFILE);
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.level = venc_v4l2_to_hal(ctrl->id,
+ profile_level.level = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.profile = venc_v4l2_to_hal(
+ profile_level.profile = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_PROFILE,
temp_ctrl->val);
pdata = &profile_level;
@@ -2123,7 +1911,7 @@
break;
case V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL:
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.profile = venc_v4l2_to_hal(
+ profile_level.profile = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL,
ctrl->val);
profile_level.level = HAL_VPX_PROFILE_UNUSED;
@@ -2134,9 +1922,9 @@
TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL);
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.profile = venc_v4l2_to_hal(ctrl->id,
+ profile_level.profile = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.level = venc_v4l2_to_hal(
+ profile_level.level = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL,
temp_ctrl->val);
pdata = &profile_level;
@@ -2145,9 +1933,9 @@
temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE);
property_id = HAL_PARAM_PROFILE_LEVEL_CURRENT;
- profile_level.level = venc_v4l2_to_hal(ctrl->id,
+ profile_level.level = msm_comm_v4l2_to_hal(ctrl->id,
ctrl->val);
- profile_level.profile = venc_v4l2_to_hal(
+ profile_level.profile = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE,
temp_ctrl->val);
pdata = &profile_level;
@@ -2162,7 +1950,7 @@
break;
}
property_id = HAL_CONFIG_VPE_OPERATIONS;
- operations.rotate = venc_v4l2_to_hal(
+ operations.rotate = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_ROTATION,
ctrl->val);
operations.flip = HAL_FLIP_NONE;
@@ -2271,7 +2059,7 @@
property_id = HAL_PARAM_VENC_H264_DEBLOCK_CONTROL;
h264_db_control.slice_alpha_offset = alpha->val;
h264_db_control.slice_beta_offset = beta->val;
- h264_db_control.mode = venc_v4l2_to_hal(
+ h264_db_control.mode = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
ctrl->val);
pdata = &h264_db_control;
@@ -2289,7 +2077,7 @@
property_id = HAL_PARAM_VENC_H264_DEBLOCK_CONTROL;
h264_db_control.slice_alpha_offset = ctrl->val;
h264_db_control.slice_beta_offset = beta->val;
- h264_db_control.mode = venc_v4l2_to_hal(
+ h264_db_control.mode = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
mode->val);
pdata = &h264_db_control;
@@ -2306,7 +2094,7 @@
property_id = HAL_PARAM_VENC_H264_DEBLOCK_CONTROL;
h264_db_control.slice_alpha_offset = alpha->val;
h264_db_control.slice_beta_offset = ctrl->val;
- h264_db_control.mode = venc_v4l2_to_hal(
+ h264_db_control.mode = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE,
mode->val);
pdata = &h264_db_control;
@@ -2602,7 +2390,7 @@
break;
case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_TYPE:
property_id = HAL_PARAM_VENC_IFRAMESIZE_TYPE;
- iframesize_type = venc_v4l2_to_hal(
+ iframesize_type = msm_comm_v4l2_to_hal(
V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_TYPE,
ctrl->val);
pdata = &iframesize_type;
diff --git a/drivers/media/platform/msm/vidc/msm_vidc.c b/drivers/media/platform/msm/vidc/msm_vidc.c
index 84b4b4d..e93b771 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc.c
@@ -1315,6 +1315,9 @@
inst->instant_bitrate = 0;
inst->pic_struct = MSM_VIDC_PIC_STRUCT_PROGRESSIVE;
inst->colour_space = MSM_VIDC_BT601_6_525;
+ inst->profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE;
+ inst->level = V4L2_MPEG_VIDEO_H264_LEVEL_1_0;
+ inst->entropy_mode = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
for (i = SESSION_MSG_INDEX(SESSION_MSG_START);
i <= SESSION_MSG_INDEX(SESSION_MSG_END); i++) {
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.c b/drivers/media/platform/msm/vidc/msm_vidc_common.c
index f5722b8..4f5309d 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.c
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.c
@@ -44,6 +44,7 @@
V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_INSUFFICIENT
#define V4L2_EVENT_RELEASE_BUFFER_REFERENCE \
V4L2_EVENT_MSM_VIDC_RELEASE_BUFFER_REFERENCE
+#define L_MODE V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY
#define MAX_SUPPORTED_INSTANCES 16
@@ -149,6 +150,308 @@
return cluster;
}
+int msm_comm_hal_to_v4l2(int id, int value)
+{
+ switch (id) {
+ /* H264 */
+ case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
+ switch (value) {
+ case HAL_H264_PROFILE_BASELINE:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE;
+ case HAL_H264_PROFILE_CONSTRAINED_BASE:
+ return
+ V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE;
+ case HAL_H264_PROFILE_MAIN:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_MAIN;
+ case HAL_H264_PROFILE_EXTENDED:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED;
+ case HAL_H264_PROFILE_HIGH:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_HIGH;
+ case HAL_H264_PROFILE_HIGH10:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10;
+ case HAL_H264_PROFILE_HIGH422:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422;
+ case HAL_H264_PROFILE_HIGH444:
+ return V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
+ switch (value) {
+ case HAL_H264_LEVEL_1:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_1_0;
+ case HAL_H264_LEVEL_1b:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_1B;
+ case HAL_H264_LEVEL_11:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_1_1;
+ case HAL_H264_LEVEL_12:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_1_2;
+ case HAL_H264_LEVEL_13:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_1_3;
+ case HAL_H264_LEVEL_2:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_2_0;
+ case HAL_H264_LEVEL_21:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_2_1;
+ case HAL_H264_LEVEL_22:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_2_2;
+ case HAL_H264_LEVEL_3:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_3_0;
+ case HAL_H264_LEVEL_31:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_3_1;
+ case HAL_H264_LEVEL_32:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_3_2;
+ case HAL_H264_LEVEL_4:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_4_0;
+ case HAL_H264_LEVEL_41:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_4_1;
+ case HAL_H264_LEVEL_42:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_4_2;
+ case HAL_H264_LEVEL_5:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_5_0;
+ case HAL_H264_LEVEL_51:
+ return V4L2_MPEG_VIDEO_H264_LEVEL_5_1;
+ default:
+ goto unknown_value;
+ }
+
+ case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
+ switch (value) {
+ case HAL_H264_ENTROPY_CAVLC:
+ return V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
+ case HAL_H264_ENTROPY_CABAC:
+ return V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL:
+ case V4L2_CID_MPEG_VIDC_VIDEO_MPEG2_PROFILE:
+ case V4L2_CID_MPEG_VIDC_VIDEO_MPEG2_LEVEL:
+ /*
+ * Extremely dirty hack: we haven't implemented g_ctrl of
+ * any of these controls and have no intention of doing
+ * so in the near future. So just return 0 so that we
+ * don't see the annoying "Unknown control" errors at the
+ * bottom of this function.
+ */
+ return 0;
+ }
+
+unknown_value:
+ dprintk(VIDC_WARN, "Unknown control (%x, %d)\n", id, value);
+ return -EINVAL;
+}
+
+int msm_comm_v4l2_to_hal(int id, int value)
+{
+ switch (id) {
+ /* H264 */
+ case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
+ switch (value) {
+ case V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE:
+ return HAL_H264_PROFILE_BASELINE;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE:
+ return HAL_H264_PROFILE_CONSTRAINED_BASE;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_MAIN:
+ return HAL_H264_PROFILE_MAIN;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED:
+ return HAL_H264_PROFILE_EXTENDED;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH:
+ return HAL_H264_PROFILE_HIGH;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10:
+ return HAL_H264_PROFILE_HIGH10;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422:
+ return HAL_H264_PROFILE_HIGH422;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE:
+ return HAL_H264_PROFILE_HIGH444;
+ case V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH:
+ return HAL_H264_PROFILE_CONSTRAINED_HIGH;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
+ switch (value) {
+ case V4L2_MPEG_VIDEO_H264_LEVEL_1_0:
+ return HAL_H264_LEVEL_1;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_1B:
+ return HAL_H264_LEVEL_1b;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_1_1:
+ return HAL_H264_LEVEL_11;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_1_2:
+ return HAL_H264_LEVEL_12;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_1_3:
+ return HAL_H264_LEVEL_13;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_2_0:
+ return HAL_H264_LEVEL_2;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_2_1:
+ return HAL_H264_LEVEL_21;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_2_2:
+ return HAL_H264_LEVEL_22;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_3_0:
+ return HAL_H264_LEVEL_3;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_3_1:
+ return HAL_H264_LEVEL_31;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_3_2:
+ return HAL_H264_LEVEL_32;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_4_0:
+ return HAL_H264_LEVEL_4;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_4_1:
+ return HAL_H264_LEVEL_41;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_4_2:
+ return HAL_H264_LEVEL_42;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_5_0:
+ return HAL_H264_LEVEL_5;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_5_1:
+ return HAL_H264_LEVEL_51;
+ case V4L2_MPEG_VIDEO_H264_LEVEL_5_2:
+ return HAL_H264_LEVEL_52;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
+ switch (value) {
+ case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC:
+ return HAL_H264_ENTROPY_CAVLC;
+ case V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC:
+ return HAL_H264_ENTROPY_CABAC;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL:
+ switch (value) {
+ case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0:
+ return HAL_H264_CABAC_MODEL_0;
+ case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_1:
+ return HAL_H264_CABAC_MODEL_1;
+ case V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_2:
+ return HAL_H264_CABAC_MODEL_2;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL:
+ switch (value) {
+ case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_0:
+ return HAL_VPX_PROFILE_VERSION_0;
+ case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_1:
+ return HAL_VPX_PROFILE_VERSION_1;
+ case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_2:
+ return HAL_VPX_PROFILE_VERSION_2;
+ case V4L2_MPEG_VIDC_VIDEO_VP8_VERSION_3:
+ return HAL_VPX_PROFILE_VERSION_3;
+ case V4L2_MPEG_VIDC_VIDEO_VP8_UNUSED:
+ return HAL_VPX_PROFILE_UNUSED;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE:
+ switch (value) {
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN:
+ return HAL_HEVC_PROFILE_MAIN;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN10:
+ return HAL_HEVC_PROFILE_MAIN10;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN_STILL_PIC:
+ return HAL_HEVC_PROFILE_MAIN_STILL_PIC;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL:
+ switch (value) {
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_1:
+ return HAL_HEVC_MAIN_TIER_LEVEL_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_2:
+ return HAL_HEVC_MAIN_TIER_LEVEL_2;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_2_1:
+ return HAL_HEVC_MAIN_TIER_LEVEL_2_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_3:
+ return HAL_HEVC_MAIN_TIER_LEVEL_3;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_3_1:
+ return HAL_HEVC_MAIN_TIER_LEVEL_3_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_4:
+ return HAL_HEVC_MAIN_TIER_LEVEL_4;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_4_1:
+ return HAL_HEVC_MAIN_TIER_LEVEL_4_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5:
+ return HAL_HEVC_MAIN_TIER_LEVEL_5;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5_1:
+ return HAL_HEVC_MAIN_TIER_LEVEL_5_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5_2:
+ return HAL_HEVC_MAIN_TIER_LEVEL_5_2;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6:
+ return HAL_HEVC_MAIN_TIER_LEVEL_6;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_1:
+ return HAL_HEVC_MAIN_TIER_LEVEL_6_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_2:
+ return HAL_HEVC_MAIN_TIER_LEVEL_6_2;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_1:
+ return HAL_HEVC_HIGH_TIER_LEVEL_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_2:
+ return HAL_HEVC_HIGH_TIER_LEVEL_2;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_2_1:
+ return HAL_HEVC_HIGH_TIER_LEVEL_2_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_3:
+ return HAL_HEVC_HIGH_TIER_LEVEL_3;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_3_1:
+ return HAL_HEVC_HIGH_TIER_LEVEL_3_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_4:
+ return HAL_HEVC_HIGH_TIER_LEVEL_4;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_4_1:
+ return HAL_HEVC_HIGH_TIER_LEVEL_4_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5:
+ return HAL_HEVC_HIGH_TIER_LEVEL_5;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5_1:
+ return HAL_HEVC_HIGH_TIER_LEVEL_5_1;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5_2:
+ return HAL_HEVC_HIGH_TIER_LEVEL_5_2;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6:
+ return HAL_HEVC_HIGH_TIER_LEVEL_6;
+ case V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6_1:
+ return HAL_HEVC_HIGH_TIER_LEVEL_6_1;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION:
+ switch (value) {
+ case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_NONE:
+ return HAL_ROTATE_NONE;
+ case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90:
+ return HAL_ROTATE_90;
+ case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_180:
+ return HAL_ROTATE_180;
+ case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270:
+ return HAL_ROTATE_270;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE:
+ switch (value) {
+ case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED:
+ return HAL_H264_DB_MODE_DISABLE;
+ case V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED:
+ return HAL_H264_DB_MODE_ALL_BOUNDARY;
+ case L_MODE:
+ return HAL_H264_DB_MODE_SKIP_SLICE_BOUNDARY;
+ default:
+ goto unknown_value;
+ }
+ case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_TYPE:
+ switch (value) {
+ case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_DEFAULT:
+ return HAL_IFRAMESIZE_TYPE_DEFAULT;
+ case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_MEDIUM:
+ return HAL_IFRAMESIZE_TYPE_MEDIUM;
+ case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_HUGE:
+ return HAL_IFRAMESIZE_TYPE_HUGE;
+ case V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_UNLIMITED:
+ return HAL_IFRAMESIZE_TYPE_UNLIMITED;
+ default:
+ goto unknown_value;
+ }
+ }
+
+unknown_value:
+ dprintk(VIDC_WARN, "Unknown control (%x, %d)\n", id, value);
+ return -EINVAL;
+}
+
int msm_comm_ctrl_init(struct msm_vidc_inst *inst,
struct msm_vidc_ctrl *drv_ctrls, u32 num_ctrls,
const struct v4l2_ctrl_ops *ctrl_ops)
@@ -1279,6 +1582,16 @@
* ptr[5] = colour space
*/
+ inst->entropy_mode = msm_comm_hal_to_v4l2(
+ V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE,
+ event_notify->entropy_mode);
+ inst->profile = msm_comm_hal_to_v4l2(
+ V4L2_CID_MPEG_VIDEO_H264_PROFILE,
+ event_notify->profile);
+ inst->level = msm_comm_hal_to_v4l2(
+ V4L2_CID_MPEG_VIDEO_H264_LEVEL,
+ event_notify->level);
+
ptr = (u32 *)seq_changed_event.u.data;
if (ptr != NULL) {
@@ -4076,11 +4389,6 @@
mutex_unlock(&inst->sync_lock);
switch (ptype) {
- case HAL_PARAM_PROFILE_LEVEL_CURRENT:
- case HAL_CONFIG_VDEC_ENTROPY:
- rc = call_hfi_op(hdev, session_get_property, inst->session,
- ptype);
- break;
case HAL_PARAM_GET_BUFFER_REQUIREMENTS:
rc = call_hfi_op(hdev, session_get_buf_req, inst->session);
break;
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_common.h b/drivers/media/platform/msm/vidc/msm_vidc_common.h
index 7f2ab04..d898682 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_common.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_common.h
@@ -99,4 +99,7 @@
int msm_vidc_comm_s_parm(struct msm_vidc_inst *inst, struct v4l2_streamparm *a);
bool msm_comm_turbo_session(struct msm_vidc_inst *inst);
void msm_comm_print_inst_info(struct msm_vidc_inst *inst);
+int msm_comm_v4l2_to_hal(int id, int value);
+int msm_comm_hal_to_v4l2(int id, int value);
+
#endif
diff --git a/drivers/media/platform/msm/vidc/msm_vidc_internal.h b/drivers/media/platform/msm/vidc/msm_vidc_internal.h
index fb90fdf7..4a14ca3 100644
--- a/drivers/media/platform/msm/vidc/msm_vidc_internal.h
+++ b/drivers/media/platform/msm/vidc/msm_vidc_internal.h
@@ -303,6 +303,9 @@
u32 pic_struct;
u32 colour_space;
u32 operating_rate;
+ u32 profile;
+ u32 level;
+ u32 entropy_mode;
};
extern struct msm_vidc_drv *vidc_driver;
diff --git a/drivers/media/platform/msm/vidc/vidc_hfi_api.h b/drivers/media/platform/msm/vidc/vidc_hfi_api.h
index 6642302..1bbb730 100644
--- a/drivers/media/platform/msm/vidc/vidc_hfi_api.h
+++ b/drivers/media/platform/msm/vidc/vidc_hfi_api.h
@@ -1383,6 +1383,9 @@
ion_phys_addr_t extra_data_buffer;
u32 pic_struct;
u32 colour_space;
+ u32 profile;
+ u32 level;
+ u32 entropy_mode;
};
struct msm_vidc_cb_data_done {