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: Group filling reserve region details

Add a function which groups filling of reserve region information. It
may not cover all as info on some regions are still filled outside like
those from atomfirmware tables.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
5dad4394 bb92be60

+26 -34
+4 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
··· 1033 1033 } 1034 1034 } 1035 1035 1036 - void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev) 1036 + void amdgpu_gmc_init_vga_resv_regions(struct amdgpu_device *adev) 1037 1037 { 1038 1038 unsigned size; 1039 + 1040 + if (adev->gmc.is_app_apu) 1041 + return; 1039 1042 1040 1043 /* 1041 1044 * Some ASICs need to reserve a region of video memory to avoid access
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h
··· 456 456 amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type, 457 457 bool enable); 458 458 459 - void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev); 459 + void amdgpu_gmc_init_vga_resv_regions(struct amdgpu_device *adev); 460 460 461 461 void amdgpu_gmc_init_pdb0(struct amdgpu_device *adev); 462 462 uint64_t amdgpu_gmc_vram_mc2pa(struct amdgpu_device *adev, uint64_t mc_addr);
+21 -18
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 1687 1687 resv->needs_cpu_map = needs_cpu_map; 1688 1688 } 1689 1689 1690 + static void amdgpu_ttm_init_vram_resv_regions(struct amdgpu_device *adev) 1691 + { 1692 + /* Initialize memory reservations as required for VGA. 1693 + * This is used for VGA emulation and pre-OS scanout buffers to 1694 + * avoid display artifacts while transitioning between pre-OS 1695 + * and driver. 1696 + */ 1697 + amdgpu_gmc_init_vga_resv_regions(adev); 1698 + } 1699 + 1690 1700 int amdgpu_ttm_mark_vram_reserved(struct amdgpu_device *adev, 1691 1701 enum amdgpu_resv_region_id id) 1692 1702 { ··· 2096 2086 adev->gmc.visible_vram_size); 2097 2087 #endif 2098 2088 2089 + amdgpu_ttm_init_vram_resv_regions(adev); 2090 + 2099 2091 /* 2100 2092 *The reserved vram for firmware must be pinned to the specified 2101 2093 *place on the VRAM, so reserve it early. ··· 2135 2123 return r; 2136 2124 } 2137 2125 2138 - /* allocate memory as required for VGA 2139 - * This is used for VGA emulation and pre-OS scanout buffers to 2140 - * avoid display artifacts while transitioning between pre-OS 2141 - * and driver. 2142 - */ 2143 - if (!adev->gmc.is_app_apu) { 2144 - r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_VGA); 2145 - if (r) 2146 - return r; 2126 + r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_VGA); 2127 + if (r) 2128 + return r; 2147 2129 2148 - r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_EXTENDED); 2149 - if (r) 2150 - return r; 2130 + r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_EXTENDED); 2131 + if (r) 2132 + return r; 2151 2133 2152 - r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_RESERVED); 2153 - if (r) 2154 - return r; 2155 - } else { 2156 - DRM_DEBUG_DRIVER("Skipped stolen memory reservation\n"); 2157 - } 2134 + r = amdgpu_ttm_mark_vram_reserved(adev, AMDGPU_RESV_STOLEN_RESERVED); 2135 + if (r) 2136 + return r; 2158 2137 2159 2138 dev_info(adev->dev, " %uM of VRAM memory ready\n", 2160 2139 (unsigned int)(adev->gmc.real_vram_size / (1024 * 1024)));
-2
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
··· 860 860 if (r) 861 861 return r; 862 862 863 - amdgpu_gmc_get_vbios_allocations(adev); 864 - 865 863 /* Memory manager */ 866 864 r = amdgpu_bo_init(adev); 867 865 if (r)
-2
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
··· 834 834 if (r) 835 835 return r; 836 836 837 - amdgpu_gmc_get_vbios_allocations(adev); 838 - 839 837 /* Memory manager */ 840 838 r = amdgpu_bo_init(adev); 841 839 if (r)
-2
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
··· 924 924 if (r) 925 925 return r; 926 926 927 - amdgpu_gmc_get_vbios_allocations(adev); 928 - 929 927 #ifdef HAVE_ACPI_DEV_GET_FIRST_MATCH_DEV 930 928 if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(12, 1, 0)) { 931 929 r = amdgpu_gmc_init_mem_ranges(adev);
-2
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
··· 854 854 if (r) 855 855 return r; 856 856 857 - amdgpu_gmc_get_vbios_allocations(adev); 858 - 859 857 r = amdgpu_bo_init(adev); 860 858 if (r) 861 859 return r;
-2
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
··· 1034 1034 if (r) 1035 1035 return r; 1036 1036 1037 - amdgpu_gmc_get_vbios_allocations(adev); 1038 - 1039 1037 /* Memory manager */ 1040 1038 r = amdgpu_bo_init(adev); 1041 1039 if (r)
-2
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
··· 1149 1149 if (r) 1150 1150 return r; 1151 1151 1152 - amdgpu_gmc_get_vbios_allocations(adev); 1153 - 1154 1152 /* Memory manager */ 1155 1153 r = amdgpu_bo_init(adev); 1156 1154 if (r)
-2
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
··· 2010 2010 if (r) 2011 2011 return r; 2012 2012 2013 - amdgpu_gmc_get_vbios_allocations(adev); 2014 - 2015 2013 if (amdgpu_is_multi_aid(adev)) { 2016 2014 r = amdgpu_gmc_init_mem_ranges(adev); 2017 2015 if (r)