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

Commit d736aa62 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-amdkfd-fixes-2018-04-24' of...

Merge tag 'drm-amdkfd-fixes-2018-04-24' of git://people.freedesktop.org/~gabbayo/linux into drm-fixes

- fix amdkfd Kconfig to select MMU_NOTIFIER
- allow clock retrieval in case GPU not present
- fix return code from function
- make function static (fix sparse warning)

* tag 'drm-amdkfd-fixes-2018-04-24' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: fix build, select MMU_NOTIFIER
  drm/amdkfd: fix clock counter retrieval for node without GPU
  drm/amdkfd: Fix the error return code in kfd_ioctl_unmap_memory_from_gpu()
  drm/amdkfd: kfd_dev_is_large_bar() can be static
parents 6d08b06e 7bbc0b95
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -6,5 +6,6 @@ config HSA_AMD
	tristate "HSA kernel driver for AMD GPU devices"
	tristate "HSA kernel driver for AMD GPU devices"
	depends on DRM_AMDGPU && X86_64
	depends on DRM_AMDGPU && X86_64
	imply AMD_IOMMU_V2
	imply AMD_IOMMU_V2
	select MMU_NOTIFIER
	help
	help
	  Enable this if you want to use HSA features on AMD GPU devices.
	  Enable this if you want to use HSA features on AMD GPU devices.
+9 −8
Original line number Original line Diff line number Diff line
@@ -749,12 +749,13 @@ static int kfd_ioctl_get_clock_counters(struct file *filep,
	struct timespec64 time;
	struct timespec64 time;


	dev = kfd_device_by_id(args->gpu_id);
	dev = kfd_device_by_id(args->gpu_id);
	if (dev == NULL)
	if (dev)
		return -EINVAL;

		/* Reading GPU clock counter from KGD */
		/* Reading GPU clock counter from KGD */
		args->gpu_clock_counter =
		args->gpu_clock_counter =
			dev->kfd2kgd->get_gpu_clock_counter(dev->kgd);
			dev->kfd2kgd->get_gpu_clock_counter(dev->kgd);
	else
		/* Node without GPU resource */
		args->gpu_clock_counter = 0;


	/* No access to rdtsc. Using raw monotonic time */
	/* No access to rdtsc. Using raw monotonic time */
	getrawmonotonic64(&time);
	getrawmonotonic64(&time);
@@ -1147,7 +1148,7 @@ static int kfd_ioctl_acquire_vm(struct file *filep, struct kfd_process *p,
	return ret;
	return ret;
}
}


bool kfd_dev_is_large_bar(struct kfd_dev *dev)
static bool kfd_dev_is_large_bar(struct kfd_dev *dev)
{
{
	struct kfd_local_mem_info mem_info;
	struct kfd_local_mem_info mem_info;


@@ -1421,7 +1422,7 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep,


	pdd = kfd_get_process_device_data(dev, p);
	pdd = kfd_get_process_device_data(dev, p);
	if (!pdd) {
	if (!pdd) {
		err = PTR_ERR(pdd);
		err = -EINVAL;
		goto bind_process_to_device_failed;
		goto bind_process_to_device_failed;
	}
	}