Call preallocated space VRAM instead of PRIV0 to be more consistent with
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Tue, 22 May 2007 20:38:58 +0000 (13:38 -0700)
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Tue, 22 May 2007 20:38:58 +0000 (13:38 -0700)
other drivers.

linux-core/i915_buffer.c
linux-core/i915_drv.c
linux-core/intel_fb.c
shared-core/i915_init.c

index 8589f46..6e93ae2 100644 (file)
@@ -86,7 +86,7 @@ int i915_init_mem_type(drm_device_t * dev, uint32_t type,
                    _DRM_FLAG_MEMTYPE_CSELECT | _DRM_FLAG_NEEDS_IOREMAP;
                man->drm_bus_maptype = _DRM_AGP;
                break;
-       case DRM_BO_MEM_PRIV0:
+       case DRM_BO_MEM_VRAM:
                if (!(drm_core_has_AGP(dev) && dev->agp)) {
                        DRM_ERROR("AGP is not enabled for memory type %u\n",
                                  (unsigned)type);
@@ -99,6 +99,9 @@ int i915_init_mem_type(drm_device_t * dev, uint32_t type,
                    _DRM_FLAG_MEMTYPE_FIXED | _DRM_FLAG_NEEDS_IOREMAP;
                man->drm_bus_maptype = _DRM_AGP;
                break;
+       case DRM_BO_MEM_PRIV0: /* for OS preallocated space */
+               DRM_ERROR("PRIV0 not used yet.\n");
+               break;
        default:
                DRM_ERROR("Unsupported memory type %u\n", (unsigned)type);
                return -EINVAL;
index ecf4277..4d4029a 100644 (file)
@@ -53,8 +53,8 @@ static drm_fence_driver_t i915_fence_driver = {
 #endif
 #ifdef I915_HAVE_BUFFER
 
-static uint32_t i915_mem_prios[] = {DRM_BO_MEM_PRIV0, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL};
-static uint32_t i915_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_PRIV0, DRM_BO_MEM_LOCAL};
+static uint32_t i915_mem_prios[] = {DRM_BO_MEM_VRAM, DRM_BO_MEM_PRIV0, DRM_BO_MEM_TT, DRM_BO_MEM_LOCAL};
+static uint32_t i915_busy_prios[] = {DRM_BO_MEM_TT, DRM_BO_MEM_PRIV0, DRM_BO_MEM_VRAM, DRM_BO_MEM_LOCAL};
 
 static drm_bo_driver_t i915_bo_driver = {
        .mem_type_prio = i915_mem_prios,
index 449ef54..3bfbcda 100644 (file)
@@ -473,7 +473,7 @@ int intelfb_probe(struct drm_device *dev, struct drm_crtc *crtc)
                                       drm_bo_type_kernel,
                                       DRM_BO_FLAG_READ |
                                       DRM_BO_FLAG_WRITE |
-                                      DRM_BO_FLAG_MEM_PRIV0 | /* FIXME! */
+                                      DRM_BO_FLAG_MEM_VRAM | /* FIXME! */
                                       DRM_BO_FLAG_NO_MOVE,
                                       0, 0, 0,
                                       &fbo);
index 61576aa..7516b2c 100644 (file)
@@ -175,8 +175,8 @@ int i915_driver_load(drm_device_t *dev, unsigned long flags)
        drm_bo_driver_init(dev);
 
        i915_probe_agp(dev->pdev, &agp_size, &prealloc_size);
-       DRM_DEBUG("setting up %ld bytes of PRIV0 space\n", prealloc_size);
-       drm_bo_init_mm(dev, DRM_BO_MEM_PRIV0, 0, prealloc_size >> PAGE_SHIFT);
+       DRM_DEBUG("setting up %ld bytes of VRAM space\n", prealloc_size);
+       drm_bo_init_mm(dev, DRM_BO_MEM_VRAM, 0, prealloc_size >> PAGE_SHIFT);
 
        I915_WRITE(LP_RING + RING_LEN, 0);
        I915_WRITE(LP_RING + RING_HEAD, 0);
@@ -185,7 +185,7 @@ int i915_driver_load(drm_device_t *dev, unsigned long flags)
        size = PRIMARY_RINGBUFFER_SIZE;
        ret = drm_buffer_object_create(dev, size, drm_bo_type_kernel,
                                       DRM_BO_FLAG_READ | DRM_BO_FLAG_WRITE |
-                                      DRM_BO_FLAG_MEM_PRIV0 |
+                                      DRM_BO_FLAG_MEM_VRAM |
                                       DRM_BO_FLAG_NO_EVICT,
                                       DRM_BO_HINT_DONT_FENCE, 0x1, 0,
                                       &dev_priv->ring_buffer);
@@ -277,7 +277,7 @@ int i915_driver_unload(drm_device_t *dev)
        drm_bo_usage_deref_locked(dev_priv->ring_buffer);
        mutex_unlock(&dev->struct_mutex);
 
-       if (drm_bo_clean_mm(dev, DRM_BO_MEM_PRIV0)) {
+       if (drm_bo_clean_mm(dev, DRM_BO_MEM_VRAM)) {
                DRM_ERROR("Memory manager type 3 not clean. "
                          "Delaying takedown\n");
        }