diff options
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index db56a6add5de..19ef8ebdc662 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -1300,6 +1300,7 @@ extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | |||
1300 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | 1300 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); |
1301 | extern int drm_vblank_get(struct drm_device *dev, int crtc); | 1301 | extern int drm_vblank_get(struct drm_device *dev, int crtc); |
1302 | extern void drm_vblank_put(struct drm_device *dev, int crtc); | 1302 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
1303 | extern void drm_vblank_off(struct drm_device *dev, int crtc); | ||
1303 | extern void drm_vblank_cleanup(struct drm_device *dev); | 1304 | extern void drm_vblank_cleanup(struct drm_device *dev); |
1304 | /* Modesetting support */ | 1305 | /* Modesetting support */ |
1305 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1306 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
@@ -1524,14 +1525,27 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
1524 | 1525 | ||
1525 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | 1526 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) |
1526 | { | 1527 | { |
1528 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
1529 | return NULL; | ||
1530 | |||
1527 | if (size * nmemb <= PAGE_SIZE) | 1531 | if (size * nmemb <= PAGE_SIZE) |
1528 | return kcalloc(nmemb, size, GFP_KERNEL); | 1532 | return kcalloc(nmemb, size, GFP_KERNEL); |
1529 | 1533 | ||
1534 | return __vmalloc(size * nmemb, | ||
1535 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | ||
1536 | } | ||
1537 | |||
1538 | /* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */ | ||
1539 | static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) | ||
1540 | { | ||
1530 | if (size != 0 && nmemb > ULONG_MAX / size) | 1541 | if (size != 0 && nmemb > ULONG_MAX / size) |
1531 | return NULL; | 1542 | return NULL; |
1532 | 1543 | ||
1544 | if (size * nmemb <= PAGE_SIZE) | ||
1545 | return kmalloc(nmemb * size, GFP_KERNEL); | ||
1546 | |||
1533 | return __vmalloc(size * nmemb, | 1547 | return __vmalloc(size * nmemb, |
1534 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | 1548 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL); |
1535 | } | 1549 | } |
1536 | 1550 | ||
1537 | static __inline void drm_free_large(void *ptr) | 1551 | static __inline void drm_free_large(void *ptr) |