summaryrefslogtreecommitdiff
path: root/bin/nv_rdfunc.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 14:54:15 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 12:37:37 +1000
commit33b1104b25f0e58ca56d6dd13ce917371a9115fe (patch)
tree67639b4e9c8d27aa402ae417dba802a02ee5c07f /bin/nv_rdfunc.h
parent7ecff2076fd08dcc202e468385dec56002d32292 (diff)
downloadnouveau-33b1104b25f0e58ca56d6dd13ce917371a9115fe.tar.gz
nvif: simplify and tidy library interfaces
A variety of tweaks to the NVIF library interfaces, mostly ripping out things that turned out to be not so useful. - Removed refcounting from nvif_object, callers are expected to not be stupid instead. - nvif_client is directly reachable from anything derived from nvif_object, removing the need for heuristics to locate it - _new() versions of interfaces, that allocate memory for the object they construct, have been removed. The vast majority of callers used the embedded _init() interfaces. - No longer storing constructor arguments (and the data returned from nvkm) inside nvif_object, it's more or less unused and just wastes memory. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'bin/nv_rdfunc.h')
-rw-r--r--bin/nv_rdfunc.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/nv_rdfunc.h b/bin/nv_rdfunc.h
index c9c2aea22..6def1b229 100644
--- a/bin/nv_rdfunc.h
+++ b/bin/nv_rdfunc.h
@@ -15,7 +15,8 @@
int
main(int argc, char **argv)
{
- struct nvif_device *device;
+ struct nvif_client client;
+ struct nvif_device _device, *device = &_device;
char *rstr = NULL;
enum {
NORMAL,
@@ -49,7 +50,7 @@ main(int argc, char **argv)
}
ret = u_device("lib", argv[0], "fatal", DETECT, true, 0,
- 0x00000000, &device);
+ 0x00000000, &client, device);
if (ret)
return ret;
@@ -133,6 +134,7 @@ main(int argc, char **argv)
}
free(data);
- nvif_device_ref(NULL, &device);
+ nvif_device_fini(device);
+ nvif_client_fini(&client);
return 0;
}