On Wed, Jun 16, 2010 at 3:26 PM, Corbin Simpson <mostawesomedude at gmail.com> wrote: > On Wed, Jun 16, 2010 at 9:24 AM, Alex Deucher <alexdeucher at gmail.com> > wrote: >> Signed-off-by: Alex Deucher <alexdeucher at 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