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

Commit e7ff1b1c authored by Umesh Pandey's avatar Umesh Pandey Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Add Colorspace in sequence change event



For HDR playback, the userspace needs info on the
colorspace info for DPB decision. Venus firmware
sends a color space info to the driver with the port
settings changed event, which is triggered as an
insufficient event to userpace if colorspace changes.

CRs-Fixed: 1081102
Change-Id: I9665dfc1c52d77dc8953042101d726e7f7ba1807
Signed-off-by: default avatarUmesh Pandey <umeshp@codeaurora.org>
parent f6a9d356
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
	u8 *data_ptr;
	int prop_id;
	enum msm_vidc_pixel_depth luma_bit_depth, chroma_bit_depth;
	struct hfi_colour_space *colour_info;

	if (sizeof(struct hfi_msg_event_notify_packet) > pkt->size) {
		dprintk(VIDC_ERR,
@@ -205,6 +206,18 @@ static int hfi_process_sess_evt_seq_changed(u32 device_id,
				data_ptr +=
					sizeof(struct hfi_pic_struct);
				break;
			case HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE:
				data_ptr = data_ptr + sizeof(u32);
				colour_info =
					(struct hfi_colour_space *) data_ptr;
				event_notify.colour_space =
					colour_info->colour_space;
				dprintk(VIDC_DBG,
					"Colour space value is: %d\n",
						colour_info->colour_space);
				data_ptr +=
					sizeof(struct hfi_colour_space);
				break;
			default:
				dprintk(VIDC_ERR,
					"%s cmd: %#x not supported\n",
+1 −0
Original line number Diff line number Diff line
@@ -1185,6 +1185,7 @@ void *msm_vidc_open(int core_id, int session_type)
	inst->bit_depth = MSM_VIDC_BIT_DEPTH_8;
	inst->instant_bitrate = 0;
	inst->pic_struct = MSM_VIDC_PIC_STRUCT_PROGRESSIVE;
	inst->colour_space = MSM_VIDC_BT601_6_525;

	for (i = SESSION_MSG_INDEX(SESSION_MSG_START);
		i <= SESSION_MSG_INDEX(SESSION_MSG_END); i++) {
+15 −2
Original line number Diff line number Diff line
@@ -1198,12 +1198,14 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
	 * ptr[2] = flag to indicate bit depth or/and pic struct changed
	 * ptr[3] = bit depth
	 * ptr[4] = pic struct (progressive or interlaced)
	 * ptr[5] = colour space
	 */

	ptr = (u32 *)seq_changed_event.u.data;
	ptr[2] = 0x0;
	ptr[3] = inst->bit_depth;
	ptr[4] = inst->pic_struct;
	ptr[5] = inst->colour_space;

	if (inst->bit_depth != event_notify->bit_depth) {
		inst->bit_depth = event_notify->bit_depth;
@@ -1224,6 +1226,17 @@ static void handle_event_change(enum hal_command_response cmd, void *data)
				"V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT due to pic-struct change\n");
	}

	if (inst->bit_depth == MSM_VIDC_BIT_DEPTH_10
		&& inst->colour_space !=
		event_notify->colour_space) {
		inst->colour_space = event_notify->colour_space;
		event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
		ptr[2] |= V4L2_EVENT_COLOUR_SPACE_FLAG;
		ptr[5] = inst->colour_space;
		dprintk(VIDC_DBG,
				"V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT due to colour space change\n");
	}

	if (event == V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT) {
		dprintk(VIDC_DBG, "V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT\n");
		inst->reconfig_height = event_notify->height;
+1 −0
Original line number Diff line number Diff line
@@ -292,6 +292,7 @@ struct msm_vidc_inst {
	u32 buffers_held_in_driver;
	atomic_t in_flush;
	u32 pic_struct;
	u32 colour_space;
};

extern struct msm_vidc_drv *vidc_driver;
+1 −0
Original line number Diff line number Diff line
@@ -1357,6 +1357,7 @@ struct msm_vidc_cb_event {
	ion_phys_addr_t packet_buffer;
	ion_phys_addr_t extra_data_buffer;
	u32 pic_struct;
	u32 colour_space;
};

struct msm_vidc_cb_data_done {
Loading