diff mbox

[3/3] drm/i915: Print prop name/id when rejecting it

Message ID 20180611193403.16118-3-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä June 11, 2018, 7:34 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use the '[PROP:id:name]' format I introduced for the core in the driver
debug messages as well.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_atomic.c       | 6 ++++--
 drivers/gpu/drm/i915/intel_atomic_plane.c | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

Comments

Daniel Vetter June 18, 2018, 8:53 a.m. UTC | #1
On Mon, Jun 11, 2018 at 10:34:03PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Use the '[PROP:id:name]' format I introduced for the core in the driver
> debug messages as well.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I'm wondering whether there's not some kind of macro magic we could do,
but unfortunately printf style stuff is really not composable :-/ And our
stuff isn't important enough to warant new %p modes either ...
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_atomic.c       | 6 ++++--
>  drivers/gpu/drm/i915/intel_atomic_plane.c | 6 ++++--
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 61ddb5871d8a..b04952bacf77 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -59,7 +59,8 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
>  	else if (property == dev_priv->broadcast_rgb_property)
>  		*val = intel_conn_state->broadcast_rgb;
>  	else {
> -		DRM_DEBUG_ATOMIC("Unknown property %s\n", property->name);
> +		DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
> +				 property->base.id, property->name);
>  		return -EINVAL;
>  	}
>  
> @@ -95,7 +96,8 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
>  		return 0;
>  	}
>  
> -	DRM_DEBUG_ATOMIC("Unknown property %s\n", property->name);
> +	DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
> +			 property->base.id, property->name);
>  	return -EINVAL;
>  }
>  
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index e8bf4cc499e1..dcba645cabb8 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -265,7 +265,8 @@ intel_plane_atomic_get_property(struct drm_plane *plane,
>  				struct drm_property *property,
>  				uint64_t *val)
>  {
> -	DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name);
> +	DRM_DEBUG_KMS("Unknown property [PROP:%d:%s]\n",
> +		      property->base.id, property->name);
>  	return -EINVAL;
>  }
>  
> @@ -287,6 +288,7 @@ intel_plane_atomic_set_property(struct drm_plane *plane,
>  				struct drm_property *property,
>  				uint64_t val)
>  {
> -	DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name);
> +	DRM_DEBUG_KMS("Unknown property [PROP:%d:%s]\n",
> +		      property->base.id, property->name);
>  	return -EINVAL;
>  }
> -- 
> 2.16.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä June 18, 2018, 12:03 p.m. UTC | #2
On Mon, Jun 18, 2018 at 10:53:13AM +0200, Daniel Vetter wrote:
> On Mon, Jun 11, 2018 at 10:34:03PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Use the '[PROP:id:name]' format I introduced for the core in the driver
> > debug messages as well.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I'm wondering whether there's not some kind of macro magic we could do,
> but unfortunately printf style stuff is really not composable :-/ And our
> stuff isn't important enough to warant new %p modes either ...

I should have DRM_PLANE_FMT, DRM_PLANE_ARGS(), etc. in some branch.
Never posted that stuff because I wasn't entirely convinced it's
all that useful. Opinions?
Daniel Vetter June 18, 2018, 4:04 p.m. UTC | #3
On Mon, Jun 18, 2018 at 03:03:39PM +0300, Ville Syrjälä wrote:
> On Mon, Jun 18, 2018 at 10:53:13AM +0200, Daniel Vetter wrote:
> > On Mon, Jun 11, 2018 at 10:34:03PM +0300, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Use the '[PROP:id:name]' format I introduced for the core in the driver
> > > debug messages as well.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > I'm wondering whether there's not some kind of macro magic we could do,
> > but unfortunately printf style stuff is really not composable :-/ And our
> > stuff isn't important enough to warant new %p modes either ...
> 
> I should have DRM_PLANE_FMT, DRM_PLANE_ARGS(), etc. in some branch.
> Never posted that stuff because I wasn't entirely convinced it's
> all that useful. Opinions?

Yeah, not sure that's better either ... and doing a %s with a
drm_format_$obj() gives us massive headaches with leaking strings
everywhere :-)

Maybe we should just have an $obj->debug_str field that we file out when
creating the object? Also not awesome, but about the best I can come up
with.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 61ddb5871d8a..b04952bacf77 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -59,7 +59,8 @@  int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
 	else if (property == dev_priv->broadcast_rgb_property)
 		*val = intel_conn_state->broadcast_rgb;
 	else {
-		DRM_DEBUG_ATOMIC("Unknown property %s\n", property->name);
+		DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
+				 property->base.id, property->name);
 		return -EINVAL;
 	}
 
@@ -95,7 +96,8 @@  int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
 		return 0;
 	}
 
-	DRM_DEBUG_ATOMIC("Unknown property %s\n", property->name);
+	DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n",
+			 property->base.id, property->name);
 	return -EINVAL;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index e8bf4cc499e1..dcba645cabb8 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -265,7 +265,8 @@  intel_plane_atomic_get_property(struct drm_plane *plane,
 				struct drm_property *property,
 				uint64_t *val)
 {
-	DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name);
+	DRM_DEBUG_KMS("Unknown property [PROP:%d:%s]\n",
+		      property->base.id, property->name);
 	return -EINVAL;
 }
 
@@ -287,6 +288,7 @@  intel_plane_atomic_set_property(struct drm_plane *plane,
 				struct drm_property *property,
 				uint64_t val)
 {
-	DRM_DEBUG_KMS("Unknown plane property '%s'\n", property->name);
+	DRM_DEBUG_KMS("Unknown property [PROP:%d:%s]\n",
+		      property->base.id, property->name);
 	return -EINVAL;
 }