All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: reduce memory footprint for debugging
@ 2014-09-04 12:44 Andy Shevchenko
  2014-09-08 22:28 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2014-09-04 12:44 UTC (permalink / raw)
  To: David Airlie, dri-devel, Alex Deucher; +Cc: Andy Shevchenko

There is no need to use hex_dump_to_buffer() since we have a kernel helper to
dump up to 64 bytes just via printk(). In our case the actual size is 15 bytes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpu/drm/radeon/atombios_dp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
index 95ea276..4e75c48 100644
--- a/drivers/gpu/drm/radeon/atombios_dp.c
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
@@ -405,16 +405,13 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
 	u8 msg[DP_DPCD_SIZE];
 	int ret;
 
-	char dpcd_hex_dump[DP_DPCD_SIZE * 3];
-
 	ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg,
 			       DP_DPCD_SIZE);
 	if (ret > 0) {
 		memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE);
 
-		hex_dump_to_buffer(dig_connector->dpcd, sizeof(dig_connector->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", dig_connector->dpcd,
+			      (int)sizeof(dig_connector->dpcd));
 
 		radeon_dp_probe_oui(radeon_connector);
 
-- 
2.1.0

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

* Re: [PATCH] drm/radeon: reduce memory footprint for debugging
  2014-09-04 12:44 [PATCH] drm/radeon: reduce memory footprint for debugging Andy Shevchenko
@ 2014-09-08 22:28 ` Alex Deucher
  2014-09-09  8:14   ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2014-09-08 22:28 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Alex Deucher, Maling list - DRI developers

On Thu, Sep 4, 2014 at 8:44 AM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> There is no need to use hex_dump_to_buffer() since we have a kernel helper to
> dump up to 64 bytes just via printk(). In our case the actual size is 15 bytes.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch generates the following warning:
  CC [M]  drivers/gpu/drm/radeon/atombios_dp.o
drivers/gpu/drm/radeon/atombios_dp.c: In function ‘radeon_dp_getdpcd’:
drivers/gpu/drm/radeon/atombios_dp.c:413:3: warning: field width
specifier ‘*’ expects argument of type ‘int’, but argument 3 has type
‘u8 *’ [-Wformat=]
   DRM_DEBUG_KMS("DPCD: %*ph\n", dig_connector->dpcd,
   ^
drivers/gpu/drm/radeon/atombios_dp.c:413:3: warning: format ‘%p’
expects argument of type ‘void *’, but argument 4 has type ‘int’
[-Wformat=]
  LD [M]  drivers/gpu/drm/radeon/radeon.o
  Building modules, stage 2.
  MODPOST 2485 modules
  LD [M]  drivers/gpu/drm/radeon/radeon.ko



> ---
>  drivers/gpu/drm/radeon/atombios_dp.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
> index 95ea276..4e75c48 100644
> --- a/drivers/gpu/drm/radeon/atombios_dp.c
> +++ b/drivers/gpu/drm/radeon/atombios_dp.c
> @@ -405,16 +405,13 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
>         u8 msg[DP_DPCD_SIZE];
>         int ret;
>
> -       char dpcd_hex_dump[DP_DPCD_SIZE * 3];
> -
>         ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg,
>                                DP_DPCD_SIZE);
>         if (ret > 0) {
>                 memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE);
>
> -               hex_dump_to_buffer(dig_connector->dpcd, sizeof(dig_connector->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", dig_connector->dpcd,
> +                             (int)sizeof(dig_connector->dpcd));
>
>                 radeon_dp_probe_oui(radeon_connector);
>
> --
> 2.1.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/radeon: reduce memory footprint for debugging
  2014-09-08 22:28 ` Alex Deucher
@ 2014-09-09  8:14   ` Andy Shevchenko
  2014-09-09 14:57     ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2014-09-09  8:14 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, Maling list - DRI developers

On Mon, 2014-09-08 at 18:28 -0400, Alex Deucher wrote:
> On Thu, Sep 4, 2014 at 8:44 AM, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > There is no need to use hex_dump_to_buffer() since we have a kernel helper to
> > dump up to 64 bytes just via printk(). In our case the actual size is 15 bytes.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Patch generates the following warning:
>   CC [M]  drivers/gpu/drm/radeon/atombios_dp.o
> drivers/gpu/drm/radeon/atombios_dp.c: In function ‘radeon_dp_getdpcd’:
> drivers/gpu/drm/radeon/atombios_dp.c:413:3: warning: field width
> specifier ‘*’ expects argument of type ‘int’, but argument 3 has type
> ‘u8 *’ [-Wformat=]
>    DRM_DEBUG_KMS("DPCD: %*ph\n", dig_connector->dpcd,
>    ^
> drivers/gpu/drm/radeon/atombios_dp.c:413:3: warning: format ‘%p’
> expects argument of type ‘void *’, but argument 4 has type ‘int’
> [-Wformat=]
>   LD [M]  drivers/gpu/drm/radeon/radeon.o
>   Building modules, stage 2.
>   MODPOST 2485 modules
>   LD [M]  drivers/gpu/drm/radeon/radeon.ko

There is a patch v2.

http://www.spinics.net/lists/dri-devel/msg67407.html

> 
> 
> 
> > ---
> >  drivers/gpu/drm/radeon/atombios_dp.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
> > index 95ea276..4e75c48 100644
> > --- a/drivers/gpu/drm/radeon/atombios_dp.c
> > +++ b/drivers/gpu/drm/radeon/atombios_dp.c
> > @@ -405,16 +405,13 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
> >         u8 msg[DP_DPCD_SIZE];
> >         int ret;
> >
> > -       char dpcd_hex_dump[DP_DPCD_SIZE * 3];
> > -
> >         ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg,
> >                                DP_DPCD_SIZE);
> >         if (ret > 0) {
> >                 memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE);
> >
> > -               hex_dump_to_buffer(dig_connector->dpcd, sizeof(dig_connector->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", dig_connector->dpcd,
> > +                             (int)sizeof(dig_connector->dpcd));
> >
> >                 radeon_dp_probe_oui(radeon_connector);
> >
> > --
> > 2.1.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel


-- 
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy

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

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

* Re: [PATCH] drm/radeon: reduce memory footprint for debugging
  2014-09-09  8:14   ` Andy Shevchenko
@ 2014-09-09 14:57     ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2014-09-09 14:57 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Alex Deucher, Maling list - DRI developers

On Tue, Sep 9, 2014 at 4:14 AM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> On Mon, 2014-09-08 at 18:28 -0400, Alex Deucher wrote:
>> On Thu, Sep 4, 2014 at 8:44 AM, Andy Shevchenko
>> <andriy.shevchenko@linux.intel.com> wrote:
>> > There is no need to use hex_dump_to_buffer() since we have a kernel helper to
>> > dump up to 64 bytes just via printk(). In our case the actual size is 15 bytes.
>> >
>> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> Patch generates the following warning:
>>   CC [M]  drivers/gpu/drm/radeon/atombios_dp.o
>> drivers/gpu/drm/radeon/atombios_dp.c: In function ‘radeon_dp_getdpcd’:
>> drivers/gpu/drm/radeon/atombios_dp.c:413:3: warning: field width
>> specifier ‘*’ expects argument of type ‘int’, but argument 3 has type
>> ‘u8 *’ [-Wformat=]
>>    DRM_DEBUG_KMS("DPCD: %*ph\n", dig_connector->dpcd,
>>    ^
>> drivers/gpu/drm/radeon/atombios_dp.c:413:3: warning: format ‘%p’
>> expects argument of type ‘void *’, but argument 4 has type ‘int’
>> [-Wformat=]
>>   LD [M]  drivers/gpu/drm/radeon/radeon.o
>>   Building modules, stage 2.
>>   MODPOST 2485 modules
>>   LD [M]  drivers/gpu/drm/radeon/radeon.ko
>
> There is a patch v2.
>
> http://www.spinics.net/lists/dri-devel/msg67407.html

Thanks.  Applied.

Alex

>
>>
>>
>>
>> > ---
>> >  drivers/gpu/drm/radeon/atombios_dp.c | 7 ++-----
>> >  1 file changed, 2 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
>> > index 95ea276..4e75c48 100644
>> > --- a/drivers/gpu/drm/radeon/atombios_dp.c
>> > +++ b/drivers/gpu/drm/radeon/atombios_dp.c
>> > @@ -405,16 +405,13 @@ bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector)
>> >         u8 msg[DP_DPCD_SIZE];
>> >         int ret;
>> >
>> > -       char dpcd_hex_dump[DP_DPCD_SIZE * 3];
>> > -
>> >         ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg,
>> >                                DP_DPCD_SIZE);
>> >         if (ret > 0) {
>> >                 memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE);
>> >
>> > -               hex_dump_to_buffer(dig_connector->dpcd, sizeof(dig_connector->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", dig_connector->dpcd,
>> > +                             (int)sizeof(dig_connector->dpcd));
>> >
>> >                 radeon_dp_probe_oui(radeon_connector);
>> >
>> > --
>> > 2.1.0
>> >
>> > _______________________________________________
>> > dri-devel mailing list
>> > dri-devel@lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
> --
> Andy Shevchenko <andriy.shevchenko@intel.com>
> Intel Finland Oy
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2014-09-09 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04 12:44 [PATCH] drm/radeon: reduce memory footprint for debugging Andy Shevchenko
2014-09-08 22:28 ` Alex Deucher
2014-09-09  8:14   ` Andy Shevchenko
2014-09-09 14:57     ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.