summaryrefslogtreecommitdiff
path: root/lib
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:36 +1000
commit0d0169db280f0bec85d273d35c6282f231b09c76 (patch)
tree933dcd326178a7fee7b7122fc7593052399f26ee /lib
parent558d9ac4b06b61f087c2411117096372124c2575 (diff)
downloadnouveau-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 'lib')
-rw-r--r--lib/main.c7
-rw-r--r--lib/null.c3
-rw-r--r--lib/priv.h3
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/main.c b/lib/main.c
index 09ff15fab..0102a7768 100644
--- a/lib/main.c
+++ b/lib/main.c
@@ -44,6 +44,10 @@ static DEFINE_MUTEX(os_mutex);
static LIST_HEAD(os_device_list);
static int os_client_nr = 0;
+bool os_device_detect = true;
+bool os_device_mmio = true;
+u64 os_device_subdev = ~0ULL;
+
/******************************************************************************
* horrific stuff to implement linux's ioremap interface on top of pciaccess
*****************************************************************************/
@@ -169,7 +173,8 @@ os_init_device(struct pci_device *pdev, u64 handle, const char *cfg, const char
ret = nvkm_device_new(&odev->pdev, NVKM_BUS_PCI, handle,
odev->pdev.dev.name, cfg, dbg,
- &odev->device);
+ os_device_detect, os_device_mmio,
+ os_device_subdev, &odev->device);
if (ret) {
fprintf(stderr, "failed to create device, %d\n", ret);
os_fini_device(odev);
diff --git a/lib/null.c b/lib/null.c
index 73b9f33f3..5a7b7f9ae 100644
--- a/lib/null.c
+++ b/lib/null.c
@@ -56,7 +56,8 @@ null_init(const char *cfg, const char *dbg, bool init)
{
int ret = nvkm_device_new(&null_pci_dev, NVKM_BUS_PCI,
~0ULL, "0000:00:00.0", cfg, dbg,
- &null_device);
+ os_device_detect, os_device_mmio,
+ os_device_subdev, &null_device);
if (ret)
null_fini();
}
diff --git a/lib/priv.h b/lib/priv.h
index 2e4f1039e..45ad431db 100644
--- a/lib/priv.h
+++ b/lib/priv.h
@@ -14,4 +14,7 @@ struct os_device {
struct pci_dev pdev;
};
+extern bool os_device_detect;
+extern bool os_device_mmio;
+extern u64 os_device_subdev;
#endif