Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5540126imu; Mon, 26 Nov 2018 01:48:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/XWtKuOlyt3e30y9VLajQF961PqVkHyL1BeXZpv3kLLu0KkMSAZTvSIUq+hyawqywWZJOCs X-Received: by 2002:a17:902:76ca:: with SMTP id j10mr26056341plt.144.1543225684469; Mon, 26 Nov 2018 01:48:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543225684; cv=none; d=google.com; s=arc-20160816; b=1DrXD57mQ3snLOCHgo/PDUtN1Go/0x/P37ST+BV0JQtVha+WJ/xjqepQ2ZmuLEMOOj msM22MyAm54QslkS5jDr8v3oVkR4tq3rxIAf7WuKV30h4Jr1vwOyXfMR29MLwJ2BEfR3 D5I4nZTC3JtdIm0kLgOnV6JhwCwZUbMqcf6W2080gEXJacAbggHPZDarIFHiLQPMNP9/ o53Lpc103G3k0ajEnU5FuGyUm7PHn+i37JlTjxz/u3uADeJomn0ZsY0w+sIUvcV37Eqe KyxARds+CedbVdl2mH01ZZxSw6QtLgCAeeiDNkHZYpgEq5gvNHxMM8+STOi7clHXU48r A5Ww== 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; bh=vVxREeXO+PAlp7en4AnUo35LnPzIhiArPtqKtPDTvQc=; b=ga3PoGHjq8UjENvnDp3714w9Ji20JUIqzVQ08K5Uz7glaikRFromcw06CMpp+u/7rx quVghLBH7BI1pqa3JRfCOyeDcJcmnQvqyt7JOIvdcuXN7I/0Iatnn57VCf+l1SUhdYyE ffe4gtFspKc7FEF5nqP+7ENnifTccKu5gunkdxLuDa1tnldF04iYy8UCi8r1dLnP+xxH Yt5SBLASDxA5gxMsSwMVUmAMB4HexfxR7+sbqxm6tI3M2CviKvOzwMta7kPpHM9H1iCM iNDsrNhfjIHtgGnxJBD4aAtaObO5icLZ9AZU73YVCbBsmLxo0FQ4aiDVFJZnflOMdbFg 0Pug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YIdtoT5q; 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 q20si61867681pgl.268.2018.11.26.01.47.49; Mon, 26 Nov 2018 01:48:04 -0800 (PST) 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=YIdtoT5q; 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 S1726338AbeKZUjY (ORCPT + 99 others); Mon, 26 Nov 2018 15:39:24 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39207 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbeKZUjY (ORCPT ); Mon, 26 Nov 2018 15:39:24 -0500 Received: by mail-wm1-f67.google.com with SMTP id n133so813546wmd.4 for ; Mon, 26 Nov 2018 01:45:49 -0800 (PST) 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=vVxREeXO+PAlp7en4AnUo35LnPzIhiArPtqKtPDTvQc=; b=YIdtoT5qxffMjqezeD+Erf10INMxb/Y8bIepQl+prGVEzL+FXcp8PCkzuWQSAq7dIb pL+nbQITf2TUwHcMHHE2psXf9GcLrNtxwokeqmFW0J6p6huaayvVZIb9ikQffDkKzPFz I8PWg/E1rWnATTqJyK9z29ORDIGXJbfY+SPoE= 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=vVxREeXO+PAlp7en4AnUo35LnPzIhiArPtqKtPDTvQc=; b=PJpGrZnEIme3QwtR01WZhFNhgnSb7TgkLKodelOtI9gj/Ez2pMg0DetMJ2vF9AGP11 ukh3EtJIoYJok5LpUdeBdYIE9QMUAih+0PlOuZDbr7uS8N04pOQyQaS7AT2DpuYm3gXj pkR1dXTD4ZN4Frv/ruMYAjiyYYyWK1y2hD4Mc9guRRqf/Qt2X42LznTPRIM+6+dURsyR iHcpNyp2nOKH7utnCvD7WTfR1SROf3f8UK3KUXVb2RytrRu6nyizFMazdZDGmBfSXreS f8edMb5JpdMfWGOIp8AqAUjw9GRUy5ZEJ0YIkXHNI970M8+2e3pNzStyG8zYjVT4sZ/i nvCA== X-Gm-Message-State: AA+aEWY70dldrhs+09VoCN17wgr6fKsnvuImzXhCHyrYn4N1E52zAXWb nDTJRMHv0RoYxqK/g6EsFVEmVdnAihg= X-Received: by 2002:a1c:cb84:: with SMTP id b126mr20859030wmg.64.1543225548499; Mon, 26 Nov 2018 01:45:48 -0800 (PST) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id h131sm378209wmd.17.2018.11.26.01.45.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 01:45:47 -0800 (PST) Subject: Re: [PATCH] media: venus: fix reported size of 0-length buffers To: Alexandre Courbot , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20181113093048.236201-1-acourbot@chromium.org> From: Stanimir Varbanov Message-ID: Date: Mon, 26 Nov 2018 11:45:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181113093048.236201-1-acourbot@chromium.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, Thanks for the patch! On 11/13/18 11:30 AM, Alexandre Courbot wrote: > The last buffer is often signaled by an empty buffer with the > V4L2_BUF_FLAG_LAST flag set. Such buffers were returned with the > bytesused field set to the full size of the OPB, which leads > user-space to believe that the buffer actually contains useful data. Fix > this by passing the number of bytes reported used by the firmware. > > Signed-off-by: Alexandre Courbot > --- > drivers/media/platform/qcom/venus/vdec.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Acked-by: Stanimir Varbanov > > diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c > index 189ec975c6bb..282de21cf2e1 100644 > --- a/drivers/media/platform/qcom/venus/vdec.c > +++ b/drivers/media/platform/qcom/venus/vdec.c > @@ -885,10 +885,8 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type, > vbuf->field = V4L2_FIELD_NONE; > > if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { > - unsigned int opb_sz = venus_helper_get_opb_size(inst); > - > vb = &vbuf->vb2_buf; > - vb2_set_plane_payload(vb, 0, bytesused ? : opb_sz); > + vb2_set_plane_payload(vb, 0, bytesused); > vb->planes[0].data_offset = data_offset; > vb->timestamp = timestamp_us * NSEC_PER_USEC; > vbuf->sequence = inst->sequence_cap++; > -- regards, Stan