drm/radeon: use ALIGN instead of open coding it
Subsystems (2)
PATCH 1/1 drm/radeon: use ALIGN instead of open coding it
CC Jerome Glisse <[email protected]>
CC Alex Deucher <[email protected]>
CC Dave Airlie <[email protected]>
Signed-off-by Matt Turner <[email protected]>
--- drivers/gpu/drm/radeon/r600_blit.c | 2 +- drivers/gpu/drm/radeon/r600_blit_kms.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/radeon/r600_blit.c +1 -1
@@ -49,7 +49,7 @@ set_render_target(drm_radeon_private_t *dev_priv, int format, int w, int h, u64RING_LOCALS ;DRM_DEBUG ("\n" ); - h = (h +7 ) & ~7 ; + h =ALIGN (h,8 );if (h <8 ) h =8 ;
drivers/gpu/drm/radeon/r600_blit_kms.c +2 -2
@@ -25,7 +25,7 @@ set_render_target(struct radeon_device *rdev, int format,u32 cb_color_info;int pitch, slice; - h = (h +7 ) & ~7 ; + h =ALIGN (h,8 );if (h <8 ) h =8 ;
@@ -396,7 +396,7 @@ set_default_state(struct radeon_device *rdev) NUM_ES_STACK_ENTRIES(num_es_stack_entries));/* emit an IB pointing at default state */ - dwords = (rdev->r600_blit.state_len +0xf ) & ~0xf ; + dwords =ALIGN (rdev->r600_blit.state_len,0x10 ); gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset;radeon_ring_write (rdev,PACKET3 (PACKET3_INDIRECT_BUFFER ,2 ));radeon_ring_write (rdev, gpu_addr &0xFFFFFFFC );
Signature · 10 lines
1.6.4.4 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --
Quoted 45 lines · Matt Turner
CC Jerome Glisse <[email protected]>CC Alex Deucher <[email protected]>CC Dave Airlie <[email protected]>Signed-off-by Matt Turner <[email protected]>---
drivers/gpu/drm/radeon/r600_blit.c | 2 +-drivers/gpu/drm/radeon/r600_blit_kms.c| 4 ++--2 files changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/radeon/r600_blit.c +1
-1@@ -49,7 +49,7 @@ set_render_target(drm_radeon_private_t *dev_priv, int format, int w, int h, u64 RING_LOCALS; DRM_DEBUG("\n"); - h = (h + 7) & ~7; + h = ALIGN(h, 8); if (h < 8) h = 8;drivers/gpu/drm/radeon/r600_blit_kms.c +2
-3@@ -25,7 +25,7 @@ set_render_target(struct radeon_device *rdev, int format, u32 cb_color_info; int pitch, slice; - h = (h + 7) & ~7; + h = ALIGN(h, 8); if (h < 8) h = 8;@@ -396,7 +396,7 @@ set_default_state(struct radeon_device *rdev) NUM_ES_STACK_ENTRIES(num_es_stack_entries)); /* emit an IB pointing at default state */ - dwords = (rdev->r600_blit.state_len + 0xf) & ~0xf; + dwords = ALIGN(rdev->r600_blit.state_len, 0x10); gpu_addr = rdev->r600_blit.shader_gpu_addr + rdev->r600_blit.state_offset; radeon_ring_write(rdev, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); radeon_ring_write(rdev, gpu_addr & 0xFFFFFFFC); --
Quoted 1 line
1.6.4.4
Seems entirely reasonable. Haven't tested, though.
Reviewed-by Corbin Simpson <[email protected]>
Signature · 13 lines
Only fools are easily impressed by what is only barely beyond their reach. ~ Unknown Corbin Simpson <[email protected]> ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --