Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3772392imm; Mon, 17 Sep 2018 03:01:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZwWXEVcw86klED0qv17q79qEZVqfxKM9z0lihai1ev8b76dLC7o1FDEtGqagS08r66/Rve X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr24389651plp.212.1537178462411; Mon, 17 Sep 2018 03:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537178462; cv=none; d=google.com; s=arc-20160816; b=XSVBU2wXDyOBoAUqTOgt5DhlL3HExgwC2IeKfKTugbXS0Dtj+l8blSdvljEFW2yza8 UbnhSAfBp5RYj4W96w7ga/amL5AUHd2mRidmYmyNqAbtU1hH3bQ+OQMCqt8uK5k4JJyy oPcMp7RhWNGTEZBzEBxTs5+yeQEcCyPwPv/hNmtNgrS6fbBlS1e7+sEV01TWI+uCkk91 jTsUnuiaCoBDsnJGiFyz6ph65X/LyCKt55//ADdKo2IlxSUugOPPoPhnwrlVM4MDREPo xlaZGjAJDFM01jZ9XyyLm7zqmSInQz3k/clRqGZsFVrV7YRekw6Goo656gK7RbhoEwXp 6BpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=r/bahqkpGr+//pyekrWVhSoJHkOP4Kn5LBK8ujez570=; b=SMJ9XCB3fFyYUrRMf0flvwiSL/ilT3NGs02COOf6OliWAo1RcslQ6zYFP9Jvo07+yy V2vFr9MAhgsAvhvhfx5lG085kUsZDuQchGg2/ScGfIwjPdCQeY8/K2djx5IEX05xebkf iUSKUOYwYWjd0fpGtzjWEuQGdAgHfGfqw4VT0ABKDPN+7Q7GVeDCqTR7LolNnyEmWoRO aPicHw44xVJ8NaZ6kEX0lyVXVypsq/WQwSpdljr4amlF0H3Iu/dP3VrH35o2phY5oYiI ngZuHvW+j1OAOkP4pmoR9UOyybay3Rajn6KJ29TVqsiTJFTuBTLDle0qRHvLVVXH06bn k2bA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si14788579plv.26.2018.09.17.03.00.45; Mon, 17 Sep 2018 03:01:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727299AbeIQP1V (ORCPT + 99 others); Mon, 17 Sep 2018 11:27:21 -0400 Received: from lb2-smtp-cloud9.xs4all.net ([194.109.24.26]:58714 "EHLO lb2-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbeIQP1V (ORCPT ); Mon, 17 Sep 2018 11:27:21 -0400 Received: from [192.168.2.10] ([212.251.195.8]) by smtp-cloud9.xs4all.net with ESMTPA id 1qKYg1Mj5bst71qKcgIbl7; Mon, 17 Sep 2018 12:00:39 +0200 Subject: Re: [PATCH] venus: vdec: fix decoded data size To: Stanimir Varbanov , Nicolas Dufresne , Vikash Garodia Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, acourbot@chromium.org References: <1530517447-29296-1-git-send-email-vgarodia@codeaurora.org> <01451f8e-aea3-b276-cb01-b0666a837d62@linaro.org> <4ce55726d810e308a2cae3f84bca7140bed48c7d.camel@ndufresne.ca> <92f6f79a-02ae-d23e-1b97-fc41fd921c89@linaro.org> From: Hans Verkuil Message-ID: <33e8d8e3-138e-0031-5b75-4bef114ac75e@xs4all.nl> Date: Mon, 17 Sep 2018 12:00:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <92f6f79a-02ae-d23e-1b97-fc41fd921c89@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfNw9N23E14kAc78KUWTCG2Apl3L3gmubVIowJjFuYohNIpopzfwTcgNvv3vDFsIxTeoUoEGYMLpPREtPsjZlinwzBlus8lI9zTDI9mr2jIo9OvI0E4hz Dx3gF0SuVP1y+6Euae9ouIgwp9Vzu2jk2KX6wQh0UpasxIi9lEoeJu2/Vcbq/cHuDe7mY8YBzo761kGtk9758GEa/mNIcg71MNbZ2c5d3+WZjRWCY65391PC 5DVTjzAdFM7h1tyxSC2GEssOigDc50CDe5XPEO/ahy3IQiGf+L7h/HSQmuQlbaelF+2kdxDMjndB/TmMVkTs8SZhFQrzWVS3cU4UO20n8JTXD2vfLfZfuZ8y y1wVwJG2GpNjjRlFbfP2R4SUvRUbIFjmHj1fsFnM+0quPp9b85cmeLN4JBmuRlIe7dC5ZS8M Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/18/2018 04:37 PM, Stanimir Varbanov wrote: > Hi, > > On 07/18/2018 04:26 PM, Nicolas Dufresne wrote: >> Le mercredi 18 juillet 2018 à 14:31 +0300, Stanimir Varbanov a écrit : >>> Hi Vikash, >>> >>> On 07/02/2018 10:44 AM, Vikash Garodia wrote: >>>> Exisiting code returns the max of the decoded >>>> size and buffer size. It turns out that buffer >>>> size is always greater due to hardware alignment >>>> requirement. As a result, payload size given to >>>> client is incorrect. This change ensures that >>>> the bytesused is assigned to actual payload size. >>>> >>>> Change-Id: Ie6f3429c0cb23f682544748d181fa4fa63ca2e28 >>>> Signed-off-by: Vikash Garodia >>>> --- >>>> drivers/media/platform/qcom/venus/vdec.c | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/media/platform/qcom/venus/vdec.c >>>> b/drivers/media/platform/qcom/venus/vdec.c >>>> index d079aeb..ada1d2f 100644 >>>> --- a/drivers/media/platform/qcom/venus/vdec.c >>>> +++ b/drivers/media/platform/qcom/venus/vdec.c >>>> @@ -890,7 +890,7 @@ static void vdec_buf_done(struct venus_inst >>>> *inst, unsigned int buf_type, >>>> >>>> vb = &vbuf->vb2_buf; >>>> vb->planes[0].bytesused = >>>> - max_t(unsigned int, opb_sz, bytesused); >>>> + min_t(unsigned int, opb_sz, bytesused); >>> >>> Most probably my intension was to avoid bytesused == 0, but that is >>> allowed from v4l2 driver -> userspace direction >> >> It remains bad practice since it was used by decoders to indicate the >> last buffer. Some userspace (some GStreamer versions) will stop working >> if you start returning 0. > > I think it is legal v4l2 driver to return bytesused = 0 when userspace > issues streamoff on both queues before EOS, no? Simply because the > capture buffers are empty. > Going through some of the older pending patches I found this one: So is this patch right or wrong? It's not clear to me. Regards, Hans