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

drm/amdgpu: Modify the compilation failed problem when other ras blocks' .h include amdgpu_ras.h

Modify the compilation failed problem when other ras blocks' .h include amdgpu_ras.h.

v2: squash in forward declaration warning fix (Alex)

Signed-off-by: yipechai <YiPeng.Chai@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

yipechai and committed by
Alex Deucher
7cab2124 6492e1b0

+51 -25
+1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 108 108 #include "amdgpu_smuio.h" 109 109 #include "amdgpu_fdinfo.h" 110 110 #include "amdgpu_mca.h" 111 + #include "amdgpu_ras.h" 111 112 112 113 #define MAX_GPU_INSTANCE 16 113 114
+39
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
··· 2810 2810 } 2811 2811 } 2812 2812 #endif 2813 + 2814 + struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev) 2815 + { 2816 + if (!adev) 2817 + return NULL; 2818 + 2819 + return adev->psp.ras_context.ras; 2820 + } 2821 + 2822 + int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras* ras_con) 2823 + { 2824 + if (!adev) 2825 + return -EINVAL;; 2826 + 2827 + adev->psp.ras_context.ras = ras_con; 2828 + return 0; 2829 + } 2830 + 2831 + /* check if ras is supported on block, say, sdma, gfx */ 2832 + int amdgpu_ras_is_supported(struct amdgpu_device *adev, 2833 + unsigned int block) 2834 + { 2835 + struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); 2836 + 2837 + if (block >= AMDGPU_RAS_BLOCK_COUNT) 2838 + return 0; 2839 + return ras && (adev->ras_enabled & (1 << block)); 2840 + } 2841 + 2842 + int amdgpu_ras_reset_gpu(struct amdgpu_device *adev) 2843 + { 2844 + struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); 2845 + 2846 + if (atomic_cmpxchg(&ras->in_recovery, 0, 1) == 0) 2847 + schedule_work(&ras->recovery_work); 2848 + return 0; 2849 + } 2850 + 2851 + 2813 2852 /* Register each ip ras block into amdgpu ras */ 2814 2853 int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, 2815 2854 struct amdgpu_ras_block_object* ras_block_obj)
+10 -24
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h
··· 26 26 27 27 #include <linux/debugfs.h> 28 28 #include <linux/list.h> 29 - #include "amdgpu.h" 30 - #include "amdgpu_psp.h" 31 29 #include "ta_ras_if.h" 32 30 #include "amdgpu_ras_eeprom.h" 31 + 32 + struct amdgpu_iv_entry; 33 33 34 34 #define AMDGPU_RAS_FLAG_INIT_BY_VBIOS (0x1 << 0) 35 35 ··· 525 525 * 8: feature disable 526 526 */ 527 527 528 - #define amdgpu_ras_get_context(adev) ((adev)->psp.ras_context.ras) 529 - #define amdgpu_ras_set_context(adev, ras_con) ((adev)->psp.ras_context.ras = (ras_con)) 530 - 531 - /* check if ras is supported on block, say, sdma, gfx */ 532 - static inline int amdgpu_ras_is_supported(struct amdgpu_device *adev, 533 - unsigned int block) 534 - { 535 - struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); 536 - 537 - if (block >= AMDGPU_RAS_BLOCK_COUNT) 538 - return 0; 539 - return ras && (adev->ras_enabled & (1 << block)); 540 - } 541 528 542 529 int amdgpu_ras_recovery_init(struct amdgpu_device *adev); 543 530 ··· 540 553 struct eeprom_table_record *bps, int pages); 541 554 542 555 int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev); 543 - 544 - static inline int amdgpu_ras_reset_gpu(struct amdgpu_device *adev) 545 - { 546 - struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); 547 - 548 - if (atomic_cmpxchg(&ras->in_recovery, 0, 1) == 0) 549 - schedule_work(&ras->recovery_work); 550 - return 0; 551 - } 552 556 553 557 static inline enum ta_ras_block 554 558 amdgpu_ras_block_to_ta(enum amdgpu_ras_block block) { ··· 671 693 const char *get_ras_block_str(struct ras_common_if *ras_block); 672 694 673 695 bool amdgpu_ras_is_poison_mode_supported(struct amdgpu_device *adev); 696 + 697 + int amdgpu_ras_is_supported(struct amdgpu_device *adev, unsigned int block); 698 + 699 + int amdgpu_ras_reset_gpu(struct amdgpu_device *adev); 700 + 701 + struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev); 702 + 703 + int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras* ras_con); 674 704 675 705 int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, struct amdgpu_ras_block_object* ras_block_obj); 676 706 #endif
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
··· 21 21 * 22 22 */ 23 23 24 - #include "amdgpu_ras.h" 24 + #include "amdgpu.h" 25 25 26 26 static int amdgpu_umc_do_page_retirement(struct amdgpu_device *adev, 27 27 void *ras_error_status,