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: Umesh Pandey <umeshp@codeaurora.org>
This commit is contained in:
Umesh Pandey 2016-08-16 19:17:29 -07:00 committed by Gerrit - the friendly Code Review server
parent 448d10ae99
commit 7300c28a5c
7 changed files with 57 additions and 17 deletions

View file

@ -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",

View file

@ -1172,6 +1172,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++) {

View file

@ -1200,29 +1200,46 @@ 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;
if (inst->bit_depth != event_notify->bit_depth) {
inst->bit_depth = event_notify->bit_depth;
ptr[2] |= V4L2_EVENT_BITDEPTH_FLAG;
if (ptr != NULL) {
ptr[2] = 0x0;
ptr[3] = inst->bit_depth;
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
dprintk(VIDC_DBG,
"V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT due to bit-depth change\n");
}
if (inst->pic_struct != event_notify->pic_struct) {
inst->pic_struct = event_notify->pic_struct;
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
ptr[2] |= V4L2_EVENT_PICSTRUCT_FLAG;
ptr[4] = inst->pic_struct;
dprintk(VIDC_DBG,
"V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT due to pic-struct change\n");
ptr[5] = inst->colour_space;
if (inst->bit_depth != event_notify->bit_depth) {
inst->bit_depth = event_notify->bit_depth;
ptr[2] |= V4L2_EVENT_BITDEPTH_FLAG;
ptr[3] = inst->bit_depth;
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
dprintk(VIDC_DBG,
"V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT due to bit-depth change\n");
}
if (inst->pic_struct != event_notify->pic_struct) {
inst->pic_struct = event_notify->pic_struct;
event = V4L2_EVENT_SEQ_CHANGED_INSUFFICIENT;
ptr[2] |= V4L2_EVENT_PICSTRUCT_FLAG;
ptr[4] = inst->pic_struct;
dprintk(VIDC_DBG,
"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) {

View file

@ -297,6 +297,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;

View file

@ -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 {

View file

@ -293,6 +293,8 @@ struct hfi_buffer_info {
(HFI_PROPERTY_PARAM_VDEC_COMMON_START + 0x007)
#define HFI_PROPERTY_PARAM_VDEC_PIC_STRUCT \
(HFI_PROPERTY_PARAM_VDEC_COMMON_START + 0x009)
#define HFI_PROPERTY_PARAM_VDEC_COLOUR_SPACE \
(HFI_PROPERTY_PARAM_VDEC_COMMON_START + 0x00A)
#define HFI_PROPERTY_CONFIG_VDEC_COMMON_START \
@ -435,6 +437,10 @@ struct hfi_bitrate {
u32 layer_id;
};
struct hfi_colour_space {
u32 colour_space;
};
#define HFI_CAPABILITY_FRAME_WIDTH (HFI_COMMON_BASE + 0x1)
#define HFI_CAPABILITY_FRAME_HEIGHT (HFI_COMMON_BASE + 0x2)
#define HFI_CAPABILITY_MBS_PER_FRAME (HFI_COMMON_BASE + 0x3)

View file

@ -2161,6 +2161,7 @@ struct v4l2_streamparm {
#define V4L2_EVENT_BITDEPTH_FLAG 0x1
#define V4L2_EVENT_PICSTRUCT_FLAG 0x2
#define V4L2_EVENT_COLOUR_SPACE_FLAG 0x4
#define V4L2_EVENT_MSM_VIDC_START (V4L2_EVENT_PRIVATE_START + 0x00001000)
#define V4L2_EVENT_MSM_VIDC_FLUSH_DONE (V4L2_EVENT_MSM_VIDC_START + 1)