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 support for non-PCI devices
details: https://anonhg.NetBSD.org/src/rev/dc2f9034443d
branches: trunk
changeset: 341083:dc2f9034443d
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Oct 17 21:13:38 2015 +0000
description:
support for non-PCI devices
diffstat:
sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c | 18 +++++----
sys/external/bsd/drm2/include/linux/platform_device.h | 12 ++++++-
2 files changed, 21 insertions(+), 9 deletions(-)
diffs (83 lines):
diff -r f7ca9697cc08 -r dc2f9034443d sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c Sat Oct 17 21:12:37 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/engine/device/nouveau_engine_device_base.c Sat Oct 17 21:13:38 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_engine_device_base.c,v 1.4 2015/03/06 13:44:18 riastradh Exp $ */
+/* $NetBSD: nouveau_engine_device_base.c,v 1.5 2015/10/17 21:13:38 jmcneill Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_base.c,v 1.4 2015/03/06 13:44:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_engine_device_base.c,v 1.5 2015/10/17 21:13:38 jmcneill Exp $");
#include <core/object.h>
#include <core/device.h>
@@ -528,8 +528,8 @@
else
return pa->pa_iot;
} else {
- /* XXX nouveau platform device */
- panic("can't handle non-PCI nouveau devices");
+ KASSERT(bar < device->platformdev->nresource);
+ return device->platformdev->resource[bar].tag;
}
}
#endif
@@ -541,8 +541,9 @@
return pci_resource_start(device->pdev, bar);
} else {
#ifdef __NetBSD__
- /* XXX nouveau platform device */
- panic("can't handle non-PCI nouveau devices");
+ if (bar >= device->platformdev->nresource)
+ return 0;
+ return device->platformdev->resource[bar].start;
#else
struct resource *res;
res = platform_get_resource(device->platformdev,
@@ -561,8 +562,9 @@
return pci_resource_len(device->pdev, bar);
} else {
#ifdef __NetBSD__
- /* XXX nouveau platform device */
- panic("can't handle non-PCI nouveau devices");
+ if (bar >= device->platformdev->nresource)
+ return 0;
+ return device->platformdev->resource[bar].len;
#else
struct resource *res;
res = platform_get_resource(device->platformdev,
diff -r f7ca9697cc08 -r dc2f9034443d sys/external/bsd/drm2/include/linux/platform_device.h
--- a/sys/external/bsd/drm2/include/linux/platform_device.h Sat Oct 17 21:12:37 2015 +0000
+++ b/sys/external/bsd/drm2/include/linux/platform_device.h Sat Oct 17 21:13:38 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: platform_device.h,v 1.4 2014/08/06 15:01:33 riastradh Exp $ */
+/* $NetBSD: platform_device.h,v 1.5 2015/10/17 21:13:38 jmcneill Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,10 +33,20 @@
#define _LINUX_PLATFORM_DEVICE_H_
#include <sys/device.h>
+#include <sys/bus.h>
+
+#define NUM_PLATFORM_RESOURCE 2
struct platform_device {
struct device dev; /* XXX DON'T BELIEVE ME */
uint64_t id;
+
+ unsigned int nresource;
+ struct {
+ bus_space_tag_t tag;
+ bus_addr_t start;
+ bus_size_t len;
+ } resource[NUM_PLATFORM_RESOURCE];
};
#endif /* _LINUX_PLATFORM_DEVICE_H_ */
Home |
Main Index |
Thread Index |
Old Index