From 17f0882d5080a2436e4351c2bf497b8e00bc8e74 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 31 Oct 2007 11:33:34 +1100 Subject: drm: add chipset flushing via agp support --- linux-core/drm_agpsupport.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux-core/drm_agpsupport.c') diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c index b68efc64..8c7f570e 100644 --- a/linux-core/drm_agpsupport.c +++ b/linux-core/drm_agpsupport.c @@ -650,4 +650,12 @@ struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev) } EXPORT_SYMBOL(drm_agp_init_ttm); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +void drm_agp_flush_chipset(struct drm_device *dev) +{ + agp_flush_chipset(dev->agp->bridge); +} +EXPORT_SYMBOL(drm_agp_flush_chipset); +#endif + #endif /* __OS_HAS_AGP */ -- cgit v1.2.3 From 61cbcb5dbe487c6d4eba04794cbaa0279ab807b0 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 1 Nov 2007 10:34:11 +1100 Subject: drm/ttm: add support for cached un-snooped mappings. This mapping allows cached objects to be mapped in/out of the TT space with the appropriate flushing calls. It should put back the old CACHED functionality for snooped mappings --- linux-core/drm_agpsupport.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linux-core/drm_agpsupport.c') diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c index 8c7f570e..7c50f411 100644 --- a/linux-core/drm_agpsupport.c +++ b/linux-core/drm_agpsupport.c @@ -541,11 +541,15 @@ static int drm_agp_bind_ttm(struct drm_ttm_backend *backend, container_of(backend, struct drm_agp_ttm_backend, backend); DRM_AGP_MEM *mem = agp_be->mem; int ret; + int snooped = (bo_mem->flags & DRM_BO_FLAG_CACHED) && !(bo_mem->flags & DRM_BO_FLAG_CACHED_MAPPED); DRM_DEBUG("drm_agp_bind_ttm\n"); mem->is_flushed = TRUE; - mem->type = (bo_mem->flags & DRM_BO_FLAG_CACHED) ? AGP_USER_CACHED_MEMORY : - AGP_USER_MEMORY; + mem->type = AGP_USER_MEMORY; + /* CACHED MAPPED implies not snooped memory */ + if (snooped) + mem->type = AGP_USER_CACHED_MEMORY; + ret = drm_agp_bind_memory(mem, bo_mem->mm_node->start); if (ret) { DRM_ERROR("AGP Bind memory failed\n"); -- cgit v1.2.3