linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andi Shyti <andi@etezian.org>
To: Smitha T Murthy <smitha.t@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, m.szyprowski@samsung.com,
	andrzej.hajda@intel.com, mchehab@kernel.org,
	hverkuil-cisco@xs4all.nl, ezequiel@vanguardiasur.com.ar,
	jernej.skrabec@gmail.com, benjamin.gaignard@collabora.com,
	stanimir.varbanov@linaro.org, dillon.minfei@gmail.com,
	david.plowman@raspberrypi.com, mark.rutland@arm.com,
	robh+dt@kernel.org, krzk+dt@kernel.org, andi@etezian.org,
	alim.akhtar@samsung.com, aswani.reddy@samsung.com,
	pankaj.dubey@samsung.com, linux-fsd@tesla.com,
	aakarsh.jain@samsung.com
Subject: Re: [Patch v2 04/15] media: s5p-mfc: Add initial support for MFCv12
Date: Tue, 13 Sep 2022 00:26:36 +0200	[thread overview]
Message-ID: <Yx+yHPFhLbaaSCAw@intel.intel> (raw)
In-Reply-To: <20220907064715.55778-5-smitha.t@samsung.com>

Hi Smitha,

just a fast look here

[...]

> +/* Encoder buffer size for MFCv12 */
> +#define ENC_V120_BASE_SIZE(x, y) \
> +	(((x + 3) * (y + 3) * 8) \
> +	+ (((y * 64) + 2304) * (x + 7) / 8))

do we need any overflow control here?

[...]

>  #define MFC_V7_BIT	BIT(2)
>  #define MFC_V8_BIT	BIT(3)
>  #define MFC_V10_BIT	BIT(5)
> +#define MFC_V12_BIT	BIT(7)
>  
>  #define MFC_V5PLUS_BITS		(MFC_V5_BIT | MFC_V6_BIT | MFC_V7_BIT | \
> -					MFC_V8_BIT | MFC_V10_BIT)
> +					MFC_V8_BIT | MFC_V10_BIT | MFC_V12_BIT)
>  #define MFC_V6PLUS_BITS		(MFC_V6_BIT | MFC_V7_BIT | MFC_V8_BIT | \
> -					MFC_V10_BIT)
> -#define MFC_V7PLUS_BITS		(MFC_V7_BIT | MFC_V8_BIT | MFC_V10_BIT)
> +					MFC_V10_BIT | MFC_V12_BIT)
> +#define MFC_V7PLUS_BITS		(MFC_V7_BIT | MFC_V8_BIT | MFC_V10_BIT | \
> +					MFC_V12_BIT)

why not MFC_V10PLUS_BITS ?

[...]

> @@ -146,7 +146,7 @@ static struct s5p_mfc_fmt formats[] = {
>  		.codec_mode	= S5P_FIMV_CODEC_HEVC_DEC,
>  		.type		= MFC_FMT_DEC,
>  		.num_planes	= 1,
> -		.versions	= MFC_V10_BIT,
> +		.versions	= MFC_V10_BIT | MFC_V12_BIT,

we could just yse MFC_V10PLUS_BITS here

[...]

> +		if (IS_MFCV12(dev)) {
> +			lcu_width = S5P_MFC_LCU_WIDTH(ctx->img_width);
> +			lcu_height = S5P_MFC_LCU_HEIGHT(ctx->img_height);
> +			if (ctx->codec_mode == S5P_FIMV_CODEC_HEVC_ENC &&
> +								ctx->is_10bit) {
> +				ctx->luma_dpb_size =
> +					width64 * height32 +
> +					ALIGN(DIV_ROUND_UP(lcu_width * 32, 4),
> +							16) * height32 + 128;
> +				if (ctx->is_422) {
> +					ctx->chroma_dpb_size =
> +						ctx->luma_dpb_size;
> +				} else {
> +					ctx->chroma_dpb_size =
> +						width64 * height32 / 2 +
> +						ALIGN(DIV_ROUND_UP(lcu_width *
> +						32, 4), 16) * height32 / 2 + 128;
> +				}

You don't need the brackets here.

> +			} else if (ctx->codec_mode == S5P_FIMV_CODEC_VP9_ENC &&
> +					ctx->is_10bit) {
> +				ctx->luma_dpb_size =
> +					ALIGN(ctx->img_width * 2, 128) *
> +					height32 + 64;
> +				ctx->chroma_dpb_size =
> +					ALIGN(ctx->img_width * 2, 128) *
> +					height32 / 2 + 64;
> +			} else {
> +				ctx->luma_dpb_size =
> +					width64 * height32 + 64;
> +				if (ctx->is_422) {
> +					ctx->chroma_dpb_size =
> +						ctx->luma_dpb_size;
> +				} else {
> +					ctx->chroma_dpb_size =
> +						width64 * height32 / 2 + 64;
> +				}

You don't need the brackets here.

[...]

Andi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-09-12 22:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220907063309epcas5p1793555c0747fd7a11997e97649924552@epcas5p1.samsung.com>
2022-09-07  6:47 ` [Patch v2 00/15] Add MFC v12 support Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 01/15] dt-bindings: media: s5p-mfc: Add new DT schema for MFC Smitha T Murthy
2022-09-07 11:22     ` Krzysztof Kozlowski
2022-09-08 12:56       ` Aakarsh Jain
2022-09-08 15:11         ` Krzysztof Kozlowski
2022-09-14 12:48           ` Aakarsh Jain
2022-09-07 15:13     ` Rob Herring
2022-09-08 11:54       ` Aakarsh Jain
2022-09-07  6:47   ` [Patch v2 02/15] dt-bindings: media: s5p-mfc: Add mfcv12 variant Smitha T Murthy
2022-09-07 11:24     ` Krzysztof Kozlowski
2022-09-08  6:53       ` Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 03/15] media: s5p-mfc: Rename IS_MFCV10 macro Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 04/15] media: s5p-mfc: Add initial support for MFCv12 Smitha T Murthy
2022-09-12 22:26     ` Andi Shyti [this message]
2022-09-07  6:47   ` [Patch v2 05/15] Documention: v4l: Documentation for VP9 CIDs Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 06/15] media: v4l2: Add v4l2 control IDs for VP9 encoder Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 07/15] media: s5p-mfc: Add support " Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 08/15] media: s5p-mfc: Add YV12 and I420 multiplanar format support Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 09/15] media: s5p-mfc: Add support for rate controls in MFCv12 Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 10/15] media: s5p-mfc: Add support for UHD encoding Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 11/15] media: s5p-mfc: Add support for DMABUF for encoder Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 13/15] media: s5p-mfc: Load firmware for each run in MFCv12 Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 14/15] media: s5p-mfc: DPB Count Independent of VIDIOC_REQBUF Smitha T Murthy
2022-09-07  6:47   ` [Patch v2 15/15] arm64: dts: fsd: Add MFC related DT enteries Smitha T Murthy
2022-09-07 11:25     ` Krzysztof Kozlowski
2022-09-07 12:16       ` Smitha T Murthy
2022-09-07  7:46   ` [Patch v2 00/15] Add MFC v12 support Smitha T Murthy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yx+yHPFhLbaaSCAw@intel.intel \
    --to=andi@etezian.org \
    --cc=aakarsh.jain@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=andrzej.hajda@intel.com \
    --cc=aswani.reddy@samsung.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=david.plowman@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dillon.minfei@gmail.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsd@tesla.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=pankaj.dubey@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=smitha.t@samsung.com \
    --cc=stanimir.varbanov@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).