All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon/kms: fix typo in evergreen_gpu_init
@ 2010-06-16 16:24 Alex Deucher
  2010-06-16 19:26 ` Corbin Simpson
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2010-06-16 16:24 UTC (permalink / raw)
  To: airlied, dri-devel

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
---
 drivers/gpu/drm/radeon/evergreen.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 4b6623d..38c500e 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -1222,11 +1222,11 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
 		ps_thread_count = 128;
 
 	sq_thread_resource_mgmt = NUM_PS_THREADS(ps_thread_count);
-	sq_thread_resource_mgmt |= NUM_VS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
-	sq_thread_resource_mgmt |= NUM_GS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
-	sq_thread_resource_mgmt |= NUM_ES_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
-	sq_thread_resource_mgmt_2 = NUM_HS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
-	sq_thread_resource_mgmt_2 |= NUM_LS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
+	sq_thread_resource_mgmt |= NUM_VS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
+	sq_thread_resource_mgmt |= NUM_GS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
+	sq_thread_resource_mgmt |= NUM_ES_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
+	sq_thread_resource_mgmt_2 = NUM_HS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
+	sq_thread_resource_mgmt_2 |= NUM_LS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
 
 	sq_stack_resource_mgmt_1 = NUM_PS_STACK_ENTRIES((rdev->config.evergreen.max_stack_entries * 1) / 6);
 	sq_stack_resource_mgmt_1 |= NUM_VS_STACK_ENTRIES((rdev->config.evergreen.max_stack_entries * 1) / 6);
-- 
1.7.0.1

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

* Re: [PATCH] drm/radeon/kms: fix typo in evergreen_gpu_init
  2010-06-16 16:24 [PATCH] drm/radeon/kms: fix typo in evergreen_gpu_init Alex Deucher
@ 2010-06-16 19:26 ` Corbin Simpson
  2010-06-16 20:02   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Corbin Simpson @ 2010-06-16 19:26 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel

On Wed, Jun 16, 2010 at 9:24 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
> ---
>  drivers/gpu/drm/radeon/evergreen.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
> index 4b6623d..38c500e 100644
> --- a/drivers/gpu/drm/radeon/evergreen.c
> +++ b/drivers/gpu/drm/radeon/evergreen.c
> @@ -1222,11 +1222,11 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
>                ps_thread_count = 128;
>
>        sq_thread_resource_mgmt = NUM_PS_THREADS(ps_thread_count);
> -       sq_thread_resource_mgmt |= NUM_VS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
> -       sq_thread_resource_mgmt |= NUM_GS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
> -       sq_thread_resource_mgmt |= NUM_ES_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
> -       sq_thread_resource_mgmt_2 = NUM_HS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
> -       sq_thread_resource_mgmt_2 |= NUM_LS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
> +       sq_thread_resource_mgmt |= NUM_VS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
> +       sq_thread_resource_mgmt |= NUM_GS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
> +       sq_thread_resource_mgmt |= NUM_ES_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
> +       sq_thread_resource_mgmt_2 = NUM_HS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
> +       sq_thread_resource_mgmt_2 |= NUM_LS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
>
>        sq_stack_resource_mgmt_1 = NUM_PS_STACK_ENTRIES((rdev->config.evergreen.max_stack_entries * 1) / 6);
>        sq_stack_resource_mgmt_1 |= NUM_VS_STACK_ENTRIES((rdev->config.evergreen.max_stack_entries * 1) / 6);
> --
> 1.7.0.1

Maybe it's just me, but is there any reason to avoid, say:

int threads = rdev->config.evergreen.max_threads - ps_thread_count;
threads /= 6; /* Divide by six for some reason */
threads &= ~7; /* Round down to the next multiple of eight for some
other reason */

Admittedly, I don't know the code at all, but this just feels like a
breeding ground for typos and eyestrain.

~ C.

-- 
When the facts change, I change my mind. What do you do, sir? ~ Keynes

Corbin Simpson
<MostAwesomeDude@gmail.com>

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

* Re: [PATCH] drm/radeon/kms: fix typo in evergreen_gpu_init
  2010-06-16 19:26 ` Corbin Simpson
@ 2010-06-16 20:02   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2010-06-16 20:02 UTC (permalink / raw)
  To: Corbin Simpson; +Cc: dri-devel

On Wed, Jun 16, 2010 at 3:26 PM, Corbin Simpson
<mostawesomedude@gmail.com> wrote:
> On Wed, Jun 16, 2010 at 9:24 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
>> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
>> ---
>>  drivers/gpu/drm/radeon/evergreen.c |   10 +++++-----
>>  1 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
>> index 4b6623d..38c500e 100644
>> --- a/drivers/gpu/drm/radeon/evergreen.c
>> +++ b/drivers/gpu/drm/radeon/evergreen.c
>> @@ -1222,11 +1222,11 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
>>                ps_thread_count = 128;
>>
>>        sq_thread_resource_mgmt = NUM_PS_THREADS(ps_thread_count);
>> -       sq_thread_resource_mgmt |= NUM_VS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
>> -       sq_thread_resource_mgmt |= NUM_GS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
>> -       sq_thread_resource_mgmt |= NUM_ES_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
>> -       sq_thread_resource_mgmt_2 = NUM_HS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
>> -       sq_thread_resource_mgmt_2 |= NUM_LS_THREADS(((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8;
>> +       sq_thread_resource_mgmt |= NUM_VS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
>> +       sq_thread_resource_mgmt |= NUM_GS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
>> +       sq_thread_resource_mgmt |= NUM_ES_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
>> +       sq_thread_resource_mgmt_2 = NUM_HS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
>> +       sq_thread_resource_mgmt_2 |= NUM_LS_THREADS((((rdev->config.evergreen.max_threads - ps_thread_count) / 6) / 8) * 8);
>>
>>        sq_stack_resource_mgmt_1 = NUM_PS_STACK_ENTRIES((rdev->config.evergreen.max_stack_entries * 1) / 6);
>>        sq_stack_resource_mgmt_1 |= NUM_VS_STACK_ENTRIES((rdev->config.evergreen.max_stack_entries * 1) / 6);
>> --
>> 1.7.0.1
>
> Maybe it's just me, but is there any reason to avoid, say:
>
> int threads = rdev->config.evergreen.max_threads - ps_thread_count;
> threads /= 6; /* Divide by six for some reason */
> threads &= ~7; /* Round down to the next multiple of eight for some
> other reason */
>
> Admittedly, I don't know the code at all, but this just feels like a
> breeding ground for typos and eyestrain.
>

Not really.  It just happened to be like that in the sample code I was
referencing.

Alex

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

end of thread, other threads:[~2010-06-16 20:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-16 16:24 [PATCH] drm/radeon/kms: fix typo in evergreen_gpu_init Alex Deucher
2010-06-16 19:26 ` Corbin Simpson
2010-06-16 20:02   ` 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.