Skip to content

Commit fd00fe8

Browse files
nirmoylucasdemarchi
authored andcommitted
drm/xe: Remove unused xe_bo->props struct
Property struct is not being used so remove it and related dead code. Fixes: ddfa2d6 ("drm/xe/uapi: Kill VM_MADVISE IOCTL") Cc: Rodrigo Vivi <[email protected]> Cc: Thomas Hellström <[email protected]> Cc: [email protected] Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]> (cherry picked from commit 002d8f0) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 4cece76 commit fd00fe8

File tree

2 files changed

+9
-69
lines changed

2 files changed

+9
-69
lines changed

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -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

189183
static 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

205192
static 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-
11361107
static 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

drivers/gpu/drm/xe/xe_bo_types.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,6 @@ struct xe_bo {
5656
*/
5757
struct list_head client_link;
5858
#endif
59-
/** @props: BO user controlled properties */
60-
struct {
61-
/** @preferred_mem: preferred memory class for this BO */
62-
s16 preferred_mem_class;
63-
/** @prefered_gt: preferred GT for this BO */
64-
s16 preferred_gt;
65-
/** @preferred_mem_type: preferred memory type */
66-
s32 preferred_mem_type;
67-
/**
68-
* @cpu_atomic: the CPU expects to do atomics operations to
69-
* this BO
70-
*/
71-
bool cpu_atomic;
72-
/**
73-
* @device_atomic: the device expects to do atomics operations
74-
* to this BO
75-
*/
76-
bool device_atomic;
77-
} props;
7859
/** @freed: List node for delayed put. */
7960
struct llist_node freed;
8061
/** @created: Whether the bo has passed initial creation */

0 commit comments

Comments
 (0)