summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-05-26 14:48:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-26 14:48:36 -0700
commitebd4c994d2f917dffec882e7a77c28c6b28758ac (patch)
tree1b25626dacb31bc7004d5fd455a13be14a605fb1 /include
parent299297c63686948aab5af1534629a0a740af6688 (diff)
parente4a5d54f924ea5ce2913d9d0687d034004816465 (diff)
downloadop-kernel-dev-ebd4c994d2f917dffec882e7a77c28c6b28758ac.zip
op-kernel-dev-ebd4c994d2f917dffec882e7a77c28c6b28758ac.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel: drm/i915: Add support for VGA load detection (pre-945). drm/i915: Use an I2C algo to do the flip to SDVO DDC bus. drm/i915: Determine type before initialising connector drm/i915: Return SDVO LVDS VBT mode if no EDID modes are detected. drm/i915: Fetch SDVO LVDS mode lines from VBT, then reserve them i915: support 8xx desktop cursors drm/i915: allocate large pointer arrays with vmalloc
Diffstat (limited to 'include')
-rw-r--r--include/drm/drmP.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index c8c4221..b84d8ae 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1519,6 +1519,30 @@ static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area)
{
return kcalloc(nmemb, size, GFP_KERNEL);
}
+
+static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
+{
+ u8 *addr;
+
+ if (size <= PAGE_SIZE)
+ return kcalloc(nmemb, size, GFP_KERNEL);
+
+ addr = vmalloc(nmemb * size);
+ if (!addr)
+ return NULL;
+
+ memset(addr, 0, nmemb * size);
+
+ return addr;
+}
+
+static __inline void drm_free_large(void *ptr)
+{
+ if (!is_vmalloc_addr(ptr))
+ return kfree(ptr);
+
+ vfree(ptr);
+}
#else
extern void *drm_alloc(size_t size, int area);
extern void drm_free(void *pt, size_t size, int area);
OpenPOWER on IntegriCloud