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

Christian König deathsimple at vodafone.de
Mon Dec 8 08:11:12 PST 2014


From: Christian König <christian.koenig at 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 at 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 --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
-- 
1.9.1



More information about the dri-devel mailing list