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

drm/amdgpu: Remove wrapper layer of cgs irq handling

v2: add Vega12 support

1. remove struct cgs_os_ops
2. delete cgs_linux.h
3. refine the irq code for vega10, can fix set pp table
failed issue.
4. add common smu irq process function

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

authored by

Rex Zhu and committed by
Alex Deucher
160b8e75 7436854e

+86 -364
-1
drivers/gpu/drm/amd/acp/include/acp_gfx_if.h
··· 25 25 #define _ACP_GFX_IF_H 26 26 27 27 #include <linux/types.h> 28 - #include "cgs_linux.h" 29 28 #include "cgs_common.h" 30 29 31 30 int amd_acp_hw_init(struct cgs_device *cgs_device,
-111
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
··· 28 28 #include <linux/firmware.h> 29 29 #include <drm/amdgpu_drm.h> 30 30 #include "amdgpu.h" 31 - #include "cgs_linux.h" 32 31 #include "atom.h" 33 32 #include "amdgpu_ucode.h" 34 33 ··· 179 180 180 181 return amdgpu_atom_execute_table( 181 182 adev->mode_info.atom_context, table, args); 182 - } 183 - 184 - struct cgs_irq_params { 185 - unsigned src_id; 186 - cgs_irq_source_set_func_t set; 187 - cgs_irq_handler_func_t handler; 188 - void *private_data; 189 - }; 190 - 191 - static int cgs_set_irq_state(struct amdgpu_device *adev, 192 - struct amdgpu_irq_src *src, 193 - unsigned type, 194 - enum amdgpu_interrupt_state state) 195 - { 196 - struct cgs_irq_params *irq_params = 197 - (struct cgs_irq_params *)src->data; 198 - if (!irq_params) 199 - return -EINVAL; 200 - if (!irq_params->set) 201 - return -EINVAL; 202 - return irq_params->set(irq_params->private_data, 203 - irq_params->src_id, 204 - type, 205 - (int)state); 206 - } 207 - 208 - static int cgs_process_irq(struct amdgpu_device *adev, 209 - struct amdgpu_irq_src *source, 210 - struct amdgpu_iv_entry *entry) 211 - { 212 - struct cgs_irq_params *irq_params = 213 - (struct cgs_irq_params *)source->data; 214 - if (!irq_params) 215 - return -EINVAL; 216 - if (!irq_params->handler) 217 - return -EINVAL; 218 - return irq_params->handler(irq_params->private_data, 219 - irq_params->src_id, 220 - entry->iv_entry); 221 - } 222 - 223 - static const struct amdgpu_irq_src_funcs cgs_irq_funcs = { 224 - .set = cgs_set_irq_state, 225 - .process = cgs_process_irq, 226 - }; 227 - 228 - static int amdgpu_cgs_add_irq_source(void *cgs_device, 229 - unsigned client_id, 230 - unsigned src_id, 231 - unsigned num_types, 232 - cgs_irq_source_set_func_t set, 233 - cgs_irq_handler_func_t handler, 234 - void *private_data) 235 - { 236 - CGS_FUNC_ADEV; 237 - int ret = 0; 238 - struct cgs_irq_params *irq_params; 239 - struct amdgpu_irq_src *source = 240 - kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL); 241 - if (!source) 242 - return -ENOMEM; 243 - irq_params = 244 - kzalloc(sizeof(struct cgs_irq_params), GFP_KERNEL); 245 - if (!irq_params) { 246 - kfree(source); 247 - return -ENOMEM; 248 - } 249 - source->num_types = num_types; 250 - source->funcs = &cgs_irq_funcs; 251 - irq_params->src_id = src_id; 252 - irq_params->set = set; 253 - irq_params->handler = handler; 254 - irq_params->private_data = private_data; 255 - source->data = (void *)irq_params; 256 - ret = amdgpu_irq_add_id(adev, client_id, src_id, source); 257 - if (ret) { 258 - kfree(irq_params); 259 - kfree(source); 260 - } 261 - 262 - return ret; 263 - } 264 - 265 - static int amdgpu_cgs_irq_get(void *cgs_device, unsigned client_id, 266 - unsigned src_id, unsigned type) 267 - { 268 - CGS_FUNC_ADEV; 269 - 270 - if (!adev->irq.client[client_id].sources) 271 - return -EINVAL; 272 - 273 - return amdgpu_irq_get(adev, adev->irq.client[client_id].sources[src_id], type); 274 - } 275 - 276 - static int amdgpu_cgs_irq_put(void *cgs_device, unsigned client_id, 277 - unsigned src_id, unsigned type) 278 - { 279 - CGS_FUNC_ADEV; 280 - 281 - if (!adev->irq.client[client_id].sources) 282 - return -EINVAL; 283 - 284 - return amdgpu_irq_put(adev, adev->irq.client[client_id].sources[src_id], type); 285 183 } 286 184 287 185 static int amdgpu_cgs_set_clockgating_state(struct cgs_device *cgs_device, ··· 691 795 .lock_grbm_idx = amdgpu_cgs_lock_grbm_idx, 692 796 }; 693 797 694 - static const struct cgs_os_ops amdgpu_cgs_os_ops = { 695 - .add_irq_source = amdgpu_cgs_add_irq_source, 696 - .irq_get = amdgpu_cgs_irq_get, 697 - .irq_put = amdgpu_cgs_irq_put 698 - }; 699 - 700 798 struct cgs_device *amdgpu_cgs_create_device(struct amdgpu_device *adev) 701 799 { 702 800 struct amdgpu_cgs_device *cgs_device = ··· 702 812 } 703 813 704 814 cgs_device->base.ops = &amdgpu_cgs_ops; 705 - cgs_device->base.os_ops = &amdgpu_cgs_os_ops; 706 815 cgs_device->adev = adev; 707 816 708 817 return (struct cgs_device *)cgs_device;
+1 -1
drivers/gpu/drm/amd/display/dc/os_types.h
··· 32 32 33 33 #include <linux/kref.h> 34 34 35 - #include "cgs_linux.h" 35 + #include "cgs_common.h" 36 36 37 37 #if defined(__BIG_ENDIAN) && !defined(BIGENDIAN_CPU) 38 38 #define BIGENDIAN_CPU
-1
drivers/gpu/drm/amd/include/cgs_common.h
··· 290 290 struct cgs_device 291 291 { 292 292 const struct cgs_ops *ops; 293 - const struct cgs_os_ops *os_ops; 294 293 /* to be embedded at the start of driver private structure */ 295 294 }; 296 295
-119
drivers/gpu/drm/amd/include/cgs_linux.h
··· 1 - /* 2 - * Copyright 2015 Advanced Micro Devices, Inc. 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice shall be included in 12 - * all copies or substantial portions of the Software. 13 - * 14 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 - * OTHER DEALINGS IN THE SOFTWARE. 21 - * 22 - * 23 - */ 24 - #ifndef _CGS_LINUX_H 25 - #define _CGS_LINUX_H 26 - 27 - #include "cgs_common.h" 28 - 29 - /** 30 - * cgs_irq_source_set_func() - Callback for enabling/disabling interrupt sources 31 - * @private_data: private data provided to cgs_add_irq_source 32 - * @src_id: interrupt source ID 33 - * @type: interrupt type 34 - * @enabled: 0 = disable source, non-0 = enable source 35 - * 36 - * Return: 0 on success, -errno otherwise 37 - */ 38 - typedef int (*cgs_irq_source_set_func_t)(void *private_data, 39 - unsigned src_id, unsigned type, 40 - int enabled); 41 - 42 - /** 43 - * cgs_irq_handler_func() - Interrupt handler callback 44 - * @private_data: private data provided to cgs_add_irq_source 45 - * @src_id: interrupt source ID 46 - * @iv_entry: pointer to raw ih ring entry 47 - * 48 - * This callback runs in interrupt context. 49 - * 50 - * Return: 0 on success, -errno otherwise 51 - */ 52 - typedef int (*cgs_irq_handler_func_t)(void *private_data, 53 - unsigned src_id, const uint32_t *iv_entry); 54 - 55 - /** 56 - * cgs_add_irq_source() - Add an IRQ source 57 - * @cgs_device: opaque device handle 58 - * @src_id: interrupt source ID 59 - * @num_types: number of interrupt types that can be independently enabled 60 - * @set: callback function to enable/disable an interrupt type 61 - * @handler: interrupt handler callback 62 - * @private_data: private data to pass to callback functions 63 - * 64 - * The same IRQ source can be added only once. Adding an IRQ source 65 - * indicates ownership of that IRQ source and all its IRQ types. 66 - * 67 - * Return: 0 on success, -errno otherwise 68 - */ 69 - typedef int (*cgs_add_irq_source_t)(void *cgs_device, unsigned client_id, 70 - unsigned src_id, 71 - unsigned num_types, 72 - cgs_irq_source_set_func_t set, 73 - cgs_irq_handler_func_t handler, 74 - void *private_data); 75 - 76 - /** 77 - * cgs_irq_get() - Request enabling an IRQ source and type 78 - * @cgs_device: opaque device handle 79 - * @src_id: interrupt source ID 80 - * @type: interrupt type 81 - * 82 - * cgs_irq_get and cgs_irq_put calls must be balanced. They count 83 - * "references" to IRQ sources. 84 - * 85 - * Return: 0 on success, -errno otherwise 86 - */ 87 - typedef int (*cgs_irq_get_t)(void *cgs_device, unsigned client_id, unsigned src_id, unsigned type); 88 - 89 - /** 90 - * cgs_irq_put() - Indicate IRQ source is no longer needed 91 - * @cgs_device: opaque device handle 92 - * @src_id: interrupt source ID 93 - * @type: interrupt type 94 - * 95 - * cgs_irq_get and cgs_irq_put calls must be balanced. They count 96 - * "references" to IRQ sources. Even after cgs_irq_put is called, the 97 - * IRQ handler may still be called if there are more refecences to 98 - * the IRQ source. 99 - * 100 - * Return: 0 on success, -errno otherwise 101 - */ 102 - typedef int (*cgs_irq_put_t)(void *cgs_device, unsigned client_id, unsigned src_id, unsigned type); 103 - 104 - struct cgs_os_ops { 105 - /* IRQ handling */ 106 - cgs_add_irq_source_t add_irq_source; 107 - cgs_irq_get_t irq_get; 108 - cgs_irq_put_t irq_put; 109 - }; 110 - 111 - #define cgs_add_irq_source(dev,client_id,src_id,num_types,set,handler,private_data) \ 112 - CGS_OS_CALL(add_irq_source,dev,client_id,src_id,num_types,set,handler, \ 113 - private_data) 114 - #define cgs_irq_get(dev,client_id,src_id,type) \ 115 - CGS_OS_CALL(irq_get,dev,client_id,src_id,type) 116 - #define cgs_irq_put(dev,client_id,src_id,type) \ 117 - CGS_OS_CALL(irq_put,dev,client_id,src_id,type) 118 - 119 - #endif /* _CGS_LINUX_H */
+1 -45
drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
··· 58 58 static int topaz_set_asic_special_caps(struct pp_hwmgr *hwmgr); 59 59 static int ci_set_asic_special_caps(struct pp_hwmgr *hwmgr); 60 60 61 - static int phm_thermal_l2h_irq(void *private_data, 62 - unsigned src_id, const uint32_t *iv_entry) 63 - { 64 - struct pp_hwmgr *hwmgr = (struct pp_hwmgr *)private_data; 65 - struct amdgpu_device *adev = hwmgr->adev; 66 - 67 - pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n", 68 - PCI_BUS_NUM(adev->pdev->devfn), 69 - PCI_SLOT(adev->pdev->devfn), 70 - PCI_FUNC(adev->pdev->devfn)); 71 - return 0; 72 - } 73 - 74 - static int phm_thermal_h2l_irq(void *private_data, 75 - unsigned src_id, const uint32_t *iv_entry) 76 - { 77 - struct pp_hwmgr *hwmgr = (struct pp_hwmgr *)private_data; 78 - struct amdgpu_device *adev = hwmgr->adev; 79 - 80 - pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n", 81 - PCI_BUS_NUM(adev->pdev->devfn), 82 - PCI_SLOT(adev->pdev->devfn), 83 - PCI_FUNC(adev->pdev->devfn)); 84 - return 0; 85 - } 86 - 87 - static int phm_ctf_irq(void *private_data, 88 - unsigned src_id, const uint32_t *iv_entry) 89 - { 90 - struct pp_hwmgr *hwmgr = (struct pp_hwmgr *)private_data; 91 - struct amdgpu_device *adev = hwmgr->adev; 92 - 93 - pr_warn("GPU Critical Temperature Fault detected on PCIe %d:%d.%d!\n", 94 - PCI_BUS_NUM(adev->pdev->devfn), 95 - PCI_SLOT(adev->pdev->devfn), 96 - PCI_FUNC(adev->pdev->devfn)); 97 - return 0; 98 - } 99 - 100 - static const struct cgs_irq_src_funcs thermal_irq_src[3] = { 101 - { .handler = phm_thermal_l2h_irq }, 102 - { .handler = phm_thermal_h2l_irq }, 103 - { .handler = phm_ctf_irq } 104 - }; 105 61 106 62 static void hwmgr_init_workload_prority(struct pp_hwmgr *hwmgr) 107 63 { ··· 206 250 if (ret) 207 251 goto err2; 208 252 209 - ret = phm_register_thermal_interrupt(hwmgr, &thermal_irq_src); 253 + ret = phm_register_thermal_interrupt(hwmgr, NULL); 210 254 if (ret) 211 255 goto err2; 212 256
+75
drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.c
··· 534 534 } 535 535 536 536 537 + int phm_irq_process(struct amdgpu_device *adev, 538 + struct amdgpu_irq_src *source, 539 + struct amdgpu_iv_entry *entry) 540 + { 541 + uint32_t client_id = entry->client_id; 542 + uint32_t src_id = entry->src_id; 543 + 544 + if (client_id == AMDGPU_IH_CLIENTID_LEGACY) { 545 + if (src_id == 230) 546 + pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n", 547 + PCI_BUS_NUM(adev->pdev->devfn), 548 + PCI_SLOT(adev->pdev->devfn), 549 + PCI_FUNC(adev->pdev->devfn)); 550 + else if (src_id == 231) 551 + pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n", 552 + PCI_BUS_NUM(adev->pdev->devfn), 553 + PCI_SLOT(adev->pdev->devfn), 554 + PCI_FUNC(adev->pdev->devfn)); 555 + else if (src_id == 83) 556 + pr_warn("GPU Critical Temperature Fault detected on PCIe %d:%d.%d!\n", 557 + PCI_BUS_NUM(adev->pdev->devfn), 558 + PCI_SLOT(adev->pdev->devfn), 559 + PCI_FUNC(adev->pdev->devfn)); 560 + } else if (client_id == SOC15_IH_CLIENTID_THM) { 561 + if (src_id == 0) 562 + pr_warn("GPU over temperature range detected on PCIe %d:%d.%d!\n", 563 + PCI_BUS_NUM(adev->pdev->devfn), 564 + PCI_SLOT(adev->pdev->devfn), 565 + PCI_FUNC(adev->pdev->devfn)); 566 + else 567 + pr_warn("GPU under temperature range detected on PCIe %d:%d.%d!\n", 568 + PCI_BUS_NUM(adev->pdev->devfn), 569 + PCI_SLOT(adev->pdev->devfn), 570 + PCI_FUNC(adev->pdev->devfn)); 571 + } else if (client_id == SOC15_IH_CLIENTID_ROM_SMUIO) 572 + pr_warn("GPU Critical Temperature Fault detected on PCIe %d:%d.%d!\n", 573 + PCI_BUS_NUM(adev->pdev->devfn), 574 + PCI_SLOT(adev->pdev->devfn), 575 + PCI_FUNC(adev->pdev->devfn)); 576 + 577 + return 0; 578 + } 579 + 580 + static const struct amdgpu_irq_src_funcs smu9_irq_funcs = { 581 + .process = phm_irq_process, 582 + }; 583 + 584 + int smu9_register_thermal_interrupt(struct pp_hwmgr *hwmgr, 585 + const void *info) 586 + { 587 + struct amdgpu_irq_src *source = 588 + kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL); 589 + 590 + if (!source) 591 + return -ENOMEM; 592 + 593 + source->funcs = &smu9_irq_funcs; 594 + 595 + amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev), 596 + SOC15_IH_CLIENTID_THM, 597 + 0, 598 + source); 599 + amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev), 600 + SOC15_IH_CLIENTID_THM, 601 + 1, 602 + source); 603 + 604 + /* Register CTF(GPIO_19) interrupt */ 605 + amdgpu_irq_add_id((struct amdgpu_device *)(hwmgr->adev), 606 + SOC15_IH_CLIENTID_ROM_SMUIO, 607 + 83, 608 + source); 609 + 610 + return 0; 611 + }
+7
drivers/gpu/drm/amd/powerplay/hwmgr/smu_helper.h
··· 73 73 uint32_t value, 74 74 uint32_t mask); 75 75 76 + int phm_irq_process(struct amdgpu_device *adev, 77 + struct amdgpu_irq_src *source, 78 + struct amdgpu_iv_entry *entry); 79 + 80 + int smu9_register_thermal_interrupt(struct pp_hwmgr *hwmgr, 81 + const void *info); 82 + 76 83 #define PHM_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT 77 84 #define PHM_FIELD_MASK(reg, field) reg##__##field##_MASK 78 85
+1 -34
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
··· 44 44 #include "vega10_thermal.h" 45 45 #include "pp_debug.h" 46 46 #include "amd_pcie_helpers.h" 47 - #include "cgs_linux.h" 48 47 #include "ppinterrupt.h" 49 48 #include "pp_overdriver.h" 50 49 #include "pp_thermal.h" ··· 4815 4816 return 0; 4816 4817 } 4817 4818 4818 - static int vega10_register_thermal_interrupt(struct pp_hwmgr *hwmgr, 4819 - const void *info) 4820 - { 4821 - struct cgs_irq_src_funcs *irq_src = 4822 - (struct cgs_irq_src_funcs *)info; 4823 - 4824 - if (hwmgr->thermal_controller.ucType == 4825 - ATOM_VEGA10_PP_THERMALCONTROLLER_VEGA10 || 4826 - hwmgr->thermal_controller.ucType == 4827 - ATOM_VEGA10_PP_THERMALCONTROLLER_EMC2103_WITH_INTERNAL) { 4828 - PP_ASSERT_WITH_CODE(!cgs_add_irq_source(hwmgr->device, 4829 - SOC15_IH_CLIENTID_THM, 4830 - 0, 0, irq_src[0].set, irq_src[0].handler, hwmgr), 4831 - "Failed to register high thermal interrupt!", 4832 - return -EINVAL); 4833 - PP_ASSERT_WITH_CODE(!cgs_add_irq_source(hwmgr->device, 4834 - SOC15_IH_CLIENTID_THM, 4835 - 1, 0, irq_src[1].set, irq_src[1].handler, hwmgr), 4836 - "Failed to register low thermal interrupt!", 4837 - return -EINVAL); 4838 - } 4839 - 4840 - /* Register CTF(GPIO_19) interrupt */ 4841 - PP_ASSERT_WITH_CODE(!cgs_add_irq_source(hwmgr->device, 4842 - SOC15_IH_CLIENTID_ROM_SMUIO, 4843 - 83, 0, irq_src[2].set, irq_src[2].handler, hwmgr), 4844 - "Failed to register CTF thermal interrupt!", 4845 - return -EINVAL); 4846 - 4847 - return 0; 4848 - } 4849 - 4850 4819 static int vega10_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf) 4851 4820 { 4852 4821 struct vega10_hwmgr *data = hwmgr->backend; ··· 4939 4972 .avfs_control = vega10_avfs_enable, 4940 4973 .notify_cac_buffer_info = vega10_notify_cac_buffer_info, 4941 4974 .get_thermal_temperature_range = vega10_get_thermal_temperature_range, 4942 - .register_internal_thermal_interrupt = vega10_register_thermal_interrupt, 4975 + .register_internal_thermal_interrupt = smu9_register_thermal_interrupt, 4943 4976 .start_thermal_controller = vega10_start_thermal_controller, 4944 4977 .get_power_profile_mode = vega10_get_power_profile_mode, 4945 4978 .set_power_profile_mode = vega10_set_power_profile_mode,
+1 -47
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
··· 44 44 #include "vega12_ppsmc.h" 45 45 #include "pp_debug.h" 46 46 #include "amd_pcie_helpers.h" 47 - #include "cgs_linux.h" 48 47 #include "ppinterrupt.h" 49 48 #include "pp_overdriver.h" 50 49 #include "pp_thermal.h" ··· 2508 2509 return 0; 2509 2510 } 2510 2511 2511 - static int vega12_is_hardware_ctf_enabled(struct pp_hwmgr *hwmgr) 2512 - { 2513 - uint32_t reg; 2514 - 2515 - reg = soc15_get_register_offset(THM_HWID, 0, 2516 - mmTHM_TCON_THERM_TRIP_BASE_IDX, 2517 - mmTHM_TCON_THERM_TRIP); 2518 - 2519 - return (((cgs_read_register(hwmgr->device, reg) & 2520 - THM_TCON_THERM_TRIP__THERM_TP_EN_MASK) >> 2521 - THM_TCON_THERM_TRIP__THERM_TP_EN__SHIFT) == 1); 2522 - } 2523 - 2524 - static int vega12_register_thermal_interrupt(struct pp_hwmgr *hwmgr, 2525 - const void *info) 2526 - { 2527 - struct cgs_irq_src_funcs *irq_src = 2528 - (struct cgs_irq_src_funcs *)info; 2529 - 2530 - if (hwmgr->thermal_controller.ucType == 2531 - ATOM_VEGA12_PP_THERMALCONTROLLER_VEGA12) { 2532 - PP_ASSERT_WITH_CODE(!cgs_add_irq_source(hwmgr->device, 2533 - 0xf, /* AMDGPU_IH_CLIENTID_THM */ 2534 - 0, 0, irq_src[0].set, irq_src[0].handler, hwmgr), 2535 - "Failed to register high thermal interrupt!", 2536 - return -EINVAL); 2537 - PP_ASSERT_WITH_CODE(!cgs_add_irq_source(hwmgr->device, 2538 - 0xf, /* AMDGPU_IH_CLIENTID_THM */ 2539 - 1, 0, irq_src[1].set, irq_src[1].handler, hwmgr), 2540 - "Failed to register low thermal interrupt!", 2541 - return -EINVAL); 2542 - } 2543 - 2544 - if (vega12_is_hardware_ctf_enabled(hwmgr)) 2545 - /* Register CTF(GPIO_19) interrupt */ 2546 - PP_ASSERT_WITH_CODE(!cgs_add_irq_source(hwmgr->device, 2547 - 0x16, /* AMDGPU_IH_CLIENTID_ROM_SMUIO, */ 2548 - 83, 0, irq_src[2].set, irq_src[2].handler, hwmgr), 2549 - "Failed to register CTF thermal interrupt!", 2550 - return -EINVAL); 2551 - 2552 - return 0; 2553 - } 2554 - 2555 - 2556 2512 static const struct pp_hwmgr_func vega12_hwmgr_funcs = { 2557 2513 .backend_init = vega12_hwmgr_backend_init, 2558 2514 .backend_fini = vega12_hwmgr_backend_fini, ··· 2557 2603 #endif 2558 2604 .notify_cac_buffer_info = vega12_notify_cac_buffer_info, 2559 2605 .get_thermal_temperature_range = vega12_get_thermal_temperature_range, 2560 - .register_internal_thermal_interrupt = vega12_register_thermal_interrupt, 2606 + .register_internal_thermal_interrupt = smu9_register_thermal_interrupt, 2561 2607 .start_thermal_controller = vega12_start_thermal_controller, 2562 2608 }; 2563 2609
-5
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h
··· 785 785 uint32_t workload_setting[Workload_Policy_Max]; 786 786 }; 787 787 788 - struct cgs_irq_src_funcs { 789 - cgs_irq_source_set_func_t set; 790 - cgs_irq_handler_func_t handler; 791 - }; 792 - 793 788 extern int hwmgr_early_init(struct pp_hwmgr *hwmgr); 794 789 extern int hwmgr_hw_init(struct pp_hwmgr *hwmgr); 795 790 extern int hwmgr_hw_fini(struct pp_hwmgr *hwmgr);