|
@@ -182,7 +182,7 @@ static void evict_entry(struct drm_gem_object *obj,
|
|
size_t size = PAGE_SIZE * n;
|
|
size_t size = PAGE_SIZE * n;
|
|
loff_t off = mmap_offset(obj) +
|
|
loff_t off = mmap_offset(obj) +
|
|
(entry->obj_pgoff << PAGE_SHIFT);
|
|
(entry->obj_pgoff << PAGE_SHIFT);
|
|
- const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE);
|
|
|
|
|
|
+ const int m = DIV_ROUND_UP(omap_obj->width << fmt, PAGE_SIZE);
|
|
|
|
|
|
if (m > 1) {
|
|
if (m > 1) {
|
|
int i;
|
|
int i;
|
|
@@ -424,7 +424,7 @@ static int fault_2d(struct drm_gem_object *obj,
|
|
* into account in some of the math, so figure out virtual stride
|
|
* into account in some of the math, so figure out virtual stride
|
|
* in pages
|
|
* in pages
|
|
*/
|
|
*/
|
|
- const int m = 1 + ((omap_obj->width << fmt) / PAGE_SIZE);
|
|
|
|
|
|
+ const int m = DIV_ROUND_UP(omap_obj->width << fmt, PAGE_SIZE);
|
|
|
|
|
|
/* We don't use vmf->pgoff since that has the fake offset: */
|
|
/* We don't use vmf->pgoff since that has the fake offset: */
|
|
pgoff = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
|
|
pgoff = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
|