All of lore.kernel.org
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: emma@anholt.net, airlied@linux.ie, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH 1/1] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi
Date: Sun, 10 Apr 2022 12:21:22 +0200	[thread overview]
Message-ID: <20220410102122.GA3818@elementary> (raw)
In-Reply-To: <20220408074110.bz7jne46k7zvrizz@houat>

Hi Maxime,

Thanks for your comments.

On Fri, Apr 08, 2022 at 09:41:10AM +0200, Maxime Ripard wrote:
> 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?

I had to add noinline to a couple of relevant functions and run the
usual:

$ sudo trace-cmd record -p function_graph -l "vc4_hdmi_*" [...]

I'll add the command to v2.

 
> > 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@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

Cool, I'll work on a follow up patch to remove vc4_encoder.hdmi_monitor
and add it to v2.

Thanks,
Jose


WARNING: multiple messages have this Message-ID (diff)
From: "José Expósito" <jose.exposito89@gmail.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: emma@anholt.net, laurent.pinchart@ideasonboard.com,
	airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi
Date: Sun, 10 Apr 2022 12:21:22 +0200	[thread overview]
Message-ID: <20220410102122.GA3818@elementary> (raw)
In-Reply-To: <20220408074110.bz7jne46k7zvrizz@houat>

Hi Maxime,

Thanks for your comments.

On Fri, Apr 08, 2022 at 09:41:10AM +0200, Maxime Ripard wrote:
> 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?

I had to add noinline to a couple of relevant functions and run the
usual:

$ sudo trace-cmd record -p function_graph -l "vc4_hdmi_*" [...]

I'll add the command to v2.

 
> > 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@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

Cool, I'll work on a follow up patch to remove vc4_encoder.hdmi_monitor
and add it to v2.

Thanks,
Jose


  reply	other threads:[~2022-04-10 10:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06 16:55 [PATCH 0/1] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi José Expósito
2022-04-06 16:55 ` José Expósito
2022-04-06 16:55 ` [PATCH 1/1] drm/vc4: hdmi: Replace drm_detect_hdmi_monitor() with is_hdmi José Expósito
2022-04-06 16:55   ` José Expósito
2022-04-08  7:41   ` Maxime Ripard
2022-04-08  7:41     ` Maxime Ripard
2022-04-10 10:21     ` José Expósito [this message]
2022-04-10 10:21       ` José Expósito

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=20220410102122.GA3818@elementary \
    --to=jose.exposito89@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime@cerno.tech \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.