From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Figa Subject: Re: [PATCH] media: venus: amend buffer size for bitstream plane Date: Tue, 23 Oct 2018 11:50:17 +0900 Message-ID: References: <1539071530-1441-1-git-send-email-mgottam@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <1539071530-1441-1-git-send-email-mgottam@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: mgottam@codeaurora.org Cc: Stanimir Varbanov , Hans Verkuil , Mauro Carvalho Chehab , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , Alexandre Courbot , vgarodia@codeaurora.org List-Id: linux-arm-msm@vger.kernel.org Hi Malathi, On Tue, Oct 9, 2018 at 4:58 PM Malathi Gottam wrote: > > For lower resolutions, incase of encoder, the compressed > frame size is more than half of the corresponding input > YUV. Keep the size as same as YUV considering worst case. > > Signed-off-by: Malathi Gottam > --- > drivers/media/platform/qcom/venus/helpers.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c > index 2679adb..05c5423 100644 > --- a/drivers/media/platform/qcom/venus/helpers.c > +++ b/drivers/media/platform/qcom/venus/helpers.c > @@ -649,7 +649,7 @@ u32 venus_helper_get_framesz(u32 v4l2_fmt, u32 width, u32 height) > } > > if (compressed) { > - sz = ALIGN(height, 32) * ALIGN(width, 32) * 3 / 2 / 2; > + sz = ALIGN(height, 32) * ALIGN(width, 32) * 3 / 2; > return ALIGN(sz, SZ_4K); > } Note that the driver should not enforce one particular buffer size for bitstream buffers unless it's a workaround for broken firmware or hardware. The userspace should be able to select the desired size. Best regards, Tomasz