]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: simplify allocation of scratch regs
authorNils Wallménius <nils.wallmenius@gmail.com>
Mon, 16 Jan 2017 20:56:48 +0000 (21:56 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 27 Jan 2017 16:13:32 +0000 (11:13 -0500)
commit3ba6901f016554159c3a8908223f99afcbddeb60
treefb6fe0437e2e5e44fa25edc4dd1f6df169da066d
parent7508034cbee9e4731f9f4efa7d70a98de0b07736
drm/amdgpu: simplify allocation of scratch regs

The scratch regs are sequential so there's no need to keep
them in an array, we can just return the index of the first
free register + the base register. Also change the array
of bools for keeping track of the free regs to a bitfield.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c