summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-01-31 14:50:57 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-01-31 14:50:57 +0100
commit3024f23c6551e219b0236041a8205bf1bc60ed94 (patch)
tree87bd9deef4a55bf887a8c0978a5ad18412bc13e5 /shared-core
parent07fabc3fd8f00006e6117081f5183a826a6d2bbb (diff)
memory manager: Make device driver aware of different memory types.
Memory types are either fixed (on-card or pre-bound AGP) or not fixed (dynamically bound) to an aperture. They also carry information about: 1) Whether they can be mapped cached. 2) Whether they are at all mappable. 3) Whether they need an ioremap to be accessible from kernel space. In this way VRAM memory and, for example, pre-bound AGP appear identical to the memory manager. This also makes support for unmappable VRAM simple to implement.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/drm.h17
-rw-r--r--shared-core/i915_drv.h6
2 files changed, 18 insertions, 5 deletions
diff --git a/shared-core/drm.h b/shared-core/drm.h
index 9efb1dc4..38cca882 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -738,8 +738,12 @@ typedef struct drm_fence_arg {
#define DRM_BO_FLAG_MEM_TT 0x02000000
/* Vram memory */
#define DRM_BO_FLAG_MEM_VRAM 0x04000000
-/* Unmappable Vram memory */
-#define DRM_BO_FLAG_MEM_VRAM_NM 0x08000000
+/* Up to the driver to define. */
+#define DRM_BO_FLAG_MEM_PRIV0 0x10000000
+#define DRM_BO_FLAG_MEM_PRIV1 0x20000000
+#define DRM_BO_FLAG_MEM_PRIV2 0x40000000
+#define DRM_BO_FLAG_MEM_PRIV3 0x80000000
+
/* Memory flag mask */
#define DRM_BO_MASK_MEM 0xFF000000
@@ -823,8 +827,13 @@ typedef struct drm_bo_arg{
#define DRM_BO_MEM_LOCAL 0
#define DRM_BO_MEM_TT 1
#define DRM_BO_MEM_VRAM 2
-#define DRM_BO_MEM_VRAM_NM 3
-#define DRM_BO_MEM_TYPES 2 /* For now. */
+#define DRM_BO_MEM_PRIV0 4
+#define DRM_BO_MEM_PRIV1 5
+#define DRM_BO_MEM_PRIV2 6
+#define DRM_BO_MEM_PRIV3 7
+
+
+#define DRM_BO_MEM_TYPES 8 /* For now. */
typedef union drm_mm_init_arg{
struct {
diff --git a/shared-core/i915_drv.h b/shared-core/i915_drv.h
index ef9f3638..be7dd76a 100644
--- a/shared-core/i915_drv.h
+++ b/shared-core/i915_drv.h
@@ -126,7 +126,9 @@ typedef struct drm_i915_private {
uint32_t flush_pending;
uint32_t saved_flush_status;
#endif
-
+#ifdef I915_HAVE_BUFFER
+ void *agp_iomap;
+#endif
spinlock_t swaps_lock;
drm_i915_vbl_swap_t vbl_swaps;
unsigned int swaps_pending;
@@ -187,6 +189,8 @@ extern void i915_poke_flush(drm_device_t *dev);
extern drm_ttm_backend_t *i915_create_ttm_backend_entry(drm_device_t *dev);
extern int i915_fence_types(uint32_t buffer_flags, uint32_t *class, uint32_t *type);
extern int i915_invalidate_caches(drm_device_t *dev, uint32_t buffer_flags);
+extern int i915_init_mem_type(drm_device_t *dev, uint32_t type,
+ drm_mem_type_manager_t *man);
#endif
#define I915_READ(reg) DRM_READ32(dev_priv->mmio_map, (reg))