KFD fixes v2
Subsystems (3)
cover KFD fixes v2
Small self-contained KFD fixes that don't introduce any new functionality or features. These may be suitable to include in drm-fixes for 4.14.
v2:
- Rebased on gabbayo/amdkfd-next
- Addressed code review feedback
- Dropped "Set /dev/kfd permissions to 0666 by default"
Felix Kuehling (3):
drm/amdkfd: Adjust dequeue latencies and timeouts drm/amdkfd: Fix incorrect destroy_mqd parameter drm/amdkfd: Print event limit messages only once per process
Yong Zhao (7):
drm/amdkfd: Reorganize kfd resume code
drm/amdkfd: Fix suspend/resume issue on Carrizo v2 drm/amdkfd: Rectify the jiffies calculation error with milliseconds v2 drm/amdkfd: Use VMID bitmap from KGD v2
drm/amdkfd: Reuse CHIP_* from amdgpu v2
drm/amdkfd: Drop _nocpsch suffix from shared functions drm/amdkfd: Fix kernel-queue wrapping bugs
drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c | 9 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 106 ++++++++++++--------- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 62 +++++------- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 5 +- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 40 +++++--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 3 + drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 37 ++++--- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 97 +++++++++++++++---- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +- 11 files changed, 235 insertions(+), 136 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1505945422-8851-1-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org
PATCH 1/10 drm/amdkfd: Reorganize kfd resume code
From: Yong Zhao <[email protected]>
The idea is to let kfd init and resume function share the same code path as much as possible, rather than to have two copies of almost identical code. That way improves the code readability and maintainability.
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 78 +++++++++++++++++---------------- 1 file changed, 40 insertions(+), 38 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +40 -38
@@ -92,6 +92,8 @@ static int kfd_gtt_sa_init(struct kfd_dev *kfd, unsigned int buf_size, unsigned int chunk_size);static void kfd_gtt_sa_fini (struct kfd_dev *kfd); +static int kfd_resume (struct kfd_dev *kfd); +static const struct kfd_device_info *lookup_device_info (unsigned short did) {size_t i;
@@ -176,15 +178,8 @@ static bool device_iommu_pasid_init(struct kfd_dev *kfd) pasid_limit, kfd->doorbell_process_limit - 1); - err =amd_iommu_init_device (kfd->pdev, pasid_limit); -if (err <0 ) { -dev_err (kfd_device,"error initializing iommu device\n" ); -return false; - } -if (!kfd_set_pasid_limit (pasid_limit)) {dev_err (kfd_device,"error setting pasid limit\n" ); -amd_iommu_free_device (kfd->pdev);return false; }
@@ -280,29 +275,22 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, goto kfd_interrupt_error; } -if (!device_iommu_pasid_init (kfd)) { -dev_err (kfd_device, -"Error initializing iommuv2 for device %x:%x\n" , - kfd->pdev->vendor, kfd->pdev->device); - goto device_iommu_pasid_error; - } -amd_iommu_set_invalidate_ctx_cb (kfd->pdev, - iommu_pasid_shutdown_callback); -amd_iommu_set_invalid_ppr_cb (kfd->pdev, iommu_invalid_ppr_cb); - kfd->dqm =device_queue_manager_init (kfd);if (!kfd->dqm) {dev_err (kfd_device,"Error initializing queue manager\n" ); goto device_queue_manager_error; } -if (kfd->dqm->ops.start (kfd->dqm)) { +if (!device_iommu_pasid_init (kfd)) {dev_err (kfd_device, -"Error starting queue manager for device %x:%x\n" , +"Error initializing iommuv2 for device %x:%x\n" , kfd->pdev->vendor, kfd->pdev->device); - goto dqm_start_error; + goto device_iommu_pasid_error; } +if (kfd_resume (kfd)) + goto kfd_resume_error; + kfd->dbgmgr =NULL ; kfd->init_complete = true;
@@ -314,11 +302,10 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, goto out; -dqm_start_error: +kfd_resume_error: +device_iommu_pasid_error:device_queue_manager_uninit (kfd->dqm); device_queue_manager_error: -amd_iommu_free_device (kfd->pdev); -device_iommu_pasid_error:kfd_interrupt_exit (kfd); kfd_interrupt_error:kfd_topology_remove_device (kfd);
@@ -338,8 +325,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,void kgd2kfd_device_exit (struct kfd_dev *kfd) {if (kfd->init_complete) { +kgd2kfd_suspend (kfd);device_queue_manager_uninit (kfd->dqm); -amd_iommu_free_device (kfd->pdev);kfd_interrupt_exit (kfd);kfd_topology_remove_device (kfd);kfd_doorbell_fini (kfd);
@@ -362,25 +349,40 @@ void kgd2kfd_suspend(struct kfd_dev *kfd)int kgd2kfd_resume (struct kfd_dev *kfd) { -unsigned int pasid_limit; -int err; +if (!kfd->init_complete) +return 0 ; - pasid_limit =kfd_get_pasid_limit (); +return kfd_resume (kfd); -if (kfd->init_complete) { - err =amd_iommu_init_device (kfd->pdev, pasid_limit); -if (err <0 ) { -dev_err (kfd_device,"failed to initialize iommu\n" ); -return -ENXIO ; - } +} -amd_iommu_set_invalidate_ctx_cb (kfd->pdev, - iommu_pasid_shutdown_callback); -amd_iommu_set_invalid_ppr_cb (kfd->pdev, iommu_invalid_ppr_cb); - kfd->dqm->ops.start (kfd->dqm); +static int kfd_resume (struct kfd_dev *kfd) +{ +int err =0 ; +unsigned int pasid_limit =kfd_get_pasid_limit (); + + err =amd_iommu_init_device (kfd->pdev, pasid_limit); +if (err) +return -ENXIO ; +amd_iommu_set_invalidate_ctx_cb (kfd->pdev, + iommu_pasid_shutdown_callback); +amd_iommu_set_invalid_ppr_cb (kfd->pdev, + iommu_invalid_ppr_cb); + + err = kfd->dqm->ops.start (kfd->dqm); +if (err) { +dev_err (kfd_device, +"Error starting queue manager for device %x:%x\n" , + kfd->pdev->vendor, kfd->pdev->device); + goto dqm_start_error; } -return 0 ; +return err; + +dqm_start_error: +amd_iommu_free_device (kfd->pdev); + +return err; }/* This is called directly from KGD at ISR. */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/10 drm/amdkfd: Fix suspend/resume issue on Carrizo v2
In reply to a message not in the archiveFrom: Yong Zhao <[email protected]>
When we do suspend/resume through "sudo pm-suspend" while there is HSA activity running, upon resume we will encounter HWS hanging, which is caused by memory read/write failures. The root cause is that when suspend, we neglected to unbind pasid from kfd device.
Another major change is that the bind/unbinding is changed to be performed on a per process basis, instead of whether there are queues in dqm.
v2:
- free IOMMU device if kfd_bind_processes_to_device fails in kfd_resume
- add comments to kfd_bind/unbind_processes_to/from_device
- minor cleanups
--- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 23 +++-- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 --- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 15 +++- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 97 ++++++++++++++++++---- 4 files changed, 109 insertions(+), 39 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +16 -7
@@ -191,7 +191,7 @@ static void iommu_pasid_shutdown_callback(struct pci_dev *pdev, int pasid)struct kfd_dev *dev =kfd_device_by_pci_dev (pdev);if (dev) -kfd_unbind_process_from_device (dev, pasid); +kfd_process_iommu_unbind_callback (dev, pasid); }/*
@@ -339,12 +339,16 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd)void kgd2kfd_suspend (struct kfd_dev *kfd) { -if (kfd->init_complete) { - kfd->dqm->ops.stop (kfd->dqm); -amd_iommu_set_invalidate_ctx_cb (kfd->pdev,NULL ); -amd_iommu_set_invalid_ppr_cb (kfd->pdev,NULL ); -amd_iommu_free_device (kfd->pdev); - } +if (!kfd->init_complete) +return ; + + kfd->dqm->ops.stop (kfd->dqm); + +kfd_unbind_processes_from_device (kfd); + +amd_iommu_set_invalidate_ctx_cb (kfd->pdev,NULL ); +amd_iommu_set_invalid_ppr_cb (kfd->pdev,NULL ); +amd_iommu_free_device (kfd->pdev); }int kgd2kfd_resume (struct kfd_dev *kfd)
@@ -369,6 +373,10 @@ static int kfd_resume(struct kfd_dev *kfd)amd_iommu_set_invalid_ppr_cb (kfd->pdev, iommu_invalid_ppr_cb); + err =kfd_bind_processes_to_device (kfd); +if (err) + goto processes_bind_error; + err = kfd->dqm->ops.start (kfd->dqm);if (err) { dev_err(kfd_device,
@@ -380,6 +388,7 @@ static int kfd_resume(struct kfd_dev *kfd)return err; dqm_start_error: +processes_bind_error:amd_iommu_free_device (kfd->pdev);return err;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +0 -13
@@ -670,7 +670,6 @@ static int initialize_cpsch(struct device_queue_manager *dqm)static int start_cpsch (struct device_queue_manager *dqm) { -struct device_process_node *node;int retval; retval =0 ;
@@ -697,11 +696,6 @@ static int start_cpsch(struct device_queue_manager *dqm)init_interrupts (dqm); -list_for_each_entry (node, &dqm->queues, list) -if (node->qpd->pqm->process && dqm->dev) -kfd_bind_process_to_device (dqm->dev, - node->qpd->pqm->process); -execute_queues_cpsch (dqm, true);return 0 ;
@@ -714,15 +708,8 @@ static int start_cpsch(struct device_queue_manager *dqm)static int stop_cpsch (struct device_queue_manager *dqm) { -struct device_process_node *node; -struct kfd_process_device *pdd; -destroy_queues_cpsch (dqm, true, true); -list_for_each_entry (node, &dqm->queues, list) { - pdd =qpd_to_pdd (node->qpd); - pdd->bound = false; - }kfd_gtt_sa_free (dqm->dev, dqm->fence_mem);pm_uninit (&dqm->packets);
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +12 -3
@@ -435,6 +435,13 @@ struct qcm_process_device {uint32_t sh_hidden_private_base; }; + +enum kfd_pdd_bound { +PDD_UNBOUND =0 , +PDD_BOUND , +PDD_BOUND_SUSPENDED , +}; +/* Data that is per-process-per device. */ struct kfd_process_device {/*
@@ -459,7 +466,7 @@ struct kfd_process_device {uint64_t scratch_limit;/* Is this process/pasid bound to this device? (amd_iommu_bind_pasid) */ -bool bound; +enum kfd_pdd_bound bound;/* This flag tells if we should reset all * wavefronts on process termination
@@ -548,8 +555,10 @@ struct kfd_process *kfd_get_process(const struct task_struct *);struct kfd_process *kfd_lookup_process_by_pasid (unsigned int pasid);struct kfd_process_device *kfd_bind_process_to_device (struct kfd_dev *dev, -struct kfd_process *p); -void kfd_unbind_process_from_device (struct kfd_dev *dev,unsigned int pasid); +struct kfd_process *p); +int kfd_bind_processes_to_device (struct kfd_dev *dev); +void kfd_unbind_processes_from_device (struct kfd_dev *dev); +void kfd_process_iommu_unbind_callback (struct kfd_dev *dev,unsigned int pasid);struct kfd_process_device *kfd_get_process_device_data (struct kfd_dev *dev,struct kfd_process *p); struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev,
drivers/gpu/drm/amd/amdkfd/kfd_process.c +81 -16
139 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/10 drm/amdkfd: Rectify the jiffies calculation error with milliseconds v2
In reply to a message not in the archiveFrom: Yong Zhao <[email protected]>
The timeout in milliseconds should not be regarded as jiffies. This commit fixed that.
v2:
- use msecs_to_jiffies
- change timeout_ms parameter to unsigned int to match msecs_to_jiffies
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 6 +++--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3 -3
@@ -835,12 +835,12 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,int amdkfd_fence_wait_timeout (unsigned int *fence_addr,unsigned int fence_value, -unsigned long timeout) +unsigned int timeout_ms) { - timeout += jiffies; +unsigned long end_jiffies =msecs_to_jiffies (timeout_ms) + jiffies;while (*fence_addr != fence_value) { -if (time_after (jiffies, timeout)) { +if (time_after (jiffies, end_jiffies)) {pr_err ("qcm fence wait loop timeout expired\n" );return -ETIME ; }
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -1
@@ -669,7 +669,7 @@ struct kernel_queue *pqm_get_kernel_queue(struct process_queue_manager *pqm,int amdkfd_fence_wait_timeout (unsigned int *fence_addr,unsigned int fence_value, -unsigned long timeout); +unsigned int timeout_ms);/* Packet Manager */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1505945422-8851-4-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org
Oded Gabbay
Reviewed-byRe: [PATCH 03/10] drm/amdkfd: Rectify the jiffies calculation error with milliseconds v2
Quoted 50 lines · Felix Kuehling
From: Yong Zhao <[email protected]>
The timeout in milliseconds should not be regarded as jiffies. This commit fixed that.
v2:
- usemsecs_to_jiffies
- changetimeout_msparameter to unsigned int to matchmsecs_to_jiffiesSigned-off-by Yong Zhao <[email protected]>Signed-off-by Felix Kuehling <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 6 +++--- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +3
-3@@ -835,12 +835,12 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,int amdkfd_fence_wait_timeout (unsigned int *fence_addr,unsigned int fence_value, -unsigned long timeout) +unsigned int timeout_ms) { - timeout += jiffies; +unsigned long end_jiffies =msecs_to_jiffies (timeout_ms) + jiffies;while (*fence_addr != fence_value) { -if (time_after (jiffies, timeout)) { +if (time_after (jiffies, end_jiffies)) {pr_err ("qcm fence wait loop timeout expired\n" );return -ETIME ; }drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1
-2@@ -669,7 +669,7 @@ struct kernel_queue *pqm_get_kernel_queue(struct process_queue_manager *pqm,int amdkfd_fence_wait_timeout (unsigned int *fence_addr,unsigned int fence_value, -unsigned long timeout); +unsigned int timeout_ms);/* Packet Manager */ --
Quoted 2 lines
2.7.4
This patch is:
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/10 drm/amdkfd: Adjust dequeue latencies and timeouts
In reply to a message not in the archiveAdjust latencies and timeouts for dequeueing with HWS and consolidate them in one place. Make them longer to allow long running waves to complete without causing a timeout. The timeout is twice as long as the latency plus some buffer to make sure we don't detect a timeout prematurely.
Change timeouts for dequeueing HQDs without HWS. KFD_UNMAP_LATENCY is more consistent with what the HWS does for user queues.
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 4 +++- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 --- 5 files changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +1 -1
@@ -323,7 +323,7 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm, retval = mqd->destroy_mqd (mqd, q->mqd,KFD_PREEMPT_TYPE_WAVEFRONT_RESET , -QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS , +KFD_UNMAP_LATENCY_MS , q->pipe, q->queue);if (retval)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +3 -1
@@ -29,7 +29,9 @@#include "kfd_priv.h" #include "kfd_mqd_manager.h" -#define QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS (500) +#define KFD_UNMAP_LATENCY_MS (4000) +#define QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS (2 * KFD_UNMAP_LATENCY_MS + 1000) +#define CIK_VMID_NUM (8)#define KFD_VMID_START_OFFSET (8)#define VMID_PER_DEVICE CIK_VMID_NUM
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +1 -1
@@ -185,7 +185,7 @@ static void uninitialize(struct kernel_queue *kq) kq->mqd->destroy_mqd (kq->mqd, kq->queue->mqd, false, -QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS , +KFD_UNMAP_LATENCY_MS , kq->queue->pipe, kq->queue->queue); else if (kq->queue->properties.type == KFD_QUEUE_TYPE_DIQ)
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +1 -1
@@ -376,7 +376,7 @@ int pm_send_set_resources(struct packet_manager *pm, packet->bitfields2.queue_type = queue_type__mes_set_resources__hsa_interface_queue_hiq; packet->bitfields2.vmid_mask = res->vmid_mask; - packet->bitfields2.unmap_latency =KFD_UNMAP_LATENCY ; + packet->bitfields2.unmap_latency =KFD_UNMAP_LATENCY_MS /100 ; packet->bitfields7.oac_mask = res->oac_mask; packet->bitfields8.gds_heap_base = res->gds_heap_base; packet->bitfields8.gds_heap_size = res->gds_heap_size;
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +0 -3
@@ -673,11 +673,8 @@ int amdkfd_fence_wait_timeout(unsigned int *fence_addr,/* Packet Manager */ -#define KFD_HIQ_TIMEOUT (500) -#define KFD_FENCE_COMPLETED (100)#define KFD_FENCE_INIT (10) -#define KFD_UNMAP_LATENCY (150)struct packet_manager {struct device_queue_manager *dqm;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/10 drm/amdkfd: Fix incorrect destroy_mqd parameter
In reply to a message not in the archiveWhen uninitializing a kernel queue.
--- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +1 -1
@@ -184,7 +184,7 @@ static void uninitialize(struct kernel_queue *kq)if (kq->queue->properties.type ==KFD_QUEUE_TYPE_HIQ ) kq->mqd->destroy_mqd (kq->mqd, kq->queue->mqd, - false, +KFD_PREEMPT_TYPE_WAVEFRONT_RESET ,KFD_UNMAP_LATENCY_MS , kq->queue->pipe, kq->queue->queue);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/10 drm/amdkfd: Use VMID bitmap from KGD v2
In reply to a message not in the archiveFrom: Yong Zhao <[email protected]>
The hard-coded values related to VMID were removed in KFD, as those values can be calculated in the KFD initialization function.
v2: remove unnecessary local variable
--- drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c | 9 ++------- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 +++++ drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 13 ++++++------- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 4 ---- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 7 +++++++ drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +- 6 files changed, 21 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c +2 -7
@@ -769,13 +769,8 @@ int dbgdev_wave_reset_wavefronts(struct kfd_dev *dev, struct kfd_process *p)union GRBM_GFX_INDEX_BITS reg_gfx_index;struct kfd_process_device *pdd;struct dbg_wave_control_info wac_info; -int temp; -int first_vmid_to_scan =8 ; -int last_vmid_to_scan =15 ; - - first_vmid_to_scan =ffs (dev->shared_resources.compute_vmid_bitmap) -1 ; - temp = dev->shared_resources.compute_vmid_bitmap >> first_vmid_to_scan; - last_vmid_to_scan = first_vmid_to_scan +ffz (temp); +int first_vmid_to_scan = dev->vm_info.first_vmid_kfd; +int last_vmid_to_scan = dev->vm_info.last_vmid_kfd; reg_sq_cmd.u32All =0 ; status =0 ;
drivers/gpu/drm/amd/amdkfd/kfd_device.c +5 -0
@@ -226,6 +226,11 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, kfd->shared_resources = *gpu_resources; + kfd->vm_info.first_vmid_kfd =ffs (gpu_resources->compute_vmid_bitmap)-1 ; + kfd->vm_info.last_vmid_kfd =fls (gpu_resources->compute_vmid_bitmap)-1 ; + kfd->vm_info.vmid_num_kfd = kfd->vm_info.last_vmid_kfd + - kfd->vm_info.first_vmid_kfd +1 ; +/* calculate max size of mqds needed for queues */ size = max_num_of_queues_per_device * kfd->device_info->mqd_size_aligned;
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +6 -7
@@ -113,11 +113,11 @@ static int allocate_vmid(struct device_queue_manager *dqm,if (dqm->vmid_bitmap ==0 )return -ENOMEM ; - bit =find_first_bit ((unsigned long *)&dqm->vmid_bitmap,CIK_VMID_NUM ); + bit =find_first_bit ((unsigned long *)&dqm->vmid_bitmap, + dqm->dev->vm_info.vmid_num_kfd);clear_bit (bit, (unsigned long *)&dqm->vmid_bitmap); -/* Kaveri kfd vmid's starts from vmid 8 */ - allocated_vmid = bit +KFD_VMID_START_OFFSET ; + allocated_vmid = bit + dqm->dev->vm_info.first_vmid_kfd;pr_debug ("vmid allocation %d\n" , allocated_vmid); qpd->vmid = allocated_vmid; q->properties.vmid = allocated_vmid;
@@ -132,7 +132,7 @@ static void deallocate_vmid(struct device_queue_manager *dqm,struct qcm_process_device *qpd, struct queue *q) { - int bit = qpd->vmid - KFD_VMID_START_OFFSET; + int bit = qpd->vmid - dqm->dev->vm_info.first_vmid_kfd;/* Release the vmid mapping */ set_pasid_vmid_mapping (dqm,0 , qpd->vmid);
@@ -507,7 +507,7 @@ static int initialize_nocpsch(struct device_queue_manager *dqm) dqm->allocated_queues[pipe] |=1 << queue; } - dqm->vmid_bitmap = (1 <<VMID_PER_DEVICE ) -1 ; + dqm->vmid_bitmap = (1 << dqm->dev->vm_info.vmid_num_kfd) -1 ; dqm->sdma_bitmap = (1 <<CIK_SDMA_QUEUES ) -1 ;return 0 ;
@@ -613,8 +613,7 @@ static int set_sched_resources(struct device_queue_manager *dqm)int i, mec;struct scheduling_resources res; - res.vmid_mask = (1 <<VMID_PER_DEVICE ) -1 ; - res.vmid_mask <<=KFD_VMID_START_OFFSET ; + res.vmid_mask = dqm->dev->shared_resources.compute_vmid_bitmap; res.queue_mask =0 ;for (i =0 ; i <KGD_MAX_QUEUES ; ++i) {
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +0 -4
@@ -32,10 +32,6 @@#define KFD_UNMAP_LATENCY_MS (4000)#define QUEUE_PREEMPT_DEFAULT_TIMEOUT_MS (2 * KFD_UNMAP_LATENCY_MS + 1000) -#define CIK_VMID_NUM (8) -#define KFD_VMID_START_OFFSET (8) -#define VMID_PER_DEVICE CIK_VMID_NUM -#define KFD_DQM_FIRST_PIPE (0)#define CIK_SDMA_QUEUES (4)#define CIK_SDMA_QUEUES_PER_ENGINE (2)#define CIK_SDMA_ENGINE_NUM (2)
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +7 -0
@@ -141,6 +141,12 @@ struct kfd_mem_obj {uint32_t *cpu_ptr; }; +struct kfd_vmid_info { +uint32_t first_vmid_kfd; +uint32_t last_vmid_kfd; +uint32_t vmid_num_kfd; +}; +struct kfd_dev {struct kgd_dev *kgd;
@@ -165,6 +171,7 @@ struct kfd_dev {*/ struct kgd2kfd_shared_resources shared_resources; +struct kfd_vmid_info vm_info;const struct kfd2kgd_calls *kfd2kgd;struct mutex doorbell_mutex;
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +1 -1
@@ -187,7 +187,7 @@ int pqm_create_queue(struct process_queue_manager *pqm,case KFD_QUEUE_TYPE_COMPUTE :/* check if there is over subscription */ if ((sched_policy ==KFD_SCHED_POLICY_HWS_NO_OVERSUBSCRIPTION ) && - ((dev->dqm->processes_count >=VMID_PER_DEVICE ) || + ((dev->dqm->processes_count >= dev->vm_info.vmid_num_kfd) || (dev->dqm->queue_count >=get_queues_num (dev->dqm)))) {pr_err ("Over-subscription is not allowed in radeon_kfd.sched_policy == 1\n" ); retval = -EPERM ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/10 drm/amdkfd: Reuse CHIP_* from amdgpu v2
In reply to a message not in the archiveFrom: Yong Zhao <[email protected]>
There are already CHIP_* definitions under amd_shared.h file on amdgpu side, so KFD should reuse them rather than defining new ones.
Using enum for asic type requires default cases on switch statements to prevent compiler warnings. WARN on unsupported ASICs. It should never get there because KFD should not be initialized on unsupported devices.
v2: Replace BUG() with WARN and error return
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++++ drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 18 ++++++++++++------ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 3 +++ drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 9 +++------ 4 files changed, 22 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4 -0
@@ -1130,6 +1130,10 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev)case CHIP_KAVERI :device_queue_manager_init_cik (&dqm->ops_asic_specific);break ; +default : +WARN (1 ,"Unexpected ASIC family %u" , + dev->device_info->asic_family); + goto out_free; }if (!dqm->ops.initialize (dqm))
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +12 -6
@@ -291,14 +291,20 @@ struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,case CHIP_KAVERI :kernel_queue_init_cik (&kq->ops_asic_specific);break ; +default : +WARN (1 ,"Unexpected ASIC family %u" , + dev->device_info->asic_family); + goto out_free; } -if (!kq->ops.initialize (kq, dev, type,KFD_KERNEL_QUEUE_SIZE )) { -pr_err ("Failed to init kernel queue\n" ); -kfree (kq); -return NULL ; - } -return kq; +if (kq->ops.initialize (kq, dev, type,KFD_KERNEL_QUEUE_SIZE )) +return kq; + +pr_err ("Failed to init kernel queue\n" ); + +out_free: +kfree (kq); +return NULL ; }void kernel_queue_uninit (struct kernel_queue *kq)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c +3 -0
@@ -31,6 +31,9 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type,return mqd_manager_init_cik (type, dev);case CHIP_CARRIZO :return mqd_manager_init_vi (type, dev); +default : +WARN (1 ,"Unexpected ASIC family %u" , + dev->device_info->asic_family); }return NULL ;
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +3 -6
@@ -33,6 +33,8 @@#include <linux/kfd_ioctl.h> #include <kgd_kfd_interface.h> +#include "amd_shared.h" +#define KFD_SYSFS_FILE_MODE 0444#define KFD_MMAP_DOORBELL_MASK 0x8000000000000
@@ -112,11 +114,6 @@ enum cache_policy {cache_policy_noncoherent }; -enum asic_family_type { -CHIP_KAVERI =0 , -CHIP_CARRIZO -}; -struct kfd_event_interrupt_class {bool (*interrupt_isr)(struct kfd_dev *dev,const uint32_t *ih_ring_entry);
@@ -125,7 +122,7 @@ struct kfd_event_interrupt_class { };struct kfd_device_info { -unsigned int asic_family; +enum amd_asic_type asic_family;const struct kfd_event_interrupt_class *event_interrupt_class;unsigned int max_pasid_bits;unsigned int max_no_of_hqd;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1505945422-8851-8-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org
Oded Gabbay
Reviewed-byRe: [PATCH 07/10] drm/amdkfd: Reuse CHIP_* from amdgpu v2
Quoted 115 lines · Felix Kuehling
From: Yong Zhao <[email protected]>
There are already CHIP_* definitions under
amd_shared.hfile on amdgpu side, so KFD should reuse them rather than defining new ones.Using enum for asic type requires default cases on switch statements to prevent compiler warnings. WARN on unsupported ASICs. It should never get there because KFD should not be initialized on unsupported devices.
v2: Replace
BUG()with WARN and error returnSigned-off-by Yong Zhao <[email protected]>Signed-off-by Felix Kuehling <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++++ drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 18 ++++++++++++------ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 3 +++ drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 9 +++------ 4 files changed, 22 insertions(+), 12 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4
-0@@ -1130,6 +1130,10 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev)case CHIP_KAVERI :device_queue_manager_init_cik (&dqm->ops_asic_specific);break ; +default : +WARN (1 ,"Unexpected ASIC family %u" , + dev->device_info->asic_family); + goto out_free; }if (!dqm->ops.initialize (dqm))drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +12
-6@@ -291,14 +291,20 @@ struct kernel_queue *kernel_queue_init(struct kfd_dev *dev,case CHIP_KAVERI :kernel_queue_init_cik (&kq->ops_asic_specific);break ; +default : +WARN (1 ,"Unexpected ASIC family %u" , + dev->device_info->asic_family); + goto out_free; } -if (!kq->ops.initialize (kq, dev, type,KFD_KERNEL_QUEUE_SIZE )) { -pr_err ("Failed to init kernel queue\n" ); -kfree (kq); -return NULL ; - } -return kq; +if (kq->ops.initialize (kq, dev, type,KFD_KERNEL_QUEUE_SIZE )) +return kq; + +pr_err ("Failed to init kernel queue\n" ); + +out_free: +kfree (kq); +return NULL ; }void kernel_queue_uninit (struct kernel_queue *kq)drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c +3
-0@@ -31,6 +31,9 @@ struct mqd_manager *mqd_manager_init(enum KFD_MQD_TYPE type,return mqd_manager_init_cik (type, dev);case CHIP_CARRIZO :return mqd_manager_init_vi (type, dev); +default : +WARN (1 ,"Unexpected ASIC family %u" , + dev->device_info->asic_family); }return NULL ;drivers/gpu/drm/amd/amdkfd/kfd_priv.h +3
-7@@ -33,6 +33,8 @@#include <linux/kfd_ioctl.h> #include <kgd_kfd_interface.h> +#include "amd_shared.h" +#define KFD_SYSFS_FILE_MODE 0444#define KFD_MMAP_DOORBELL_MASK 0x8000000000000@@ -112,11 +114,6 @@ enum cache_policy {cache_policy_noncoherent }; -enum asic_family_type { -CHIP_KAVERI =0 , -CHIP_CARRIZO -}; -struct kfd_event_interrupt_class {bool (*interrupt_isr)(struct kfd_dev *dev,const uint32_t *ih_ring_entry);@@ -125,7 +122,7 @@ struct kfd_event_interrupt_class { };struct kfd_device_info { -unsigned int asic_family; +enum amd_asic_type asic_family;const struct kfd_event_interrupt_class *event_interrupt_class;unsigned int max_pasid_bits;unsigned int max_no_of_hqd; --
Quoted 2 lines
2.7.4
This patch is:
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/10 drm/amdkfd: Drop _nocpsch suffix from shared functions
In reply to a message not in the archiveFrom: Yong Zhao <[email protected]>
Several functions in DQM are shared between cpsch and nocpsch code. Remove the misleading _nocpsch suffix from their names.
--- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +12 -12
@@ -386,7 +386,7 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)return retval; } -static struct mqd_manager *get_mqd_manager_nocpsch ( +static struct mqd_manager *get_mqd_manager (struct device_queue_manager *dqm,enum KFD_MQD_TYPE type) {struct mqd_manager *mqd;
@@ -407,7 +407,7 @@ static struct mqd_manager *get_mqd_manager_nocpsch(return mqd; } -static int register_process_nocpsch (struct device_queue_manager *dqm, +static int register_process (struct device_queue_manager *dqm,struct qcm_process_device *qpd) {struct device_process_node *n;
@@ -431,7 +431,7 @@ static int register_process_nocpsch(struct device_queue_manager *dqm,return retval; } -static int unregister_process_nocpsch (struct device_queue_manager *dqm, +static int unregister_process (struct device_queue_manager *dqm,struct qcm_process_device *qpd) {int retval;
@@ -513,7 +513,7 @@ static int initialize_nocpsch(struct device_queue_manager *dqm)return 0 ; } -static void uninitialize_nocpsch (struct device_queue_manager *dqm) +static void uninitialize (struct device_queue_manager *dqm) {int i;
@@ -1095,10 +1095,10 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev) dqm->ops.stop = stop_cpsch; dqm->ops.destroy_queue = destroy_queue_cpsch; dqm->ops.update_queue = update_queue; - dqm->ops.get_mqd_manager = get_mqd_manager_nocpsch; - dqm->ops.register_process = register_process_nocpsch; - dqm->ops.unregister_process = unregister_process_nocpsch; - dqm->ops.uninitialize = uninitialize_nocpsch; + dqm->ops.get_mqd_manager = get_mqd_manager; + dqm->ops.register_process = register_process; + dqm->ops.unregister_process = unregister_process; + dqm->ops.uninitialize = uninitialize; dqm->ops.create_kernel_queue = create_kernel_queue_cpsch; dqm->ops.destroy_kernel_queue = destroy_kernel_queue_cpsch; dqm->ops.set_cache_memory_policy = set_cache_memory_policy;
@@ -1110,11 +1110,11 @@ struct device_queue_manager *device_queue_manager_init(struct kfd_dev *dev) dqm->ops.create_queue = create_queue_nocpsch; dqm->ops.destroy_queue = destroy_queue_nocpsch; dqm->ops.update_queue = update_queue; - dqm->ops.get_mqd_manager = get_mqd_manager_nocpsch; - dqm->ops.register_process = register_process_nocpsch; - dqm->ops.unregister_process = unregister_process_nocpsch; + dqm->ops.get_mqd_manager = get_mqd_manager; + dqm->ops.register_process = register_process; + dqm->ops.unregister_process = unregister_process; dqm->ops.initialize = initialize_nocpsch; - dqm->ops.uninitialize = uninitialize_nocpsch; + dqm->ops.uninitialize = uninitialize; dqm->ops.set_cache_memory_policy = set_cache_memory_policy;break ;default :
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/10 drm/amdkfd: Fix kernel-queue wrapping bugs
In reply to a message not in the archiveFrom: Yong Zhao <[email protected]>
Avoid intermediate negative numbers when doing calculations with a mix of signed and unsigned variables where implicit conversions can lead to unexpected results.
When kernel queue buffer wraps around to 0, we need to check that rptr won't be overwritten by the new packet.
--- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +15 -3
@@ -210,6 +210,11 @@ static int acquire_packet_buffer(struct kernel_queue *kq,uint32_t wptr, rptr;unsigned int *queue_address; +/* When rptr == wptr, the buffer is empty. +* When rptr == wptr + 1, the buffer is full. +* It is always rptr that advances to the position of wptr, rather than +* the opposite. So we can only use up to queue_size_dwords - 1 dwords. +*/ rptr = *kq->rptr_kernel; wptr = *kq->wptr_kernel; queue_address = (unsigned int *)kq->pq_kernel_addr;
@@ -219,11 +224,10 @@ static int acquire_packet_buffer(struct kernel_queue *kq,pr_debug ("wptr: %d\n" , wptr);pr_debug ("queue_address 0x%p\n" , queue_address); - available_size = (rptr -1 - wptr + queue_size_dwords) % + available_size = (rptr + queue_size_dwords -1 - wptr) % queue_size_dwords; -if (packet_size_in_dwords >= queue_size_dwords || - packet_size_in_dwords >= available_size) { +if (packet_size_in_dwords > available_size) {/* * make sure calling functions know * acquire_packet_buffer() failed
@@ -233,6 +237,14 @@ static int acquire_packet_buffer(struct kernel_queue *kq, }if (wptr + packet_size_in_dwords >= queue_size_dwords) { +/* make sure after rolling back to position 0, there is +* still enough space. +*/ +if (packet_size_in_dwords >= rptr) { + *buffer_ptr =NULL ; +return -ENOMEM ; + } +/* fill nops, roll back and start at position 0 */ while (wptr >0 ) { queue_address[wptr] = kq->nop_packet; wptr = (wptr +1 ) % queue_size_dwords;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1505945422-8851-10-git-send-email-Felix.Kuehling-5C7GfCeVMHo@public.gmane.org
Oded Gabbay
Reviewed-byRe: [PATCH 09/10] drm/amdkfd: Fix kernel-queue wrapping bugs
Quoted 61 lines · Felix Kuehling
From: Yong Zhao <[email protected]>
Avoid intermediate negative numbers when doing calculations with a mix of signed and unsigned variables where implicit conversions can lead to unexpected results.
When kernel queue buffer wraps around to 0, we need to check that rptr won't be overwritten by the new packet.
Signed-off-by Yong Zhao <[email protected]>Signed-off-by Felix Kuehling <[email protected]>--- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +15
-4@@ -210,6 +210,11 @@ static int acquire_packet_buffer(struct kernel_queue *kq,uint32_t wptr, rptr;unsigned int *queue_address; +/* When rptr == wptr, the buffer is empty. +* When rptr == wptr + 1, the buffer is full. +* It is always rptr that advances to the position of wptr, rather than +* the opposite. So we can only use up to queue_size_dwords - 1 dwords. +*/ rptr = *kq->rptr_kernel; wptr = *kq->wptr_kernel; queue_address = (unsigned int *)kq->pq_kernel_addr;@@ -219,11 +224,10 @@ static int acquire_packet_buffer(struct kernel_queue *kq,pr_debug ("wptr: %d\n" , wptr);pr_debug ("queue_address 0x%p\n" , queue_address); - available_size = (rptr -1 - wptr + queue_size_dwords) % + available_size = (rptr + queue_size_dwords -1 - wptr) % queue_size_dwords; -if (packet_size_in_dwords >= queue_size_dwords || - packet_size_in_dwords >= available_size) { +if (packet_size_in_dwords > available_size) {/* * make sure calling functions know * acquire_packet_buffer() failed @@ -233,6 +237,14 @@ static int acquire_packet_buffer(struct kernel_queue *kq, }if (wptr + packet_size_in_dwords >= queue_size_dwords) { +/* make sure after rolling back to position 0, there is +* still enough space. +*/ +if (packet_size_in_dwords >= rptr) { + *buffer_ptr =NULL ; +return -ENOMEM ; + } +/* fill nops, roll back and start at position 0 */ while (wptr >0 ) { queue_address[wptr] = kq->nop_packet; wptr = (wptr +1 ) % queue_size_dwords; --
Quoted 2 lines
2.7.4
This patch is:
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/10 drm/amdkfd: Print event limit messages only once per process
In reply to a message not in the archiveTo avoid spamming the log.
--- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 5 ++++- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +4 -1
@@ -292,7 +292,10 @@ static int create_signal_event(struct file *devkfd, struct kfd_event *ev) {if (p->signal_event_count ==KFD_SIGNAL_EVENT_LIMIT ) { -pr_warn ("Signal event wasn't created because limit was reached\n" ); +if (!p->signal_event_limit_reached) { +pr_warn ("Signal event wasn't created because limit was reached\n" ); + p->signal_event_limit_reached = true; + }return -ENOMEM ; }
drivers/gpu/drm/amd/amdkfd/kfd_priv.h +1 -0
@@ -532,6 +532,7 @@ struct kfd_process {struct list_head signal_event_pages;u32 next_nonsignal_event_id;size_t signal_event_count; +bool signal_event_limit_reached; };/**
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Felix Kuehling
Small self-contained KFD fixes that don't introduce any new functionality or features. These may be suitable to include in drm-fixes for 4.14.
Thanks!
I added patches 5, 9 and 10 to my -fixes tree and I will send them shortly to Dave (together with another fix).
I don't feel comfortable adding the other patches in rc stages. I will send them to 4.15 merge window.
Thanks,
Oded
Quoted 32 lines
v2:
- Rebased on gabbayo/amdkfd-next
- Addressed code review feedback
- Dropped "Set/dev/kfdpermissions to 0666 by default"Felix Kuehling (3):
drm/amdkfd: Adjust dequeue latencies and timeouts drm/amdkfd: Fix incorrectdestroy_mqdparameter drm/amdkfd: Print event limit messages only once per processYong Zhao (7):
drm/amdkfd: Reorganize kfd resume code
drm/amdkfd: Fix suspend/resume issue on Carrizo v2 drm/amdkfd: Rectify the jiffies calculation error with milliseconds v2 drm/amdkfd: Use VMID bitmap from KGD v2
drm/amdkfd: Reuse CHIP_* from amdgpu v2
drm/amdkfd: Drop_nocpschsuffix from shared functions drm/amdkfd: Fix kernel-queue wrapping bugsdrivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c | 9 +- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 106 ++++++++++++--------- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 62 +++++------- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 8 +- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 5 +- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 40 +++++--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c | 3 + drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 37 ++++--- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 97 +++++++++++++++---- .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +- 11 files changed, 235 insertions(+), 136 deletions(-)
Quoted 3 lines
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx