* [PATCH] drm/gma500: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
@ 2024-09-10 5:18 Tejas Vipin
2024-09-10 7:59 ` Jani Nikula
0 siblings, 1 reply; 2+ messages in thread
From: Tejas Vipin @ 2024-09-10 5:18 UTC (permalink / raw)
To: Laurent.pinchart, patrik.r.jakobsson, maarten.lankhorst, mripard,
tzimmermann, airlied, daniel
Cc: dri-devel, linux-kernel, Tejas Vipin
Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi since
monitor HDMI information is available after EDID is parsed. Additionally
rewrite the code the code to have fewer indentation levels.
Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
---
drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
index 2d95e0471291..cfbf3137e144 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
@@ -135,16 +135,16 @@ static enum drm_connector_status cdv_hdmi_detect(
hdmi_priv->has_hdmi_sink = false;
hdmi_priv->has_hdmi_audio = false;
- if (edid) {
- if (edid->input & DRM_EDID_INPUT_DIGITAL) {
- status = connector_status_connected;
- hdmi_priv->has_hdmi_sink =
- drm_detect_hdmi_monitor(edid);
- hdmi_priv->has_hdmi_audio =
- drm_detect_monitor_audio(edid);
- }
- kfree(edid);
+ if (!edid)
+ return status;
+
+ if (edid->input & DRM_EDID_INPUT_DIGITAL) {
+ status = connector_status_connected;
+ hdmi_priv->has_hdmi_sink = connector->display_info.is_hdmi;
+ hdmi_priv->has_hdmi_audio = drm_detect_monitor_audio(edid);
}
+ kfree(edid);
+
return status;
}
--
2.46.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/gma500: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
2024-09-10 5:18 [PATCH] drm/gma500: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Tejas Vipin
@ 2024-09-10 7:59 ` Jani Nikula
0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2024-09-10 7:59 UTC (permalink / raw)
To: Tejas Vipin, Laurent.pinchart, patrik.r.jakobsson,
maarten.lankhorst, mripard, tzimmermann, airlied, daniel
Cc: dri-devel, linux-kernel, Tejas Vipin
On Tue, 10 Sep 2024, Tejas Vipin <tejasvipin76@gmail.com> wrote:
> Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi since
> monitor HDMI information is available after EDID is parsed. Additionally
> rewrite the code the code to have fewer indentation levels.
>
> Signed-off-by: Tejas Vipin <tejasvipin76@gmail.com>
> ---
> drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> index 2d95e0471291..cfbf3137e144 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_hdmi.c
> @@ -135,16 +135,16 @@ static enum drm_connector_status cdv_hdmi_detect(
>
> hdmi_priv->has_hdmi_sink = false;
> hdmi_priv->has_hdmi_audio = false;
> - if (edid) {
> - if (edid->input & DRM_EDID_INPUT_DIGITAL) {
> - status = connector_status_connected;
> - hdmi_priv->has_hdmi_sink =
> - drm_detect_hdmi_monitor(edid);
> - hdmi_priv->has_hdmi_audio =
> - drm_detect_monitor_audio(edid);
> - }
> - kfree(edid);
> + if (!edid)
> + return status;
> +
> + if (edid->input & DRM_EDID_INPUT_DIGITAL) {
> + status = connector_status_connected;
> + hdmi_priv->has_hdmi_sink = connector->display_info.is_hdmi;
> + hdmi_priv->has_hdmi_audio = drm_detect_monitor_audio(edid);
display_info.has_audio
> }
> + kfree(edid);
> +
Please switch the code to use struct drm_edid and the related functions
drm_edid_read(), drm_edid_connector_update() and
drm_edid_connector_add_modes() while you're at it. See git log
--grep=drm_edid for a number of examples.
BR,
Jani.
> return status;
> }
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-09-10 7:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-10 5:18 [PATCH] drm/gma500: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Tejas Vipin
2024-09-10 7:59 ` Jani Nikula
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).