Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: Make the HPD status updates debug logs more readable
@ 2012-12-10 20:24 Damien Lespiau
  2012-12-10 20:24 ` [PATCH 2/2] drm: Don't prune modes loudly when a connector is disconnected Damien Lespiau
  2012-12-10 21:12 ` [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Jesse Barnes
  0 siblings, 2 replies; 3+ messages in thread
From: Damien Lespiau @ 2012-12-10 20:24 UTC (permalink / raw)
  To: intel-gfx, dri-devel

From: Damien Lespiau <damien.lespiau@intel.com>

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

v2: Also patch output_poll_execute() (Daniel Vetter)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_crtc_helper.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 1fe719f..524f0d3 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -950,6 +950,18 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_kms_helper_hotplug_event);
 
+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";
+	}
+}
+
 #define DRM_OUTPUT_POLL_PERIOD (10*HZ)
 static void output_poll_execute(struct work_struct *work)
 {
@@ -984,10 +996,11 @@ static void output_poll_execute(struct work_struct *work)
 			continue;
 
 		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;
 	}
@@ -1062,10 +1075,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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm: Don't prune modes loudly when a connector is disconnected
  2012-12-10 20:24 [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Damien Lespiau
@ 2012-12-10 20:24 ` Damien Lespiau
  2012-12-10 21:12 ` [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Damien Lespiau @ 2012-12-10 20:24 UTC (permalink / raw)
  To: intel-gfx, dri-devel

From: Damien Lespiau <damien.lespiau@intel.com>

drm_helper_probe_single_connector_modes() is responsible for pruning the
previously detected modes on a disconnected connector. We don't really
need to log, again, the full list of modes that used to be valid when
connected.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_crtc_helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 524f0d3..865b0f7 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -111,6 +111,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 		connector->helper_private;
 	int count = 0;
 	int mode_flags = 0;
+	bool verbose_prune = true;
 
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
 			drm_get_connector_name(connector));
@@ -139,6 +140,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
 			connector->base.id, drm_get_connector_name(connector));
 		drm_mode_connector_update_edid_property(connector, NULL);
+		verbose_prune = false;
 		goto prune;
 	}
 
@@ -172,7 +174,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
 	}
 
 prune:
-	drm_mode_prune_invalid(dev, &connector->modes, true);
+	drm_mode_prune_invalid(dev, &connector->modes, verbose_prune);
 
 	if (list_empty(&connector->modes))
 		return 0;
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] drm: Make the HPD status updates debug logs more readable
  2012-12-10 20:24 [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Damien Lespiau
  2012-12-10 20:24 ` [PATCH 2/2] drm: Don't prune modes loudly when a connector is disconnected Damien Lespiau
@ 2012-12-10 21:12 ` Jesse Barnes
  1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2012-12-10 21:12 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: intel-gfx, dri-devel

On Mon, 10 Dec 2012 20:24:23 +0000
Damien Lespiau <damien.lespiau@gmail.com> wrote:

> From: Damien Lespiau <damien.lespiau@intel.com>
> 
> Instead of just printing "status updated from 1 to 2", make those enum
> numbers immediately readable.
> 
> v2: Also patch output_poll_execute() (Daniel Vetter)
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/drm_crtc_helper.c | 22 ++++++++++++++++++----
>  1 file changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
> index 1fe719f..524f0d3 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -950,6 +950,18 @@ void drm_kms_helper_hotplug_event(struct drm_device *dev)
>  }
>  EXPORT_SYMBOL(drm_kms_helper_hotplug_event);
>  
> +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";
> +	}
> +}
> +
>  #define DRM_OUTPUT_POLL_PERIOD (10*HZ)
>  static void output_poll_execute(struct work_struct *work)
>  {
> @@ -984,10 +996,11 @@ static void output_poll_execute(struct work_struct *work)
>  			continue;
>  
>  		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;
>  	}
> @@ -1062,10 +1075,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;
>  	}

Yeah, thanks.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-10 21:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-10 20:24 [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Damien Lespiau
2012-12-10 20:24 ` [PATCH 2/2] drm: Don't prune modes loudly when a connector is disconnected Damien Lespiau
2012-12-10 21:12 ` [PATCH 1/2] drm: Make the HPD status updates debug logs more readable Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox