From: Rex-BC Chen <rex-bc.chen@mediatek.com>
To: CK Hu <ck.hu@mediatek.com>, <chunkuang.hu@kernel.org>,
<p.zabel@pengutronix.de>, <daniel@ffwll.ch>, <robh+dt@kernel.org>,
<krzysztof.kozlowski+dt@linaro.org>, <matthias.bgg@gmail.com>,
<airlied@linux.ie>
Cc: <msp@baylibre.com>, <granquet@baylibre.com>,
<jitao.shi@mediatek.com>, <wenst@chromium.org>,
<angelogioacchino.delregno@collabora.com>,
<dri-devel@lists.freedesktop.org>,
<linux-mediatek@lists.infradead.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<Project_Global_Chrome_Upstream_Group@mediatek.com>
Subject: Re: [PATCH v11 12/12] drm/mediatek: dpi: Add matrix_sel helper
Date: Thu, 16 Jun 2022 18:51:31 +0800 [thread overview]
Message-ID: <bd0183b088c4c2849837f49b4b35b26d9079ac5f.camel@mediatek.com> (raw)
In-Reply-To: <de65caa980c270e4dedcf134d45185d41cd4c0ae.camel@mediatek.com>
On Tue, 2022-06-14 at 14:20 +0800, CK Hu wrote:
> Hi, Bo-Chen:
>
> On Mon, 2022-06-13 at 14:48 +0800, Bo-Chen Chen wrote:
> > From: Guillaume Ranquet <granquet@baylibre.com>
> >
> > Add a mtk_dpi_matrix_sel() helper to update the DPI_MATRIX_SET
> > register depending on the color format.
>
> Why set DPI_MATRIX_SET? New feature or bug fix? What does this matrix
> work for?
>
> Regards,
> CK
>
Matrix selection is a new feature for both dpi and dpintf of MT8195.
I will add this in next version.
> >
> > Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
> > Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
> > ---
> > drivers/gpu/drm/mediatek/mtk_dpi.c | 21 +++++++++++++++++++++
> > drivers/gpu/drm/mediatek/mtk_dpi_regs.h | 3 +++
> > 2 files changed, 24 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c
> > b/drivers/gpu/drm/mediatek/mtk_dpi.c
> > index 9668bd5dd14a..dc355a512963 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c
> > @@ -387,6 +387,25 @@ static void mtk_dpi_config_disable_edge(struct
> > mtk_dpi *dpi)
> > mtk_dpi_mask(dpi, dpi->conf->reg_h_fre_con, 0,
> > EDGE_SEL_EN);
> > }
> >
> > +static void mtk_dpi_matrix_sel(struct mtk_dpi *dpi, enum
> > mtk_dpi_out_color_format format)
> > +{
> > + u32 matrix_sel = 0;
> > +
> > + switch (format) {
> > + case MTK_DPI_COLOR_FORMAT_YCBCR_422:
> > + case MTK_DPI_COLOR_FORMAT_YCBCR_422_FULL:
> > + case MTK_DPI_COLOR_FORMAT_YCBCR_444:
> > + case MTK_DPI_COLOR_FORMAT_YCBCR_444_FULL:
> > + case MTK_DPI_COLOR_FORMAT_XV_YCC:
> > + if (dpi->mode.hdisplay <= 720)
> > + matrix_sel = 0x2;
> > + break;
> > + default:
> > + break;
> > + }
> > + mtk_dpi_mask(dpi, DPI_MATRIX_SET, matrix_sel,
> > INT_MATRIX_SEL_MASK);
> > +}
> > +
> > static void mtk_dpi_config_color_format(struct mtk_dpi *dpi,
> > enum mtk_dpi_out_color_format
> > format)
> > {
> > @@ -394,6 +413,7 @@ static void mtk_dpi_config_color_format(struct
> > mtk_dpi *dpi,
> > (format == MTK_DPI_COLOR_FORMAT_YCBCR_444_FULL)) {
> > mtk_dpi_config_yuv422_enable(dpi, false);
> > mtk_dpi_config_csc_enable(dpi, true);
> > + mtk_dpi_matrix_sel(dpi, format);
> > if (dpi->conf->swap_input_support)
> > mtk_dpi_config_swap_input(dpi, false);
> > mtk_dpi_config_channel_swap(dpi,
> > MTK_DPI_OUT_CHANNEL_SWAP_BGR);
> > @@ -401,6 +421,7 @@ static void mtk_dpi_config_color_format(struct
> > mtk_dpi *dpi,
> > (format == MTK_DPI_COLOR_FORMAT_YCBCR_422_FULL)) {
> > mtk_dpi_config_yuv422_enable(dpi, true);
> > mtk_dpi_config_csc_enable(dpi, true);
> > + mtk_dpi_matrix_sel(dpi, format);
> > if (dpi->conf->swap_input_support)
> > mtk_dpi_config_swap_input(dpi, true);
> > mtk_dpi_config_channel_swap(dpi,
> > MTK_DPI_OUT_CHANNEL_SWAP_RGB);
> > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi_regs.h
> > b/drivers/gpu/drm/mediatek/mtk_dpi_regs.h
> > index f7f0272dbd6a..96c117202d0d 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_dpi_regs.h
> > +++ b/drivers/gpu/drm/mediatek/mtk_dpi_regs.h
> > @@ -230,4 +230,7 @@
> > #define EDGE_SEL_EN BIT(5)
> > #define H_FRE_2N BIT(25)
> >
> > +#define DPI_MATRIX_SET 0xB4
> > +#define INT_MATRIX_SEL_MASK (0x1F << 0)
> > +
> > #endif /* __MTK_DPI_REGS_H */
>
>
prev parent reply other threads:[~2022-06-16 10:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 6:48 [PATCH v11 00/12] drm/mediatek: Add MT8195 dp_intf driver Bo-Chen Chen
2022-06-13 6:48 ` [PATCH v11 01/12] dt-bindings: mediatek,dpi: Add DP_INTF compatible Bo-Chen Chen
2022-06-13 13:33 ` Rob Herring
2022-06-14 3:05 ` CK Hu
2022-06-16 7:58 ` Rex-BC Chen
2022-06-14 20:24 ` Rob Herring
2022-06-16 7:55 ` Rex-BC Chen
2022-06-13 6:48 ` [PATCH v11 02/12] drm/mediatek: dpi: move dpi limits to SoC config Bo-Chen Chen
2022-06-14 3:21 ` CK Hu
2022-06-16 10:31 ` Rex-BC Chen
2022-06-13 6:48 ` [PATCH v11 03/12] drm/mediatek: dpi: implement a CK/DE pol toggle in " Bo-Chen Chen
2022-06-14 3:36 ` CK Hu
2022-06-13 6:48 ` [PATCH v11 04/12] drm/mediatek: dpi: implement a swap_input " Bo-Chen Chen
2022-06-14 5:27 ` CK Hu
2022-06-16 10:36 ` Rex-BC Chen
2022-06-13 6:48 ` [PATCH v11 05/12] drm/mediatek: dpi: move dimension mask to " Bo-Chen Chen
2022-06-13 6:48 ` [PATCH v11 06/12] drm/mediatek: dpi: move hvsize_mask " Bo-Chen Chen
2022-06-13 6:48 ` [PATCH v11 07/12] drm/mediatek: dpi: move swap_shift " Bo-Chen Chen
2022-06-14 5:38 ` CK Hu
2022-06-13 6:48 ` [PATCH v11 08/12] drm/mediatek: dpi: move the yuv422_en_bit " Bo-Chen Chen
2022-06-13 6:48 ` [PATCH v11 09/12] drm/mediatek: dpi: move the csc_enable bit " Bo-Chen Chen
2022-06-14 5:45 ` CK Hu
2022-06-13 6:48 ` [PATCH v11 10/12] drm/mediatek: dpi: Add dpintf support Bo-Chen Chen
2022-06-13 10:55 ` AngeloGioacchino Del Regno
2022-06-16 7:57 ` Rex-BC Chen
2022-06-14 6:04 ` CK Hu
2022-06-16 9:09 ` Rex-BC Chen
2022-06-13 6:48 ` [PATCH v11 11/12] drm/mediatek: dpi: Only enable dpi after the bridge is enabled Bo-Chen Chen
2022-06-14 6:24 ` CK Hu
2022-06-16 10:49 ` Rex-BC Chen
2022-06-13 6:48 ` [PATCH v11 12/12] drm/mediatek: dpi: Add matrix_sel helper Bo-Chen Chen
2022-06-14 6:20 ` CK Hu
2022-06-16 10:51 ` Rex-BC Chen [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=bd0183b088c4c2849837f49b4b35b26d9079ac5f.camel@mediatek.com \
--to=rex-bc.chen@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=airlied@linux.ie \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=ck.hu@mediatek.com \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=granquet@baylibre.com \
--cc=jitao.shi@mediatek.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=msp@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=wenst@chromium.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).