Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp603428imm; Wed, 18 Jul 2018 07:39:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeUNy0ot3bCRNy9T5IDyPl74NF64bKQdBq/Pi4NMdaoLZ9zbWhuxK6Bawtd1VW3PYgRhbSL X-Received: by 2002:a62:a3d1:: with SMTP id q78-v6mr5436621pfl.5.1531924772891; Wed, 18 Jul 2018 07:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531924772; cv=none; d=google.com; s=arc-20160816; b=wiB/bDi6OOzMKPSb0YwWGCeQt7u1nSy89GSSWAnVix94PJvAbIUWTE3GRx67FbCQdz V4KD/hcYg8sADoanpDdLFENk66+9dh0DjjD5PbHhi++9cMfGeHDA7m+jKnncLkyw7hDq 1QuJh3TA03F1WKdGurPsLz+E33w/NSb8WfTMPvax5HVJAXEb57bllb1oQRKNv5hv4BLh 0VpLkh9vCbrHDB5jlkc9hLy+CaBujMHK+ejj5fCn6mwPf271Gulnic58ELFM4WWpSlVY aBRsbo5EvBF/1Ck0Bx3mki7o6gdxf8giajdn4UWzh7EQHWP8lb/FC+BJ3HObmUcYTmk+ 7ZRg== 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:dkim-signature :arc-authentication-results; bh=pXv0CfQkEqOIcCPtFbyw9ZmnTtcYZsXptCyHB2MrQY4=; b=u03/dahgnr3murRkrBL09sQHHMqhUpzDzBwPxtBdKTu/9WxHUAu2IcYxa4tKOxeJDp BP94gmy/42AztibPNG9n3TrOlTx4L57bFEZ9zlu+ZG0oYs6h6cOpvMWDOgLPXyhxaH4o R0VvvTc88cxgEvghXylREcf0/Ig8NHTYGUBcO/Hklr4r5Dxngocc/ExvmOVhFPP1bZtt f8keKv3yWipCSr+YMDZ8CmJF3ZeV21u4D2L4/1uLdJcOfmt6Gx3TalLwlo5fx40AEAle yLcDUcb6TiJ8efnm4z74ZxJ6hYaJo6GFYmgHvqNklmiP8GQv9JqPbMLTcL7FNYpvDYCA e4ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O+seIFOW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92-v6si3257433plw.102.2018.07.18.07.39.17; Wed, 18 Jul 2018 07:39:32 -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=@linaro.org header.s=google header.b=O+seIFOW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730745AbeGRPQO (ORCPT + 99 others); Wed, 18 Jul 2018 11:16:14 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39911 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730514AbeGRPQN (ORCPT ); Wed, 18 Jul 2018 11:16:13 -0400 Received: by mail-wr1-f67.google.com with SMTP id h10-v6so4931338wre.6 for ; Wed, 18 Jul 2018 07:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pXv0CfQkEqOIcCPtFbyw9ZmnTtcYZsXptCyHB2MrQY4=; b=O+seIFOWuxlIX9KE6Qglnce3IwWjjezGJixV+9b6wLj7ZgedCtsH7lAvxas/jkTgKu wi1GKxLEAS608cGDUZ3yQQNlObr+lus+YpTuTPyQWjGSTLBJmD3GsOXinyiRCY5s21JG Rk3S9rqrty/0TGSRkW3jCblE8qazDpZcHVa6s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pXv0CfQkEqOIcCPtFbyw9ZmnTtcYZsXptCyHB2MrQY4=; b=m5vnbYA3LTi1FJwYKVkyrEmuR8w5+qmn/0Bg0MzUEeG8bEYhhQAXqUXvMcz1HJpV0w ua5AhL1gxUnGb/mWqWi5tmHo+ry6SU147BfjH+J0wbBx1sfKWCdnMINLom34VmuMbk/D +bbm5SK6U8hm3O98JidtMfnDRdPRPDiZQocwWeTY7e2c5YOtLPyQXlZiuDiiTvZGGG2L jHCNb8253xAvfH7spuOMZTGxqGxEIqqxmQO5KolUbaxW3CHaJ7jQAPo6vcslxn55jcyB jjZu7Pt+XWzS2OHYTQGIwtcqg+cx4zMiwrnCC1IKpYk4jNaYq2niRGtqRHLVxNrPb9RX iF2A== X-Gm-Message-State: AOUpUlGsoGVkU/Vesg0djjseS+GM9QtTYpfNDa0fPmC5Q9gNwd+9TbYS zWVNB8SJUYbaF1znjMhlSYx97l5AIns= X-Received: by 2002:adf:8806:: with SMTP id d6-v6mr4530060wrd.41.1531924679672; Wed, 18 Jul 2018 07:37:59 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id i4-v6sm1882840wmf.4.2018.07.18.07.37.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 07:37:58 -0700 (PDT) Subject: Re: [PATCH] venus: vdec: fix decoded data size To: 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> From: Stanimir Varbanov Message-ID: <92f6f79a-02ae-d23e-1b97-fc41fd921c89@linaro.org> Date: Wed, 18 Jul 2018 17:37:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <4ce55726d810e308a2cae3f84bca7140bed48c7d.camel@ndufresne.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- regards, Stan