Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: simplify nv and soc21 read_register functions

Check of the base offset for the IP exists rather than
explicitly checking for how many instances of a particular
IP there are. This is what soc15.c already does. Expand
this to nv.c and soc21.c.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+6 -6
+3 -3
drivers/gpu/drm/amd/amdgpu/nv.c
··· 392 392 *value = 0; 393 393 for (i = 0; i < ARRAY_SIZE(nv_allowed_read_registers); i++) { 394 394 en = &nv_allowed_read_registers[i]; 395 - if ((i == 7 && (adev->sdma.num_instances == 1)) || /* some asics don't have SDMA1 */ 396 - reg_offset != 397 - (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) 395 + if (adev->reg_offset[en->hwip][en->inst] && 396 + reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg] 397 + + en->reg_offset)) 398 398 continue; 399 399 400 400 *value = nv_get_register_value(adev,
+3 -3
drivers/gpu/drm/amd/amdgpu/soc21.c
··· 252 252 *value = 0; 253 253 for (i = 0; i < ARRAY_SIZE(soc21_allowed_read_registers); i++) { 254 254 en = &soc21_allowed_read_registers[i]; 255 - if ((i == 7 && (adev->sdma.num_instances == 1)) || /* some asics don't have SDMA1 */ 256 - reg_offset != 257 - (adev->reg_offset[en->hwip][en->inst][en->seg] + en->reg_offset)) 255 + if (adev->reg_offset[en->hwip][en->inst] && 256 + reg_offset != (adev->reg_offset[en->hwip][en->inst][en->seg] 257 + + en->reg_offset)) 258 258 continue; 259 259 260 260 *value = soc21_get_register_value(adev,