Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp642306imm; Sat, 7 Jul 2018 05:29:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfsjbLAvt7bihtOX8b8Y5AEwCXrY5AoUPOTN/mOZlsgTS17G9KLJCU5cFwQ1jnD3JyKqixc X-Received: by 2002:a17:902:b112:: with SMTP id q18-v6mr6724plr.284.1530966550450; Sat, 07 Jul 2018 05:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530966550; cv=none; d=google.com; s=arc-20160816; b=fdWgHkLDJyJ+RL+VQtIvvDRcFZaa7x+4nxAxMj2vx5otHB3LCYIOrAzZhh97dwwWJB lBd7Xxa9vJDlZDFx/rAdFgybfF4gog0Cs14okn1MhDTPPDoS37fNaT9MwnAG779r/I5S kqUipTK1fx1P9uXigcHJWyw9Dl3z766zY2xWf70vQ/88ec8M7atC7M84m+ktEBLffprG /UOxLXWinpPkwMiyVwdO8CxlkAk+Mc/h5gNPwSHKQGd8xNtLO3o4ofDh+sGj8a3smJOB hbprJV/TUibB0cGG9ctUn1pgtWf0XFasH/Nl2Q8gDT0yXjTfim6yOFy4EcwI58KsIydo vVrA== 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=rkTrTCC9225uuwkhDpCuDmfSWEcGwOABPeLV3ei5SRQ=; b=xiJsz4MyqOymswZsIgPVQq56E6a/lpbC/nhkoFqwKFI7l3OK57Y2oLnpZRBCRHsdCZ 3Rj+IcUoJJpfZxjvtfrvnRL2qbQfkhfBTy9U45NGvWP8nF2yWvS31kynGy5QJJdDtZpN 4ZEGzIonLZcACGiKd7f/Hfg+s+lnAXyIGc03fwlGHR9Xvo99u83RLvHkHuRLEVhUamPS acfi0r/9WRUaWIRmU/S0s7pfdoLL3jXzoqPFgB7cH9X4eM7XHntDn9HQ/MuWWCeK6rq8 eCj6lcEMxk7P8QucUAAuu4OMbnautGzYSE/8+5bXY6o46eJifXe1NvSTEFtIEKPKi2gU 6kow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UJExPvpb; 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 y187-v6si10356754pfy.101.2018.07.07.05.28.27; Sat, 07 Jul 2018 05:29:10 -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=UJExPvpb; 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 S1754038AbeGGM0o (ORCPT + 99 others); Sat, 7 Jul 2018 08:26:44 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37551 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752096AbeGGM0m (ORCPT ); Sat, 7 Jul 2018 08:26:42 -0400 Received: by mail-wr1-f68.google.com with SMTP id q10-v6so6517222wrd.4 for ; Sat, 07 Jul 2018 05:26:42 -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=rkTrTCC9225uuwkhDpCuDmfSWEcGwOABPeLV3ei5SRQ=; b=UJExPvpbSpTZ1lGHmdXJiyawajBHGkOqLfZN1atB1E3MOHVmE1rhQx8DxnVoKn3I1q a9sB034KI38aa8AsryIrT5YNtgLY5vVAxz0000oBPo5PbT8JadWTRPmJl8CO9BHRFNPy ZVQdOXuLYxJbcFi9RvBFtd4vBqRuLHOYrdEwg= 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=rkTrTCC9225uuwkhDpCuDmfSWEcGwOABPeLV3ei5SRQ=; b=LikVPC+m3Tmh9xtnUZ86wOg3sr9WRtwutCprEg611M6Yqv66WS1Qabrb/DGTn5iESA kSKnOyjza3iJ8IQSb7BMqiqgM9FitOQEDV0KxYJQyXNbt3JI3MIVyzsdyZCza35BxHnq m2X4B8Kk2o5aaP72wmHcsq9pkfMHO/Ai8x6ixB/gJQ2am0//05uGwxlvAUyMQOYAd6oG FkJ3BoBHDu/sl5m87Kqe47eDPQLzEgZe6hIpz5swqTKGqotiGZ28JiHtdIvLQY0RBnmO sGWOfwax1dM5n73fNdMRXajkg9ppyO2Ssa58Q3NpePwDlQsUbrN6nqakAaMWtNFEbjMu zOLw== X-Gm-Message-State: APt69E11M0Jpx1nHY/NbdudeHRJhBPNnBxUk7KlscL2t8JYFso4gUiR0 Rh5VWdcx+N8IRR6vjyhBIm8IEQ== X-Received: by 2002:a5d:4210:: with SMTP id n16-v6mr9494863wrq.55.1530966401382; Sat, 07 Jul 2018 05:26:41 -0700 (PDT) Received: from [192.168.1.8] (hst-221-57.medicom.bg. [84.238.221.57]) by smtp.googlemail.com with ESMTPSA id n8-v6sm16541862wmg.27.2018.07.07.05.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jul 2018 05:26:40 -0700 (PDT) Subject: Re: [PATCH] venus: vdec: fix decoded data size To: Vikash Garodia , stanimir.varbanov@linaro.org 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> From: Stanimir Varbanov Message-ID: Date: Sat, 7 Jul 2018 15:26:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1530517447-29296-1-git-send-email-vgarodia@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed 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 2.07.2018 10:44, 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); I cannot remember the exact reason to make it this way, might be an issue with vp8 or some mpeg2/4 on v1 which I workaround by this way. I'll test the patch on v1 & v3 and come back. regards, Stan