[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAOTY__JXYfCRTBh_TYWCNy1d0hcNXOzeR8Czk=KiauEs6xcXQ@mail.gmail.com>
Date: Thu, 2 Jan 2025 22:10:10 +0800
From: Chun-Kuang Hu <chunkuang.hu@...nel.org>
To: Liankun Yang <liankun.yang@...iatek.com>
Cc: chunkuang.hu@...nel.org, p.zabel@...gutronix.de, airlied@...il.com,
simona@...ll.ch, matthias.bgg@...il.com,
angelogioacchino.delregno@...labora.com, ck.hu@...iatek.com,
granquet@...libre.com, dmitry.osipenko@...labora.com,
rex-bc.chen@...iatek.com, jitao.shi@...iatek.com, mac.shen@...iatek.com,
peng.liu@...iatek.com, Project_Global_Chrome_Upstream_Group@...iatek.com,
dri-devel@...ts.freedesktop.org, linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/1] drm/mediatek: Add return value check when reading DPCD
Hi, Liankun:
Liankun Yang <liankun.yang@...iatek.com> 於 2024年12月18日 週三 下午7:35寫道:
>
> Returns the number of bytes transferred (1) on success.
> Check the return value to confirm that AUX communication is successful.
>
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
>
> Signed-off-by: Liankun Yang <liankun.yang@...iatek.com>
> ---
> Changes in V3:
> - Using drm_dp_read_sink_count() to improve patch.
> Per suggestion from the previous thread:
> https://patchwork.kernel.org/project/linux-mediatek/patch/20241128030940.25657-1-liankun.yang@mediatek.com/
>
> Changes in V2:
> - Modify Fixes in Commit Message.
> Per suggestion from the previous thread:
> https://patchwork.kernel.org/project/linux-mediatek/patch/20240930092000.5385-1-liankun.yang@mediatek.com/
> ---
> drivers/gpu/drm/mediatek/mtk_dp.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index 36713c176cfc..b26dad8783be 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -2100,7 +2100,6 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
> struct mtk_dp *mtk_dp = mtk_dp_from_bridge(bridge);
> enum drm_connector_status ret = connector_status_disconnected;
> bool enabled = mtk_dp->enabled;
> - u8 sink_count = 0;
>
> if (!mtk_dp->train_info.cable_plugged_in)
> return ret;
> @@ -2115,8 +2114,8 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
> * function, we just need to check the HPD connection to check
> * whether we connect to a sink device.
> */
> - drm_dp_dpcd_readb(&mtk_dp->aux, DP_SINK_COUNT, &sink_count);
> - if (DP_GET_SINK_COUNT(sink_count))
> +
> + if (drm_dp_read_sink_count(&mtk_dp->aux))
if (drm_dp_read_sink_count(&mtk_dp->aux) > 0)
With this fix-up, 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.
> ret = connector_status_connected;
>
> if (!enabled)
> --
> 2.45.2
>
Powered by blists - more mailing lists