Skip to content

Commit 541372b

Browse files
Le Maalexdeucher
authored andcommitted
drm/amdgpu: add some basic elements for multiple XCD case
Add some basic definitions and structure member. Inscrease MAX_WB slots to 1024 to support the increasing number of rings for multiple partitions. v2: unify naming style Signed-off-by: Le Ma <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0530553 commit 541372b

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv);
470470
/*
471471
* Writeback
472472
*/
473-
#define AMDGPU_MAX_WB 256 /* Reserve at most 256 WB slots for amdgpu-owned rings. */
473+
#define AMDGPU_MAX_WB 1024 /* Reserve at most 1024 WB slots for amdgpu-owned rings. */
474474

475475
struct amdgpu_wb {
476476
struct amdgpu_bo *wb_obj;

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#define AMDGPU_GFX_CG_DISABLED_MODE 0x00000004L
4343
#define AMDGPU_GFX_LBPW_DISABLED_MODE 0x00000008L
4444

45+
#define AMDGPU_MAX_GC_INSTANCES 8
46+
4547
#define AMDGPU_MAX_GFX_QUEUES KGD_MAX_QUEUES
4648
#define AMDGPU_MAX_COMPUTE_QUEUES KGD_MAX_QUEUES
4749

@@ -53,6 +55,15 @@ enum amdgpu_gfx_pipe_priority {
5355
#define AMDGPU_GFX_QUEUE_PRIORITY_MINIMUM 0
5456
#define AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM 15
5557

58+
enum amdgpu_gfx_partition {
59+
AMDGPU_SPX_PARTITION_MODE = 0,
60+
AMDGPU_DPX_PARTITION_MODE = 1,
61+
AMDGPU_TPX_PARTITION_MODE = 2,
62+
AMDGPU_QPX_PARTITION_MODE = 3,
63+
AMDGPU_CPX_PARTITION_MODE = 4,
64+
AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE,
65+
};
66+
5667
struct amdgpu_mec {
5768
struct amdgpu_bo *hpd_eop_obj;
5869
u64 hpd_eop_gpu_addr;
@@ -323,7 +334,7 @@ struct amdgpu_gfx {
323334
bool cp_fw_write_wait;
324335
struct amdgpu_ring gfx_ring[AMDGPU_MAX_GFX_RINGS];
325336
unsigned num_gfx_rings;
326-
struct amdgpu_ring compute_ring[AMDGPU_MAX_COMPUTE_RINGS];
337+
struct amdgpu_ring compute_ring[AMDGPU_MAX_COMPUTE_RINGS * AMDGPU_MAX_GC_INSTANCES];
327338
unsigned num_compute_rings;
328339
struct amdgpu_irq_src eop_irq;
329340
struct amdgpu_irq_src priv_reg_irq;
@@ -364,6 +375,10 @@ struct amdgpu_gfx {
364375

365376
struct amdgpu_ring sw_gfx_ring[AMDGPU_MAX_SW_GFX_RINGS];
366377
struct amdgpu_ring_mux muxer;
378+
379+
enum amdgpu_gfx_partition partition_mode;
380+
uint32_t num_xcd;
381+
uint32_t num_xcc_per_xcp;
367382
};
368383

369384
#define amdgpu_gfx_get_gpu_clock_counter(adev) (adev)->gfx.funcs->get_gpu_clock_counter((adev))

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ struct amdgpu_ring {
249249
uint64_t ptr_mask;
250250
uint32_t buf_mask;
251251
u32 idx;
252+
u32 xcc_id;
252253
u32 me;
253254
u32 pipe;
254255
u32 queue;

0 commit comments

Comments
 (0)