diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 00:54:16 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-27 22:40:32 -0400 |
commit | 99d4d36ad673c2b4fea364f6d456718f0f701ce4 (patch) | |
tree | 399fcfec785e9b4f94ad003ea9a8c45c4245edb2 /drivers/gpu/drm/nouveau/nvif | |
parent | bf81df9be28657eea4aca8c6ab4ed3e69f8a051c (diff) |
drm/nouveau/nvif: extend nop ioctl to return nvif version identifier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvif/client.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/client.c b/drivers/gpu/drm/nouveau/nvif/client.c index 64d3d0c37a83..1ee9294eca2e 100644 --- a/drivers/gpu/drm/nouveau/nvif/client.c +++ b/drivers/gpu/drm/nouveau/nvif/client.c | |||
@@ -71,6 +71,10 @@ int | |||
71 | nvif_client_init(const char *driver, const char *name, u64 device, | 71 | nvif_client_init(const char *driver, const char *name, u64 device, |
72 | const char *cfg, const char *dbg, struct nvif_client *client) | 72 | const char *cfg, const char *dbg, struct nvif_client *client) |
73 | { | 73 | { |
74 | struct { | ||
75 | struct nvif_ioctl_v0 ioctl; | ||
76 | struct nvif_ioctl_nop_v0 nop; | ||
77 | } args = {}; | ||
74 | int ret, i; | 78 | int ret, i; |
75 | 79 | ||
76 | ret = nvif_object_init(NULL, 0, 0, NULL, 0, &client->object); | 80 | ret = nvif_object_init(NULL, 0, 0, NULL, 0, &client->object); |
@@ -91,6 +95,11 @@ nvif_client_init(const char *driver, const char *name, u64 device, | |||
91 | } | 95 | } |
92 | } | 96 | } |
93 | 97 | ||
98 | if (ret == 0) { | ||
99 | ret = nvif_client_ioctl(client, &args, sizeof(args)); | ||
100 | client->version = args.nop.version; | ||
101 | } | ||
102 | |||
94 | if (ret) | 103 | if (ret) |
95 | nvif_client_fini(client); | 104 | nvif_client_fini(client); |
96 | return ret; | 105 | return ret; |