[PATCH 1/1] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi

Maxime Ripard maxime at cerno.tech
Fri Apr 8 07:41:10 UTC 2022


Hi Jose,

On Wed, Apr 06, 2022 at 06:55:14PM +0200, José Expósito wrote:
> Once EDID is parsed, the monitor HDMI support information is cached in
> drm_display_info.is_hdmi by drm_parse_hdmi_vsdb_video().
> 
> This driver calls drm_detect_hdmi_monitor() to receive the same
> information and stores its own cached value, which is less efficient.
> 
> Avoid calling drm_detect_hdmi_monitor() and use drm_display_info.is_hdmi
> instead.
> 
> drm_detect_hdmi_monitor() is called in vc4_hdmi_connector_detect() and
> vc4_hdmi_connector_get_modes(). In both cases it is safe to rely on
> drm_display_info.is_hdmi as shown by ftrace:

How do you use ftrace to generate that?

> vc4_hdmi_connector_detect:
> 
>     vc4_hdmi_connector_detect() {
>       drm_get_edid() {
>         drm_connector_update_edid_property() {
>           drm_add_display_info() {
>             drm_reset_display_info();
>             drm_for_each_detailed_block.part.0();
>             drm_parse_cea_ext() {
>               drm_find_cea_extension();
>               cea_db_offsets.part.0();
>               cea_db_is_hdmi_vsdb.part.0();
>               drm_parse_hdmi_vsdb_video();
>               /* drm_display_info.is_hdmi is cached here */
>             }
>           }
>         }
>       }
>       /* drm_display_info.is_hdmi is used here */
>     }
> 
> vc4_hdmi_connector_get_modes:
> 
>     vc4_hdmi_connector_get_modes() {
>       drm_get_edid() {
>         drm_connector_update_edid_property() {
>           drm_add_display_info() {
>             drm_reset_display_info();
>             drm_for_each_detailed_block.part.0();
>             drm_parse_cea_ext() {
>               drm_find_cea_extension();
>               cea_db_offsets.part.0();
>               cea_db_is_hdmi_vsdb.part.0();
>               drm_parse_hdmi_vsdb_video();
>               /* drm_display_info.is_hdmi is cached here */
>             }
>           }
>         }
>       }
>       /* drm_display_info.is_hdmi is used here */
>       drm_connector_update_edid_property();
>     }
> 
> Signed-off-by: José Expósito <jose.exposito89 at gmail.com>

I think what you're hinting at in the cover letter would be best though:
we should just remove that caching entirely and use is_hdmi everywhere

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20220408/8845828b/attachment-0001.sig>


More information about the dri-devel mailing list