Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp528892imm; Wed, 18 Jul 2018 06:28:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdkC8wutM23xDXzuMwD4M/RobbyXmL/U/w03jXgQbsGSXd5esSBV32NgorN5t7xKJiAGxY3 X-Received: by 2002:a63:f45:: with SMTP id 5-v6mr5943824pgp.447.1531920527985; Wed, 18 Jul 2018 06:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531920527; cv=none; d=google.com; s=arc-20160816; b=Yrs0AV43mAfDv2dM6IYShh4R8K+RUYm01cvoA9IX8KHy5p6DEzPFJoJrXH5l0ZOgIW +2eDw6bal2fB2qlD6rLqhBHD4ZZteZurTLaOH9ehFffX2NojzxUGEjefeas9PST/Beok HLCugFL9DkyvkHw1rSxeeBvtBRQEdyZCx/8QMQbvgwYCfUeTgKyR3FARDyBkgYFesGYe 89UtexYoAENGpueY16hvu0WrNKmGK+bYOrM0vuIvSItJ/jOyDDD8POXsccXmu2eX/UuX 4K0C2nzh38pewwf8wKyYJCvO8X5+rbaZ4VgvldwGJx4zDEO5cYO7mbM7ZxZQ285pWqrO ivSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:dkim-signature :arc-authentication-results; bh=FrxFjTF1SSvDnNRrUqEvEiWrVmxNXVkcHmzFPcgzoLM=; b=UviwGY/a/D5NJyDIJi5xIkTkqivQm/A4m+ucKMOlo8k2nQto/pECYpCn77hJRsqC9b pRZP3nGeNNIqxFHqaH3uWassDN7MGSnvqGlliVVJ24EIry89IhjpdlniQR/iqmiIlKid 1S7JaZ1lXLRq9vhNCah8D/FhklA/eqz/oXj2hnFqU+yQENF0DQZZYk06seHwYFZvTxmN 1HSoC6NQR51Yw/+gNRiTKeSjix/BELfOpBNsZWud47Iz5w3soOu+iwETN6zDi4PJN7pZ eQn6+wrwTIPeRjw+9ty/znp0t2b5Ra9PRh2ycmQK9EhKeb4O51LT+nyKakGyZo2tmwcI hUbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b=QUcGPe6F; 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 34-v6si3278406plc.346.2018.07.18.06.28.32; Wed, 18 Jul 2018 06:28:47 -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; dkim=pass header.i=@ndufresne-ca.20150623.gappssmtp.com header.s=20150623 header.b=QUcGPe6F; 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 S1731416AbeGROEt (ORCPT + 99 others); Wed, 18 Jul 2018 10:04:49 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:36799 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731104AbeGROEs (ORCPT ); Wed, 18 Jul 2018 10:04:48 -0400 Received: by mail-qt0-f195.google.com with SMTP id t5-v6so3961697qtn.3 for ; Wed, 18 Jul 2018 06:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version; bh=FrxFjTF1SSvDnNRrUqEvEiWrVmxNXVkcHmzFPcgzoLM=; b=QUcGPe6FgZG+A4pPcYPIlpYDZMKGCE80DpoxKK1oTyYfoaXtUOkyvG3T5VRCSD0FCV DTLjYrMnp1yv0muV6rFJ9i8Ivl5XlRR6stVDRO7t6iLi6v2nnyieg7W+zv4mxkXDw57a H6ony26b7NL6baxv4LnvuUyH7Id4NuGyrpJ0WJXMOOo/BdyvzmMsBBXSKLCeJ/PAyXYh hjf5Cl1RxcpNk1cUo2/CiJrTsmP/pbDNESUOehJOUOpEgQSobDS6TkAGhRtVxpvR2cjq zjrnPykbQ9u1rIGG3H90dEQ2QiUSppvGB+hPRUXNeJlopPE0cXKT0Dv9jh8Su04bfBhm CKZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version; bh=FrxFjTF1SSvDnNRrUqEvEiWrVmxNXVkcHmzFPcgzoLM=; b=lpunhuu5RGH4X1OPPWFdTGREUGC2QUlw7eJreiiTc6EIJQIw2B6MHnYNvVJOXmF9cq bHOcETr2ICdaYoy/5xzwt1BWGjZfnTIF2TvWiGTwrRqE+NdjP7YLQIgsp9n9YI9DOjRn tJf/KmUET7zczCdw2zkBnVJEp2ibA8MckoRoKVhHfZYws3iekau5HI+ObFpvYPlOppuR wR4hO0f/OU0TEGTdnqao+/GzzJR8ze5qGFq3NJ+V8BdIR1oxEpmlwyMan4bdZLdfJmgH ZvV0vXRQ9Y4uVIy1F0MM6eo9JHWGdLbfwRHSJMHl0flS+O5xKjgVPU1ZVq5gFUmcurkl M4CQ== X-Gm-Message-State: AOUpUlFwXZuzgkd6WJAd58BeP0Qx37RQtjrLk/TYBA1xvuwW1d71k3qM WVYcmduMcmauKs5eDynvobauyQ== X-Received: by 2002:aed:22ae:: with SMTP id p43-v6mr5588303qtc.393.1531920412201; Wed, 18 Jul 2018 06:26:52 -0700 (PDT) Received: from tpx230-nicolas (modemcable154.55-37-24.static.videotron.ca. [24.37.55.154]) by smtp.gmail.com with ESMTPSA id y142-v6sm3174252qka.5.2018.07.18.06.26.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Jul 2018 06:26:50 -0700 (PDT) Message-ID: <4ce55726d810e308a2cae3f84bca7140bed48c7d.camel@ndufresne.ca> Subject: Re: [PATCH] venus: vdec: fix decoded data size From: Nicolas Dufresne To: Stanimir Varbanov , Vikash Garodia Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, acourbot@chromium.org Date: Wed, 18 Jul 2018 09:26:49 -0400 In-Reply-To: <01451f8e-aea3-b276-cb01-b0666a837d62@linaro.org> References: <1530517447-29296-1-git-send-email-vgarodia@codeaurora.org> <01451f8e-aea3-b276-cb01-b0666a837d62@linaro.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-fKYfImwMbR0HkN/Oa7w8" X-Mailer: Evolution 3.28.3 (3.28.3-1.fc28) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-fKYfImwMbR0HkN/Oa7w8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le mercredi 18 juillet 2018 =C3=A0 14:31 +0300, Stanimir Varbanov a =C3=A9c= rit : > Hi Vikash, >=20 > 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. > >=20 > > Change-Id: Ie6f3429c0cb23f682544748d181fa4fa63ca2e28 > > Signed-off-by: Vikash Garodia > > --- > > drivers/media/platform/qcom/venus/vdec.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > 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, > > =20 > > vb =3D &vbuf->vb2_buf; > > vb->planes[0].bytesused =3D > > - max_t(unsigned int, opb_sz, bytesused); > > + min_t(unsigned int, opb_sz, bytesused); >=20 > Most probably my intension was to avoid bytesused =3D=3D 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. >=20 > Could you drop min/max_t macros at all and use bytesused directly > i.e. >=20 > vb2_set_plane_payload(vb, 0, bytesused) --=-fKYfImwMbR0HkN/Oa7w8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSScpfJiL+hb5vvd45xUwItrAaoHAUCW09AGQAKCRBxUwItrAao HM7XAKDWXjbEjj3x65ftmCkFjkZXJJv/lwCfZf8yTBfGAvNVjUwn/e4272azGSw= =jRgp -----END PGP SIGNATURE----- --=-fKYfImwMbR0HkN/Oa7w8--