[PATCH] drm: Make the HPD status updates debug logs more readable

2012-12-10 Thread Damien Lespiau
On Tue, Dec 4, 2012 at 5:39 PM, Daniel Vetter  wrote:
> On Tue, Dec 04, 2012 at 04:00:17PM +, Damien Lespiau wrote:
>> From: Damien Lespiau 
>>
>> Instead of just printing "status updated from 1 to 2", make those enum
>> numbers immediately readable.
>>
>> Signed-off-by: Damien Lespiau 
>
> I like, stupid me can never remember the magic values. For the patch
> itself, can you please also patch the connector updates in
> drm_helper_probe_single_connector_modes (which is required to avoid losing
> hpd events when doing a manual probe cycle) and output_poll_execute. For
> completeness maybe also throw in a debug output in
> drm_helper_disable_unused_functions, but that's only relevant for drivers
> that use the modeset helpers (i.e. not for drm/i915).

v2 sent. I think that the current log messages around ->detect in
drm_helper_probe_single_connector_modes() serves as nice guards around
the detection code and went to "fix" a bigger offender, namely logging
all the previously valid modes when detecting a disconnection.

For the last one, leaving the decision of adding yet another log
message to the users of that helper sounds better to me.

-- 
Damien


Re: [PATCH] drm: Make the HPD status updates debug logs more readable

2012-12-10 Thread Damien Lespiau
On Tue, Dec 4, 2012 at 5:39 PM, Daniel Vetter dan...@ffwll.ch wrote:
 On Tue, Dec 04, 2012 at 04:00:17PM +, Damien Lespiau wrote:
 From: Damien Lespiau damien.lesp...@intel.com

 Instead of just printing status updated from 1 to 2, make those enum
 numbers immediately readable.

 Signed-off-by: Damien Lespiau damien.lesp...@intel.com

 I like, stupid me can never remember the magic values. For the patch
 itself, can you please also patch the connector updates in
 drm_helper_probe_single_connector_modes (which is required to avoid losing
 hpd events when doing a manual probe cycle) and output_poll_execute. For
 completeness maybe also throw in a debug output in
 drm_helper_disable_unused_functions, but that's only relevant for drivers
 that use the modeset helpers (i.e. not for drm/i915).

v2 sent. I think that the current log messages around -detect in
drm_helper_probe_single_connector_modes() serves as nice guards around
the detection code and went to fix a bigger offender, namely logging
all the previously valid modes when detecting a disconnection.

For the last one, leaving the decision of adding yet another log
message to the users of that helper sounds better to me.

-- 
Damien
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm: Make the HPD status updates debug logs more readable

2012-12-04 Thread Daniel Vetter
On Tue, Dec 04, 2012 at 04:00:17PM +, Damien Lespiau wrote:
> From: Damien Lespiau 
> 
> Instead of just printing "status updated from 1 to 2", make those enum
> numbers immediately readable.
> 
> Signed-off-by: Damien Lespiau 

I like, stupid me can never remember the magic values. For the patch
itself, can you please also patch the connector updates in
drm_helper_probe_single_connector_modes (which is required to avoid losing
hpd events when doing a manual probe cycle) and output_poll_execute. For
completeness maybe also throw in a debug output in
drm_helper_disable_unused_functions, but that's only relevant for drivers
that use the modeset helpers (i.e. not for drm/i915).

Thanks, Daniel

> ---
>  drivers/gpu/drm/drm_crtc_helper.c | 17 +++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c 
> b/drivers/gpu/drm/drm_crtc_helper.c
> index 1fe719f..8b963fd 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -1043,6 +1043,18 @@ void drm_kms_helper_poll_fini(struct drm_device *dev)
>  }
>  EXPORT_SYMBOL(drm_kms_helper_poll_fini);
>  
> +static const char *connector_status_str(enum drm_connector_status status)
> +{
> + switch (status) {
> + case connector_status_connected:
> + return "connected";
> + case connector_status_disconnected:
> + return "disconnected";
> + default:
> + return "unknown";
> + }
> +}
> +
>  void drm_helper_hpd_irq_event(struct drm_device *dev)
>  {
>   struct drm_connector *connector;
> @@ -1062,10 +1074,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
>   old_status = connector->status;
>  
>   connector->status = connector->funcs->detect(connector, false);
> - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to 
> %d\n",
> + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to 
> %s\n",
> connector->base.id,
> drm_get_connector_name(connector),
> -   old_status, connector->status);
> +   connector_status_str(old_status),
> +   connector_status_str(connector->status));
>   if (old_status != connector->status)
>   changed = true;
>   }
> -- 
> 1.7.11.7
> 
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


[PATCH] drm: Make the HPD status updates debug logs more readable

2012-12-04 Thread Damien Lespiau
From: Damien Lespiau 

Instead of just printing "status updated from 1 to 2", make those enum
numbers immediately readable.

Signed-off-by: Damien Lespiau 
---
 drivers/gpu/drm/drm_crtc_helper.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c 
b/drivers/gpu/drm/drm_crtc_helper.c
index 1fe719f..8b963fd 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -1043,6 +1043,18 @@ void drm_kms_helper_poll_fini(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);

+static const char *connector_status_str(enum drm_connector_status status)
+{
+   switch (status) {
+   case connector_status_connected:
+   return "connected";
+   case connector_status_disconnected:
+   return "disconnected";
+   default:
+   return "unknown";
+   }
+}
+
 void drm_helper_hpd_irq_event(struct drm_device *dev)
 {
struct drm_connector *connector;
@@ -1062,10 +1074,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
old_status = connector->status;

connector->status = connector->funcs->detect(connector, false);
-   DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to 
%d\n",
+   DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to 
%s\n",
  connector->base.id,
  drm_get_connector_name(connector),
- old_status, connector->status);
+ connector_status_str(old_status),
+ connector_status_str(connector->status));
if (old_status != connector->status)
changed = true;
}
-- 
1.7.11.7



[PATCH] drm: Make the HPD status updates debug logs more readable

2012-12-04 Thread Damien Lespiau
From: Damien Lespiau damien.lesp...@intel.com

Instead of just printing status updated from 1 to 2, make those enum
numbers immediately readable.

Signed-off-by: Damien Lespiau damien.lesp...@intel.com
---
 drivers/gpu/drm/drm_crtc_helper.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c 
b/drivers/gpu/drm/drm_crtc_helper.c
index 1fe719f..8b963fd 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -1043,6 +1043,18 @@ void drm_kms_helper_poll_fini(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_kms_helper_poll_fini);
 
+static const char *connector_status_str(enum drm_connector_status status)
+{
+   switch (status) {
+   case connector_status_connected:
+   return connected;
+   case connector_status_disconnected:
+   return disconnected;
+   default:
+   return unknown;
+   }
+}
+
 void drm_helper_hpd_irq_event(struct drm_device *dev)
 {
struct drm_connector *connector;
@@ -1062,10 +1074,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
old_status = connector-status;
 
connector-status = connector-funcs-detect(connector, false);
-   DRM_DEBUG_KMS([CONNECTOR:%d:%s] status updated from %d to 
%d\n,
+   DRM_DEBUG_KMS([CONNECTOR:%d:%s] status updated from %s to 
%s\n,
  connector-base.id,
  drm_get_connector_name(connector),
- old_status, connector-status);
+ connector_status_str(old_status),
+ connector_status_str(connector-status));
if (old_status != connector-status)
changed = true;
}
-- 
1.7.11.7

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm: Make the HPD status updates debug logs more readable

2012-12-04 Thread Daniel Vetter
On Tue, Dec 04, 2012 at 04:00:17PM +, Damien Lespiau wrote:
 From: Damien Lespiau damien.lesp...@intel.com
 
 Instead of just printing status updated from 1 to 2, make those enum
 numbers immediately readable.
 
 Signed-off-by: Damien Lespiau damien.lesp...@intel.com

I like, stupid me can never remember the magic values. For the patch
itself, can you please also patch the connector updates in
drm_helper_probe_single_connector_modes (which is required to avoid losing
hpd events when doing a manual probe cycle) and output_poll_execute. For
completeness maybe also throw in a debug output in
drm_helper_disable_unused_functions, but that's only relevant for drivers
that use the modeset helpers (i.e. not for drm/i915).

Thanks, Daniel

 ---
  drivers/gpu/drm/drm_crtc_helper.c | 17 +++--
  1 file changed, 15 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/gpu/drm/drm_crtc_helper.c 
 b/drivers/gpu/drm/drm_crtc_helper.c
 index 1fe719f..8b963fd 100644
 --- a/drivers/gpu/drm/drm_crtc_helper.c
 +++ b/drivers/gpu/drm/drm_crtc_helper.c
 @@ -1043,6 +1043,18 @@ void drm_kms_helper_poll_fini(struct drm_device *dev)
  }
  EXPORT_SYMBOL(drm_kms_helper_poll_fini);
  
 +static const char *connector_status_str(enum drm_connector_status status)
 +{
 + switch (status) {
 + case connector_status_connected:
 + return connected;
 + case connector_status_disconnected:
 + return disconnected;
 + default:
 + return unknown;
 + }
 +}
 +
  void drm_helper_hpd_irq_event(struct drm_device *dev)
  {
   struct drm_connector *connector;
 @@ -1062,10 +1074,11 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
   old_status = connector-status;
  
   connector-status = connector-funcs-detect(connector, false);
 - DRM_DEBUG_KMS([CONNECTOR:%d:%s] status updated from %d to 
 %d\n,
 + DRM_DEBUG_KMS([CONNECTOR:%d:%s] status updated from %s to 
 %s\n,
 connector-base.id,
 drm_get_connector_name(connector),
 -   old_status, connector-status);
 +   connector_status_str(old_status),
 +   connector_status_str(connector-status));
   if (old_status != connector-status)
   changed = true;
   }
 -- 
 1.7.11.7
 
 ___
 dri-devel mailing list
 dri-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel