xref: /linux/drivers/gpu/drm/xe/xe_tile.h (revision 220994d61cebfc04f071d69049127657c7e8191b)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _XE_TILE_H_
7 #define _XE_TILE_H_
8 
9 #include "xe_device_types.h"
10 
11 struct xe_tile;
12 
13 int xe_tile_init_early(struct xe_tile *tile, struct xe_device *xe, u8 id);
14 int xe_tile_init_noalloc(struct xe_tile *tile);
15 int xe_tile_init(struct xe_tile *tile);
16 
17 void xe_tile_migrate_wait(struct xe_tile *tile);
18 
19 #if IS_ENABLED(CONFIG_DRM_XE_PAGEMAP)
xe_tile_local_pagemap(struct xe_tile * tile)20 static inline struct drm_pagemap *xe_tile_local_pagemap(struct xe_tile *tile)
21 {
22 	return &tile->mem.vram.dpagemap;
23 }
24 #else
xe_tile_local_pagemap(struct xe_tile * tile)25 static inline struct drm_pagemap *xe_tile_local_pagemap(struct xe_tile *tile)
26 {
27 	return NULL;
28 }
29 #endif
30 
xe_tile_is_root(struct xe_tile * tile)31 static inline bool xe_tile_is_root(struct xe_tile *tile)
32 {
33 	return tile->id == 0;
34 }
35 
36 #endif
37