Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01a5cdef authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: add support for dynamic flip"

parents 78fcd26e 15f81253
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -1556,6 +1556,35 @@ int create_pkt_cmd_session_set_property(
		pkt->size += sizeof(struct hfi_vpe_rotation_type);
		break;
	}
	case HAL_CONFIG_VPE_FLIP:
	{
		u32 hfi_flip = HFI_FLIP_NONE;
		enum hal_flip flip = *(enum hal_flip *)pdata;

		pkt->rg_property_data[0] = HFI_PROPERTY_CONFIG_VPE_FLIP;

		switch (flip) {
		case HAL_FLIP_NONE:
			hfi_flip = HFI_FLIP_NONE;
			break;
		case HAL_FLIP_HORIZONTAL:
			hfi_flip = HFI_FLIP_HORIZONTAL;
			break;
		case HAL_FLIP_VERTICAL:
			hfi_flip = HFI_FLIP_VERTICAL;
			break;
		case HAL_FLIP_BOTH:
			hfi_flip = HFI_FLIP_HORIZONTAL | HFI_FLIP_VERTICAL;
			break;
		default:
			dprintk(VIDC_ERR, "Invalid flip: %#x\n", flip);
			rc = -EINVAL;
			break;
		}
		pkt->rg_property_data[1] = hfi_flip;
		pkt->size += sizeof(u32);
		break;
	}
	case HAL_PARAM_VENC_INTRA_REFRESH:
	{
		struct hfi_intra_refresh *hfi;
+9 −0
Original line number Diff line number Diff line
@@ -1352,6 +1352,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
	struct hal_nal_stream_format_select stream_format;
	struct hal_heic_frame_quality frame_quality;
	struct hal_heic_grid_enable grid_enable;
	enum hal_flip flip = HAL_FLIP_NONE;

	if (!inst || !inst->core || !inst->core->device) {
		dprintk(VIDC_ERR, "%s invalid parameters\n", __func__);
@@ -1656,6 +1657,14 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
	case V4L2_CID_MPEG_VIDC_VIDEO_FLIP:
	{
		dprintk(VIDC_DBG, "Flip %d\n", ctrl->val);
		if (inst->state >= MSM_VIDC_START_DONE &&
			inst->state <= MSM_VIDC_STOP_DONE) {
			property_id = HAL_CONFIG_VPE_FLIP;
			flip = msm_comm_v4l2_to_hal(
				V4L2_CID_MPEG_VIDC_VIDEO_FLIP,
				ctrl->val);
			pdata = &flip;
		}
		break;
	}
	case V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE: {
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ enum hal_property {
	HAL_CONFIG_VENC_IDR_PERIOD,
	HAL_PARAM_VENC_ADAPTIVE_B,
	HAL_PARAM_VPE_ROTATION,
	HAL_CONFIG_VPE_FLIP,
	HAL_PARAM_VENC_INTRA_REFRESH,
	HAL_PARAM_VENC_MULTI_SLICE_CONTROL,
	HAL_SYS_DEBUG_CONFIG,
+3 −0
Original line number Diff line number Diff line
@@ -388,6 +388,9 @@ struct hfi_buffer_info {
#define HFI_PROPERTY_CONFIG_VPE_COMMON_START				\
	(HFI_DOMAIN_BASE_VPE + HFI_ARCH_COMMON_OFFSET + 0x8000)

#define HFI_PROPERTY_CONFIG_VPE_FLIP				\
	(HFI_PROPERTY_CONFIG_VPE_COMMON_START + 0x001)

struct hfi_pic_struct {
	u32 progressive_only;
};