Merge "msm: vidc: Compare ion_handles rather than fds"
This commit is contained in:
commit
019b7d0c64
1 changed files with 11 additions and 11 deletions
|
@ -242,8 +242,7 @@ err_invalid_input:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct msm_smem *get_same_fd_buffer(struct msm_vidc_list *buf_list,
|
||||
int fd)
|
||||
static struct msm_smem *get_same_fd_buffer(struct msm_vidc_inst *inst, int fd)
|
||||
{
|
||||
struct buffer_info *temp;
|
||||
struct msm_smem *same_fd_handle = NULL;
|
||||
|
@ -253,16 +252,18 @@ static struct msm_smem *get_same_fd_buffer(struct msm_vidc_list *buf_list,
|
|||
if (!fd)
|
||||
return NULL;
|
||||
|
||||
if (!buf_list || fd < 0) {
|
||||
dprintk(VIDC_ERR, "Invalid input\n");
|
||||
if (!inst || fd < 0) {
|
||||
dprintk(VIDC_ERR, "%s: Invalid input\n", __func__);
|
||||
goto err_invalid_input;
|
||||
}
|
||||
|
||||
mutex_lock(&buf_list->lock);
|
||||
list_for_each_entry(temp, &buf_list->list, list) {
|
||||
mutex_lock(&inst->registeredbufs.lock);
|
||||
list_for_each_entry(temp, &inst->registeredbufs.list, list) {
|
||||
for (i = 0; i < min(temp->num_planes, VIDEO_MAX_PLANES); i++) {
|
||||
if (temp->fd[i] == fd &&
|
||||
temp->handle[i] && temp->mapped[i]) {
|
||||
bool ion_hndl_matches = temp->handle[i] ?
|
||||
msm_smem_compare_buffers(inst->mem_client, fd,
|
||||
temp->handle[i]->smem_priv) : false;
|
||||
if (ion_hndl_matches && temp->mapped[i]) {
|
||||
temp->same_fd_ref[i]++;
|
||||
dprintk(VIDC_INFO,
|
||||
"Found same fd buffer\n");
|
||||
|
@ -273,7 +274,7 @@ static struct msm_smem *get_same_fd_buffer(struct msm_vidc_list *buf_list,
|
|||
if (same_fd_handle)
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&buf_list->lock);
|
||||
mutex_unlock(&inst->registeredbufs.lock);
|
||||
|
||||
err_invalid_input:
|
||||
return same_fd_handle;
|
||||
|
@ -487,8 +488,7 @@ int map_and_register_buf(struct msm_vidc_inst *inst, struct v4l2_buffer *b)
|
|||
}
|
||||
|
||||
same_fd_handle = get_same_fd_buffer(
|
||||
&inst->registeredbufs,
|
||||
b->m.planes[i].reserved[0]);
|
||||
inst, b->m.planes[i].reserved[0]);
|
||||
|
||||
populate_buf_info(binfo, b, i);
|
||||
if (same_fd_handle) {
|
||||
|
|
Loading…
Add table
Reference in a new issue