Skip to content

Commit fc3a50c

Browse files
piorkovmwajdecz
authored andcommitted
drm/xe: Rename struct xe_mem_region to struct xe_vram_region
The xe_mem_region structure has so far been used only in the context of VRAM regions. Also, the description of its fields clearly indicates that it was designed for VRAM regions. This struct is strictly related only to VRAM. So let's be clear on this point and rename it to xe_vram_region. Signed-off-by: Piotr Piórkowski <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Michal Wajdeczko <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent cbc0a0e commit fc3a50c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ mem_type_to_migrate(struct xe_device *xe, u32 mem_type)
143143
return tile->migrate;
144144
}
145145

146-
static struct xe_mem_region *res_to_mem_region(struct ttm_resource *res)
146+
static struct xe_vram_region *res_to_mem_region(struct ttm_resource *res)
147147
{
148148
struct xe_device *xe = ttm_to_xe_device(res->bo->bdev);
149149
struct ttm_resource_manager *mgr;
@@ -179,7 +179,7 @@ static void add_vram(struct xe_device *xe, struct xe_bo *bo,
179179
struct ttm_place *places, u32 bo_flags, u32 mem_type, u32 *c)
180180
{
181181
struct ttm_place place = { .mem_type = mem_type };
182-
struct xe_mem_region *vram;
182+
struct xe_vram_region *vram;
183183
u64 io_size;
184184

185185
xe_assert(xe, *c < ARRAY_SIZE(bo->placements));
@@ -468,7 +468,7 @@ static int xe_ttm_io_mem_reserve(struct ttm_device *bdev,
468468
return 0;
469469
case XE_PL_VRAM0:
470470
case XE_PL_VRAM1: {
471-
struct xe_mem_region *vram = res_to_mem_region(mem);
471+
struct xe_vram_region *vram = res_to_mem_region(mem);
472472

473473
if (!xe_ttm_resource_visible(mem))
474474
return -EINVAL;
@@ -815,7 +815,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
815815

816816
/* Create a new VMAP once kernel BO back in VRAM */
817817
if (!ret && resource_is_vram(new_mem)) {
818-
struct xe_mem_region *vram = res_to_mem_region(new_mem);
818+
struct xe_vram_region *vram = res_to_mem_region(new_mem);
819819
void __iomem *new_addr = vram->mapping +
820820
(new_mem->start << PAGE_SHIFT);
821821

@@ -1025,7 +1025,7 @@ static unsigned long xe_ttm_io_mem_pfn(struct ttm_buffer_object *ttm_bo,
10251025
{
10261026
struct xe_bo *bo = ttm_to_xe_bo(ttm_bo);
10271027
struct xe_res_cursor cursor;
1028-
struct xe_mem_region *vram;
1028+
struct xe_vram_region *vram;
10291029

10301030
if (ttm_bo->resource->mem_type == XE_PL_STOLEN)
10311031
return xe_ttm_stolen_io_offset(bo, page_offset << PAGE_SHIFT) >> PAGE_SHIFT;
@@ -1165,7 +1165,7 @@ static int xe_ttm_access_memory(struct ttm_buffer_object *ttm_bo,
11651165
struct xe_device *xe = ttm_to_xe_device(ttm_bo->bdev);
11661166
struct iosys_map vmap;
11671167
struct xe_res_cursor cursor;
1168-
struct xe_mem_region *vram;
1168+
struct xe_vram_region *vram;
11691169
int bytes_left = len;
11701170

11711171
xe_bo_assert_held(bo);

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ struct xe_pxp;
7070
struct xe_tile * : (tile__)->xe)
7171

7272
/**
73-
* struct xe_mem_region - memory region structure
73+
* struct xe_vram_region - memory region structure
7474
* This is used to describe a memory region in xe
7575
* device, such as HBM memory or CXL extension memory.
7676
*/
77-
struct xe_mem_region {
77+
struct xe_vram_region {
7878
/** @io_start: IO start address of this VRAM instance */
7979
resource_size_t io_start;
8080
/**
@@ -197,7 +197,7 @@ struct xe_tile {
197197
* Although VRAM is associated with a specific tile, it can
198198
* still be accessed by all tiles' GTs.
199199
*/
200-
struct xe_mem_region vram;
200+
struct xe_vram_region vram;
201201

202202
/** @mem.vram_mgr: VRAM TTM manager */
203203
struct xe_ttm_vram_mgr *vram_mgr;
@@ -369,7 +369,7 @@ struct xe_device {
369369
/** @mem: memory info for device */
370370
struct {
371371
/** @mem.vram: VRAM info for device */
372-
struct xe_mem_region vram;
372+
struct xe_vram_region vram;
373373
/** @mem.sys_mgr: system TTM manager */
374374
struct ttm_resource_manager sys_mgr;
375375
} mem;

drivers/gpu/drm/xe/xe_ttm_vram_mgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ int __xe_ttm_vram_mgr_init(struct xe_device *xe, struct xe_ttm_vram_mgr *mgr,
340340
int xe_ttm_vram_mgr_init(struct xe_tile *tile, struct xe_ttm_vram_mgr *mgr)
341341
{
342342
struct xe_device *xe = tile_to_xe(tile);
343-
struct xe_mem_region *vram = &tile->mem.vram;
343+
struct xe_vram_region *vram = &tile->mem.vram;
344344

345345
mgr->vram = vram;
346346
return __xe_ttm_vram_mgr_init(xe, mgr, XE_PL_VRAM0 + tile->id,

drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <drm/drm_buddy.h>
1010
#include <drm/ttm/ttm_device.h>
1111

12-
struct xe_mem_region;
12+
struct xe_vram_region;
1313

1414
/**
1515
* struct xe_ttm_vram_mgr - XE TTM VRAM manager
@@ -22,7 +22,7 @@ struct xe_ttm_vram_mgr {
2222
/** @mm: DRM buddy allocator which manages the VRAM */
2323
struct drm_buddy mm;
2424
/** @vram: ptr to details of associated VRAM region */
25-
struct xe_mem_region *vram;
25+
struct xe_vram_region *vram;
2626
/** @visible_size: Proped size of the CPU visible portion */
2727
u64 visible_size;
2828
/** @visible_avail: CPU visible portion still unallocated */

0 commit comments

Comments
 (0)