Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3635128imm; Mon, 2 Jul 2018 02:47:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcpvoibkUrAtzc+rinlSJMMy1qni2rzWbqaAm53SBbyZDT7PhQr2NXF+mFKq0A+tRuTtifT X-Received: by 2002:a62:d693:: with SMTP id a19-v6mr20005182pfl.248.1530524820523; Mon, 02 Jul 2018 02:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530524820; cv=none; d=google.com; s=arc-20160816; b=kY8BAiAfhwGnHsLJ8QDj3ttySinN4PG2FrnLlhaKvCPGY9zhll5LqgLsRAeDi4hHV/ EB/j4AFnoiTO0WUqRLl0tw8DbYSUv92bi+Gl5XElu6uxvcMvznFQm0WGA6OnpctZUDs6 ixCTSOhAvPr9ISzI+MhDt0gc9BtPUtTP8WxQAqsdBxhadkcgQ/dqS90zG7VVXxq8B0cC 66ecK/MgPqOjrO34u6vf5UDLNNhNRFl30jsFWkCwPKZu403wglKiZb/hc6uQXqGE8fSK FHVoUi6QcOmyzWw1wpbH66bE3TsA/Te4Or+L23yAI2XCchavQiNv2YjDcoqcJhkaFDpx MoeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=mAxLzkBpMMFXy/cRf9JdoQefsFzrievic96sM5LXPUk=; b=sU9VN/S/Y3ys5EFyH0BlYU8d/8cmzPzvYx4u5+bxZIDpRrukhO6X+wlMiEpSKqc7gg uPMORbb8pZHzEIewOsw+crERM8iWMB3WsXWJHBjXdUHQQrDi9j6i9zupmPVmS6UilVLM auj379u0ZvnCYRXAWhhsFpMg7JxVOJOUGo3WZnruMGi3BHBvd728s5Ywz5zvwjFg1HV7 /72m43xD4t3DsUnmfWgHXcNTKUG0PNb+DYFx3t87JN5bWjfJTx93eRDZZufnKq0te0Yq 9PjfCSHQ5K8qQvc5UMBasxcAg/XUvs0TW1oONDergQEpjpKmkPLdSTLbwo3JATDe6ZFF tw+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=TRngxVDa; dkim=pass header.i=@codeaurora.org header.s=default header.b=TRngxVDa; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5-v6si15794935pls.53.2018.07.02.02.46.45; Mon, 02 Jul 2018 02:47:00 -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=@codeaurora.org header.s=default header.b=TRngxVDa; dkim=pass header.i=@codeaurora.org header.s=default header.b=TRngxVDa; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934139AbeGBJfY (ORCPT + 99 others); Mon, 2 Jul 2018 05:35:24 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60560 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933423AbeGBJfV (ORCPT ); Mon, 2 Jul 2018 05:35:21 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D5DF360B14; Mon, 2 Jul 2018 09:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530524120; bh=eJ18xMIPVgnGbrZcVLHcYO23CmazJEqoHMr+9t8p1DA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TRngxVDay4hEx/oIQyqNkpO7aZwDkkG0QE3/rAInsfO28i8Qtdqd2iazJMEDSj2xc lCiOfbXJE5UgEbjjZk+s7DDkPJCm5u0Vw45z59VkvD9AR/+odH8yCwCvp64sviEDoi GDpB1AcOD2NeNsERKXwavXMZ+ffxNto0X9hnGqIc= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 29AB1601CF; Mon, 2 Jul 2018 09:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530524120; bh=eJ18xMIPVgnGbrZcVLHcYO23CmazJEqoHMr+9t8p1DA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TRngxVDay4hEx/oIQyqNkpO7aZwDkkG0QE3/rAInsfO28i8Qtdqd2iazJMEDSj2xc lCiOfbXJE5UgEbjjZk+s7DDkPJCm5u0Vw45z59VkvD9AR/+odH8yCwCvp64sviEDoi GDpB1AcOD2NeNsERKXwavXMZ+ffxNto0X9hnGqIc= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 02 Jul 2018 15:05:20 +0530 From: Vikash Garodia To: Alexandre Courbot Cc: Stanimir Varbanov , Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, Tomasz Figa , linux-media-owner@vger.kernel.org Subject: Re: [PATCH v4 24/27] venus: helpers: move frame size calculations on common place In-Reply-To: References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> <20180627152725.9783-25-stanimir.varbanov@linaro.org> Message-ID: <4e22af7d7ef9037996b606892ed25b36@codeaurora.org> X-Sender: vgarodia@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-07-02 14:16, Alexandre Courbot wrote: > On Thu, Jun 28, 2018 at 12:28 AM Stanimir Varbanov > wrote: >> >> This move the calculations of raw and compressed buffer sizes >> on common helper and make it identical for encoder and decoder. >> >> Signed-off-by: Stanimir Varbanov >> --- >> drivers/media/platform/qcom/venus/helpers.c | 98 >> +++++++++++++++++++++++++++++ >> drivers/media/platform/qcom/venus/helpers.h | 2 + >> drivers/media/platform/qcom/venus/vdec.c | 54 ++++------------ >> drivers/media/platform/qcom/venus/venc.c | 56 ++++------------- >> 4 files changed, 126 insertions(+), 84 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/helpers.c >> b/drivers/media/platform/qcom/venus/helpers.c >> index 6b31c91528ed..a342472ae2f0 100644 >> --- a/drivers/media/platform/qcom/venus/helpers.c >> +++ b/drivers/media/platform/qcom/venus/helpers.c >> @@ -452,6 +452,104 @@ int venus_helper_get_bufreq(struct venus_inst >> *inst, u32 type, >> } >> EXPORT_SYMBOL_GPL(venus_helper_get_bufreq); >> >> +static u32 get_framesize_raw_nv12(u32 width, u32 height) >> +{ >> + u32 y_stride, uv_stride, y_plane; >> + u32 y_sclines, uv_sclines, uv_plane; >> + u32 size; >> + >> + y_stride = ALIGN(width, 128); >> + uv_stride = ALIGN(width, 128); >> + y_sclines = ALIGN(height, 32); >> + uv_sclines = ALIGN(((height + 1) >> 1), 16); >> + >> + y_plane = y_stride * y_sclines; >> + uv_plane = uv_stride * uv_sclines + SZ_4K; >> + size = y_plane + uv_plane + SZ_8K; > > Do you know the reason for this extra 8K at the end? As explained about the hardware requirement over bug [1], 8k is not needed. I am working on a patch to fix the alignment requirement for ubwc format as well. In downstream driver, this 8k was added to accomodate the video extradata. [1] https://partnerissuetracker.corp.google.com/u/1/issues/110448791