summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-18 16:54:17 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-18 16:54:17 +0200
commite172945d668f1de1243ac2ae91ab77f3b2bda40a (patch)
tree5aaa5a34d14bf9770286df794a37df6e1dc3ba9d /linux-core
parent25fe4a80490bba709099f0401535d2f96ac7729c (diff)
Avoid driver-specific AGP user-populated types, since we don't know what AGP
driver we're on. Avoid global cache flushes before inserting pages. In general, they are never mapped, and not accessed through the kernel map, so a cache flush should not be necessary. The exception is pages that are bound cached. We might need a cache flush for those.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/drmP.h5
-rw-r--r--linux-core/drm_agpsupport.c20
-rw-r--r--linux-core/i915_buffer.c5
3 files changed, 14 insertions, 16 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index fab3608f..d78ea7c8 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -1295,10 +1295,7 @@ extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
extern drm_ttm_backend_t *drm_agp_init_ttm(struct drm_device *dev,
- drm_ttm_backend_t *backend,
- unsigned alloc_type,
- unsigned cached_type,
- unsigned uncached_type);
+ drm_ttm_backend_t *backend);
/* Stub support (drm_stub.h) */
extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
struct drm_driver *driver);
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index ffbe04f8..a5f1f9ee 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -558,6 +558,12 @@ int drm_agp_unbind_memory(DRM_AGP_MEM * handle)
* AGP ttm backend interface.
*/
+#ifndef AGP_USER_TYPES
+#define AGP_USER_TYPES (1 << 16)
+#define AGP_USER_MEMORY (AGP_USER_TYPES)
+#define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1)
+#endif
+
static int drm_agp_needs_unbind_cache_adjust(drm_ttm_backend_t *backend) {
return ((backend->flags & DRM_BE_FLAG_BOUND_CACHED) ? 0 : 1);
}
@@ -604,7 +610,7 @@ static int drm_agp_bind_ttm(drm_ttm_backend_t *backend,
DRM_DEBUG("drm_agp_bind_ttm\n");
DRM_MASK_VAL(backend->flags, DRM_BE_FLAG_BOUND_CACHED,
(cached) ? DRM_BE_FLAG_BOUND_CACHED : 0);
- mem->is_flushed = FALSE;
+ mem->is_flushed = TRUE;
mem->type = (cached) ? agp_priv->cached_type : agp_priv->uncached_type;
ret = drm_agp_bind_memory(mem, offset);
if (ret) {
@@ -662,10 +668,8 @@ static void drm_agp_destroy_ttm(drm_ttm_backend_t *backend) {
drm_ttm_backend_t *drm_agp_init_ttm(struct drm_device *dev,
- drm_ttm_backend_t *backend,
- unsigned alloc_type,
- unsigned cached_type,
- unsigned uncached_type) {
+ drm_ttm_backend_t *backend)
+{
drm_ttm_backend_t *agp_be;
drm_agp_ttm_priv *agp_priv;
@@ -684,9 +688,9 @@ drm_ttm_backend_t *drm_agp_init_ttm(struct drm_device *dev,
}
agp_priv->mem = NULL;
- agp_priv->alloc_type = alloc_type;
- agp_priv->cached_type = cached_type;
- agp_priv->uncached_type = uncached_type;
+ agp_priv->alloc_type = AGP_USER_MEMORY;
+ agp_priv->cached_type = AGP_USER_CACHED_MEMORY;
+ agp_priv->uncached_type = AGP_USER_MEMORY;
agp_priv->bridge = dev->agp->bridge;
agp_priv->populated = FALSE;
agp_be->aperture_base = dev->agp->agp_info.aper_base;
diff --git a/linux-core/i915_buffer.c b/linux-core/i915_buffer.c
index 729ba4b2..c3e54468 100644
--- a/linux-core/i915_buffer.c
+++ b/linux-core/i915_buffer.c
@@ -33,13 +33,10 @@
#include "i915_drm.h"
#include "i915_drv.h"
-#define INTEL_AGP_MEM_USER 3
-#define INTEL_AGP_MEM_UCACHED 4
drm_ttm_backend_t *i915_create_ttm_backend_entry(drm_device_t * dev)
{
- return drm_agp_init_ttm(dev, NULL, INTEL_AGP_MEM_USER,
- INTEL_AGP_MEM_UCACHED, INTEL_AGP_MEM_USER);
+ return drm_agp_init_ttm(dev, NULL);
}
int i915_fence_types(uint32_t buffer_flags, uint32_t * class, uint32_t * type)