Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +12 −4 Original line number Original line Diff line number Diff line Loading @@ -6300,6 +6300,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, struct msm_vidc_buffer *temp; struct msm_vidc_buffer *temp; bool found = false; bool found = false; int i = 0; int i = 0; u32 planes[VIDEO_MAX_PLANES] = {0}; mutex_lock(&inst->flush_lock); mutex_lock(&inst->flush_lock); mutex_lock(&inst->registeredbufs.lock); mutex_lock(&inst->registeredbufs.lock); Loading @@ -6313,6 +6314,10 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, } } } } if (found) { if (found) { /* save device_addr */ for (i = 0; i < mbuf->vvb.vb2_buf.num_planes; i++) planes[i] = mbuf->smem[i].device_addr; /* send RBR event to client */ /* send RBR event to client */ msm_vidc_queue_rbr_event(inst, msm_vidc_queue_rbr_event(inst, mbuf->vvb.vb2_buf.planes[0].m.fd, mbuf->vvb.vb2_buf.planes[0].m.fd, Loading @@ -6330,6 +6335,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, if (!mbuf->smem[0].refcount) { if (!mbuf->smem[0].refcount) { list_del(&mbuf->list); list_del(&mbuf->list); kref_put_mbuf(mbuf); kref_put_mbuf(mbuf); mbuf = NULL; } } } else { } else { print_vidc_buffer(VIDC_ERR, "mbuf not found", inst, mbuf); print_vidc_buffer(VIDC_ERR, "mbuf not found", inst, mbuf); Loading @@ -6347,8 +6353,8 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, */ */ found = false; found = false; list_for_each_entry(temp, &inst->registeredbufs.list, list) { list_for_each_entry(temp, &inst->registeredbufs.list, list) { if (msm_comm_compare_vb2_plane(inst, mbuf, if (msm_comm_compare_device_plane(temp, planes, 0)) { &temp->vvb.vb2_buf, 0)) { mbuf = temp; found = true; found = true; break; break; } } Loading @@ -6368,9 +6374,11 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, /* don't queue the buffer */ /* don't queue the buffer */ found = false; found = false; } } /* clear DEFERRED flag, if any, as the buffer is going to be queued */ /* clear required flags as the buffer is going to be queued */ if (found) if (found) { mbuf->flags &= ~MSM_VIDC_FLAG_DEFERRED; mbuf->flags &= ~MSM_VIDC_FLAG_DEFERRED; mbuf->flags &= ~MSM_VIDC_FLAG_RBR_PENDING; } unlock: unlock: mutex_unlock(&inst->registeredbufs.lock); mutex_unlock(&inst->registeredbufs.lock); Loading Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +12 −4 Original line number Original line Diff line number Diff line Loading @@ -6300,6 +6300,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, struct msm_vidc_buffer *temp; struct msm_vidc_buffer *temp; bool found = false; bool found = false; int i = 0; int i = 0; u32 planes[VIDEO_MAX_PLANES] = {0}; mutex_lock(&inst->flush_lock); mutex_lock(&inst->flush_lock); mutex_lock(&inst->registeredbufs.lock); mutex_lock(&inst->registeredbufs.lock); Loading @@ -6313,6 +6314,10 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, } } } } if (found) { if (found) { /* save device_addr */ for (i = 0; i < mbuf->vvb.vb2_buf.num_planes; i++) planes[i] = mbuf->smem[i].device_addr; /* send RBR event to client */ /* send RBR event to client */ msm_vidc_queue_rbr_event(inst, msm_vidc_queue_rbr_event(inst, mbuf->vvb.vb2_buf.planes[0].m.fd, mbuf->vvb.vb2_buf.planes[0].m.fd, Loading @@ -6330,6 +6335,7 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, if (!mbuf->smem[0].refcount) { if (!mbuf->smem[0].refcount) { list_del(&mbuf->list); list_del(&mbuf->list); kref_put_mbuf(mbuf); kref_put_mbuf(mbuf); mbuf = NULL; } } } else { } else { print_vidc_buffer(VIDC_ERR, "mbuf not found", inst, mbuf); print_vidc_buffer(VIDC_ERR, "mbuf not found", inst, mbuf); Loading @@ -6347,8 +6353,8 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, */ */ found = false; found = false; list_for_each_entry(temp, &inst->registeredbufs.list, list) { list_for_each_entry(temp, &inst->registeredbufs.list, list) { if (msm_comm_compare_vb2_plane(inst, mbuf, if (msm_comm_compare_device_plane(temp, planes, 0)) { &temp->vvb.vb2_buf, 0)) { mbuf = temp; found = true; found = true; break; break; } } Loading @@ -6368,9 +6374,11 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, /* don't queue the buffer */ /* don't queue the buffer */ found = false; found = false; } } /* clear DEFERRED flag, if any, as the buffer is going to be queued */ /* clear required flags as the buffer is going to be queued */ if (found) if (found) { mbuf->flags &= ~MSM_VIDC_FLAG_DEFERRED; mbuf->flags &= ~MSM_VIDC_FLAG_DEFERRED; mbuf->flags &= ~MSM_VIDC_FLAG_RBR_PENDING; } unlock: unlock: mutex_unlock(&inst->registeredbufs.lock); mutex_unlock(&inst->registeredbufs.lock); Loading