aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/uvd_v2_2.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-05-01 12:34:12 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-17 09:53:50 -0700
commit90ad0e7f869d77c8fa845806bf17a68febcfa820 (patch)
treed76d39b692993a9982a79788164ea9f376a11d45 /drivers/gpu/drm/radeon/uvd_v2_2.c
parent763abc9213593916d187cbe4e7398839b1ebb675 (diff)
downloadlinux-linaro-stable-90ad0e7f869d77c8fa845806bf17a68febcfa820.tar.gz
drm/radeon: disable semaphores for UVD V1 (v2)
commit 013ead48a843442e63b9426e3bd5df18ca5d054a upstream. Hardware doesn't seem to work correctly, just block userspace in this case. v2: add missing defines Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=85320 Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/radeon/uvd_v2_2.c')
-rw-r--r--drivers/gpu/drm/radeon/uvd_v2_2.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/uvd_v2_2.c b/drivers/gpu/drm/radeon/uvd_v2_2.c
index d1771004cb52..19ccb2ae7a5d 100644
--- a/drivers/gpu/drm/radeon/uvd_v2_2.c
+++ b/drivers/gpu/drm/radeon/uvd_v2_2.c
@@ -60,6 +60,35 @@ void uvd_v2_2_fence_emit(struct radeon_device *rdev,
}
/**
+ * uvd_v2_2_semaphore_emit - emit semaphore command
+ *
+ * @rdev: radeon_device pointer
+ * @ring: radeon_ring pointer
+ * @semaphore: semaphore to emit commands for
+ * @emit_wait: true if we should emit a wait command
+ *
+ * Emit a semaphore command (either wait or signal) to the UVD ring.
+ */
+bool uvd_v2_2_semaphore_emit(struct radeon_device *rdev,
+ struct radeon_ring *ring,
+ struct radeon_semaphore *semaphore,
+ bool emit_wait)
+{
+ uint64_t addr = semaphore->gpu_addr;
+
+ radeon_ring_write(ring, PACKET0(UVD_SEMA_ADDR_LOW, 0));
+ radeon_ring_write(ring, (addr >> 3) & 0x000FFFFF);
+
+ radeon_ring_write(ring, PACKET0(UVD_SEMA_ADDR_HIGH, 0));
+ radeon_ring_write(ring, (addr >> 23) & 0x000FFFFF);
+
+ radeon_ring_write(ring, PACKET0(UVD_SEMA_CMD, 0));
+ radeon_ring_write(ring, emit_wait ? 1 : 0);
+
+ return true;
+}
+
+/**
* uvd_v2_2_resume - memory controller programming
*
* @rdev: radeon_device pointer