diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:15 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:37:36 +1000 |
commit | 0d0169db280f0bec85d273d35c6282f231b09c76 (patch) | |
tree | 933dcd326178a7fee7b7122fc7593052399f26ee /bin/util.h | |
parent | 558d9ac4b06b61f087c2411117096372124c2575 (diff) | |
download | nouveau-0d0169db280f0bec85d273d35c6282f231b09c76.tar.gz |
device: simplify subdev construction
Replaces the piece-by-piece (in response to NV_DEVICE ctor args) device
contruction with a once-off all-or-nothing approach, eliminating some
tricky refcounting issues. The partial device init capability was only
required by some tools, and has been moved to probe time instead.
Temporarily removes a workaround for some boards where we need to fiddle
with AGP registers before executing the DEVINIT scripts. A later commit
in this series reinstates it.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'bin/util.h')
-rw-r--r-- | bin/util.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/util.h b/bin/util.h index 2b07e5e79..af6feac44 100644 --- a/bin/util.h +++ b/bin/util.h @@ -5,6 +5,8 @@ #include <unistd.h> +#include "../lib/priv.h" + #define U_GETOPT "a:b:c:d:" static const char *u_drv; @@ -31,6 +33,9 @@ u_client(const char *drv, const char *name, const char *dbg, bool detect, bool mmio, u64 subdev, struct nvif_client **pclient) { + os_device_detect = detect; + os_device_mmio = mmio; + os_device_subdev = subdev; return nvif_client_new(u_drv ? u_drv : drv, name, u_dev, u_cfg, u_dbg ? u_dbg : dbg, pclient); } @@ -46,13 +51,6 @@ u_device(const char *drv, const char *name, const char *dbg, ret = nvif_device_new(client->object, handle, NV_DEVICE, &(struct nv_device_v0) { .device = ~0ULL, - .disable = ~( - (detect ? NV_DEVICE_V0_DISABLE_IDENTIFY : 0) | - ( mmio ? NV_DEVICE_V0_DISABLE_MMIO : 0) | - ((subdev & (1ULL << NVDEV_SUBDEV_VBIOS)) ? - NV_DEVICE_V0_DISABLE_VBIOS : 0) | - (subdev ? NV_DEVICE_V0_DISABLE_CORE : 0)), - .debug0 = ~subdev, }, sizeof(struct nv_device_v0), pdevice); nvif_client_ref(NULL, &client); |