@@ -144,9 +144,6 @@ static void try_add_system(struct xe_device *xe, struct xe_bo *bo,
144144 .mem_type = XE_PL_TT ,
145145 };
146146 * c += 1 ;
147-
148- if (bo -> props .preferred_mem_type == XE_BO_PROPS_INVALID )
149- bo -> props .preferred_mem_type = XE_PL_TT ;
150147 }
151148}
152149
@@ -181,25 +178,15 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo,
181178 }
182179 places [* c ] = place ;
183180 * c += 1 ;
184-
185- if (bo -> props .preferred_mem_type == XE_BO_PROPS_INVALID )
186- bo -> props .preferred_mem_type = mem_type ;
187181}
188182
189183static void try_add_vram (struct xe_device * xe , struct xe_bo * bo ,
190184 u32 bo_flags , u32 * c )
191185{
192- if (bo -> props .preferred_gt == XE_GT1 ) {
193- if (bo_flags & XE_BO_CREATE_VRAM1_BIT )
194- add_vram (xe , bo , bo -> placements , bo_flags , XE_PL_VRAM1 , c );
195- if (bo_flags & XE_BO_CREATE_VRAM0_BIT )
196- add_vram (xe , bo , bo -> placements , bo_flags , XE_PL_VRAM0 , c );
197- } else {
198- if (bo_flags & XE_BO_CREATE_VRAM0_BIT )
199- add_vram (xe , bo , bo -> placements , bo_flags , XE_PL_VRAM0 , c );
200- if (bo_flags & XE_BO_CREATE_VRAM1_BIT )
201- add_vram (xe , bo , bo -> placements , bo_flags , XE_PL_VRAM1 , c );
202- }
186+ if (bo_flags & XE_BO_CREATE_VRAM0_BIT )
187+ add_vram (xe , bo , bo -> placements , bo_flags , XE_PL_VRAM0 , c );
188+ if (bo_flags & XE_BO_CREATE_VRAM1_BIT )
189+ add_vram (xe , bo , bo -> placements , bo_flags , XE_PL_VRAM1 , c );
203190}
204191
205192static void try_add_stolen (struct xe_device * xe , struct xe_bo * bo ,
@@ -223,17 +210,8 @@ static int __xe_bo_placement_for_flags(struct xe_device *xe, struct xe_bo *bo,
223210{
224211 u32 c = 0 ;
225212
226- bo -> props .preferred_mem_type = XE_BO_PROPS_INVALID ;
227-
228- /* The order of placements should indicate preferred location */
229-
230- if (bo -> props .preferred_mem_class == DRM_XE_MEM_REGION_CLASS_SYSMEM ) {
231- try_add_system (xe , bo , bo_flags , & c );
232- try_add_vram (xe , bo , bo_flags , & c );
233- } else {
234- try_add_vram (xe , bo , bo_flags , & c );
235- try_add_system (xe , bo , bo_flags , & c );
236- }
213+ try_add_vram (xe , bo , bo_flags , & c );
214+ try_add_system (xe , bo , bo_flags , & c );
237215 try_add_stolen (xe , bo , bo_flags , & c );
238216
239217 if (!c )
@@ -1126,13 +1104,6 @@ static void xe_gem_object_close(struct drm_gem_object *obj,
11261104 }
11271105}
11281106
1129- static bool should_migrate_to_system (struct xe_bo * bo )
1130- {
1131- struct xe_device * xe = xe_bo_device (bo );
1132-
1133- return xe_device_in_fault_mode (xe ) && bo -> props .cpu_atomic ;
1134- }
1135-
11361107static vm_fault_t xe_gem_fault (struct vm_fault * vmf )
11371108{
11381109 struct ttm_buffer_object * tbo = vmf -> vma -> vm_private_data ;
@@ -1141,7 +1112,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
11411112 struct xe_bo * bo = ttm_to_xe_bo (tbo );
11421113 bool needs_rpm = bo -> flags & XE_BO_CREATE_VRAM_MASK ;
11431114 vm_fault_t ret ;
1144- int idx , r = 0 ;
1115+ int idx ;
11451116
11461117 if (needs_rpm )
11471118 xe_device_mem_access_get (xe );
@@ -1153,17 +1124,8 @@ static vm_fault_t xe_gem_fault(struct vm_fault *vmf)
11531124 if (drm_dev_enter (ddev , & idx )) {
11541125 trace_xe_bo_cpu_fault (bo );
11551126
1156- if (should_migrate_to_system (bo )) {
1157- r = xe_bo_migrate (bo , XE_PL_TT );
1158- if (r == - EBUSY || r == - ERESTARTSYS || r == - EINTR )
1159- ret = VM_FAULT_NOPAGE ;
1160- else if (r )
1161- ret = VM_FAULT_SIGBUS ;
1162- }
1163- if (!ret )
1164- ret = ttm_bo_vm_fault_reserved (vmf ,
1165- vmf -> vma -> vm_page_prot ,
1166- TTM_BO_VM_NUM_PREFAULT );
1127+ ret = ttm_bo_vm_fault_reserved (vmf , vmf -> vma -> vm_page_prot ,
1128+ TTM_BO_VM_NUM_PREFAULT );
11671129 drm_dev_exit (idx );
11681130 } else {
11691131 ret = ttm_bo_vm_dummy_page (vmf , vmf -> vma -> vm_page_prot );
@@ -1291,9 +1253,6 @@ struct xe_bo *___xe_bo_create_locked(struct xe_device *xe, struct xe_bo *bo,
12911253 bo -> flags = flags ;
12921254 bo -> cpu_caching = cpu_caching ;
12931255 bo -> ttm .base .funcs = & xe_gem_object_funcs ;
1294- bo -> props .preferred_mem_class = XE_BO_PROPS_INVALID ;
1295- bo -> props .preferred_gt = XE_BO_PROPS_INVALID ;
1296- bo -> props .preferred_mem_type = XE_BO_PROPS_INVALID ;
12971256 bo -> ttm .priority = XE_BO_PRIORITY_NORMAL ;
12981257 INIT_LIST_HEAD (& bo -> pinned_link );
12991258#ifdef CONFIG_PROC_FS
0 commit comments