summaryrefslogtreecommitdiff
path: root/linux-core/drm_objects.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-02-28 13:47:15 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-02-28 14:06:46 +0100
commit8ef838e5ff7b3c005d7fbc725e17bcccd0e1e1eb (patch)
tree7c772349e4cd4a3196221a7aeee705b8238b58d6 /linux-core/drm_objects.h
parentfd595fa4dc6f788a8a1e1b56178e15f411706cb9 (diff)
Add a compat kmap_atomic_prot_pfn to do quick kernel map / unmaps of
PCI- or high memory. This is substantially more efficient than drm_bo_kmap, since the mapping only lives on a single processor. Unmapping is done use kunmap_atomic(). Flushes only a single tlb() entry. Add a support utility int drm_bo_pfn_prot() that returns the pfn and desired page protection for a given bo offset. This is all intended for relocations in bound TTMS or vram. Mapping-accessing-unmapping must be atomic, either using preempt_xx() macros or a spinlock.
Diffstat (limited to 'linux-core/drm_objects.h')
-rw-r--r--linux-core/drm_objects.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-core/drm_objects.h b/linux-core/drm_objects.h
index e43e8dfd..8055afe1 100644
--- a/linux-core/drm_objects.h
+++ b/linux-core/drm_objects.h
@@ -738,6 +738,10 @@ static inline void *drm_bmo_virtual(struct drm_bo_kmap_obj *map, int *is_iomem)
extern void drm_bo_kunmap(struct drm_bo_kmap_obj *map);
extern int drm_bo_kmap(struct drm_buffer_object *bo, unsigned long start_page,
unsigned long num_pages, struct drm_bo_kmap_obj *map);
+extern int drm_bo_pfn_prot(struct drm_buffer_object *bo,
+ unsigned long dst_offset,
+ unsigned long *pfn,
+ pgprot_t *prot);
/*