Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2540868imm; Wed, 3 Oct 2018 05:37:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV63H3YYZtEbfYkUjDmMxqteaWZcnrTzpxTGJJHQHX1RE9bOfD/MqBO/hxj5g6G0S2D59sjbk X-Received: by 2002:a63:141:: with SMTP id 62-v6mr947848pgb.406.1538570223148; Wed, 03 Oct 2018 05:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538570223; cv=none; d=google.com; s=arc-20160816; b=d1NJ3RIUJfi5i/EKwsvRAmV48lPDTTNG8SycfjqbbUApW+IHjc5EZFz+LMXF+C2R1a 3SDjqyskvEXLzKoEB5WJG8vTJunjKY5VOG1rVeFIKeluE0vxsvzpnU4qWDjjcmDogn/L pbOfwuA7d4z13WYrD4pQ8DoeO2ECBJTYXHRc5Ublav4nRhCKmSlxVYKY57rxAEB6NbT6 5E2EtuusPvlnOfeWfNHJwaHO/vv6T7gSJ87c2QLrPtlF+8MfUlSw6UYGoXBlYp1b8apM RMiL+qAD3TC3Q8Z0DaIPlM7Y+gr8iPDRhhAmkINpkD0y7p67ccnohjMCAe+ZXZSXZmQ+ r/7Q== 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=bilsBF32UJf49Wo7eYBNsxtSGvXWT7lDnqlmAQ3nyPY=; b=J6dcG7GMUj8IrRbdR+M89nngXxUQossrWbp4LGyeX5h8I+tzvJlgY18uw30na65jaD L61XuxNpBrODB8A1VtR554Ig2H3ATeQ/P1XRGPUIWSbpzpUjDfMOnxj4K/wigA8BR7cc uh3A+1BPvEvyi7Er4mPI0ft1ybpZzpU8UojSdBhSFsRS7e0IJAU0c5Rx/ua2Obu+aLD5 zaR1p1O39J9poUnNrflI5hBaem0cjl+pLCYqogTlLITSPp+09Zb3RihxVl3OCvbY7M86 7pAmnQWyut5wvvIXBnM4EcNMXgUVuBjliX9Uvn2U2mjEo4w7AYFBjP6+w8YJ90votoPv VvqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I6WaKX95; 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 d39-v6si1557437pla.41.2018.10.03.05.36.47; Wed, 03 Oct 2018 05:37:03 -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=I6WaKX95; 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 S1726807AbeJCTYz (ORCPT + 99 others); Wed, 3 Oct 2018 15:24:55 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:37254 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbeJCTYy (ORCPT ); Wed, 3 Oct 2018 15:24:54 -0400 Received: by mail-wm1-f66.google.com with SMTP id 185-v6so5496821wmt.2 for ; Wed, 03 Oct 2018 05:36:40 -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=bilsBF32UJf49Wo7eYBNsxtSGvXWT7lDnqlmAQ3nyPY=; b=I6WaKX95Q0AqkPSb7/170HcKWeIaEDYhXQl0s5hzGIn+cQomhbl+DVvNaGRCp4VhGF kuzAgvlI5IO+pANtv9X/oCxlOYLfKMajdDNMlVhv1/D+whuYIXtgxxKq3IGL7X/jowsc ECeXinJXTPY0dZa09cbyMd5q4DOATjGGFNK5M= 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=bilsBF32UJf49Wo7eYBNsxtSGvXWT7lDnqlmAQ3nyPY=; b=ZeHWBdBkWa6zp8d/HWpIu3PhJCeigPQ6L5ay+3zrsGu/FM83CL3M/omR3pBmQQFQdt 36IYQZ53MZp0mQLSKcwfjjpcDf81vHanDOw3JH1IGBO9ECRRYIwXzaqy+c2158+d0CC0 qqyq7mtG+dWFwPZDtB9l2lG+eT7qWHpooiefeSnmQ8azZbykndKUIlfMUUQAqwTisHmg DlbPlbuW1otxNZGr+rvaCd2HPW6fpigbnu6MEucVRTHx3WTdfvAh7IKkhiiPmI+ZkmGM GENe6IZiWNWIrZaeH/0SLNpzWMBJOPGZ92xzlqSf8v7aw6C9P9ppPG8h7VMjCS8De4RG wehw== X-Gm-Message-State: ABuFfoiU6QIDtar2ZjFqhga0LQ4G36eHpR/8LwhpjyVYgvXg4p4XlIuW JFjkIQHfWZUvrlHhIueAbkWx/U0ZzWU= X-Received: by 2002:a1c:2846:: with SMTP id o67-v6mr1339731wmo.60.1538570199790; Wed, 03 Oct 2018 05:36:39 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id e142-v6sm4454720wmf.20.2018.10.03.05.36.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 05:36:38 -0700 (PDT) Subject: Re: [PATCH] venus: vdec: fix decoded data size To: Vikash Garodia , hverkuil@xs4all.nl, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, acourbot@chromium.org References: <1538566221-21369-1-git-send-email-vgarodia@codeaurora.org> From: Stanimir Varbanov Message-ID: Date: Wed, 3 Oct 2018 15:36:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1538566221-21369-1-git-send-email-vgarodia@codeaurora.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 Vikash, On 10/03/2018 02:30 PM, 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, when available. > > Signed-off-by: Vikash Garodia > --- > drivers/media/platform/qcom/venus/vdec.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c > index 991e158..189ec97 100644 > --- a/drivers/media/platform/qcom/venus/vdec.c > +++ b/drivers/media/platform/qcom/venus/vdec.c > @@ -888,8 +888,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type, > unsigned int opb_sz = venus_helper_get_opb_size(inst); > > vb = &vbuf->vb2_buf; > - vb->planes[0].bytesused = > - max_t(unsigned int, opb_sz, bytesused); > + vb2_set_plane_payload(vb, 0, bytesused ? : opb_sz); > vb->planes[0].data_offset = data_offset; > vb->timestamp = timestamp_us * NSEC_PER_USEC; > vbuf->sequence = inst->sequence_cap++; > Acked-by: Stanimir Varbanov -- regards, Stan