Message ID | 1454180017-29071-4-git-send-email-ayaka@soulik.info (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Kamil Debski |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84) (envelope-from <linux-media-owner@vger.kernel.org>) id 1aPapT-0003s5-UV; Sat, 30 Jan 2016 19:05:03 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.76/mailfrontend-7) with esmtp id 1aPapS-0007xw-0a; Sat, 30 Jan 2016 20:05:03 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751580AbcA3TEx (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Sat, 30 Jan 2016 14:04:53 -0500 Received: from kozue.soulik.info ([108.61.200.231]:40702 "EHLO kozue.soulik.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751308AbcA3TEQ (ORCPT <rfc822;linux-media@vger.kernel.org>); Sat, 30 Jan 2016 14:04:16 -0500 Received: from ritsuko.sumomo.pri (unknown [IPv6:2001:470:b30d:2::3bd]) by kozue.soulik.info (Postfix) with ESMTPA id 8A4861007C1; Sun, 31 Jan 2016 03:54:18 +0900 (JST) From: ayaka <ayaka@soulik.info> To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, k.debski@samsung.com, jtp.park@samsung.com, mchehab@osg.samsung.com, linux-arm-kernel@lists.infradead.org, ayaka <ayaka@soulik.info> Subject: [PATCH 3/4] [media] s5p-mfc: don't close instance after free OUTPUT buffers Date: Sun, 31 Jan 2016 02:53:36 +0800 Message-Id: <1454180017-29071-4-git-send-email-ayaka@soulik.info> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454180017-29071-1-git-send-email-ayaka@soulik.info> References: <1454180017-29071-1-git-send-email-ayaka@soulik.info> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.1.30.185715 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, FROM_NAME_ONE_WORD 0.05, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_1099 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, INFO_TLD 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __DATE_TZ_HK 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __INFO_FROM 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Randy Li
Jan. 30, 2016, 6:53 p.m. UTC
Free buffers in OUTPUT is quite normal to detect the driver's
buffer capacity, it doesn't mean the application want to close
that mfc instance.
Signed-off-by: ayaka <ayaka@soulik.info>
---
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 1 -
1 file changed, 1 deletion(-)
Comments
Hi, > From: ayaka [mailto:ayaka@soulik.info] > Sent: Saturday, January 30, 2016 7:54 PM > > Free buffers in OUTPUT is quite normal to detect the driver's buffer capacity, > it doesn't mean the application want to close that mfc instance. > > Signed-off-by: ayaka <ayaka@soulik.info> > --- > drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > index aebe4fd..609b17b 100644 > --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c > @@ -474,7 +474,6 @@ static int reqbufs_output(struct s5p_mfc_dev *dev, > struct s5p_mfc_ctx *ctx, > ret = vb2_reqbufs(&ctx->vq_src, reqbufs); > if (ret) > goto out; > - s5p_mfc_close_mfc_inst(dev, ctx); > ctx->src_bufs_cnt = 0; > ctx->output_state = QUEUE_FREE; > } else if (ctx->output_state == QUEUE_FREE) { What exactly do you mean by "detecting buffer capacity" ? Is it the max number of buffer that can be allocated? Anyway, if the instance is not closed, then in a consecutive call to reqbufs (with cound != 0) the instance will be opened for a second time. So either the instance has to be closed, or it should be opened in another place. Best wishes,
I reviewed the code again 2016-02-04 22:23, Kamil Debski wrote: > Hi, > >> From: ayaka [mailto:ayaka@soulik.info] >> Sent: Saturday, January 30, 2016 7:54 PM >> >> Free buffers in OUTPUT is quite normal to detect the driver's buffer > capacity, >> it doesn't mean the application want to close that mfc instance. >> >> Signed-off-by: ayaka <ayaka@soulik.info> >> --- >> drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c >> b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c >> index aebe4fd..609b17b 100644 >> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c >> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c >> @@ -474,7 +474,6 @@ static int reqbufs_output(struct s5p_mfc_dev *dev, >> struct s5p_mfc_ctx *ctx, >> ret = vb2_reqbufs(&ctx->vq_src, reqbufs); >> if (ret) >> goto out; >> - s5p_mfc_close_mfc_inst(dev, ctx); >> ctx->src_bufs_cnt = 0; >> ctx->output_state = QUEUE_FREE; >> } else if (ctx->output_state == QUEUE_FREE) { > What exactly do you mean by "detecting buffer capacity" ? Is it the max > number of buffer > that can be allocated? > > Anyway, if the instance is not closed, then in a consecutive call to reqbufs > (with cound != 0) > the instance will be opened for a second time. So either the instance has to > be closed, or Does the s5p_mfc_open_mfc_inst() open a new instance?In that case if reqbufs->count == 0, it won't open a new instance. Also before allocate buffers, it will check whether the instance has been opened. So I think the instance won't be opened twice. > it should be opened in another place. > > Best wishes, -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index aebe4fd..609b17b 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -474,7 +474,6 @@ static int reqbufs_output(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx, ret = vb2_reqbufs(&ctx->vq_src, reqbufs); if (ret) goto out; - s5p_mfc_close_mfc_inst(dev, ctx); ctx->src_bufs_cnt = 0; ctx->output_state = QUEUE_FREE; } else if (ctx->output_state == QUEUE_FREE) {