All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller
@ 2021-07-15 14:37 ` Colin King
  0 siblings, 0 replies; 5+ messages in thread
From: Colin King @ 2021-07-15 14:37 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	Xinhui.Pan, David Airlie, Daniel Vetter, amd-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array common_rates on the stack but instead it
static. Makes the object code smaller by 80 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
 268019	  98322	    256	 366597	  59805	../display/amdgpu_dm/amdgpu_dm.o

After:
   text	   data	    bss	    dec	    hex	filename
 267843	  98418	    256	 366517	  597b5	../display/amdgpu_dm/amdgpu_dm.o

Reduction of 80 bytes

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 2d48bb09645f..b196bb6eafc0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7580,8 +7580,10 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector)
 	 * 60 	    - Commonly used
 	 * 48,72,96 - Multiples of 24
 	 */
-	const uint32_t common_rates[] = { 23976, 24000, 25000, 29970, 30000,
-					 48000, 50000, 60000, 72000, 96000 };
+	static const uint32_t common_rates[] = {
+		23976, 24000, 25000, 29970, 30000,
+		48000, 50000, 60000, 72000, 96000
+	};
 
 	/*
 	 * Find mode with highest refresh rate with the same resolution
-- 
2.31.1


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

* [PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller
@ 2021-07-15 14:37 ` Colin King
  0 siblings, 0 replies; 5+ messages in thread
From: Colin King @ 2021-07-15 14:37 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	Xinhui.Pan, David Airlie, Daniel Vetter, amd-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array common_rates on the stack but instead it
static. Makes the object code smaller by 80 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
 268019	  98322	    256	 366597	  59805	../display/amdgpu_dm/amdgpu_dm.o

After:
   text	   data	    bss	    dec	    hex	filename
 267843	  98418	    256	 366517	  597b5	../display/amdgpu_dm/amdgpu_dm.o

Reduction of 80 bytes

(gcc version 10.3.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 2d48bb09645f..b196bb6eafc0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7580,8 +7580,10 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector)
 	 * 60 	    - Commonly used
 	 * 48,72,96 - Multiples of 24
 	 */
-	const uint32_t common_rates[] = { 23976, 24000, 25000, 29970, 30000,
-					 48000, 50000, 60000, 72000, 96000 };
+	static const uint32_t common_rates[] = {
+		23976, 24000, 25000, 29970, 30000,
+		48000, 50000, 60000, 72000, 96000
+	};
 
 	/*
 	 * Find mode with highest refresh rate with the same resolution
-- 
2.31.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller
  2021-07-15 14:37 ` Colin King
  (?)
@ 2021-07-15 16:04   ` Alex Deucher
  -1 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2021-07-15 16:04 UTC (permalink / raw)
  To: Colin King
  Cc: Harry Wentland, Leo Li, Alex Deucher, Christian König,
	xinhui pan, David Airlie, Daniel Vetter, amd-gfx list,
	Maling list - DRI developers, kernel-janitors, LKML

On Thu, Jul 15, 2021 at 10:37 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const array common_rates on the stack but instead it
> static. Makes the object code smaller by 80 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>  268019   98322     256  366597   59805 ../display/amdgpu_dm/amdgpu_dm.o
>
> After:
>    text    data     bss     dec     hex filename
>  267843   98418     256  366517   597b5 ../display/amdgpu_dm/amdgpu_dm.o
>
> Reduction of 80 bytes
>
> (gcc version 10.3.0)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 2d48bb09645f..b196bb6eafc0 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7580,8 +7580,10 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector)
>          * 60       - Commonly used
>          * 48,72,96 - Multiples of 24
>          */
> -       const uint32_t common_rates[] = { 23976, 24000, 25000, 29970, 30000,
> -                                        48000, 50000, 60000, 72000, 96000 };
> +       static const uint32_t common_rates[] = {
> +               23976, 24000, 25000, 29970, 30000,
> +               48000, 50000, 60000, 72000, 96000
> +       };
>
>         /*
>          * Find mode with highest refresh rate with the same resolution
> --
> 2.31.1
>

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

* Re: [PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller
@ 2021-07-15 16:04   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2021-07-15 16:04 UTC (permalink / raw)
  To: Colin King
  Cc: Leo Li, xinhui pan, kernel-janitors, LKML, amd-gfx list,
	David Airlie, Maling list - DRI developers, Alex Deucher,
	Christian König

On Thu, Jul 15, 2021 at 10:37 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const array common_rates on the stack but instead it
> static. Makes the object code smaller by 80 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>  268019   98322     256  366597   59805 ../display/amdgpu_dm/amdgpu_dm.o
>
> After:
>    text    data     bss     dec     hex filename
>  267843   98418     256  366517   597b5 ../display/amdgpu_dm/amdgpu_dm.o
>
> Reduction of 80 bytes
>
> (gcc version 10.3.0)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 2d48bb09645f..b196bb6eafc0 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7580,8 +7580,10 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector)
>          * 60       - Commonly used
>          * 48,72,96 - Multiples of 24
>          */
> -       const uint32_t common_rates[] = { 23976, 24000, 25000, 29970, 30000,
> -                                        48000, 50000, 60000, 72000, 96000 };
> +       static const uint32_t common_rates[] = {
> +               23976, 24000, 25000, 29970, 30000,
> +               48000, 50000, 60000, 72000, 96000
> +       };
>
>         /*
>          * Find mode with highest refresh rate with the same resolution
> --
> 2.31.1
>

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

* Re: [PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller
@ 2021-07-15 16:04   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2021-07-15 16:04 UTC (permalink / raw)
  To: Colin King
  Cc: Leo Li, xinhui pan, kernel-janitors, LKML, amd-gfx list,
	David Airlie, Maling list - DRI developers, Daniel Vetter,
	Alex Deucher, Harry Wentland, Christian König

On Thu, Jul 15, 2021 at 10:37 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the const array common_rates on the stack but instead it
> static. Makes the object code smaller by 80 bytes:
>
> Before:
>    text    data     bss     dec     hex filename
>  268019   98322     256  366597   59805 ../display/amdgpu_dm/amdgpu_dm.o
>
> After:
>    text    data     bss     dec     hex filename
>  267843   98418     256  366517   597b5 ../display/amdgpu_dm/amdgpu_dm.o
>
> Reduction of 80 bytes
>
> (gcc version 10.3.0)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 2d48bb09645f..b196bb6eafc0 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7580,8 +7580,10 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector)
>          * 60       - Commonly used
>          * 48,72,96 - Multiples of 24
>          */
> -       const uint32_t common_rates[] = { 23976, 24000, 25000, 29970, 30000,
> -                                        48000, 50000, 60000, 72000, 96000 };
> +       static const uint32_t common_rates[] = {
> +               23976, 24000, 25000, 29970, 30000,
> +               48000, 50000, 60000, 72000, 96000
> +       };
>
>         /*
>          * Find mode with highest refresh rate with the same resolution
> --
> 2.31.1
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-07-15 16:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15 14:37 [PATCH] drm/amdgpu/display: make a const array common_rates static, makes object smaller Colin King
2021-07-15 14:37 ` Colin King
2021-07-15 16:04 ` Alex Deucher
2021-07-15 16:04   ` Alex Deucher
2021-07-15 16:04   ` 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.