Skip to content

Commit 3af0ba7

Browse files
6by9popcornmix
authored andcommitted
staging: vc04_services: codec: Fix incorrect buffer cleanup
The allocated input and output buffers are initialised in buf_init and should only be cleared up in buf_cleanup. stop_streaming was (incorrectly) cleaning up the buffers to avoid an issue in videobuf2 that had been fixed by the orphaned buffer support. Remove the erroneous cleanup. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 72571a3 commit 3af0ba7

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

‎drivers/staging/vc04_services/bcm2835-codec/bcm2835-v4l2-codec.c‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,10 +2320,7 @@ static void bcm2835_codec_stop_streaming(struct vb2_queue *q)
23202320
struct bcm2835_codec_q_data *q_data = get_q_data(ctx, q->type);
23212321
struct vchiq_mmal_port *port = get_port_data(ctx, q->type);
23222322
struct vb2_v4l2_buffer *vbuf;
2323-
struct vb2_v4l2_buffer *vb2;
2324-
struct v4l2_m2m_buffer *m2m;
2325-
struct m2m_mmal_buffer *buf;
2326-
int ret, i;
2323+
int ret;
23272324

23282325
v4l2_dbg(1, debug, &ctx->dev->v4l2_dev, "%s: type: %d - return buffers\n",
23292326
__func__, q->type);
@@ -2363,18 +2360,6 @@ static void bcm2835_codec_stop_streaming(struct vb2_queue *q)
23632360
}
23642361
}
23652362

2366-
/*
2367-
* Release the VCSM handle here as otherwise REQBUFS(0) aborts because
2368-
* someone is using the dmabuf before giving the driver a chance to do
2369-
* anything about it.
2370-
*/
2371-
for (i = 0; i < q->num_buffers; i++) {
2372-
vb2 = to_vb2_v4l2_buffer(q->bufs[i]);
2373-
m2m = container_of(vb2, struct v4l2_m2m_buffer, vb);
2374-
buf = container_of(m2m, struct m2m_mmal_buffer, m2m);
2375-
2376-
bcm2835_codec_mmal_buf_cleanup(&buf->mmal);
2377-
}
23782363

23792364
/* If both ports disabled, then disable the component */
23802365
if (!ctx->component->input[0].enabled &&

0 commit comments

Comments
 (0)