|
@@ -4110,7 +4110,7 @@ int msm_vidc_release_internal_buffers(struct msm_vidc_inst *inst,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
|
|
|
|
|
|
+int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
|
|
struct msm_vidc_buffer *buf)
|
|
struct msm_vidc_buffer *buf)
|
|
{
|
|
{
|
|
int type, port, state;
|
|
int type, port, state;
|
|
@@ -4177,56 +4177,6 @@ static int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int msm_vidc_v4l2_buffer_event(struct msm_vidc_inst *inst,
|
|
|
|
- struct msm_vidc_buffer *buf)
|
|
|
|
-{
|
|
|
|
- int rc = 0;
|
|
|
|
- struct v4l2_event event = {0};
|
|
|
|
- struct v4l2_event_vidc_metadata *event_data = NULL;
|
|
|
|
-
|
|
|
|
- if (!inst || !buf) {
|
|
|
|
- d_vpr_e("%s: invalid params\n", __func__);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (buf->type != MSM_VIDC_BUF_INPUT_META) {
|
|
|
|
- i_vpr_e(inst, "%s: unsupported buffer type %s\n",
|
|
|
|
- __func__, buf_name(buf->type));
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- event.type = V4L2_EVENT_VIDC_METADATA;
|
|
|
|
- event_data = (struct v4l2_event_vidc_metadata *)event.u.data;
|
|
|
|
- event_data->type = INPUT_META_PLANE;
|
|
|
|
- event_data->fd = buf->fd;
|
|
|
|
- event_data->index = buf->index;
|
|
|
|
- event_data->bytesused = buf->data_size;
|
|
|
|
- event_data->offset = buf->data_offset;
|
|
|
|
-
|
|
|
|
- v4l2_event_queue_fh(&inst->event_handler, &event);
|
|
|
|
-
|
|
|
|
- return rc;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int msm_vidc_buffer_done(struct msm_vidc_inst *inst,
|
|
|
|
- struct msm_vidc_buffer *buf)
|
|
|
|
-{
|
|
|
|
- if (!inst || !inst->capabilities || !buf) {
|
|
|
|
- d_vpr_e("%s: invalid params\n", __func__);
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (buf->type == MSM_VIDC_BUF_INPUT_META &&
|
|
|
|
- inst->capabilities->cap[INPUT_META_VIA_REQUEST].value) {
|
|
|
|
- if (is_meta_rx_inp_enabled(inst, META_OUTBUF_FENCE))
|
|
|
|
- return msm_vidc_v4l2_buffer_event(inst, buf);
|
|
|
|
- } else {
|
|
|
|
- return msm_vidc_vb2_buffer_done(inst, buf);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
int msm_vidc_event_queue_init(struct msm_vidc_inst *inst)
|
|
int msm_vidc_event_queue_init(struct msm_vidc_inst *inst)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|
|
@@ -5612,7 +5562,7 @@ int msm_vidc_flush_buffers(struct msm_vidc_inst *inst,
|
|
buf->attr & MSM_VIDC_ATTR_DEFERRED) {
|
|
buf->attr & MSM_VIDC_ATTR_DEFERRED) {
|
|
print_vidc_buffer(VIDC_HIGH, "high", "flushing buffer", inst, buf);
|
|
print_vidc_buffer(VIDC_HIGH, "high", "flushing buffer", inst, buf);
|
|
if (!(buf->attr & MSM_VIDC_ATTR_BUFFER_DONE))
|
|
if (!(buf->attr & MSM_VIDC_ATTR_BUFFER_DONE))
|
|
- msm_vidc_buffer_done(inst, buf);
|
|
|
|
|
|
+ msm_vidc_vb2_buffer_done(inst, buf);
|
|
msm_vidc_put_driver_buf(inst, buf);
|
|
msm_vidc_put_driver_buf(inst, buf);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -5757,7 +5707,7 @@ void msm_vidc_destroy_buffers(struct msm_vidc_inst *inst)
|
|
list_for_each_entry_safe(buf, dummy, &buffers->list, list) {
|
|
list_for_each_entry_safe(buf, dummy, &buffers->list, list) {
|
|
print_vidc_buffer(VIDC_ERR, "err ", "destroying ", inst, buf);
|
|
print_vidc_buffer(VIDC_ERR, "err ", "destroying ", inst, buf);
|
|
if (!(buf->attr & MSM_VIDC_ATTR_BUFFER_DONE))
|
|
if (!(buf->attr & MSM_VIDC_ATTR_BUFFER_DONE))
|
|
- msm_vidc_buffer_done(inst, buf);
|
|
|
|
|
|
+ msm_vidc_vb2_buffer_done(inst, buf);
|
|
msm_vidc_put_driver_buf(inst, buf);
|
|
msm_vidc_put_driver_buf(inst, buf);
|
|
}
|
|
}
|
|
msm_vidc_unmap_buffers(inst, ext_buf_types[i]);
|
|
msm_vidc_unmap_buffers(inst, ext_buf_types[i]);
|