Skip to content

Commit 73c0e80

Browse files
committed
drm/xe: Move PF and VF device types to separate headers
We plan to add more PF and VF types and mixing them in a single file is not desired. Move them out to new dedicated files. Signed-off-by: Michal Wajdeczko <[email protected]> Reviewed-by: Piotr Piórkowski <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7dcae52 commit 73c0e80

File tree

4 files changed

+58
-36
lines changed

4 files changed

+58
-36
lines changed

drivers/gpu/drm/xe/xe_device_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#include "xe_platform_types.h"
2222
#include "xe_pmu_types.h"
2323
#include "xe_pt_types.h"
24+
#include "xe_sriov_pf_types.h"
2425
#include "xe_sriov_types.h"
26+
#include "xe_sriov_vf_types.h"
2527
#include "xe_step_types.h"
2628
#include "xe_survivability_mode_types.h"
2729
#include "xe_ttm_vram_mgr_types.h"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2023-2025 Intel Corporation
4+
*/
5+
6+
#ifndef _XE_SRIOV_PF_TYPES_H_
7+
#define _XE_SRIOV_PF_TYPES_H_
8+
9+
#include <linux/mutex.h>
10+
#include <linux/types.h>
11+
12+
/**
13+
* struct xe_device_pf - Xe PF related data
14+
*
15+
* The data in this structure is valid only if driver is running in the
16+
* @XE_SRIOV_MODE_PF mode.
17+
*/
18+
struct xe_device_pf {
19+
/** @device_total_vfs: Maximum number of VFs supported by the device. */
20+
u16 device_total_vfs;
21+
22+
/** @driver_max_vfs: Maximum number of VFs supported by the driver. */
23+
u16 driver_max_vfs;
24+
25+
/** @master_lock: protects all VFs configurations across GTs */
26+
struct mutex master_lock;
27+
};
28+
29+
#endif

drivers/gpu/drm/xe/xe_sriov_types.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
#define _XE_SRIOV_TYPES_H_
88

99
#include <linux/build_bug.h>
10-
#include <linux/mutex.h>
11-
#include <linux/types.h>
12-
#include <linux/workqueue_types.h>
1310

1411
/**
1512
* VFID - Virtual Function Identifier
@@ -40,37 +37,4 @@ enum xe_sriov_mode {
4037
};
4138
static_assert(XE_SRIOV_MODE_NONE);
4239

43-
/**
44-
* struct xe_device_pf - Xe PF related data
45-
*
46-
* The data in this structure is valid only if driver is running in the
47-
* @XE_SRIOV_MODE_PF mode.
48-
*/
49-
struct xe_device_pf {
50-
/** @device_total_vfs: Maximum number of VFs supported by the device. */
51-
u16 device_total_vfs;
52-
53-
/** @driver_max_vfs: Maximum number of VFs supported by the driver. */
54-
u16 driver_max_vfs;
55-
56-
/** @master_lock: protects all VFs configurations across GTs */
57-
struct mutex master_lock;
58-
};
59-
60-
/**
61-
* struct xe_device_vf - Xe Virtual Function related data
62-
*
63-
* The data in this structure is valid only if driver is running in the
64-
* @XE_SRIOV_MODE_VF mode.
65-
*/
66-
struct xe_device_vf {
67-
/** @migration: VF Migration state data */
68-
struct {
69-
/** @migration.worker: VF migration recovery worker */
70-
struct work_struct worker;
71-
/** @migration.gt_flags: Per-GT request flags for VF migration recovery */
72-
unsigned long gt_flags;
73-
} migration;
74-
};
75-
7640
#endif
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2023-2025 Intel Corporation
4+
*/
5+
6+
#ifndef _XE_SRIOV_VF_TYPES_H_
7+
#define _XE_SRIOV_VF_TYPES_H_
8+
9+
#include <linux/workqueue_types.h>
10+
11+
/**
12+
* struct xe_device_vf - Xe Virtual Function related data
13+
*
14+
* The data in this structure is valid only if driver is running in the
15+
* @XE_SRIOV_MODE_VF mode.
16+
*/
17+
struct xe_device_vf {
18+
/** @migration: VF Migration state data */
19+
struct {
20+
/** @migration.worker: VF migration recovery worker */
21+
struct work_struct worker;
22+
/** @migration.gt_flags: Per-GT request flags for VF migration recovery */
23+
unsigned long gt_flags;
24+
} migration;
25+
};
26+
27+
#endif

0 commit comments

Comments
 (0)