Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ad472e3 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-amdkfd-next-2017-11-02' of git://people.freedesktop.org/~gabbayo/linux into drm-next

- Usermode Events
The current events code implemented some data structures (waitqueue, fifo)
that were already implemented in the kernel. The patches below addresses
this issue by replacing them with the standard kernel implementation.
In addition, they simplify allocation of events IDs and memory for the events.

The patches also increase the maximum number of events while maintaining
compatibility with the older userspace library.

- Remove radeon support
Because Kaveri is fully supported in amdgpu and because current and future
versions of userspace libraries will only support amdgpu, we removed radeon
support from kfd. Current users can move to amdgpu while using the same
userspace libraries.

- Various bug fixes and cleanups

* tag 'drm-amdkfd-next-2017-11-02' of git://people.freedesktop.org/~gabbayo/linux: (26 commits)
  drm/amdkfd: Minor cleanups
  drm/amdkfd: Update queue_count before mapping queues
  drm/amdkfd: Cleanup DQM ASIC-specific ops
  drm/amdkfd: Register/Deregister process on qpd resolution
  drm/amdkfd: Fix debug unregister procedure on process termination
  drm/amdkfd: Avoid calling amd_iommu_unbind_pasid() when suspending
  drm/amdkfd: Disable CP/SDMA ring/doorbell in MQD
  drm/amdkfd: Clean up the data structure in kfd_process
  drm/radeon: deprecate and remove KFD interface
  drm/amdkfd: use a high priority workqueue for IH work
  drm/amdkfd: wait only for IH work on IH exit
  drm/amdkfd: increase IH num entries to 8192
  drm/amdkfd: use standard kernel kfifo for IH
  drm/amdkfd: increase limit of signal events to 4096 per process
  drm/amdkfd: Make event limit dependent on user mode mapping size
  drm/amdkfd: Use IH context ID for signal lookup
  drm/amdkfd: Simplify event ID and signal slot management
  drm/amdkfd: Simplify events page allocator
  drm/amdkfd: Use wait_queue_t to implement event waiting
  drm/amdkfd: remove redundant kfd_event_waiter.input_index
  ...
parents 85f6e0f6 894a8293
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -759,8 +759,6 @@ F: drivers/gpu/drm/amd/amdkfd/
F:	drivers/gpu/drm/amd/include/cik_structs.h
F:	drivers/gpu/drm/amd/include/kgd_kfd_interface.h
F:	drivers/gpu/drm/amd/include/vi_structs.h
F:	drivers/gpu/drm/radeon/radeon_kfd.c
F:	drivers/gpu/drm/radeon/radeon_kfd.h
F:	include/uapi/linux/kfd_ioctl.h

AMD SEATTLE DEVICE TREE SUPPORT
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,6 @@

config HSA_AMD
	tristate "HSA kernel driver for AMD GPU devices"
	depends on (DRM_RADEON || DRM_AMDGPU) && AMD_IOMMU_V2 && X86_64
	depends on DRM_AMDGPU && AMD_IOMMU_V2 && X86_64
	help
	  Enable this if you want to use HSA features on AMD GPU devices.
+6 −2
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ static bool cik_event_interrupt_isr(struct kfd_dev *dev,
	/* Do not process in ISR, just request it to be forwarded to WQ. */
	return (pasid != 0) &&
		(ihre->source_id == CIK_INTSRC_CP_END_OF_PIPE ||
		ihre->source_id == CIK_INTSRC_SDMA_TRAP ||
		ihre->source_id == CIK_INTSRC_SQ_INTERRUPT_MSG ||
		ihre->source_id == CIK_INTSRC_CP_BAD_OPCODE);
}
@@ -46,6 +47,7 @@ static void cik_event_interrupt_wq(struct kfd_dev *dev,
	unsigned int pasid;
	const struct cik_ih_ring_entry *ihre =
			(const struct cik_ih_ring_entry *)ih_ring_entry;
	uint32_t context_id = ihre->data & 0xfffffff;

	pasid = (ihre->ring_id & 0xffff0000) >> 16;

@@ -53,9 +55,11 @@ static void cik_event_interrupt_wq(struct kfd_dev *dev,
		return;

	if (ihre->source_id == CIK_INTSRC_CP_END_OF_PIPE)
		kfd_signal_event_interrupt(pasid, 0, 0);
		kfd_signal_event_interrupt(pasid, context_id, 28);
	else if (ihre->source_id == CIK_INTSRC_SDMA_TRAP)
		kfd_signal_event_interrupt(pasid, context_id, 28);
	else if (ihre->source_id == CIK_INTSRC_SQ_INTERRUPT_MSG)
		kfd_signal_event_interrupt(pasid, ihre->data & 0xFF, 8);
		kfd_signal_event_interrupt(pasid, context_id & 0xff, 8);
	else if (ihre->source_id == CIK_INTSRC_CP_BAD_OPCODE)
		kfd_signal_hw_exception_event(pasid);
}
+2 −1
Original line number Diff line number Diff line
@@ -32,9 +32,10 @@ struct cik_ih_ring_entry {
	uint32_t reserved;
};

#define CIK_INTSRC_DEQUEUE_COMPLETE	0xC6
#define CIK_INTSRC_CP_END_OF_PIPE	0xB5
#define CIK_INTSRC_CP_BAD_OPCODE	0xB7
#define CIK_INTSRC_DEQUEUE_COMPLETE	0xC6
#define CIK_INTSRC_SDMA_TRAP		0xE0
#define CIK_INTSRC_SQ_INTERRUPT_MSG	0xEF

#endif
+3 −6
Original line number Diff line number Diff line
@@ -450,8 +450,8 @@ static int kfd_ioctl_dbg_register(struct file *filep,
		return -EINVAL;
	}

	mutex_lock(kfd_get_dbgmgr_mutex());
	mutex_lock(&p->mutex);
	mutex_lock(kfd_get_dbgmgr_mutex());

	/*
	 * make sure that we have pdd, if this the first queue created for
@@ -479,8 +479,8 @@ static int kfd_ioctl_dbg_register(struct file *filep,
	}

out:
	mutex_unlock(&p->mutex);
	mutex_unlock(kfd_get_dbgmgr_mutex());
	mutex_unlock(&p->mutex);

	return status;
}
@@ -835,15 +835,12 @@ static int kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p,
				void *data)
{
	struct kfd_ioctl_wait_events_args *args = data;
	enum kfd_event_wait_result wait_result;
	int err;

	err = kfd_wait_on_events(p, args->num_events,
			(void __user *)args->events_ptr,
			(args->wait_for_all != 0),
			args->timeout, &wait_result);

	args->wait_result = wait_result;
			args->timeout, &args->wait_result);

	return err;
}
Loading