I have sent this before but maybe it was lost in the sea of other patches. So
this time round with explicit cc to hopefully get a definitive decision whether
to pursue or drop.

Basically replacing the runtime conditionals in RLC15 register access with a
function table set at device probe time:

    add/remove: 9/31 grow/shrink: 74/1012 up/down: 39784/-381724 (-341940)
    ...
    Total: Before=9421643, After=9079703, chg -3.63%

More or less, but probably a little bit more, since I collected that before
the gfx12.1 support landed.

Unless I missed some gotcha it looks like the approach could work (it doesn't
crash and burn on the Steam Deck at least) and as the saving is quite
significant so why not? Let me know of the verdict.

Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>

Tvrtko Ursulin (2):
  drm/amdgpu: Choose SOC15 RLC register read write functions at init
    time
  drm/amdgpu: Only calculate register offset once in SOC15 RLC

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c    | 39 +++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h    | 10 ++++
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c     |  2 +
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c     |  2 +
 drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c     |  2 +
 drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c     |  2 +
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c      |  2 +
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c    |  2 +
 drivers/gpu/drm/amd/amdgpu/soc15_common.h  | 55 ++++++++++++----------
 10 files changed, 91 insertions(+), 26 deletions(-)

-- 
2.52.0

Reply via email to