Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3638156imm; Mon, 2 Jul 2018 02:51:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKfDX4nt3XrjZyNIeKjeMytLjIYqInF7AYbUVGEOrRBswzt5OniKeQKjM8OuYOt6Cp03vEw X-Received: by 2002:a63:5f50:: with SMTP id t77-v6mr20065285pgb.300.1530525100549; Mon, 02 Jul 2018 02:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530525100; cv=none; d=google.com; s=arc-20160816; b=t4xGpno8gd1esW/oPGhL12v1VG3OvMhy0wjk4TMoaOAbyWuHCJI0Pe3tnEV7reBirt dfOnotgHRzLYOKQFUIjnfYyv+1siF1i/65Zag+Ex+nTGvTg7SMejI9o4juHQGUsy4tEP hFze8FsgelvipBmTpPDlCxyRuWZ7ubAlmHDlANP7OM0Oh4RzvOSTP5mwtA8N63IF32+u fsSCIsfqJ8yRByUBXeYZwwXqkj7rXMtXdPfF7fDAwDVqIx6O4d4ewCekSWss2UjOobob /vd4DlDTl9oaQpKIehbQ0k/CzGjL1fgaNq3hah39QH2jQ8xlXlLdnqyuqwfwb0KRzBQ0 nfuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=k23BH3UnEaboTgtLzDrT6o8k8D0+sTXkBi51nRnOdaw=; b=0+qRrdXNmL/6HPw0gNS+F8P0pvJRvhic+Qv6S7CRtzNk9QSVWgh3tSt08chu/Uxj4O bk5pyhOLFvj0goar9UR2ZRH3j4wdeLniUjDwgTujuQzN8wPQht0o4834GR+1grALmUiA lK7LjeZcq2fwN5eq5fSc7iueJeMTluOICGt6caGKiM3lyfxWPazjOxz3NX1JvIsAC/ht b41FjNfkaJxNmUJIGwkCBZ+8J7Nj1vTyLePZ2/kUGD51BprJiyYZsM2RyqVeADn8s3/8 dE73/HdWJuPOlAVkcnnkEyygx1cNVw4VNS/iCBU6lFFwusPr7OqMFJmyuEtiHGZrecOc 5+pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hGes0rje; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si15196692pld.80.2018.07.02.02.51.26; Mon, 02 Jul 2018 02:51:40 -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=@chromium.org header.s=google header.b=hGes0rje; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965264AbeGBJiC (ORCPT + 99 others); Mon, 2 Jul 2018 05:38:02 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:39433 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933679AbeGBJh5 (ORCPT ); Mon, 2 Jul 2018 05:37:57 -0400 Received: by mail-yw0-f194.google.com with SMTP id 81-v6so6444086ywb.6 for ; Mon, 02 Jul 2018 02:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k23BH3UnEaboTgtLzDrT6o8k8D0+sTXkBi51nRnOdaw=; b=hGes0rjeMPe72uyS+3pbszFfn4cC8+TBjzWdAv3aOO2WpCxqQJVvlQe/MutCWbN+oA wQySvjLui0SPtdIZscmKq6eUykCoBaGZ947B3g7bh4dOHG5qigdUjMNn4wHTrXRH1mzq LD+eRXjkgczvfuRPDlLJA0pLuarDXFbauM15U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k23BH3UnEaboTgtLzDrT6o8k8D0+sTXkBi51nRnOdaw=; b=ud4vM1ClyDymo0yemkRzUJif+LcmlPuTY1AiNscNee0aMyar4IjvQFPaDar9AHlCcz 6eM/MlAfy4XbxgiraSOyyp569NwVOoGJznQxSEWzFKwMM1o+A+DjReCkBXVI3XwqR7/C u/mabNYr2Wo7caP6dsQ2ike4GdKqfjKAYy/heJdtPGeFRSqXE/CNKhvUJcOSpch88rKh Lhg36V+apkMiBLPmA4tm7oOWsJx8rEs3W3zudw3NxsNdUzldHj10jLqwKcy2oZAcZ/5D xWZBoOYbWpVcfxCD3vCrW6F5OxNLIHsLDwVn4E2mQz9n/sIjna2jz4m6R2DDl60wCUCf 0VWw== X-Gm-Message-State: APt69E1tYOujhaMW3QFl0BVOq5/tTsKEEIXcZwqwUX341YZEpR4yUp/n wDfHV9L84G0ewaPcSo96uCC/PSjV1W8= X-Received: by 2002:a0d:e8d7:: with SMTP id r206-v6mr8057392ywe.86.1530524276047; Mon, 02 Jul 2018 02:37:56 -0700 (PDT) Received: from mail-yb0-f175.google.com (mail-yb0-f175.google.com. [209.85.213.175]) by smtp.gmail.com with ESMTPSA id p3-v6sm6053926ywh.36.2018.07.02.02.37.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 02:37:54 -0700 (PDT) Received: by mail-yb0-f175.google.com with SMTP id s8-v6so1252083ybe.8 for ; Mon, 02 Jul 2018 02:37:54 -0700 (PDT) X-Received: by 2002:a25:588a:: with SMTP id m132-v6mr12012379ybb.405.1530524273996; Mon, 02 Jul 2018 02:37:53 -0700 (PDT) MIME-Version: 1.0 References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> <20180627152725.9783-25-stanimir.varbanov@linaro.org> <4e22af7d7ef9037996b606892ed25b36@codeaurora.org> In-Reply-To: <4e22af7d7ef9037996b606892ed25b36@codeaurora.org> From: Tomasz Figa Date: Mon, 2 Jul 2018 18:37:42 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 24/27] venus: helpers: move frame size calculations on common place To: vgarodia@codeaurora.org Cc: Alexandre Courbot , Stanimir Varbanov , Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , linux-media-owner@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 2, 2018 at 6:35 PM Vikash Garodia wrote: > > 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 Thanks Vikash. I'd also ask the same question about the extra 4K at the end of UV plane. Best regards, Tomasz