dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/mediatek: mtk_hdmi: fix inverted parameters in some regmap_update_bits calls
@ 2025-08-18 14:17 Louis-Alexis Eyraud
  2025-08-20  2:37 ` CK Hu (胡俊光)
  2025-08-23 15:35 ` Chun-Kuang Hu
  0 siblings, 2 replies; 3+ messages in thread
From: Louis-Alexis Eyraud @ 2025-08-18 14:17 UTC (permalink / raw)
  To: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Matthias Brugger, AngeloGioacchino Del Regno, CK Hu,
	Guillaume Ranquet
  Cc: kernel, dri-devel, linux-mediatek, linux-kernel, linux-arm-kernel,
	Louis-Alexis Eyraud

In mtk_hdmi driver, a recent change replaced custom register access
function calls by regmap ones, but two replacements by regmap_update_bits
were done incorrectly, because original offset and mask parameters were
inverted, so fix them.

Fixes: d6e25b3590a0 ("drm/mediatek: hdmi: Use regmap instead of iomem for main registers")
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
 drivers/gpu/drm/mediatek/mtk_hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
index 845fd8aa43c3c91659808d9e6bb78758d1f9b857..b766dd5e6c8de6d16bff50972b45c3c1a083b985 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
@@ -182,8 +182,8 @@ static inline struct mtk_hdmi *hdmi_ctx_from_bridge(struct drm_bridge *b)
 
 static void mtk_hdmi_hw_vid_black(struct mtk_hdmi *hdmi, bool black)
 {
-	regmap_update_bits(hdmi->regs, VIDEO_SOURCE_SEL,
-			   VIDEO_CFG_4, black ? GEN_RGB : NORMAL_PATH);
+	regmap_update_bits(hdmi->regs, VIDEO_CFG_4,
+			   VIDEO_SOURCE_SEL, black ? GEN_RGB : NORMAL_PATH);
 }
 
 static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable)
@@ -310,8 +310,8 @@ static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer,
 
 static void mtk_hdmi_hw_send_aud_packet(struct mtk_hdmi *hdmi, bool enable)
 {
-	regmap_update_bits(hdmi->regs, AUDIO_PACKET_OFF,
-			   GRL_SHIFT_R2, enable ? 0 : AUDIO_PACKET_OFF);
+	regmap_update_bits(hdmi->regs, GRL_SHIFT_R2,
+			   AUDIO_PACKET_OFF, enable ? 0 : AUDIO_PACKET_OFF);
 }
 
 static void mtk_hdmi_hw_config_sys(struct mtk_hdmi *hdmi)

---
base-commit: afb39542bbf14acf910012eee2d4159add05d384
change-id: 20250818-mt8173-fix-hdmi-issue-287cf353b077

Best regards,
-- 
Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/mediatek: mtk_hdmi: fix inverted parameters in some regmap_update_bits calls
  2025-08-18 14:17 [PATCH] drm/mediatek: mtk_hdmi: fix inverted parameters in some regmap_update_bits calls Louis-Alexis Eyraud
@ 2025-08-20  2:37 ` CK Hu (胡俊光)
  2025-08-23 15:35 ` Chun-Kuang Hu
  1 sibling, 0 replies; 3+ messages in thread
From: CK Hu (胡俊光) @ 2025-08-20  2:37 UTC (permalink / raw)
  To: granquet@baylibre.com, chunkuang.hu@kernel.org, simona@ffwll.ch,
	AngeloGioacchino Del Regno, airlied@gmail.com,
	p.zabel@pengutronix.de, matthias.bgg@gmail.com,
	Louis-Alexis Eyraud
  Cc: dri-devel@lists.freedesktop.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, kernel@collabora.com,
	linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2339 bytes --]

On Mon, 2025-08-18 at 16:17 +0200, Louis-Alexis Eyraud wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> In mtk_hdmi driver, a recent change replaced custom register access
> function calls by regmap ones, but two replacements by regmap_update_bits
> were done incorrectly, because original offset and mask parameters were
> inverted, so fix them.

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

> 
> Fixes: d6e25b3590a0 ("drm/mediatek: hdmi: Use regmap instead of iomem for main registers")
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_hdmi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index 845fd8aa43c3c91659808d9e6bb78758d1f9b857..b766dd5e6c8de6d16bff50972b45c3c1a083b985 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -182,8 +182,8 @@ static inline struct mtk_hdmi *hdmi_ctx_from_bridge(struct drm_bridge *b)
> 
>  static void mtk_hdmi_hw_vid_black(struct mtk_hdmi *hdmi, bool black)
>  {
> -       regmap_update_bits(hdmi->regs, VIDEO_SOURCE_SEL,
> -                          VIDEO_CFG_4, black ? GEN_RGB : NORMAL_PATH);
> +       regmap_update_bits(hdmi->regs, VIDEO_CFG_4,
> +                          VIDEO_SOURCE_SEL, black ? GEN_RGB : NORMAL_PATH);
>  }
> 
>  static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable)
> @@ -310,8 +310,8 @@ static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer,
> 
>  static void mtk_hdmi_hw_send_aud_packet(struct mtk_hdmi *hdmi, bool enable)
>  {
> -       regmap_update_bits(hdmi->regs, AUDIO_PACKET_OFF,
> -                          GRL_SHIFT_R2, enable ? 0 : AUDIO_PACKET_OFF);
> +       regmap_update_bits(hdmi->regs, GRL_SHIFT_R2,
> +                          AUDIO_PACKET_OFF, enable ? 0 : AUDIO_PACKET_OFF);
>  }
> 
>  static void mtk_hdmi_hw_config_sys(struct mtk_hdmi *hdmi)
> 
> ---
> base-commit: afb39542bbf14acf910012eee2d4159add05d384
> change-id: 20250818-mt8173-fix-hdmi-issue-287cf353b077
> 
> Best regards,
> --
> Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
> 


[-- Attachment #2: Type: text/html, Size: 4910 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/mediatek: mtk_hdmi: fix inverted parameters in some regmap_update_bits calls
  2025-08-18 14:17 [PATCH] drm/mediatek: mtk_hdmi: fix inverted parameters in some regmap_update_bits calls Louis-Alexis Eyraud
  2025-08-20  2:37 ` CK Hu (胡俊光)
@ 2025-08-23 15:35 ` Chun-Kuang Hu
  1 sibling, 0 replies; 3+ messages in thread
From: Chun-Kuang Hu @ 2025-08-23 15:35 UTC (permalink / raw)
  To: Louis-Alexis Eyraud
  Cc: Chun-Kuang Hu, Philipp Zabel, David Airlie, Simona Vetter,
	Matthias Brugger, AngeloGioacchino Del Regno, CK Hu,
	Guillaume Ranquet, kernel, dri-devel, linux-mediatek,
	linux-kernel, linux-arm-kernel

Hi, Louis:

Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com> 於 2025年8月18日 週一
下午10:18寫道:
>
> In mtk_hdmi driver, a recent change replaced custom register access
> function calls by regmap ones, but two replacements by regmap_update_bits
> were done incorrectly, because original offset and mask parameters were
> inverted, so fix them.

Applied to mediatek-drm-fixes [1], thanks.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes

Regards,
Chun-Kuang.

>
> Fixes: d6e25b3590a0 ("drm/mediatek: hdmi: Use regmap instead of iomem for main registers")
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_hdmi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index 845fd8aa43c3c91659808d9e6bb78758d1f9b857..b766dd5e6c8de6d16bff50972b45c3c1a083b985 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -182,8 +182,8 @@ static inline struct mtk_hdmi *hdmi_ctx_from_bridge(struct drm_bridge *b)
>
>  static void mtk_hdmi_hw_vid_black(struct mtk_hdmi *hdmi, bool black)
>  {
> -       regmap_update_bits(hdmi->regs, VIDEO_SOURCE_SEL,
> -                          VIDEO_CFG_4, black ? GEN_RGB : NORMAL_PATH);
> +       regmap_update_bits(hdmi->regs, VIDEO_CFG_4,
> +                          VIDEO_SOURCE_SEL, black ? GEN_RGB : NORMAL_PATH);
>  }
>
>  static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable)
> @@ -310,8 +310,8 @@ static void mtk_hdmi_hw_send_info_frame(struct mtk_hdmi *hdmi, u8 *buffer,
>
>  static void mtk_hdmi_hw_send_aud_packet(struct mtk_hdmi *hdmi, bool enable)
>  {
> -       regmap_update_bits(hdmi->regs, AUDIO_PACKET_OFF,
> -                          GRL_SHIFT_R2, enable ? 0 : AUDIO_PACKET_OFF);
> +       regmap_update_bits(hdmi->regs, GRL_SHIFT_R2,
> +                          AUDIO_PACKET_OFF, enable ? 0 : AUDIO_PACKET_OFF);
>  }
>
>  static void mtk_hdmi_hw_config_sys(struct mtk_hdmi *hdmi)
>
> ---
> base-commit: afb39542bbf14acf910012eee2d4159add05d384
> change-id: 20250818-mt8173-fix-hdmi-issue-287cf353b077
>
> Best regards,
> --
> Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-23 15:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 14:17 [PATCH] drm/mediatek: mtk_hdmi: fix inverted parameters in some regmap_update_bits calls Louis-Alexis Eyraud
2025-08-20  2:37 ` CK Hu (胡俊光)
2025-08-23 15:35 ` Chun-Kuang Hu

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).