diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-18 16:54:17 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-18 16:54:17 +0200 |
commit | e172945d668f1de1243ac2ae91ab77f3b2bda40a (patch) | |
tree | 5aaa5a34d14bf9770286df794a37df6e1dc3ba9d /linux-core/drm_agpsupport.c | |
parent | 25fe4a80490bba709099f0401535d2f96ac7729c (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/drm_agpsupport.c')
-rw-r--r-- | linux-core/drm_agpsupport.c | 20 |
1 files changed, 12 insertions, 8 deletions
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; |