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

Commit e47c71b2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Add support for scaling secure video into non-secure"

parents 713435d3 72d4138b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1827,6 +1827,16 @@ int create_pkt_cmd_session_set_property(
		pkt->size += sizeof(u32) * 2;
		break;
	}
	case HAL_PARAM_VDEC_NON_SECURE_OUTPUT2:
	{
		struct hfi_enable *hfi;
		pkt->rg_property_data[0] =
			HFI_PROPERTY_PARAM_VDEC_NONCP_OUTPUT2;
		hfi = (struct hfi_enable *) &pkt->rg_property_data[1];
		hfi->enable = ((struct hfi_enable *) pdata)->enable;
		pkt->size += sizeof(u32) + sizeof(struct hfi_enable);
		break;
	}
	/* FOLLOWING PROPERTIES ARE NOT IMPLEMENTED IN CORE YET */
	case HAL_CONFIG_BUFFER_REQUIREMENTS:
	case HAL_CONFIG_PRIORITY:
+4 −2
Original line number Diff line number Diff line
@@ -450,11 +450,13 @@ static inline void copy_cap_prop(
	case HFI_CAPABILITY_ENC_LTR_COUNT:
		out = &sess_init_done->ltr_count;
		break;

	case HFI_CAPABILITY_CP_OUTPUT2_THRESH:
		out = &sess_init_done->secure_output2_threshold;
		break;
	}

	if (out) {
		out->capability_type =
			(enum hal_capability)in->capability_type;
		out->min = in->min;
		out->max = in->max;
		out->step_size = in->step_size;
+60 −11
Original line number Diff line number Diff line
@@ -492,7 +492,30 @@ static struct msm_vidc_ctrl msm_vdec_ctrls[] = {
		.name = "Buffer size limit",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = 0,
		.maximum = 0x7fffffff,
		.maximum = INT_MAX,
		.default_value = 0,
		.step = 1,
		.menu_skip_mask = 0,
		.qmenu = NULL,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_SECURE_SCALING_THRESHOLD,
		.name = "Secure scaling output2 threshold",
		.type = V4L2_CTRL_TYPE_INTEGER,
		.minimum = 0,
		.maximum = INT_MAX,
		.default_value = 0,
		.step = 1,
		.menu_skip_mask = 0,
		.qmenu = NULL,
		.flags = V4L2_CTRL_FLAG_VOLATILE,
	},
	{
		.id = V4L2_CID_MPEG_VIDC_VIDEO_NON_SECURE_OUTPUT2,
		.name = "Non-Secure output2",
		.type = V4L2_CTRL_TYPE_BOOLEAN,
		.minimum = 0,
		.maximum = 1,
		.default_value = 0,
		.step = 1,
		.menu_skip_mask = 0,
@@ -1692,6 +1715,8 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
	inst->capability.width.max = DEFAULT_WIDTH;
	inst->capability.buffer_mode[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC;
	inst->capability.buffer_mode[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC;
	inst->capability.secure_output2_threshold.min = 0;
	inst->capability.secure_output2_threshold.max = 0;
	inst->buffer_mode_set[OUTPUT_PORT] = HAL_BUFFER_MODE_STATIC;
	inst->buffer_mode_set[CAPTURE_PORT] = HAL_BUFFER_MODE_STATIC;
	inst->prop.fps = 30;
@@ -1779,12 +1804,24 @@ static int try_get_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		dprintk(VIDC_DBG, "%s: LEVEL ctrl->id:%x ctrl->val:%d\n",
					__func__, ctrl->id, ctrl->val);
		break;
	default:
		dprintk(VIDC_ERR, "%s id:%x not supported\n",
	case V4L2_CID_MPEG_VIDC_VIDEO_SECURE_SCALING_THRESHOLD:
		if (!(inst->flags & VIDC_SECURE) ||
			!inst->capability.secure_output2_threshold.max) {
			dprintk(VIDC_ERR, "%s id:%x invalid configuration\n",
					__func__, ctrl->id);
			rc = -EINVAL;
			break;
		}
		dprintk(VIDC_DBG,
				"Secure Scaling Threshold is : %d",
				inst->capability.secure_output2_threshold.max);
		ctrl->val = inst->capability.secure_output2_threshold.max;
		break;
	default:
		dprintk(VIDC_DBG, "%s id:%x not supported\n",
					__func__, ctrl->id);
		break;
	}
	return rc;
}

@@ -2141,12 +2178,17 @@ static int try_set_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		pdata = &profile_level;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_BUFFER_SIZE_LIMIT:
	{
		inst->capability.buffer_size_limit = ctrl->val;
		dprintk(VIDC_DBG,
			"Limiting input buffer size to :%u\n", ctrl->val);
		break;
	}
	case V4L2_CID_MPEG_VIDC_VIDEO_NON_SECURE_OUTPUT2:
		property_id = HAL_PARAM_VDEC_NON_SECURE_OUTPUT2;
		hal_property.enable = ctrl->val;
		dprintk(VIDC_DBG, "%s non_secure output2\n",
			ctrl->val ? "Enabling" : "Disabling");
		pdata = &hal_property;
		break;
	default:
		break;
	}
@@ -2211,13 +2253,19 @@ static int msm_vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
		goto failed_open_done;
	}
	for (c = 0; c < master->ncontrols; ++c) {
		if (master->cluster[c]->id == ctrl->id) {
			rc = try_get_ctrl(inst, ctrl);
		int d = 0;
		for (d = 0; d < NUM_CTRLS; ++d) {
			if (master->cluster[c]->id == inst->ctrls[d]->id &&
				inst->ctrls[d]->flags &
				V4L2_CTRL_FLAG_VOLATILE) {
				rc = try_get_ctrl(inst, master->cluster[c]);
				if (rc) {
					dprintk(VIDC_ERR, "Failed getting %x\n",
					ctrl->id);
							master->cluster[c]->id);
					return rc;
				}
				break;
			}
		}
	}
	return rc;
@@ -2348,6 +2396,7 @@ int msm_vdec_ctrl_init(struct msm_vidc_inst *inst)
		case V4L2_CID_MPEG_VIDC_VIDEO_H263_PROFILE:
		case V4L2_CID_MPEG_VIDC_VIDEO_H263_LEVEL:
		case V4L2_CID_MPEG_VIDC_VIDEO_VP8_PROFILE_LEVEL:
		case V4L2_CID_MPEG_VIDC_VIDEO_SECURE_SCALING_THRESHOLD:
			ctrl->flags |= msm_vdec_ctrls[idx].flags;
			break;
		}
+3 −2
Original line number Diff line number Diff line
@@ -85,9 +85,8 @@ enum multi_stream msm_comm_get_stream_output_mode(struct msm_vidc_inst *inst)
			return HAL_VIDEO_DECODER_SECONDARY;
	}
	return HAL_VIDEO_DECODER_PRIMARY;


}

static int msm_comm_get_mbs_per_sec(struct msm_vidc_inst *inst)
{
	int output_port_mbs, capture_port_mbs;
@@ -643,6 +642,8 @@ static void handle_session_init_done(enum command_response cmd, void *data)
			inst->capability.capability_set = true;
			inst->capability.buffer_mode[CAPTURE_PORT] =
				session_init_done->alloc_mode_out;
			inst->capability.secure_output2_threshold =
				session_init_done->secure_output2_threshold;
		} else {
			dprintk(VIDC_ERR,
				"Session init response from FW : 0x%x\n",
+1 −0
Original line number Diff line number Diff line
@@ -254,6 +254,7 @@ struct msm_vidc_core_capability {
	struct hal_capability_supported hier_p;
	struct hal_capability_supported ltr_count;
	struct hal_capability_supported mbs_per_frame;
	struct hal_capability_supported secure_output2_threshold;
	u32 capability_set;
	enum buffer_mode_type buffer_mode[MAX_PORT_NUM];
	u32 buffer_size_limit;
Loading