Wed Jul 24 02:46:49 2013 UTC ()
Replace extra data in struct drm_local_map by a union.

This is a tagged union; only certain variants, specified by the map's
type, need a bus space handle and a drm bus map.  They will also need
a bus space tag later.  Other variants use other data, with more to
be added in the future, probably.


(riastradh)
diff -r1.1.1.1.2.36 -r1.1.1.1.2.37 src/sys/external/bsd/drm2/dist/include/drm/drmP.h

cvs diff -r1.1.1.1.2.36 -r1.1.1.1.2.37 src/sys/external/bsd/drm2/dist/include/drm/Attic/drmP.h (expand / switch to context diff)
--- src/sys/external/bsd/drm2/dist/include/drm/Attic/drmP.h 2013/07/24 02:45:06 1.1.1.1.2.36
+++ src/sys/external/bsd/drm2/dist/include/drm/Attic/drmP.h 2013/07/24 02:46:49 1.1.1.1.2.37
@@ -664,8 +664,30 @@
 	int mtrr;		 /**< MTRR slot used */
 
 #ifdef __NetBSD__
-	bus_space_handle_t bsh;
-	struct drm_bus_map *bus_map;
+	union {
+		/* _DRM_FRAME_BUFFER, _DRM_AGP, _DRM_REGISTERS */
+		/* XXX mtrr should be moved into this case too.  */
+		struct {
+			/*
+			 * XXX bst seems like a waste of space, but not
+			 * all accessors have the drm_device handy.
+			 */
+			bus_space_tag_t bst;
+			bus_space_handle_t bsh;
+			struct drm_bus_map *bus_map;
+		} bus_space;
+
+		/* _DRM_CONSISTENT */
+		struct drm_dma_handle *dmah;
+
+		/* _DRM_SCATTER_GATHER */
+#if 0				/* XXX stored in dev->sg instead */
+		struct drm_sg_mem *sg;
+#endif
+
+		/* _DRM_SHM */
+		/* XXX Anything?  uvm object?  */
+	} lm_data;
 #endif
 };