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

Commit 520e9b26 authored by Praneeth Paladugu's avatar Praneeth Paladugu
Browse files

msm: vidc: Enhance sequence event parsing



Venus HW sends output buffer count and crop window dimensions
as part of sequence change event to host. Add code in driver
to parse the same and to store internally.

CRs-Fixed: 2055218
Change-Id: I2a12ccbc1d9b194e42d95e6c69b8d4164e2a1047
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent 92b0fef6
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
	struct hfi_profile_level *profile_level;
	struct hfi_bit_depth *pixel_depth;
	struct hfi_pic_struct *pic_struct;
	struct hfi_buffer_requirements *buf_req;
	struct hfi_index_extradata_input_crop_payload *crop_info;
	u32 entropy_mode = 0;
	u8 *data_ptr;
	int prop_id;
@@ -231,6 +233,41 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
				data_ptr +=
					sizeof(u32);
				break;
			case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS:
				data_ptr = data_ptr + sizeof(u32);
				buf_req =
					(struct hfi_buffer_requirements *)
						data_ptr;
				event_notify.capture_buf_count =
					buf_req->buffer_count_min;
				dprintk(VIDC_DBG,
					"Capture Count : 0x%x\n",
						event_notify.capture_buf_count);
				data_ptr +=
					sizeof(struct hfi_buffer_requirements);
				break;
			case HFI_INDEX_EXTRADATA_INPUT_CROP:
				data_ptr = data_ptr + sizeof(u32);
				crop_info = (struct
				hfi_index_extradata_input_crop_payload *)
						data_ptr;
				event_notify.crop_data.left = crop_info->left;
				event_notify.crop_data.top = crop_info->top;
				event_notify.crop_data.width = crop_info->width;
				event_notify.crop_data.height =
					crop_info->height;
				dprintk(VIDC_DBG,
					"CROP info : Left = %d Top = %d\n",
						crop_info->left,
						crop_info->top);
				dprintk(VIDC_DBG,
					"CROP info : Width = %d Height = %d\n",
						crop_info->width,
						crop_info->height);
				data_ptr +=
					sizeof(struct
					hfi_index_extradata_input_crop_payload);
				break;
			default:
				dprintk(VIDC_ERR,
					"%s cmd: %#x not supported\n",
+15 −0
Original line number Diff line number Diff line
@@ -1554,6 +1554,14 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
	inst->entropy_mode = event_notify->entropy_mode;
	inst->profile = event_notify->profile;
	inst->level = event_notify->level;
	inst->prop.crop_info.left =
		event_notify->crop_data.left;
	inst->prop.crop_info.top =
		event_notify->crop_data.top;
	inst->prop.crop_info.height =
		event_notify->crop_data.height;
	inst->prop.crop_info.width =
		event_notify->crop_data.width;

	ptr = (u32 *)seq_changed_event.u.data;
	ptr[0] = event_notify->height;
@@ -1571,6 +1579,13 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
		event_notify->bit_depth, event_notify->pic_struct,
			event_notify->colour_space);

	dprintk(VIDC_DBG,
		"Event payload: CROP top = %d left = %d Height = %d Width = %d\n",
			event_notify->crop_data.top,
			event_notify->crop_data.left,
			event_notify->crop_data.height,
			event_notify->crop_data.width);

	mutex_lock(&inst->lock);
	inst->in_reconfig = true;
	inst->reconfig_height = event_notify->height;
+8 −0
Original line number Diff line number Diff line
@@ -175,9 +175,17 @@ struct msm_video_device {
	struct video_device vdev;
};

struct session_crop {
	u32 left;
	u32 top;
	u32 width;
	u32 height;
};

struct session_prop {
	u32 width[MAX_PORT_NUM];
	u32 height[MAX_PORT_NUM];
	struct session_crop crop_info;
	u32 fps;
	u32 bitrate;
};
+12 −10
Original line number Diff line number Diff line
@@ -1212,6 +1212,16 @@ struct msm_vidc_cb_cmd_done {
	} data;
};

struct hal_index_extradata_input_crop_payload {
	u32 size;
	u32 version;
	u32 port_index;
	u32 left;
	u32 top;
	u32 width;
	u32 height;
};

struct msm_vidc_cb_event {
	u32 device_id;
	void *session_id;
@@ -1227,6 +1237,8 @@ struct msm_vidc_cb_event {
	u32 profile;
	u32 level;
	u32 entropy_mode;
	u32 capture_buf_count;
	struct hal_index_extradata_input_crop_payload crop_data;
};

struct msm_vidc_cb_data_done {
@@ -1314,16 +1326,6 @@ struct vidc_clk_scale_data {
	int num_sessions;
};

struct hal_index_extradata_input_crop_payload {
	u32 size;
	u32 version;
	u32 port_index;
	u32 left;
	u32 top;
	u32 width;
	u32 height;
};

struct hal_cmd_sys_get_property_packet {
	u32 size;
	u32 packet_type;