dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 7/8] radeon: Out of line radeon_get_ib_value
       [not found] <1400276595-6965-1-git-send-email-andi@firstfloor.org>
@ 2014-05-16 21:43 ` Andi Kleen
  2014-05-20 16:16   ` Marek Olšák
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2014-05-16 21:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Andi Kleen, alexander.deucher, dri-devel

From: Andi Kleen <ak@linux.intel.com>

Saves about 5k of text

   text	   data	    bss	    dec	    hex	filename
14080360	2008168	1507328	17595856	10c7dd0	vmlinux-before-radeon
14074978	2008168	1507328	17590474	10c68ca	vmlinux-radeon

Cc: alexander.deucher@amd.com
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/gpu/drm/radeon/radeon.h        | 10 +---------
 drivers/gpu/drm/radeon/radeon_device.c |  9 +++++++++
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index 6852861..8cae409 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1032,15 +1032,7 @@ struct radeon_cs_parser {
 	struct ww_acquire_ctx	ticket;
 };
 
-static inline u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
-{
-	struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
-
-	if (ibc->kdata)
-		return ibc->kdata[idx];
-	return p->ib.ptr[idx];
-}
-
+u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx);
 
 struct radeon_cs_packet {
 	unsigned	idx;
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 0e770bb..1cbd171 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -112,6 +112,15 @@ bool radeon_is_px(struct drm_device *dev)
 	return false;
 }
 
+u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
+{
+	struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
+
+	if (ibc->kdata)
+		return ibc->kdata[idx];
+	return p->ib.ptr[idx];
+}
+
 /**
  * radeon_program_register_sequence - program an array of registers.
  *
-- 
1.9.0

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

* Re: [PATCH 7/8] radeon: Out of line radeon_get_ib_value
  2014-05-16 21:43 ` [PATCH 7/8] radeon: Out of line radeon_get_ib_value Andi Kleen
@ 2014-05-20 16:16   ` Marek Olšák
  2014-05-20 17:04     ` Andi Kleen
  2014-05-20 18:14     ` Christian König
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Olšák @ 2014-05-20 16:16 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Deucher, Alexander, akpm, Andi Kleen, linux-kernel, dri-devel

I think the function should stay in the header file. It's used in
performance-critical code, so we want it to be inlined.

Marek

On Fri, May 16, 2014 at 11:43 PM, Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> Saves about 5k of text
>
>    text    data     bss     dec     hex filename
> 14080360        2008168 1507328 17595856        10c7dd0 vmlinux-before-radeon
> 14074978        2008168 1507328 17590474        10c68ca vmlinux-radeon
>
> Cc: alexander.deucher@amd.com
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  drivers/gpu/drm/radeon/radeon.h        | 10 +---------
>  drivers/gpu/drm/radeon/radeon_device.c |  9 +++++++++
>  2 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index 6852861..8cae409 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -1032,15 +1032,7 @@ struct radeon_cs_parser {
>         struct ww_acquire_ctx   ticket;
>  };
>
> -static inline u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
> -{
> -       struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
> -
> -       if (ibc->kdata)
> -               return ibc->kdata[idx];
> -       return p->ib.ptr[idx];
> -}
> -
> +u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx);
>
>  struct radeon_cs_packet {
>         unsigned        idx;
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 0e770bb..1cbd171 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -112,6 +112,15 @@ bool radeon_is_px(struct drm_device *dev)
>         return false;
>  }
>
> +u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
> +{
> +       struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
> +
> +       if (ibc->kdata)
> +               return ibc->kdata[idx];
> +       return p->ib.ptr[idx];
> +}
> +
>  /**
>   * radeon_program_register_sequence - program an array of registers.
>   *
> --
> 1.9.0
>
> _______________________________________________
> 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 7/8] radeon: Out of line radeon_get_ib_value
  2014-05-20 16:16   ` Marek Olšák
@ 2014-05-20 17:04     ` Andi Kleen
  2014-05-20 18:14     ` Christian König
  1 sibling, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2014-05-20 17:04 UTC (permalink / raw)
  To: Marek Olšák
  Cc: Andi Kleen, linux-kernel, Deucher, Alexander, akpm, dri-devel

On Tue, May 20, 2014 at 06:16:48PM +0200, Marek Olšák wrote:
> I think the function should stay in the header file. It's used in
> performance-critical code, so we want it to be inlined.

This doesn't make any sense. If it's talking to the hardware it will
be dominated by the cache misses.

-Andi

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

* Re: [PATCH 7/8] radeon: Out of line radeon_get_ib_value
  2014-05-20 16:16   ` Marek Olšák
  2014-05-20 17:04     ` Andi Kleen
@ 2014-05-20 18:14     ` Christian König
  1 sibling, 0 replies; 4+ messages in thread
From: Christian König @ 2014-05-20 18:14 UTC (permalink / raw)
  To: Marek Olšák, Andi Kleen
  Cc: Deucher, Alexander, akpm, Andi Kleen, linux-kernel, dri-devel

Yeah, agree. That function is quite critical for command stream parsing 
and patching.

Christian.

Am 20.05.2014 18:16, schrieb Marek Olšák:
> I think the function should stay in the header file. It's used in
> performance-critical code, so we want it to be inlined.
>
> Marek
>
> On Fri, May 16, 2014 at 11:43 PM, Andi Kleen <andi@firstfloor.org> wrote:
>> From: Andi Kleen <ak@linux.intel.com>
>>
>> Saves about 5k of text
>>
>>     text    data     bss     dec     hex filename
>> 14080360        2008168 1507328 17595856        10c7dd0 vmlinux-before-radeon
>> 14074978        2008168 1507328 17590474        10c68ca vmlinux-radeon
>>
>> Cc: alexander.deucher@amd.com
>> Cc: dri-devel@lists.freedesktop.org
>> Signed-off-by: Andi Kleen <ak@linux.intel.com>
>> ---
>>   drivers/gpu/drm/radeon/radeon.h        | 10 +---------
>>   drivers/gpu/drm/radeon/radeon_device.c |  9 +++++++++
>>   2 files changed, 10 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
>> index 6852861..8cae409 100644
>> --- a/drivers/gpu/drm/radeon/radeon.h
>> +++ b/drivers/gpu/drm/radeon/radeon.h
>> @@ -1032,15 +1032,7 @@ struct radeon_cs_parser {
>>          struct ww_acquire_ctx   ticket;
>>   };
>>
>> -static inline u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
>> -{
>> -       struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
>> -
>> -       if (ibc->kdata)
>> -               return ibc->kdata[idx];
>> -       return p->ib.ptr[idx];
>> -}
>> -
>> +u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx);
>>
>>   struct radeon_cs_packet {
>>          unsigned        idx;
>> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
>> index 0e770bb..1cbd171 100644
>> --- a/drivers/gpu/drm/radeon/radeon_device.c
>> +++ b/drivers/gpu/drm/radeon/radeon_device.c
>> @@ -112,6 +112,15 @@ bool radeon_is_px(struct drm_device *dev)
>>          return false;
>>   }
>>
>> +u32 radeon_get_ib_value(struct radeon_cs_parser *p, int idx)
>> +{
>> +       struct radeon_cs_chunk *ibc = &p->chunks[p->chunk_ib_idx];
>> +
>> +       if (ibc->kdata)
>> +               return ibc->kdata[idx];
>> +       return p->ib.ptr[idx];
>> +}
>> +
>>   /**
>>    * radeon_program_register_sequence - program an array of registers.
>>    *
>> --
>> 1.9.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

end of thread, other threads:[~2014-05-20 18:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1400276595-6965-1-git-send-email-andi@firstfloor.org>
2014-05-16 21:43 ` [PATCH 7/8] radeon: Out of line radeon_get_ib_value Andi Kleen
2014-05-20 16:16   ` Marek Olšák
2014-05-20 17:04     ` Andi Kleen
2014-05-20 18:14     ` Christian König

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