Skip to content

Commit

Permalink
drm/amdkfd: Preserve CP_MQD_IQ_RPTR internal state
Browse files Browse the repository at this point in the history
CP microcode uses undocumented bits in this register to record queue
state information. The KFD zeroes these bits in update_mqd, when invoked
through the UPDATE_QUEUE ioctl, causing incoherent state when the ioctl
is used to successively unmap and map a queue.

Since the queue type cannot be changed in this path, move the MQD write
to init_mqd.

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
  • Loading branch information
Jay Cornwall authored and Oded Gabbay committed Jan 19, 2015
1 parent b6819ce commit d752f95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ static int init_mqd(struct mqd_manager *mm, void **mqd,
m->cp_hqd_pipe_priority = 1;
m->cp_hqd_queue_priority = 15;

if (q->format == KFD_QUEUE_FORMAT_AQL)
m->cp_hqd_iq_rptr = AQL_ENABLE;

*mqd = m;
if (gart_addr != NULL)
*gart_addr = addr;
Expand Down Expand Up @@ -187,7 +190,6 @@ static int update_mqd(struct mqd_manager *mm, void *mqd,
m->cp_hqd_vmid = q->vmid;

if (q->format == KFD_QUEUE_FORMAT_AQL) {
m->cp_hqd_iq_rptr = AQL_ENABLE;
m->cp_hqd_pq_control |= NO_UPDATE_RPTR;
}

Expand Down

0 comments on commit d752f95

Please sign in to comment.