Merge "msm: vidc: copy the crop info during dequeue buf"

This commit is contained in:
Linux Build Service Account 2018-10-03 19:20:56 -07:00 committed by Gerrit - the friendly Code Review server
commit 84c6d5be73
3 changed files with 39 additions and 0 deletions

View file

@ -1091,6 +1091,15 @@ int msm_vidc_dqbuf(void *instance, struct v4l2_buffer *b)
b->m.planes[i].m.userptr = buffer_info->uvaddr[i];
b->m.planes[i].reserved[0] = buffer_info->fd[i];
b->m.planes[i].reserved[1] = buffer_info->buff_off[i];
b->m.planes[i].reserved[2] = buffer_info->crop_data.nLeft;
b->m.planes[i].reserved[3] = buffer_info->crop_data.nTop;
b->m.planes[i].reserved[4] = buffer_info->crop_data.nWidth;
b->m.planes[i].reserved[5] = buffer_info->crop_data.nHeight;
b->m.planes[i].reserved[6] =
buffer_info->crop_data.width_height[0];
b->m.planes[i].reserved[7] =
buffer_info->crop_data.width_height[1];
if (!(inst->flags & VIDC_SECURE) && !b->m.planes[i].m.userptr) {
dprintk(VIDC_ERR,
"%s: Failed to find user virtual address, %#lx, %d, %d\n",

View file

@ -2061,6 +2061,7 @@ static void handle_fbd(enum hal_command_response cmd, void *data)
int extra_idx = 0;
int64_t time_usec = 0;
struct vb2_v4l2_buffer *vbuf = NULL;
struct buffer_info *buffer_info = NULL;
if (!response) {
dprintk(VIDC_ERR, "Invalid response from vidc_hal\n");
@ -2102,6 +2103,26 @@ static void handle_fbd(enum hal_command_response cmd, void *data)
"fbd:Overflow bytesused = %d; length = %d\n",
vb->planes[0].bytesused,
vb->planes[0].length);
buffer_info = device_to_uvaddr(&inst->registeredbufs,
fill_buf_done->packet_buffer1);
if (!buffer_info) {
dprintk(VIDC_ERR,
"%s buffer not found in registered list\n",
__func__);
return;
}
buffer_info->crop_data.nLeft = fill_buf_done->start_x_coord;
buffer_info->crop_data.nTop = fill_buf_done->start_y_coord;
buffer_info->crop_data.nWidth = fill_buf_done->frame_width;
buffer_info->crop_data.nHeight = fill_buf_done->frame_height;
buffer_info->crop_data.width_height[0] =
inst->prop.width[CAPTURE_PORT];
buffer_info->crop_data.width_height[1] =
inst->prop.height[CAPTURE_PORT];
if (!(fill_buf_done->flags1 &
HAL_BUFFERFLAG_TIMESTAMPINVALID)) {
time_usec = fill_buf_done->timestamp_hi;

View file

@ -329,6 +329,14 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst);
int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst);
void msm_vidc_queue_v4l2_event(struct msm_vidc_inst *inst, int event_type);
struct crop_info {
u32 nLeft;
u32 nTop;
u32 nWidth;
u32 nHeight;
u32 width_height[MAX_PORT_NUM];
};
struct buffer_info {
struct list_head list;
int type;
@ -348,6 +356,7 @@ struct buffer_info {
bool mapped[VIDEO_MAX_PLANES];
int same_fd_ref[VIDEO_MAX_PLANES];
struct timeval timestamp;
struct crop_info crop_data;
};
struct buffer_info *device_to_uvaddr(struct msm_vidc_list *buf_list,