diff mbox

drm/i915: reduce memory footprint for debugging

Message ID 1452772.eQ4uGTB4Tx@pebbles.site (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Brüns Sept. 23, 2014, 6:04 p.m. UTC
see df8fbc231b7e4a78dae2b02e116fe73e4ea63cb0

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 drivers/gpu/drm/i915/intel_dp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Jani Nikula Sept. 24, 2014, 8:16 a.m. UTC | #1
On Tue, 23 Sep 2014, Stefan Brüns <stefan.bruens@rwth-aachen.de> wrote:
> see df8fbc231b7e4a78dae2b02e116fe73e4ea63cb0

Andy beat you to it with

commit a8e98153627dfbb10ff4dd65729676115a932b2e
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Mon Sep 1 14:12:01 2014 +0300

    drm: i915: reduce memory footprint when debugging

on its way upstream.

Thanks anyway.

BR,
Jani.



>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index fdff1d4..dafb169 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3322,15 +3322,12 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
>  	struct drm_device *dev = dig_port->base.base.dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
> -	char dpcd_hex_dump[sizeof(intel_dp->dpcd) * 3];
> -
>  	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd,
>  				    sizeof(intel_dp->dpcd)) < 0)
>  		return false; /* aux transfer failed */
>  
> -	hex_dump_to_buffer(intel_dp->dpcd, sizeof(intel_dp->dpcd),
> -			   32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false);
> -	DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump);
> +	DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(intel_dp->dpcd),
> +			      dig_connector->dpcd);
>  
>  	if (intel_dp->dpcd[DP_DPCD_REV] == 0)
>  		return false; /* DPCD not present */
> -- 
> 1.8.4.5
>
>
> -- 
> Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
> home: +49 241 53809034     mobile: +49 151 50412019
> work: +49 2405 49936-424
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter Sept. 24, 2014, 8:30 a.m. UTC | #2
On Tue, Sep 23, 2014 at 08:04:07PM +0200, Stefan Brüns wrote:
> see df8fbc231b7e4a78dae2b02e116fe73e4ea63cb0
> 
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

I already have such a patch:

commit a8e98153627dfbb10ff4dd65729676115a932b2e
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Mon Sep 1 14:12:01 2014 +0300

    drm: i915: reduce memory footprint when debugging

Please check linux-next before doing such cleanup patches next time
around.

Thanks, Daniel

> ---
>  drivers/gpu/drm/i915/intel_dp.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index fdff1d4..dafb169 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3322,15 +3322,12 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
>  	struct drm_device *dev = dig_port->base.base.dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  
> -	char dpcd_hex_dump[sizeof(intel_dp->dpcd) * 3];
> -
>  	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd,
>  				    sizeof(intel_dp->dpcd)) < 0)
>  		return false; /* aux transfer failed */
>  
> -	hex_dump_to_buffer(intel_dp->dpcd, sizeof(intel_dp->dpcd),
> -			   32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false);
> -	DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump);
> +	DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(intel_dp->dpcd),
> +			      dig_connector->dpcd);
>  
>  	if (intel_dp->dpcd[DP_DPCD_REV] == 0)
>  		return false; /* DPCD not present */
> -- 
> 1.8.4.5
> 
> 
> -- 
> Stefan Brüns  /  Bergstraße 21  /  52062 Aachen
> home: +49 241 53809034     mobile: +49 151 50412019
> work: +49 2405 49936-424
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index fdff1d4..dafb169 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3322,15 +3322,12 @@  intel_dp_get_dpcd(struct intel_dp *intel_dp)
 	struct drm_device *dev = dig_port->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	char dpcd_hex_dump[sizeof(intel_dp->dpcd) * 3];
-
 	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd,
 				    sizeof(intel_dp->dpcd)) < 0)
 		return false; /* aux transfer failed */
 
-	hex_dump_to_buffer(intel_dp->dpcd, sizeof(intel_dp->dpcd),
-			   32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false);
-	DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump);
+	DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(intel_dp->dpcd),
+			      dig_connector->dpcd);
 
 	if (intel_dp->dpcd[DP_DPCD_REV] == 0)
 		return false; /* DPCD not present */