mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"kernel@collabora.com" <kernel@collabora.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"amergnat@baylibre.com" <amergnat@baylibre.com>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>
Subject: Re: [PATCH v5 2/9] drm/mediatek: dsi: Fix DSI RGB666 formats and definitions
Date: Thu, 15 Feb 2024 06:12:18 +0000	[thread overview]
Message-ID: <23017aad8135b41bffede3b55c0ac273daef0b82.camel@mediatek.com> (raw)
In-Reply-To: <20240207145307.1626009-3-angelogioacchino.delregno@collabora.com>

Hi, Angelo:

On Wed, 2024-02-07 at 15:53 +0100, AngeloGioacchino Del Regno wrote:
> The register bits definitions for RGB666 formats are wrong in
> multiple
> ways: first, in the DSI_PS_SEL bits region, the Packed 18-bits RGB666
> format is selected with bit 1, while the Loosely Packed one is bit 2,
> and second - the definition name "LOOSELY_PS_18BIT_RGB666" is wrong
> because the loosely packed format is 24 bits instead!
> 
> Either way, functions mtk_dsi_ps_control_vact() and
> mtk_dsi_ps_control()
> do not even agree on the DSI_PS_SEL bit to set in DSI_PSCTRL: one
> sets
> loosely packed (24) on RGB666, the other sets packed (18), and the
> other
> way around for RGB666_PACKED.
> 
> Fixing this entire stack of issues is done in one go:
>  - Use the correct bit for the Loosely Packed RGB666 definition
>  - Rename LOOSELY_PS_18BIT_RGB666 to LOOSELY_PS_24BIT_RGB666
>  - Change ps_bpp_mode in mtk_dsi_ps_control_vact() to set:
>     - Loosely Packed, 24-bits for MIPI_DSI_FMT_RGB666
>     - Packed, 18-bits for MIPI_DSI_FMT_RGB666_PACKED

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Fixes: 2e54c14e310f ("drm/mediatek: Add DSI sub driver")
> Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
> Signed-off-by: AngeloGioacchino Del Regno <
> angelogioacchino.delregno@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dsi.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c
> b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index c66e18006070..8af0afbe9e3d 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -71,8 +71,8 @@
>  #define DSI_PS_WC			GENMASK(13, 0)
>  #define DSI_PS_SEL			GENMASK(17, 16)
>  #define PACKED_PS_16BIT_RGB565		(0 << 16)
> -#define LOOSELY_PS_18BIT_RGB666		(1 << 16)
> -#define PACKED_PS_18BIT_RGB666		(2 << 16)
> +#define PACKED_PS_18BIT_RGB666		(1 << 16)
> +#define LOOSELY_PS_24BIT_RGB666		(2 << 16)
>  #define PACKED_PS_24BIT_RGB888		(3 << 16)
>  
>  #define DSI_VSA_NL		0x20
> @@ -370,10 +370,10 @@ static void mtk_dsi_ps_control_vact(struct
> mtk_dsi *dsi)
>  		ps_bpp_mode |= PACKED_PS_24BIT_RGB888;
>  		break;
>  	case MIPI_DSI_FMT_RGB666:
> -		ps_bpp_mode |= PACKED_PS_18BIT_RGB666;
> +		ps_bpp_mode |= LOOSELY_PS_24BIT_RGB666;
>  		break;
>  	case MIPI_DSI_FMT_RGB666_PACKED:
> -		ps_bpp_mode |= LOOSELY_PS_18BIT_RGB666;
> +		ps_bpp_mode |= PACKED_PS_18BIT_RGB666;
>  		break;
>  	case MIPI_DSI_FMT_RGB565:
>  		ps_bpp_mode |= PACKED_PS_16BIT_RGB565;
> @@ -427,7 +427,7 @@ static void mtk_dsi_ps_control(struct mtk_dsi
> *dsi)
>  		dsi_tmp_buf_bpp = 3;
>  		break;
>  	case MIPI_DSI_FMT_RGB666:
> -		tmp_reg = LOOSELY_PS_18BIT_RGB666;
> +		tmp_reg = LOOSELY_PS_24BIT_RGB666;
>  		dsi_tmp_buf_bpp = 3;
>  		break;
>  	case MIPI_DSI_FMT_RGB666_PACKED:

  reply	other threads:[~2024-02-15  6:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 14:52 [PATCH v5 0/9] MediaTek DRM - DSI driver cleanups AngeloGioacchino Del Regno
2024-02-07 14:52 ` [PATCH v5 1/9] drm/mediatek: dsi: Use GENMASK() for register mask definitions AngeloGioacchino Del Regno
2024-02-15  6:02   ` CK Hu (胡俊光)
2024-02-07 14:53 ` [PATCH v5 2/9] drm/mediatek: dsi: Fix DSI RGB666 formats and definitions AngeloGioacchino Del Regno
2024-02-15  6:12   ` CK Hu (胡俊光) [this message]
2024-02-07 14:53 ` [PATCH v5 3/9] drm/mediatek: dsi: Cleanup functions mtk_dsi_ps_control{_vact}() AngeloGioacchino Del Regno
2024-02-15  7:07   ` CK Hu (胡俊光)
2024-02-07 14:53 ` [PATCH v5 4/9] drm/mediatek: dsi: Use bitfield macros where useful AngeloGioacchino Del Regno
2024-02-15  7:33   ` CK Hu (胡俊光)
2024-02-07 14:53 ` [PATCH v5 5/9] drm/mediatek: dsi: Replace open-coded instance of HZ_PER_MHZ AngeloGioacchino Del Regno
2024-02-15  7:40   ` CK Hu (胡俊光)
2024-02-07 14:53 ` [PATCH v5 6/9] drm/mediatek: dsi: Register DSI host after acquiring clocks and PHY AngeloGioacchino Del Regno
2024-02-07 14:53 ` [PATCH v5 7/9] drm/mediatek: dsi: Simplify with dev_err_probe and remove gotos AngeloGioacchino Del Regno
2024-02-07 14:53 ` [PATCH v5 8/9] drm/mediatek: dsi: Compress of_device_id entries and add sentinel AngeloGioacchino Del Regno
2024-02-07 14:53 ` [PATCH v5 9/9] drm/mediatek: dsi: Use mipi_dsi_pixel_format_to_bpp() helper function AngeloGioacchino Del Regno

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=23017aad8135b41bffede3b55c0ac273daef0b82.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=amergnat@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --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=p.zabel@pengutronix.de \
    /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

all inboxes | Powered by JetHome®