Added TI patches, generated from commit 04f9d72 of the following tree:
[ubuntu-omap:gst-plugins-bad1-0.git] / debian / patches / 0037-07-12-drmbufferpool-fix-dmabuf-leak.patch
1 From 5d28904393363ff2c7ddcf90c70c95a73f7575bf Mon Sep 17 00:00:00 2001
2 From: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
3 Date: Thu, 23 Aug 2012 17:35:31 +0000
4 Subject: [PATCH 037/100] [07/12] drmbufferpool: fix dmabuf leak
5
6 As the comment in gst_drm_buffer_initialize says, gst_buffer_set_dma_buf
7 does not take ownership of the passed dmabuf, so unref it when done.
8 ---
9  gst-libs/gst/drm/gstdrmbufferpool.c |    7 +++++--
10  1 file changed, 5 insertions(+), 2 deletions(-)
11
12 diff --git a/gst-libs/gst/drm/gstdrmbufferpool.c b/gst-libs/gst/drm/gstdrmbufferpool.c
13 index 67810fb..9a4eb41 100644
14 --- a/gst-libs/gst/drm/gstdrmbufferpool.c
15 +++ b/gst-libs/gst/drm/gstdrmbufferpool.c
16 @@ -254,6 +254,8 @@ void
17  gst_drm_buffer_initialize (GstDRMBuffer * self,
18      GstDRMBufferPool * pool, struct omap_bo * bo)
19  {
20 +  GstDmaBuf *dmabuf;
21 +
22    self->bo = bo;
23  
24    GST_BUFFER_DATA (self) = omap_bo_map (self->bo);
25 @@ -263,8 +265,9 @@ gst_drm_buffer_initialize (GstDRMBuffer * self,
26     * plugins can access for zero copy hw accel:
27     */
28    // XXX buffer doesn't take ownership of the GstDmaBuf...
29 -  gst_buffer_set_dma_buf (GST_BUFFER (self),
30 -      gst_dma_buf_new (omap_bo_dmabuf (self->bo)));
31 +  dmabuf = gst_dma_buf_new (omap_bo_dmabuf (self->bo));
32 +  gst_buffer_set_dma_buf (GST_BUFFER (self), dmabuf);
33 +  gst_dma_buf_unref (dmabuf);
34  
35    gst_drm_buffer_set_pool (self, pool);
36  }
37 -- 
38 1.7.9.5
39