Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2 Make viadrm (UMS) almost build.
details: https://anonhg.NetBSD.org/src/rev/1363f328ad9a
branches: trunk
changeset: 337819:1363f328ad9a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Apr 29 04:45:03 2015 +0000
description:
Make viadrm (UMS) almost build.
Missing part: something needs to issue config_found_ia("drmums_pci"),
and config(5) needs to be told that it will do that. The sensible
approach is for vga_pci to do so. But config(5) doesn't seem to
understand that *only* vga_pci will do that, not all vga.
The old scheme was to tell config(5) that vga would always attach
drm, and actually attach it in vga_pci, and hope that nobody would
ever consider trying to attach non-PCI devices but quietly leave the
token `pci' out of the name of the drm interface attribute so it
didn't look wrong to have it outside dev/pci/files.pci.
Maybe that's still the right thing, as far as anything UMS can be
right.
diffstat:
sys/external/bsd/drm2/dist/drm/via/via_drv.c | 12 +++++++++++-
sys/external/bsd/drm2/dist/drm/via/via_drv.h | 2 +-
sys/external/bsd/drm2/dist/drm/via/via_irq.c | 2 +-
sys/external/bsd/drm2/pci/files.drmkms_pci | 11 +++++++++--
sys/external/bsd/drm2/via/files.via | 13 ++++++-------
5 files changed, 28 insertions(+), 12 deletions(-)
diffs (132 lines):
diff -r 413dedebc663 -r 1363f328ad9a sys/external/bsd/drm2/dist/drm/via/via_drv.c
--- a/sys/external/bsd/drm2/dist/drm/via/via_drv.c Wed Apr 29 04:38:55 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/via/via_drv.c Wed Apr 29 04:45:03 2015 +0000
@@ -53,6 +53,7 @@
kfree(file_priv);
}
+#ifndef __NetBSD__
static struct pci_device_id pciidlist[] = {
viadrv_PCI_IDS
};
@@ -69,6 +70,7 @@
#endif
.llseek = noop_llseek,
};
+#endif
static struct drm_driver driver = {
.driver_features =
@@ -90,7 +92,9 @@
.dma_quiescent = via_driver_dma_quiescent,
.lastclose = via_lastclose,
.ioctls = via_ioctls,
+#ifndef __NetBSD__
.fops = &via_driver_fops,
+#endif
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.date = DRIVER_DATE,
@@ -99,9 +103,14 @@
.patchlevel = DRIVER_PATCHLEVEL,
};
+#ifdef __NetBSD__
+struct drm_driver *const via_drm_driver = &driver;
+#endif
+
+#ifndef __NetBSD__
static struct pci_driver via_pci_driver = {
.name = DRIVER_NAME,
- .id_table = pciidlist,
+ .id_table = viadrm_pciidlist,
};
static int __init via_init(void)
@@ -115,6 +124,7 @@
{
drm_pci_exit(&driver, &via_pci_driver);
}
+#endif /* __NetBSD__ */
module_init(via_init);
module_exit(via_exit);
diff -r 413dedebc663 -r 1363f328ad9a sys/external/bsd/drm2/dist/drm/via/via_drv.h
--- a/sys/external/bsd/drm2/dist/drm/via/via_drv.h Wed Apr 29 04:38:55 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/via/via_drv.h Wed Apr 29 04:45:03 2015 +0000
@@ -152,7 +152,7 @@
extern int via_enable_vblank(struct drm_device *dev, int crtc);
extern void via_disable_vblank(struct drm_device *dev, int crtc);
-extern irqreturn_t via_driver_irq_handler(int irq, void *arg);
+extern irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS);
extern void via_driver_irq_preinstall(struct drm_device *dev);
extern int via_driver_irq_postinstall(struct drm_device *dev);
extern void via_driver_irq_uninstall(struct drm_device *dev);
diff -r 413dedebc663 -r 1363f328ad9a sys/external/bsd/drm2/dist/drm/via/via_irq.c
--- a/sys/external/bsd/drm2/dist/drm/via/via_irq.c Wed Apr 29 04:38:55 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/via/via_irq.c Wed Apr 29 04:45:03 2015 +0000
@@ -104,7 +104,7 @@
return atomic_read(&dev_priv->vbl_received);
}
-irqreturn_t via_driver_irq_handler(int irq, void *arg)
+irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
{
struct drm_device *dev = (struct drm_device *) arg;
drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
diff -r 413dedebc663 -r 1363f328ad9a sys/external/bsd/drm2/pci/files.drmkms_pci
--- a/sys/external/bsd/drm2/pci/files.drmkms_pci Wed Apr 29 04:38:55 2015 +0000
+++ b/sys/external/bsd/drm2/pci/files.drmkms_pci Wed Apr 29 04:45:03 2015 +0000
@@ -1,7 +1,14 @@
-# $NetBSD: files.drmkms_pci,v 1.5 2015/03/05 17:50:41 riastradh Exp $
+# $NetBSD: files.drmkms_pci,v 1.6 2015/04/29 04:45:03 riastradh Exp $
+# Attribute for kernel components supporting PCI-based real graphics
+# drivers, a.k.a. `drmkms' (kernel mode-setting).
define drmkms_pci: drmkms
+# Interface attribute for attaching PCI-based fake graphics drivers,
+# a.k.a. `drmums' (user mode-setting). This uses all the same support
+# code as PCI-based KMS drivers but has a bogus attachment via vga(4).
+define drmums_pci {}: drmkms_pci
+
# XXX Not quite right! Should AGP stuff be kept separate?
makeoptions drmkms_pci CPPFLAGS+="-DCONFIG_AGP"
@@ -16,4 +23,4 @@
include "external/bsd/drm2/i915drm/files.i915drmkms"
include "external/bsd/drm2/radeon/files.radeon"
include "external/bsd/drm2/nouveau/files.nouveau"
-#...
+#include "external/bsd/drm2/via/files.via"
diff -r 413dedebc663 -r 1363f328ad9a sys/external/bsd/drm2/via/files.via
--- a/sys/external/bsd/drm2/via/files.via Wed Apr 29 04:38:55 2015 +0000
+++ b/sys/external/bsd/drm2/via/files.via Wed Apr 29 04:45:03 2015 +0000
@@ -1,16 +1,13 @@
-# $NetBSD: files.via,v 1.1 2014/08/26 17:28:14 riastradh Exp $
+# $NetBSD: files.via,v 1.2 2015/04/29 04:45:03 riastradh Exp $
-define viafbbus { }
-device viadrmums: drmkms, drmkms_pci, viafbbus
-attach viadrmums at pci
-
-device viafb: viafbbus, genfb, wsemuldisplaydev
-attach viafb at viafbbus
+device viadrmums
+attach viadrmums at drmums_pci
makeoptions viadrmums CPPFLAGS+="-I$S/external/bsd/drm2/dist/drm/via"
makeoptions viadrmums CPPFLAGS+="-I$S/external/bsd/drm2/via"
makeoptions viadrmums "CWARNFLAGS.via_verifier.c"+="-Wno-shadow"
+makeoptions viadrmums "CWARNFLAGS.via_pci.c"+="-Wno-missing-field-initializers"
file external/bsd/drm2/dist/drm/via/via_dma.c viadrmums
file external/bsd/drm2/dist/drm/via/via_dmablit.c viadrmums
@@ -20,3 +17,5 @@
file external/bsd/drm2/dist/drm/via/via_mm.c viadrmums
file external/bsd/drm2/dist/drm/via/via_verifier.c viadrmums
file external/bsd/drm2/dist/drm/via/via_video.c viadrmums
+
+file external/bsd/drm2/via/via_pci.c viadrmums
Home |
Main Index |
Thread Index |
Old Index