From f93360f79a38d2d31b8dbb0000abaadb6cabde0b Mon Sep 17 00:00:00 2001 From: jsg Date: Tue, 7 Apr 2026 09:30:23 +0000 Subject: [PATCH] drm/amdgpu: fix gpu idle power consumption issue for gfx v12 From Yang Wang ad696758a45ca0c70fa60b7fd2f921edec7fc600 in linux-6.18.y/6.18.21 a6571045cf06c4aa749b4801382ae96650e2f0e1 in mainline linux --- sys/dev/pci/drm/amd/amdgpu/mes_v12_0.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/amd/amdgpu/mes_v12_0.c b/sys/dev/pci/drm/amd/amdgpu/mes_v12_0.c index bb566ccf68c..4988d8f7909 100644 --- a/sys/dev/pci/drm/amd/amdgpu/mes_v12_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/mes_v12_0.c @@ -727,6 +727,9 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe) int i; struct amdgpu_device *adev = mes->adev; union MESAPI_SET_HW_RESOURCES mes_set_hw_res_pkt; + uint32_t mes_rev = (pipe == AMDGPU_MES_SCHED_PIPE) ? + (mes->sched_version & AMDGPU_MES_VERSION_MASK) : + (mes->kiq_version & AMDGPU_MES_VERSION_MASK); memset(&mes_set_hw_res_pkt, 0, sizeof(mes_set_hw_res_pkt)); @@ -781,7 +784,7 @@ static int mes_v12_0_set_hw_resources(struct amdgpu_mes *mes, int pipe) * handling support, other queue will not use the oversubscribe timer. * handling mode - 0: disabled; 1: basic version; 2: basic+ version */ - mes_set_hw_res_pkt.oversubscription_timer = 50; + mes_set_hw_res_pkt.oversubscription_timer = mes_rev < 0x8b ? 0 : 50; mes_set_hw_res_pkt.unmapped_doorbell_handling = 1; if (amdgpu_mes_log_enable) {