diff mbox

[5/6] drm/radeon: optionally return an ID for the last PT update

Message ID 1418055073-2211-5-git-send-email-deathsimple@vodafone.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christian König Dec. 8, 2014, 4:11 p.m. UTC
From: Christian König <christian.koenig@amd.com>

PT updates can be seen as command submissions as well,
and we don't necessary need to wait on all of them.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/radeon/radeon_gem.c | 12 +++++++++++-
 include/uapi/drm/radeon_drm.h       |  1 +
 2 files changed, 12 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index fe48f22..dd45611 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -691,8 +691,18 @@  int radeon_gem_va_ioctl(struct drm_device *dev, void *data,
 	default:
 		break;
 	}
-	if (!r)
+	args->id = 0;
+	if (!r) {
+		struct radeon_fence *fence;
+
 		radeon_gem_va_update_vm(rdev, bo_va);
+		fence = bo_va->last_pt_update;
+		if (fence) {
+			mutex_lock(&fpriv->seq_lock);
+			args->id = radeon_seq_push(&fpriv->seq, fence);
+			mutex_unlock(&fpriv->seq_lock);
+		}
+	}
 	args->operation = RADEON_VA_RESULT_OK;
 	if (r) {
 		args->operation = RADEON_VA_RESULT_ERROR;
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index a34e3db..2c50838 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -940,6 +940,7 @@  struct drm_radeon_gem_va {
 	uint32_t		vm_id;
 	uint32_t		flags;
 	uint64_t		offset;
+	uint64_t		id;
 };
 
 #define RADEON_CHUNK_ID_RELOCS		0x01