From: Daniel Almeida <daniel.almeida@collabora.com>
To: Jianhua Lin <jianhua.lin@mediatek.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
matthias.bgg@gmail.com,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH] media: mediatek: jpeg: support 34bits
Date: Mon, 3 Jun 2024 11:57:15 -0300 [thread overview]
Message-ID: <D76FE1CB-1EF9-4F38-8D73-F3E0D7942A6C@collabora.com> (raw)
In-Reply-To: <20240327040145.7155-1-jianhua.lin@mediatek.com>
Hi Jianhua,
> + ret = of_property_read_u32(pdev->dev.of_node, "mediatek,34bits",
> + &jpeg->support_34bit);
> + if (ret != 0) {
> + dev_info(&pdev->dev, "default for 32bits");
> + jpeg->support_34bit = 0;
> + }
> + dev_info(&pdev->dev, "use 34bits: %d", jpeg->support_34bit);
> +
Please use of_property_read_bool instead.
> enc_get_file_size(void __iomem *base, u32 support_34bit)
> {
> - return readl(base + JPEG_ENC_DMA_ADDR0) -
> + u32 value = 1;
> +
> + if (support_34bit)
> + value = 4;
> +
> + return readl(base + JPEG_ENC_DMA_ADDR0) * value -
> readl(base + JPEG_ENC_DST_ADDR0);
> }
Please use the ternary operator instead, there’s no need for two assignments.
Can you please add a comment inline to explain why this multiplier is needed?
> EXPORT_SYMBOL_GPL(mtk_jpeg_enc_get_file_size);
> @@ -75,6 +80,9 @@ void mtk_jpeg_enc_start(void __iomem *base)
>
> value = readl(base + JPEG_ENC_CTRL);
> value |= JPEG_ENC_CTRL_INT_EN_BIT | JPEG_ENC_CTRL_ENABLE_BIT;
> + value |= JPEG_ENC_CTRL_RDMA_PADDING_EN;
> + value |= JPEG_ENC_CTRL_RDMA_RIGHT_PADDING_EN;
> + value &= ~JPEG_ENC_CTRL_RDMA_PADDING_0_EN;
> writel(value, base + JPEG_ENC_CTRL);
> }
These do not have to be gated by “support_34bit” ?
— Daniel
prev parent reply other threads:[~2024-06-03 14:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 4:01 [PATCH] media: mediatek: jpeg: support 34bits Jianhua Lin
2024-06-03 14:57 ` Daniel Almeida [this message]
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=D76FE1CB-1EF9-4F38-8D73-F3E0D7942A6C@collabora.com \
--to=daniel.almeida@collabora.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=jianhua.lin@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.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 read-only IMAP folder(s) and NNTP newsgroup(s).