drm/i915: Extract tile_row_size for fencing
Computing the tile row size of a tiled object (for use with fence registers) is repeated, so extract it to a common helper. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: http://patchwork.freedesktop.org/patch/msgid/20170109161613.11881-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
This commit is contained in:
@@ -1696,12 +1696,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,
|
||||
|
||||
static unsigned int tile_row_pages(struct drm_i915_gem_object *obj)
|
||||
{
|
||||
u64 size;
|
||||
|
||||
size = i915_gem_object_get_stride(obj);
|
||||
size *= i915_gem_object_get_tiling(obj) == I915_TILING_Y ? 32 : 8;
|
||||
|
||||
return size >> PAGE_SHIFT;
|
||||
return i915_gem_object_get_tile_row_size(obj) >> PAGE_SHIFT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user