Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3699398imm; Mon, 2 Jul 2018 04:07:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe1T9yNkAsM1n5F1Fdgc1J3i32BURppWnLhqJmJadJW3zVQ+qkVtOCQSLIH2eFRDke371PO X-Received: by 2002:a17:902:8c88:: with SMTP id t8-v6mr3753351plo.117.1530529643513; Mon, 02 Jul 2018 04:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530529643; cv=none; d=google.com; s=arc-20160816; b=FeA2MhSy6U9N8UUgS1IH5JnqYc4Ecaj34yNk3EXtQLCwq/Si6AfS0tu4XMqHR+08WA rgNAZGfFedO9ofGCOgGLfK9noJ9QzNV6/+mbB6HDhYpXc7Ks21ENshBJeQVTkwP2CDfw XiAu6/vEouBumhUHpM8U61RhGK5R9yYM0ib5jeBxCUbPE4PD1l+Dr5/k6t4WOEWHhn/C 7cJgg5QvtfG11o8ydC0wZxrYSnjGQuraIT0SSz55xrgWeLOCRijBgQQabQONcnnA4sFy j2mJaceDQfF7HOXU0NyU1MnCRiBJvoI9Ja23/xPdCcbwj+PsDhE2dE/zK8j7TQFRoTL7 FOXQ== 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=y9t15OAu6H/ZV+XZJL+b5GiX1/4LSw6e0Ci2AU9QfIM=; b=UQTkfTfinDp3WtfasqXzaCyx5vocycHwgj2JYNtGs+2dg2l/+6rN2/qSSbP2DuvZl3 otNaGBKS5akFjImUeSnKSqLVNXyfIZpWtzWxUr99XeGhxtQappUfUcuD5TvTNlsp4CSt fLXRSuRuwbMckAklJz2M9Zsnl36GXREdXCFwB7RXaeaeDbVvHTiH5DP52ZiD+z8iiqkc +0em+htjct/n5lan8LoNprV6qeiGzQLzJ4AXwWhtWlGXtZfmW/0VMlrRv9qroN0LI7+C PASk0U7pXKxjX9syC4E3+/oP11fLaXwoaXV0fvpLs4c74hJwXkiOg1an90JC1QoGdIvd zidA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=g2m52wPZ; 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 k2-v6si15936273plt.374.2018.07.02.04.07.08; Mon, 02 Jul 2018 04:07:23 -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=g2m52wPZ; 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 S965023AbeGBIq2 (ORCPT + 99 others); Mon, 2 Jul 2018 04:46:28 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:41331 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754308AbeGBIqW (ORCPT ); Mon, 2 Jul 2018 04:46:22 -0400 Received: by mail-io0-f196.google.com with SMTP id q9-v6so3309263ioj.8 for ; Mon, 02 Jul 2018 01:46:22 -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=y9t15OAu6H/ZV+XZJL+b5GiX1/4LSw6e0Ci2AU9QfIM=; b=g2m52wPZ0+DjttImqBBhRgpMKmQ8LKOkZyNsMj5Ae+ytuv2/a6j3YmICwJJymfHUvx rjxCU1bXzU1Om62AygoYsSqqAZadfGnb/WuQk/pKgZwJKWAbJQ79nZs8NdYvTZ2HW2VM Ggv99nCAKB/0q2cQqeHl5Otc9ubduCAqPcfNo= 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=y9t15OAu6H/ZV+XZJL+b5GiX1/4LSw6e0Ci2AU9QfIM=; b=eTNTmvDexMPuRekT4bushQ/6PunW3laBiJbgF8PaH/sA21QO4Id6nyqVmIQboM/EiU DOH9bi9TARH9FuWj8JwajKf7kdes//a9L3avzDo4POWDC6Bi6imQW6xZmp0cG+VxNi/5 MkMqCQVwob54iARZO2hx8+8lKFlFlBdw95LZLY/ac0fp+Ewnqo23ttqTd7IjrUN8UTT1 ZmZTev2TJ6PouYz0L9yyvENUlau6neRb8S+KvsKk8n5zrGWx0+hZj1CtVwdegFJSmLnJ vbIlikPixVF1CDKhW5m1MXYOTLlBdMJBTMGCrwAU8yWqdc2Z1yO+z1wT/xgHghK10EXY YeWA== X-Gm-Message-State: APt69E2gTR/ib4sN4Tj8WCNhWi7NgB+8SfqT9vhPWuTRfcwsDCEbFuU0 W6bFSw/GclIaI17aZz5BPrNxZ4jxVUY= X-Received: by 2002:a6b:2c4b:: with SMTP id s72-v6mr13085808ios.195.1530521181676; Mon, 02 Jul 2018 01:46:21 -0700 (PDT) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id e14-v6sm1811180ioe.11.2018.07.02.01.46.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 01:46:21 -0700 (PDT) Received: by mail-it0-f47.google.com with SMTP id a195-v6so11061288itd.3 for ; Mon, 02 Jul 2018 01:46:20 -0700 (PDT) X-Received: by 2002:a24:5e0b:: with SMTP id h11-v6mr3075504itb.80.1530521180300; Mon, 02 Jul 2018 01:46:20 -0700 (PDT) MIME-Version: 1.0 References: <20180627152725.9783-1-stanimir.varbanov@linaro.org> <20180627152725.9783-25-stanimir.varbanov@linaro.org> In-Reply-To: <20180627152725.9783-25-stanimir.varbanov@linaro.org> From: Alexandre Courbot Date: Mon, 2 Jul 2018 17:46:09 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 24/27] venus: helpers: move frame size calculations on common place To: Stanimir Varbanov Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , LKML , linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org, Tomasz Figa 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 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?