mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
drm/amdkfd: Adjust parameter of allocate_mqd
Make allocate_mqd consistent with other callbacks. Prepare for next patch to use mqd_manager->mqd_size. Signed-off-by: Lang Yu <lang.yu@amd.com> Reviewed-by: David Belanger <david.belanger@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Reviewed-by: Mukul Joshi <mukul.joshi@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
a6a4dd519c
commit
3aca6f835b
11 changed files with 24 additions and 15 deletions
|
|
@ -676,7 +676,7 @@ static int create_queue_nocpsch(struct device_queue_manager *dqm,
|
|||
|
||||
/* Temporarily release dqm lock to avoid a circular lock dependency */
|
||||
dqm_unlock(dqm);
|
||||
q->mqd_mem_obj = mqd_mgr->allocate_mqd(mqd_mgr->dev, &q->properties);
|
||||
q->mqd_mem_obj = mqd_mgr->allocate_mqd(mqd_mgr, &q->properties);
|
||||
dqm_lock(dqm);
|
||||
|
||||
if (!q->mqd_mem_obj) {
|
||||
|
|
@ -2002,7 +2002,7 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
|
|||
dqm->asic_ops.init_sdma_vm(dqm, q, qpd);
|
||||
q->properties.tba_addr = qpd->tba_addr;
|
||||
q->properties.tma_addr = qpd->tma_addr;
|
||||
q->mqd_mem_obj = mqd_mgr->allocate_mqd(mqd_mgr->dev, &q->properties);
|
||||
q->mqd_mem_obj = mqd_mgr->allocate_mqd(mqd_mgr, &q->properties);
|
||||
if (!q->mqd_mem_obj) {
|
||||
retval = -ENOMEM;
|
||||
goto out_deallocate_doorbell;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev,
|
|||
|
||||
kq->queue->device = dev;
|
||||
|
||||
kq->queue->mqd_mem_obj = kq->mqd_mgr->allocate_mqd(kq->mqd_mgr->dev,
|
||||
kq->queue->mqd_mem_obj = kq->mqd_mgr->allocate_mqd(kq->mqd_mgr,
|
||||
&kq->queue->properties);
|
||||
if (!kq->queue->mqd_mem_obj)
|
||||
goto err_allocate_mqd;
|
||||
|
|
|
|||
|
|
@ -46,9 +46,10 @@ int pipe_priority_map[] = {
|
|||
KFD_PIPE_PRIORITY_CS_HIGH
|
||||
};
|
||||
|
||||
struct kfd_mem_obj *allocate_hiq_mqd(struct kfd_node *dev, struct queue_properties *q)
|
||||
struct kfd_mem_obj *allocate_hiq_mqd(struct mqd_manager *mm, struct queue_properties *q)
|
||||
{
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
struct kfd_node *dev = mm->dev;
|
||||
|
||||
mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL);
|
||||
if (!mqd_mem_obj)
|
||||
|
|
@ -61,10 +62,11 @@ struct kfd_mem_obj *allocate_hiq_mqd(struct kfd_node *dev, struct queue_properti
|
|||
return mqd_mem_obj;
|
||||
}
|
||||
|
||||
struct kfd_mem_obj *allocate_sdma_mqd(struct kfd_node *dev,
|
||||
struct kfd_mem_obj *allocate_sdma_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
struct kfd_node *dev = mm->dev;
|
||||
uint64_t offset;
|
||||
|
||||
mqd_mem_obj = kzalloc(sizeof(struct kfd_mem_obj), GFP_KERNEL);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
*/
|
||||
extern int pipe_priority_map[];
|
||||
struct mqd_manager {
|
||||
struct kfd_mem_obj* (*allocate_mqd)(struct kfd_node *kfd,
|
||||
struct kfd_mem_obj* (*allocate_mqd)(struct mqd_manager *mm,
|
||||
struct queue_properties *q);
|
||||
|
||||
void (*init_mqd)(struct mqd_manager *mm, void **mqd,
|
||||
|
|
@ -153,10 +153,10 @@ struct mqd_user_context_save_area_header {
|
|||
uint32_t wave_state_size;
|
||||
};
|
||||
|
||||
struct kfd_mem_obj *allocate_hiq_mqd(struct kfd_node *dev,
|
||||
struct kfd_mem_obj *allocate_hiq_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q);
|
||||
|
||||
struct kfd_mem_obj *allocate_sdma_mqd(struct kfd_node *dev,
|
||||
struct kfd_mem_obj *allocate_sdma_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q);
|
||||
void free_mqd_hiq_sdma(struct mqd_manager *mm, void *mqd,
|
||||
struct kfd_mem_obj *mqd_mem_obj);
|
||||
|
|
|
|||
|
|
@ -73,9 +73,10 @@ static void set_priority(struct cik_mqd *m, struct queue_properties *q)
|
|||
m->cp_hqd_queue_priority = q->priority;
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *kfd,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_node *kfd = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
|
||||
if (kfd_gtt_sa_allocate(kfd, sizeof(struct cik_mqd),
|
||||
|
|
|
|||
|
|
@ -73,9 +73,10 @@ static void set_priority(struct v10_compute_mqd *m, struct queue_properties *q)
|
|||
m->cp_hqd_queue_priority = q->priority;
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *kfd,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_node *kfd = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
|
||||
if (kfd_gtt_sa_allocate(kfd, sizeof(struct v10_compute_mqd),
|
||||
|
|
|
|||
|
|
@ -99,9 +99,10 @@ static void set_priority(struct v11_compute_mqd *m, struct queue_properties *q)
|
|||
m->cp_hqd_queue_priority = q->priority;
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *node,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_node *node = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
int size;
|
||||
|
||||
|
|
|
|||
|
|
@ -80,9 +80,10 @@ static void set_priority(struct v12_compute_mqd *m, struct queue_properties *q)
|
|||
m->cp_hqd_queue_priority = q->priority;
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *node,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_node *node = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -145,9 +145,10 @@ static void set_priority(struct v12_1_compute_mqd *m, struct queue_properties *q
|
|||
m->cp_hqd_queue_priority = q->priority;
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *node,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_node *node = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
unsigned int size;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,10 +120,11 @@ static bool mqd_on_vram(struct amdgpu_device *adev)
|
|||
}
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *node,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
int retval;
|
||||
struct kfd_node *node = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj = NULL;
|
||||
|
||||
/* For V9 only, due to a HW bug, the control stack of a user mode
|
||||
|
|
|
|||
|
|
@ -76,9 +76,10 @@ static void set_priority(struct vi_mqd *m, struct queue_properties *q)
|
|||
m->cp_hqd_queue_priority = q->priority;
|
||||
}
|
||||
|
||||
static struct kfd_mem_obj *allocate_mqd(struct kfd_node *kfd,
|
||||
static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
|
||||
struct queue_properties *q)
|
||||
{
|
||||
struct kfd_node *kfd = mm->dev;
|
||||
struct kfd_mem_obj *mqd_mem_obj;
|
||||
|
||||
if (kfd_gtt_sa_allocate(kfd, sizeof(struct vi_mqd),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue