public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s5p-mfc: encoder handles buffers freeing
@ 2014-07-04  3:39 ayaka
       [not found] ` <CACHYQ-qJ+seYs3pGW=4-1Y8W4zpM_Xeoaq+L8wJhVXWBiyf1_g@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: ayaka @ 2014-07-04  3:39 UTC (permalink / raw)
  To: linux-media; +Cc: k.debski, kyungmin.park, jtp.park, m.chehab, ayaka

Add handling of buffer freeing reqbufs request to the encoder of
s5p-mfc.

Signed-off-by: ayaka <ayaka@soulik.info>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
index d26b248..74fb80b 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
@@ -1166,6 +1166,11 @@ static int vidioc_reqbufs(struct file *file, void *priv,
 			mfc_err("error in vb2_reqbufs() for E(D)\n");
 			return ret;
 		}
+		if (reqbufs->count == 0) {
+			mfc_debug(2, "Freeing buffers\n");
+			ctx->capture_state = QUEUE_FREE;
+			return ret;
+		}
 		ctx->capture_state = QUEUE_BUFS_REQUESTED;
 
 		ret = s5p_mfc_hw_call(ctx->dev->mfc_ops,
@@ -1200,6 +1205,11 @@ static int vidioc_reqbufs(struct file *file, void *priv,
 			mfc_err("error in vb2_reqbufs() for E(S)\n");
 			return ret;
 		}
+		if (reqbufs->count == 0) {
+			mfc_debug(2, "Freeing buffers\n");
+			ctx->output_state = QUEUE_FREE;
+			return ret;
+		}
 		ctx->output_state = QUEUE_BUFS_REQUESTED;
 	} else {
 		mfc_err("invalid buf type\n");
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-04  4:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04  3:39 [PATCH] s5p-mfc: encoder handles buffers freeing ayaka
     [not found] ` <CACHYQ-qJ+seYs3pGW=4-1Y8W4zpM_Xeoaq+L8wJhVXWBiyf1_g@mail.gmail.com>
2014-07-04  4:34   ` ayaka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox