Remove the pinned buffer from the LRU when pinning.
Also, be a little safer with setting the pinned flag within the struct lock. I'm not 100% sure if this is required, but it seems like it might be.main
parent
cf4f1a85af
commit
3a0bc518e3
|
@ -268,6 +268,7 @@ PAGE_AGP := $(shell cat $(LINUXDIR)/include/asm/agp.h 2>/dev/null | \
|
||||||
ifneq ($(PAGE_AGP),0)
|
ifneq ($(PAGE_AGP),0)
|
||||||
EXTRA_CFLAGS += -DHAVE_PAGE_AGP
|
EXTRA_CFLAGS += -DHAVE_PAGE_AGP
|
||||||
endif
|
endif
|
||||||
|
EXTRA_CFLAGS += -g -O0
|
||||||
|
|
||||||
# Start with all modules turned off.
|
# Start with all modules turned off.
|
||||||
CONFIG_DRM_GAMMA := n
|
CONFIG_DRM_GAMMA := n
|
||||||
|
|
|
@ -1990,8 +1990,8 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Validate the buffer into its pinned location, with no pending
|
/* Validate the buffer into its pinned location, with no
|
||||||
* fence.
|
* pending fence.
|
||||||
*/
|
*/
|
||||||
ret = drm_buffer_object_validate(bo, 0, 0, 0);
|
ret = drm_buffer_object_validate(bo, 0, 0, 0);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -1999,9 +1999,12 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add our buffer to the pinned list */
|
/* Pull the buffer off of the LRU and add it to the pinned
|
||||||
|
* list
|
||||||
|
*/
|
||||||
bo->pinned_mem_type = bo->mem.mem_type;
|
bo->pinned_mem_type = bo->mem.mem_type;
|
||||||
mutex_lock(&dev->struct_mutex);
|
mutex_lock(&dev->struct_mutex);
|
||||||
|
list_del_init(&bo->lru);
|
||||||
list_del_init(&bo->pinned_lru);
|
list_del_init(&bo->pinned_lru);
|
||||||
drm_bo_add_to_pinned_lru(bo);
|
drm_bo_add_to_pinned_lru(bo);
|
||||||
|
|
||||||
|
@ -2011,6 +2014,7 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
|
||||||
bo->pinned_node = bo->mem.mm_node;
|
bo->pinned_node = bo->mem.mm_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bo->pinned = pin;
|
||||||
mutex_unlock(&dev->struct_mutex);
|
mutex_unlock(&dev->struct_mutex);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -2022,9 +2026,9 @@ drm_bo_set_pin(struct drm_device *dev, struct drm_buffer_object *bo,
|
||||||
|
|
||||||
list_del_init(&bo->pinned_lru);
|
list_del_init(&bo->pinned_lru);
|
||||||
bo->pinned_node = NULL;
|
bo->pinned_node = NULL;
|
||||||
|
bo->pinned = pin;
|
||||||
mutex_unlock(&dev->struct_mutex);
|
mutex_unlock(&dev->struct_mutex);
|
||||||
}
|
}
|
||||||
bo->pinned = pin;
|
|
||||||
mutex_unlock(&bo->mutex);
|
mutex_unlock(&bo->mutex);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue