diff options
| -rw-r--r-- | drivers/dma-buf/dma-fence.c | 17 | ||||
| -rw-r--r-- | drivers/dma-buf/sync_debug.c | 2 | ||||
| -rw-r--r-- | drivers/dma-buf/sync_file.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_dp_mst_topology.c | 41 | ||||
| -rw-r--r-- | drivers/gpu/drm/imx/ipuv3-plane.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/imx/parallel-display.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_kfd.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 66 | ||||
| -rw-r--r-- | include/linux/dma-fence.h | 2 |
14 files changed, 95 insertions, 64 deletions
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 57da14c15987..56e0a0e1b600 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c | |||
| @@ -75,11 +75,6 @@ int dma_fence_signal_locked(struct dma_fence *fence) | |||
| 75 | if (WARN_ON(!fence)) | 75 | if (WARN_ON(!fence)) |
| 76 | return -EINVAL; | 76 | return -EINVAL; |
| 77 | 77 | ||
| 78 | if (!ktime_to_ns(fence->timestamp)) { | ||
| 79 | fence->timestamp = ktime_get(); | ||
| 80 | smp_mb__before_atomic(); | ||
| 81 | } | ||
| 82 | |||
| 83 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { | 78 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { |
| 84 | ret = -EINVAL; | 79 | ret = -EINVAL; |
| 85 | 80 | ||
| @@ -87,8 +82,11 @@ int dma_fence_signal_locked(struct dma_fence *fence) | |||
| 87 | * we might have raced with the unlocked dma_fence_signal, | 82 | * we might have raced with the unlocked dma_fence_signal, |
| 88 | * still run through all callbacks | 83 | * still run through all callbacks |
| 89 | */ | 84 | */ |
| 90 | } else | 85 | } else { |
| 86 | fence->timestamp = ktime_get(); | ||
| 87 | set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags); | ||
| 91 | trace_dma_fence_signaled(fence); | 88 | trace_dma_fence_signaled(fence); |
| 89 | } | ||
| 92 | 90 | ||
| 93 | list_for_each_entry_safe(cur, tmp, &fence->cb_list, node) { | 91 | list_for_each_entry_safe(cur, tmp, &fence->cb_list, node) { |
| 94 | list_del_init(&cur->node); | 92 | list_del_init(&cur->node); |
| @@ -115,14 +113,11 @@ int dma_fence_signal(struct dma_fence *fence) | |||
| 115 | if (!fence) | 113 | if (!fence) |
| 116 | return -EINVAL; | 114 | return -EINVAL; |
| 117 | 115 | ||
| 118 | if (!ktime_to_ns(fence->timestamp)) { | ||
| 119 | fence->timestamp = ktime_get(); | ||
| 120 | smp_mb__before_atomic(); | ||
| 121 | } | ||
| 122 | |||
| 123 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) | 116 | if (test_and_set_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) |
| 124 | return -EINVAL; | 117 | return -EINVAL; |
| 125 | 118 | ||
| 119 | fence->timestamp = ktime_get(); | ||
| 120 | set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags); | ||
| 126 | trace_dma_fence_signaled(fence); | 121 | trace_dma_fence_signaled(fence); |
| 127 | 122 | ||
| 128 | if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags)) { | 123 | if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &fence->flags)) { |
diff --git a/drivers/dma-buf/sync_debug.c b/drivers/dma-buf/sync_debug.c index 82a6e7f6d37f..59a3b2f8ee91 100644 --- a/drivers/dma-buf/sync_debug.c +++ b/drivers/dma-buf/sync_debug.c | |||
| @@ -84,7 +84,7 @@ static void sync_print_fence(struct seq_file *s, | |||
| 84 | show ? "_" : "", | 84 | show ? "_" : "", |
| 85 | sync_status_str(status)); | 85 | sync_status_str(status)); |
| 86 | 86 | ||
| 87 | if (status) { | 87 | if (test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags)) { |
| 88 | struct timespec64 ts64 = | 88 | struct timespec64 ts64 = |
| 89 | ktime_to_timespec64(fence->timestamp); | 89 | ktime_to_timespec64(fence->timestamp); |
| 90 | 90 | ||
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 545e2c5c4815..d7e219d2669d 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c | |||
| @@ -391,7 +391,13 @@ static void sync_fill_fence_info(struct dma_fence *fence, | |||
| 391 | sizeof(info->driver_name)); | 391 | sizeof(info->driver_name)); |
| 392 | 392 | ||
| 393 | info->status = dma_fence_get_status(fence); | 393 | info->status = dma_fence_get_status(fence); |
| 394 | info->timestamp_ns = ktime_to_ns(fence->timestamp); | 394 | while (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) && |
| 395 | !test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags)) | ||
| 396 | cpu_relax(); | ||
| 397 | info->timestamp_ns = | ||
| 398 | test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags) ? | ||
| 399 | ktime_to_ns(fence->timestamp) : | ||
| 400 | ktime_set(0, 0); | ||
| 395 | } | 401 | } |
| 396 | 402 | ||
| 397 | static long sync_file_ioctl_fence_info(struct sync_file *sync_file, | 403 | static long sync_file_ioctl_fence_info(struct sync_file *sync_file, |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index 5f8ada1d872b..37971d9402e3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | |||
| @@ -101,7 +101,6 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) | |||
| 101 | if (adev->kfd) { | 101 | if (adev->kfd) { |
| 102 | struct kgd2kfd_shared_resources gpu_resources = { | 102 | struct kgd2kfd_shared_resources gpu_resources = { |
| 103 | .compute_vmid_bitmap = 0xFF00, | 103 | .compute_vmid_bitmap = 0xFF00, |
| 104 | .num_mec = adev->gfx.mec.num_mec, | ||
| 105 | .num_pipe_per_mec = adev->gfx.mec.num_pipe_per_mec, | 104 | .num_pipe_per_mec = adev->gfx.mec.num_pipe_per_mec, |
| 106 | .num_queue_per_pipe = adev->gfx.mec.num_queue_per_pipe | 105 | .num_queue_per_pipe = adev->gfx.mec.num_queue_per_pipe |
| 107 | }; | 106 | }; |
| @@ -122,7 +121,7 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *adev) | |||
| 122 | 121 | ||
| 123 | /* According to linux/bitmap.h we shouldn't use bitmap_clear if | 122 | /* According to linux/bitmap.h we shouldn't use bitmap_clear if |
| 124 | * nbits is not compile time constant */ | 123 | * nbits is not compile time constant */ |
| 125 | last_valid_bit = adev->gfx.mec.num_mec | 124 | last_valid_bit = 1 /* only first MEC can have compute queues */ |
| 126 | * adev->gfx.mec.num_pipe_per_mec | 125 | * adev->gfx.mec.num_pipe_per_mec |
| 127 | * adev->gfx.mec.num_queue_per_pipe; | 126 | * adev->gfx.mec.num_queue_per_pipe; |
| 128 | for (i = last_valid_bit; i < KGD_MAX_QUEUES; ++i) | 127 | for (i = last_valid_bit; i < KGD_MAX_QUEUES; ++i) |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 88187bfc5ea3..3f95f7cb4019 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c | |||
| @@ -226,10 +226,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, | |||
| 226 | 226 | ||
| 227 | kfd->shared_resources = *gpu_resources; | 227 | kfd->shared_resources = *gpu_resources; |
| 228 | 228 | ||
| 229 | /* We only use the first MEC */ | ||
| 230 | if (kfd->shared_resources.num_mec > 1) | ||
| 231 | kfd->shared_resources.num_mec = 1; | ||
| 232 | |||
| 233 | /* calculate max size of mqds needed for queues */ | 229 | /* calculate max size of mqds needed for queues */ |
| 234 | size = max_num_of_queues_per_device * | 230 | size = max_num_of_queues_per_device * |
| 235 | kfd->device_info->mqd_size_aligned; | 231 | kfd->device_info->mqd_size_aligned; |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 955aa304ff48..602769ced3bd 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | |||
| @@ -77,13 +77,6 @@ static bool is_pipe_enabled(struct device_queue_manager *dqm, int mec, int pipe) | |||
| 77 | return false; | 77 | return false; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | unsigned int get_mec_num(struct device_queue_manager *dqm) | ||
| 81 | { | ||
| 82 | BUG_ON(!dqm || !dqm->dev); | ||
| 83 | |||
| 84 | return dqm->dev->shared_resources.num_mec; | ||
| 85 | } | ||
| 86 | |||
| 87 | unsigned int get_queues_num(struct device_queue_manager *dqm) | 80 | unsigned int get_queues_num(struct device_queue_manager *dqm) |
| 88 | { | 81 | { |
| 89 | BUG_ON(!dqm || !dqm->dev); | 82 | BUG_ON(!dqm || !dqm->dev); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h index 66b9615bc3c1..faf820a06400 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h | |||
| @@ -180,7 +180,6 @@ void device_queue_manager_init_cik(struct device_queue_manager_asic_ops *ops); | |||
| 180 | void device_queue_manager_init_vi(struct device_queue_manager_asic_ops *ops); | 180 | void device_queue_manager_init_vi(struct device_queue_manager_asic_ops *ops); |
| 181 | void program_sh_mem_settings(struct device_queue_manager *dqm, | 181 | void program_sh_mem_settings(struct device_queue_manager *dqm, |
| 182 | struct qcm_process_device *qpd); | 182 | struct qcm_process_device *qpd); |
| 183 | unsigned int get_mec_num(struct device_queue_manager *dqm); | ||
| 184 | unsigned int get_queues_num(struct device_queue_manager *dqm); | 183 | unsigned int get_queues_num(struct device_queue_manager *dqm); |
| 185 | unsigned int get_queues_per_pipe(struct device_queue_manager *dqm); | 184 | unsigned int get_queues_per_pipe(struct device_queue_manager *dqm); |
| 186 | unsigned int get_pipes_per_mec(struct device_queue_manager *dqm); | 185 | unsigned int get_pipes_per_mec(struct device_queue_manager *dqm); |
diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h index 91ef1484b3bb..36f376677a53 100644 --- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h +++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h | |||
| @@ -63,9 +63,6 @@ struct kgd2kfd_shared_resources { | |||
| 63 | /* Bit n == 1 means VMID n is available for KFD. */ | 63 | /* Bit n == 1 means VMID n is available for KFD. */ |
| 64 | unsigned int compute_vmid_bitmap; | 64 | unsigned int compute_vmid_bitmap; |
| 65 | 65 | ||
| 66 | /* number of mec available from the hardware */ | ||
| 67 | uint32_t num_mec; | ||
| 68 | |||
| 69 | /* number of pipes per mec */ | 66 | /* number of pipes per mec */ |
| 70 | uint32_t num_pipe_per_mec; | 67 | uint32_t num_pipe_per_mec; |
| 71 | 68 | ||
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index bfd237c15e76..ae5f06895562 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | |||
| @@ -330,6 +330,13 @@ static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg, | |||
| 330 | return false; | 330 | return false; |
| 331 | } | ||
