diff options
author | Nian Wu <nian.wu@intel.com> | 2007-03-23 17:00:41 +0800 |
---|---|---|
committer | Nian Wu <nian.wu@intel.com> | 2007-03-23 17:00:41 +0800 |
commit | e7cd5a1e2df29c1a06b74439faf750c6c5bb8e4a (patch) | |
tree | 5c074a2bea8454dc343993a3af2d1ebb3a444f3b /linux-core/drm_memory.c | |
parent | 0467ad41188031073cbbad1139a916e2439af2f1 (diff) | |
parent | 4988fa48869098b18a3b60884550614818d60445 (diff) |
Merge git://proxy01.pd.intel.com:9419/git/mesa/drm into crestline
Diffstat (limited to 'linux-core/drm_memory.c')
-rw-r--r-- | linux-core/drm_memory.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c index a1aaa8f5..86c869f1 100644 --- a/linux-core/drm_memory.c +++ b/linux-core/drm_memory.c @@ -61,17 +61,17 @@ int drm_alloc_memctl(size_t size) { int ret; unsigned long a_size = drm_size_align(size); - + spin_lock(&drm_memctl.lock); - ret = ((drm_memctl.cur_used + a_size) > drm_memctl.high_threshold) ? + ret = ((drm_memctl.cur_used + a_size) > drm_memctl.high_threshold) ? -ENOMEM : 0; - if (!ret) + if (!ret) drm_memctl.cur_used += a_size; spin_unlock(&drm_memctl.lock); return ret; } EXPORT_SYMBOL(drm_alloc_memctl); - + void drm_free_memctl(size_t size) { unsigned long a_size = drm_size_align(size); @@ -84,14 +84,14 @@ EXPORT_SYMBOL(drm_free_memctl); void drm_query_memctl(drm_u64_t *cur_used, drm_u64_t *low_threshold, - drm_u64_t *high_threshold) + drm_u64_t *high_threshold) { spin_lock(&drm_memctl.lock); *cur_used = drm_memctl.cur_used; *low_threshold = drm_memctl.low_threshold; *high_threshold = drm_memctl.high_threshold; spin_unlock(&drm_memctl.lock); -} +} EXPORT_SYMBOL(drm_query_memctl); void drm_init_memctl(size_t p_low_threshold, |