diff options
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_gem.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_gem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c index 13abf221d153..5c5c86ddd6f4 100644 --- a/drivers/gpu/drm/omapdrm/omap_gem.c +++ b/drivers/gpu/drm/omapdrm/omap_gem.c | |||
@@ -182,7 +182,7 @@ static void evict_entry(struct drm_gem_object *obj, | |||
182 | size_t size = PAGE_SIZE * n; | 182 | size_t size = PAGE_SIZE * n; |
183 | loff_t off = mmap_offset(obj) + | 183 | loff_t off = mmap_offset(obj) + |
184 | (entry->obj_pgoff << PAGE_SHIFT); | 184 | (entry->obj_pgoff << PAGE_SHIFT); |
185 | const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE); | 185 | const int m = DIV_ROUND_UP(omap_obj->width << fmt, PAGE_SIZE); |
186 | 186 | ||
187 | if (m > 1) { | 187 | if (m > 1) { |
188 | int i; | 188 | int i; |
@@ -424,7 +424,7 @@ static int fault_2d(struct drm_gem_object *obj, | |||
424 | * into account in some of the math, so figure out virtual stride | 424 | * into account in some of the math, so figure out virtual stride |
425 | * in pages | 425 | * in pages |
426 | */ | 426 | */ |
427 | const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE); | 427 | const int m = DIV_ROUND_UP(omap_obj->width << fmt, PAGE_SIZE); |
428 | 428 | ||
429 | /* We don't use vmf->pgoff since that has the fake offset: */ | 429 | /* We don't use vmf->pgoff since that has the fake offset: */ |
430 | pgoff = (vmf->address - vma->vm_start) >> PAGE_SHIFT; | 430 | pgoff = (vmf->address - vma->vm_start) >> PAGE_SHIFT; |