public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Kamil Debski <k.debski@samsung.com>
To: 'ayaka' <ayaka@soulik.info>, linux-media@vger.kernel.org
Cc: kyungmin.park@samsung.com, jtp.park@samsung.com, m.chehab@samsung.com
Subject: RE: [PATCH] s5p-mfc: encoder could free buffers
Date: Thu, 03 Jul 2014 17:13:10 +0200	[thread overview]
Message-ID: <0bc901cf96d1$4dabf500$e903df00$%debski@samsung.com> (raw)
In-Reply-To: <53AC2ACA.7080106@soulik.info>

Hi Ayaka,

Thank you for your patch, however I see some things that need to be
corrected.

> From: linux-media-owner@vger.kernel.org [mailto:linux-media-
> owner@vger.kernel.org] On Behalf Of ayaka
> Sent: Thursday, June 26, 2014 4:15 PM
> To: linux-media@vger.kernel.org
> Cc: kyungmin.park@samsung.com; jtp.park@samsung.com;
> m.chehab@samsung.com
> Subject: [PATCH] s5p-mfc: encoder could free buffers
> 
> [PATCH] s5p-mfc: encoder could free buffers

The above line is not necessary.

> 
> The patch is necessary or the buffers could be freeed but it would

Typo - should be "freed"

> break the state of encoder in s5p-mfc. It is also need by some
> application which would detect the buffer allocation way, like
> gstreamer.

I would rephrase the whole commit message. Maybe something along the lines
"Add handling of buffer freeing reqbufs request to the encoder of s5p-mfc."

> ---
> drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 8 ++++++++
> 1 file changed, 8 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..1a7518f 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c
> @@ -1166,6 +1166,10 @@ 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");
> + return ret;
> + }

Indentation is wrong here, please correct.
Also, I think you should set ctx->capture_state to QUEUE_FREE.

> ctx->capture_state = QUEUE_BUFS_REQUESTED;
> 
> ret = s5p_mfc_hw_call(ctx->dev->mfc_ops,
> @@ -1200,6 +1204,10 @@ 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");
> + return ret;
> + }

Indentation is wrong here, please correct.
Also, I think you should set ctx->capture_state to QUEUE_FREE.

> ctx->output_state = QUEUE_BUFS_REQUESTED;
> } else {
> mfc_err("invalid buf type\n");

In addition to the above, for capture this patch will not work. The
following
check will prevent buffers from being freed:

if (ctx->capture_state != QUEUE_FREE) {
         mfc_err("invalid capture state: %d\n",
                                         ctx->capture_state);
         return -EINVAL;
 }

Also, you should provide a proper Signed-off-by with your full name and
email
address. Did you use git send-email to send this patch?

Best wishes,
-- 
Kamil Debski
Samsung R&D Institute Poland



      reply	other threads:[~2014-07-03 15:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 14:14 [PATCH] s5p-mfc: encoder could free buffers ayaka
2014-07-03 15:13 ` Kamil Debski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='0bc901cf96d1$4dabf500$e903df00$%debski@samsung.com' \
    --to=k.debski@samsung.com \
    --cc=ayaka@soulik.info \
    --cc=jtp.park@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox