Merge branch 'drm-next-5.1' of git://people.freedesktop.org/~agd5f/linux into drm-next
Fixes for 5.1: amdgpu: - Fix missing fw declaration after dropping old CI DPM code - Fix debugfs access to registers beyond the MMIO bar size - Fix context priority handling - Add missing license on some new files - Various cleanups and bug fixes radeon: - Fix missing break in CS parser for evergreen - Various cleanups and bug fixes sched: - Fix entities with 0 run queues Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexdeucher@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190221214134.3308-1-alexander.deucher@amd.com
This commit is contained in:
@@ -134,12 +134,18 @@ static int allocate_doorbell(struct qcm_process_device *qpd, struct queue *q)
|
||||
*/
|
||||
q->doorbell_id = q->properties.queue_id;
|
||||
} else if (q->properties.type == KFD_QUEUE_TYPE_SDMA) {
|
||||
/* For SDMA queues on SOC15, use static doorbell
|
||||
* assignments based on the engine and queue.
|
||||
/* For SDMA queues on SOC15 with 8-byte doorbell, use static
|
||||
* doorbell assignments based on the engine and queue id.
|
||||
* The doobell index distance between RLC (2*i) and (2*i+1)
|
||||
* for a SDMA engine is 512.
|
||||
*/
|
||||
q->doorbell_id = dev->shared_resources.sdma_doorbell
|
||||
[q->properties.sdma_engine_id]
|
||||
[q->properties.sdma_queue_id];
|
||||
uint32_t *idx_offset =
|
||||
dev->shared_resources.sdma_doorbell_idx;
|
||||
|
||||
q->doorbell_id = idx_offset[q->properties.sdma_engine_id]
|
||||
+ (q->properties.sdma_queue_id & 1)
|
||||
* KFD_QUEUE_DOORBELL_MIRROR_OFFSET
|
||||
+ (q->properties.sdma_queue_id >> 1);
|
||||
} else {
|
||||
/* For CP queues on SOC15 reserve a free doorbell ID */
|
||||
unsigned int found;
|
||||
|
@@ -97,17 +97,29 @@
|
||||
#define KFD_CWSR_TBA_TMA_SIZE (PAGE_SIZE * 2)
|
||||
#define KFD_CWSR_TMA_OFFSET PAGE_SIZE
|
||||
|
||||
#define KFD_MAX_NUM_OF_QUEUES_PER_DEVICE \
|
||||
(KFD_MAX_NUM_OF_PROCESSES * \
|
||||
KFD_MAX_NUM_OF_QUEUES_PER_PROCESS)
|
||||
|
||||
#define KFD_KERNEL_QUEUE_SIZE 2048
|
||||
|
||||
/*
|
||||
* 512 = 0x200
|
||||
* The doorbell index distance between SDMA RLC (2*i) and (2*i+1) in the
|
||||
* same SDMA engine on SOC15, which has 8-byte doorbells for SDMA.
|
||||
* 512 8-byte doorbell distance (i.e. one page away) ensures that SDMA RLC
|
||||
* (2*i+1) doorbells (in terms of the lower 12 bit address) lie exactly in
|
||||
* the OFFSET and SIZE set in registers like BIF_SDMA0_DOORBELL_RANGE.
|
||||
*/
|
||||
#define KFD_QUEUE_DOORBELL_MIRROR_OFFSET 512
|
||||
|
||||
|
||||
/*
|
||||
* Kernel module parameter to specify maximum number of supported queues per
|
||||
* device
|
||||
*/
|
||||
extern int max_num_of_queues_per_device;
|
||||
|
||||
#define KFD_MAX_NUM_OF_QUEUES_PER_DEVICE \
|
||||
(KFD_MAX_NUM_OF_PROCESSES * \
|
||||
KFD_MAX_NUM_OF_QUEUES_PER_PROCESS)
|
||||
|
||||
#define KFD_KERNEL_QUEUE_SIZE 2048
|
||||
|
||||
/* Kernel module parameter to specify the scheduling policy */
|
||||
extern int sched_policy;
|
||||
|
@@ -607,13 +607,17 @@ static int init_doorbell_bitmap(struct qcm_process_device *qpd,
|
||||
if (!qpd->doorbell_bitmap)
|
||||
return -ENOMEM;
|
||||
|
||||
/* Mask out any reserved doorbells */
|
||||
for (i = 0; i < KFD_MAX_NUM_OF_QUEUES_PER_PROCESS; i++)
|
||||
if ((dev->shared_resources.reserved_doorbell_mask & i) ==
|
||||
dev->shared_resources.reserved_doorbell_val) {
|
||||
/* Mask out doorbells reserved for SDMA, IH, and VCN on SOC15. */
|
||||
for (i = 0; i < KFD_MAX_NUM_OF_QUEUES_PER_PROCESS / 2; i++) {
|
||||
if (i >= dev->shared_resources.non_cp_doorbells_start
|
||||
&& i <= dev->shared_resources.non_cp_doorbells_end) {
|
||||
set_bit(i, qpd->doorbell_bitmap);
|
||||
pr_debug("reserved doorbell 0x%03x\n", i);
|
||||
set_bit(i + KFD_QUEUE_DOORBELL_MIRROR_OFFSET,
|
||||
qpd->doorbell_bitmap);
|
||||
pr_debug("reserved doorbell 0x%03x and 0x%03x\n", i,
|
||||
i + KFD_QUEUE_DOORBELL_MIRROR_OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user