Loading drivers/media/platform/msm/vidc/msm_venc.c +2 −19 Original line number Diff line number Diff line Loading @@ -1393,7 +1393,6 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) struct hal_h264_entropy_control h264_entropy_control; struct hal_intra_period intra_period; struct hal_idr_period idr_period; struct hal_vpe_rotation vpe_rotation; struct hal_intra_refresh intra_refresh; struct hal_multi_slice_control multi_slice_control; struct hal_h264_db_control h264_db_control; Loading Loading @@ -1692,28 +1691,12 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) break; case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION: { temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_FLIP); property_id = HAL_PARAM_VPE_ROTATION; vpe_rotation.rotate = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_ROTATION, ctrl->val); vpe_rotation.flip = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_FLIP, temp_ctrl->val); pdata = &vpe_rotation; dprintk(VIDC_DBG, "Rotation %d\n", ctrl->val); break; } case V4L2_CID_MPEG_VIDC_VIDEO_FLIP: { temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); property_id = HAL_PARAM_VPE_ROTATION; vpe_rotation.rotate = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_ROTATION, temp_ctrl->val); vpe_rotation.flip = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_FLIP, ctrl->val); pdata = &vpe_rotation; dprintk(VIDC_DBG, "Flip %d\n", ctrl->val); break; } case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE: { Loading drivers/media/platform/msm/vidc/msm_vidc.c +62 −0 Original line number Diff line number Diff line Loading @@ -946,6 +946,59 @@ static int msm_vidc_create_tile_info_table(struct msm_vidc_inst *inst) return 0; } static int msm_vidc_set_rotation(struct msm_vidc_inst *inst) { int rc = 0; int value = 0; struct hfi_device *hdev; struct hal_vpe_rotation vpe_rotation; struct hal_frame_size frame_sz; hdev = inst->core->device; /* Set rotation and flip first */ value = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); if (value < 0) { dprintk(VIDC_ERR, "Get control for rotation failed\n"); return value; } vpe_rotation.rotate = value; value = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_FLIP); if (value < 0) { dprintk(VIDC_ERR, "Get control for flip failed\n"); return value; } vpe_rotation.flip = value; dprintk(VIDC_DBG, "Set rotation = %d, flip = %d for capture port.\n", vpe_rotation.rotate, vpe_rotation.flip); rc = call_hfi_op(hdev, session_set_property, (void *)inst->session, HAL_PARAM_VPE_ROTATION, &vpe_rotation); if (rc) { dprintk(VIDC_ERR, "Set rotation/flip at start stream failed\n"); return rc; } /* flip the output resolution if required */ value = vpe_rotation.rotate; if (value == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 || value == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270) { frame_sz.buffer_type = HAL_BUFFER_OUTPUT; frame_sz.width = inst->prop.height[CAPTURE_PORT]; frame_sz.height = inst->prop.width[CAPTURE_PORT]; dprintk(VIDC_DBG, "CAPTURE port width = %d, height = %d\n", frame_sz.width, frame_sz.height); rc = call_hfi_op(hdev, session_set_property, (void *) inst->session, HAL_PARAM_FRAME_SIZE, &frame_sz); if (rc) { dprintk(VIDC_ERR, "Failed to set framesize for CAPTURE port\n"); return rc; } } return rc; } static inline int start_streaming(struct msm_vidc_inst *inst) { int rc = 0; Loading @@ -954,6 +1007,15 @@ static inline int start_streaming(struct msm_vidc_inst *inst) hdev = inst->core->device; if (inst->session_type == MSM_VIDC_ENCODER) { rc = msm_vidc_set_rotation(inst); if (rc) { dprintk(VIDC_ERR, "Set rotation for encoder failed\n"); goto fail_start; } } /* Create tile info table */ rc = msm_vidc_create_tile_info_table(inst); if (rc) { Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +0 −30 Original line number Diff line number Diff line Loading @@ -5522,7 +5522,6 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst) { u32 x_min, x_max, y_min, y_max; u32 input_height, input_width, output_height, output_width; u32 rotation; if (is_heic_encode_session(inst)) { dprintk(VIDC_DBG, "Skip downscale check for HEIC\n"); Loading Loading @@ -5563,20 +5562,6 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst) return 0; } rotation = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); if ((output_width != output_height) && (rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 || rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270)) { output_width = inst->prop.height[CAPTURE_PORT]; output_height = inst->prop.width[CAPTURE_PORT]; dprintk(VIDC_DBG, "Rotation=%u Swapped Output W=%u H=%u to check scaling", rotation, output_width, output_height); } x_min = (1<<16)/inst->capability.scale_x.min; y_min = (1<<16)/inst->capability.scale_y.min; x_max = inst->capability.scale_x.max >> 16; Loading Loading @@ -5622,7 +5607,6 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst) struct hfi_device *hdev; struct msm_vidc_core *core; u32 output_height, output_width, input_height, input_width; u32 rotation; if (!inst || !inst->core || !inst->core->device) { dprintk(VIDC_WARN, "%s: Invalid parameter\n", __func__); Loading Loading @@ -5661,23 +5645,9 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst) rc = -ENOTSUPP; } rotation = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); output_height = ALIGN(inst->prop.height[CAPTURE_PORT], 16); output_width = ALIGN(inst->prop.width[CAPTURE_PORT], 16); if ((output_width != output_height) && (rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 || rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270)) { output_width = ALIGN(inst->prop.height[CAPTURE_PORT], 16); output_height = ALIGN(inst->prop.width[CAPTURE_PORT], 16); dprintk(VIDC_DBG, "Rotation=%u Swapped Output W=%u H=%u to check capability", rotation, output_width, output_height); } if (!rc) { if (output_width < capability->width.min || output_height < capability->height.min) { Loading Loading
drivers/media/platform/msm/vidc/msm_venc.c +2 −19 Original line number Diff line number Diff line Loading @@ -1393,7 +1393,6 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) struct hal_h264_entropy_control h264_entropy_control; struct hal_intra_period intra_period; struct hal_idr_period idr_period; struct hal_vpe_rotation vpe_rotation; struct hal_intra_refresh intra_refresh; struct hal_multi_slice_control multi_slice_control; struct hal_h264_db_control h264_db_control; Loading Loading @@ -1692,28 +1691,12 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl) break; case V4L2_CID_MPEG_VIDC_VIDEO_ROTATION: { temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_FLIP); property_id = HAL_PARAM_VPE_ROTATION; vpe_rotation.rotate = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_ROTATION, ctrl->val); vpe_rotation.flip = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_FLIP, temp_ctrl->val); pdata = &vpe_rotation; dprintk(VIDC_DBG, "Rotation %d\n", ctrl->val); break; } case V4L2_CID_MPEG_VIDC_VIDEO_FLIP: { temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); property_id = HAL_PARAM_VPE_ROTATION; vpe_rotation.rotate = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_ROTATION, temp_ctrl->val); vpe_rotation.flip = msm_comm_v4l2_to_hal( V4L2_CID_MPEG_VIDC_VIDEO_FLIP, ctrl->val); pdata = &vpe_rotation; dprintk(VIDC_DBG, "Flip %d\n", ctrl->val); break; } case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE: { Loading
drivers/media/platform/msm/vidc/msm_vidc.c +62 −0 Original line number Diff line number Diff line Loading @@ -946,6 +946,59 @@ static int msm_vidc_create_tile_info_table(struct msm_vidc_inst *inst) return 0; } static int msm_vidc_set_rotation(struct msm_vidc_inst *inst) { int rc = 0; int value = 0; struct hfi_device *hdev; struct hal_vpe_rotation vpe_rotation; struct hal_frame_size frame_sz; hdev = inst->core->device; /* Set rotation and flip first */ value = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); if (value < 0) { dprintk(VIDC_ERR, "Get control for rotation failed\n"); return value; } vpe_rotation.rotate = value; value = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_FLIP); if (value < 0) { dprintk(VIDC_ERR, "Get control for flip failed\n"); return value; } vpe_rotation.flip = value; dprintk(VIDC_DBG, "Set rotation = %d, flip = %d for capture port.\n", vpe_rotation.rotate, vpe_rotation.flip); rc = call_hfi_op(hdev, session_set_property, (void *)inst->session, HAL_PARAM_VPE_ROTATION, &vpe_rotation); if (rc) { dprintk(VIDC_ERR, "Set rotation/flip at start stream failed\n"); return rc; } /* flip the output resolution if required */ value = vpe_rotation.rotate; if (value == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 || value == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270) { frame_sz.buffer_type = HAL_BUFFER_OUTPUT; frame_sz.width = inst->prop.height[CAPTURE_PORT]; frame_sz.height = inst->prop.width[CAPTURE_PORT]; dprintk(VIDC_DBG, "CAPTURE port width = %d, height = %d\n", frame_sz.width, frame_sz.height); rc = call_hfi_op(hdev, session_set_property, (void *) inst->session, HAL_PARAM_FRAME_SIZE, &frame_sz); if (rc) { dprintk(VIDC_ERR, "Failed to set framesize for CAPTURE port\n"); return rc; } } return rc; } static inline int start_streaming(struct msm_vidc_inst *inst) { int rc = 0; Loading @@ -954,6 +1007,15 @@ static inline int start_streaming(struct msm_vidc_inst *inst) hdev = inst->core->device; if (inst->session_type == MSM_VIDC_ENCODER) { rc = msm_vidc_set_rotation(inst); if (rc) { dprintk(VIDC_ERR, "Set rotation for encoder failed\n"); goto fail_start; } } /* Create tile info table */ rc = msm_vidc_create_tile_info_table(inst); if (rc) { Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +0 −30 Original line number Diff line number Diff line Loading @@ -5522,7 +5522,6 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst) { u32 x_min, x_max, y_min, y_max; u32 input_height, input_width, output_height, output_width; u32 rotation; if (is_heic_encode_session(inst)) { dprintk(VIDC_DBG, "Skip downscale check for HEIC\n"); Loading Loading @@ -5563,20 +5562,6 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst) return 0; } rotation = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); if ((output_width != output_height) && (rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 || rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270)) { output_width = inst->prop.height[CAPTURE_PORT]; output_height = inst->prop.width[CAPTURE_PORT]; dprintk(VIDC_DBG, "Rotation=%u Swapped Output W=%u H=%u to check scaling", rotation, output_width, output_height); } x_min = (1<<16)/inst->capability.scale_x.min; y_min = (1<<16)/inst->capability.scale_y.min; x_max = inst->capability.scale_x.max >> 16; Loading Loading @@ -5622,7 +5607,6 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst) struct hfi_device *hdev; struct msm_vidc_core *core; u32 output_height, output_width, input_height, input_width; u32 rotation; if (!inst || !inst->core || !inst->core->device) { dprintk(VIDC_WARN, "%s: Invalid parameter\n", __func__); Loading Loading @@ -5661,23 +5645,9 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst) rc = -ENOTSUPP; } rotation = msm_comm_g_ctrl_for_id(inst, V4L2_CID_MPEG_VIDC_VIDEO_ROTATION); output_height = ALIGN(inst->prop.height[CAPTURE_PORT], 16); output_width = ALIGN(inst->prop.width[CAPTURE_PORT], 16); if ((output_width != output_height) && (rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 || rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270)) { output_width = ALIGN(inst->prop.height[CAPTURE_PORT], 16); output_height = ALIGN(inst->prop.width[CAPTURE_PORT], 16); dprintk(VIDC_DBG, "Rotation=%u Swapped Output W=%u H=%u to check capability", rotation, output_width, output_height); } if (!rc) { if (output_width < capability->width.min || output_height < capability->height.min) { Loading