summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérôme Glisse <jglisse@redhat.com>2017-08-11 16:19:19 -0400
committerJérôme Glisse <jglisse@redhat.com>2017-09-05 14:52:38 -0400
commitd0fcf82da23d86b1e6008a2499aab1d951b588a8 (patch)
tree08607b567bb201d804c53405ffc6ad2b5629946a
parentb6a4536b546061090dbf449c54e84295f46e46d9 (diff)
drm/nouveau/compote: create a compute object to force graphic context creationhmm-nouveau
Graphic context is not created until there is an object that reference the engine. Creating a compute class object as no other side effect than pgrah context creation. Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/compote/compote-channel.c11
-rw-r--r--drivers/gpu/drm/nouveau/compote/compote.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/compote/compote-channel.c b/drivers/gpu/drm/nouveau/compote/compote-channel.c
index b5a490acf051..3bb7333f41a0 100644
--- a/drivers/gpu/drm/nouveau/compote/compote-channel.c
+++ b/drivers/gpu/drm/nouveau/compote/compote-channel.c
@@ -61,9 +61,18 @@ int compote_channel_new(struct compote_channel **channelp,
if (ret)
goto error;
+ ret = nvif_object_init(&channel->nvchan->user, 0, PASCAL_COMPUTE_B,
+ NULL, 0, &channel->nvcompute);
+ if (ret)
+ goto error_compute;
+ nvif_object_map(&channel->nvcompute);
+
*channelp = channel;
return 0;
+error_compute:
+ nouveau_channel_idle(channel->nvchan);
+ nouveau_channel_del(&channel->nvchan);
error:
kfree(channel);
return ret;
@@ -77,6 +86,8 @@ static void compote_channel_kref_put(struct kref *kref)
channel = container_of(kref, struct compote_channel, kref);
cfile = channel->cfile;
+ nvif_object_fini(&channel->nvcompute);
+
/*
* Wait for all activity to stop before releasing notify object, which
* may be still in use.
diff --git a/drivers/gpu/drm/nouveau/compote/compote.h b/drivers/gpu/drm/nouveau/compote/compote.h
index ef8ea114db42..6e04c56c2613 100644
--- a/drivers/gpu/drm/nouveau/compote/compote.h
+++ b/drivers/gpu/drm/nouveau/compote/compote.h
@@ -65,6 +65,7 @@ struct compote_channel {
struct compote_file *cfile;
struct nouveau_channel *nvchan;
struct kref kref;
+ struct nvif_object nvcompute;
};
long compote_ioctl_mem_alloc(struct compote_file *cfile, void __user *uarg);