Re: [PATCH] drm: change logs to print connectors in the form CONNECTOR:id:name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 15, 2021 at 12:22:08PM +0200, Jani Nikula wrote:
> On Sat, 13 Nov 2021, Claudio Suarez <cssk@xxxxxxxx> wrote:
> > The prefered way to log connectors is [CONNECTOR:id:name]. Change it in
> > drm core programs.
> >
> > Suggested-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> > Signed-off-by: Claudio Suarez <cssk@xxxxxxxx>
> > ---
> >  drivers/gpu/drm/drm_client_modeset.c | 51 ++++++++++++++--------------
> >  drivers/gpu/drm/drm_connector.c      | 12 ++++---
> >  drivers/gpu/drm/drm_edid.c           | 36 ++++++++++----------
> >  drivers/gpu/drm/drm_edid_load.c      | 11 +++---
> >  drivers/gpu/drm/drm_mode_config.c    |  3 +-
> >  5 files changed, 59 insertions(+), 54 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
> > index ced09c7c06f9..4f35dc375bdd 100644
> > --- a/drivers/gpu/drm/drm_client_modeset.c
> > +++ b/drivers/gpu/drm/drm_client_modeset.c
> > @@ -240,7 +240,7 @@ static void drm_client_connectors_enabled(struct drm_connector **connectors,
> >  	for (i = 0; i < connector_count; i++) {
> >  		connector = connectors[i];
> >  		enabled[i] = drm_connector_enabled(connector, true);
> > -		DRM_DEBUG_KMS("connector %d enabled? %s\n", connector->base.id,
> > +		DRM_DEBUG_KMS("[CONNECTOR:%d;%s] enabled? %s\n", connector->base.id, connector->name,
> >  			      connector->display_info.non_desktop ? "non desktop" : enabled[i] ? "yes" : "no");
> 
> You have a semicolon instead of a colon there.

Sorry my typo. I am going to do a new version.

> 
> Not to block this patch, but I've wondered about bigger changes such as:
> 
> - Adding "debug_name" member or similar in drm_connector, which would be
>   an allocated string with "[CONNECTOR:id:name]" that you could use with
>   just %s while debug logging.
> 
> - Adding drm_dbg_connector() which would take drm_connector as context,
>   and do drm_dbg_kms() with the above prefix.
> 
> >  
> >  		any_enabled |= enabled[i];
> > @@ -350,8 +350,8 @@ static int drm_client_get_tile_offsets(struct drm_connector **connectors,
> >  			continue;
> >  
> >  		if (!modes[i] && (h_idx || v_idx)) {
> > -			DRM_DEBUG_KMS("no modes for connector tiled %d %d\n", i,
> > -				      connector->base.id);
> > +			DRM_DEBUG_KMS("no modes for [CONNECTOR:%d:%s] tiled %d\n",
> > +				      connector->base.id, connector->name, i);
> 
> Personally I'd prefer adding [CONNECTOR:id:name] as a prefix in the
> beginning, throughout, not in the middle.

I'd prefer too. I am going to change it in the new version.

B.R.
Claudio Suarez.






[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux