From c425ad1a34439d019edd589c32a7161d01b4d822 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 26 Aug 2005 20:56:11 +0000 Subject: Previously, drm_get_resource_start() and drm_get_resource_len() would allocate the resource RF_ACTIVE, pull out the appropriate value, and return it. However, allocating large framebuffers RF_ACTIVE would run the system out of KVA, and this also left open the possibility of the resource getting moved after getting the offset. Instead, when either of these are called, allocate the resource if it isn't allocated already (non-RF_ACTIVE) and store it in the DRM device, to be cleaned up on lastclose. --- bsd-core/drmP.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bsd-core/drmP.h') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index d5907355..751714b6 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -686,6 +686,9 @@ struct drm_driver_info { unsigned use_mtrr :1; }; +/* Length for the array of resource pointers for drm_get_resource_*. */ +#define DRM_MAX_PCI_RESOURCE 3 + /** * DRM device functions structure */ @@ -748,6 +751,10 @@ struct drm_device { #endif void *irqh; /* Handle from bus_setup_intr */ + /* Storage of resource pointers for drm_get_resource_* */ + struct resource *pcir[DRM_MAX_PCI_RESOURCE]; + int pcirid[DRM_MAX_PCI_RESOURCE]; + int pci_domain; int pci_bus; int pci_slot; -- cgit v1.2.3