Commit dd2575ff authored by Chris Wilson's avatar Chris Wilson

drm/i915: Remove impossible error handling from bit17 swizzling

Our usage of kmap() cannot return NULL here, so remove the unnecessary
error handling.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 8c80b59b
...@@ -399,16 +399,14 @@ i915_gem_get_tiling(struct drm_device *dev, void *data, ...@@ -399,16 +399,14 @@ i915_gem_get_tiling(struct drm_device *dev, void *data,
* bit 17 of its physical address and therefore being interpreted differently * bit 17 of its physical address and therefore being interpreted differently
* by the GPU. * by the GPU.
*/ */
static int static void
i915_gem_swizzle_page(struct page *page) i915_gem_swizzle_page(struct page *page)
{ {
char temp[64];
char *vaddr; char *vaddr;
int i; int i;
char temp[64];
vaddr = kmap(page); vaddr = kmap(page);
if (vaddr == NULL)
return -ENOMEM;
for (i = 0; i < PAGE_SIZE; i += 128) { for (i = 0; i < PAGE_SIZE; i += 128) {
memcpy(temp, &vaddr[i], 64); memcpy(temp, &vaddr[i], 64);
...@@ -417,8 +415,6 @@ i915_gem_swizzle_page(struct page *page) ...@@ -417,8 +415,6 @@ i915_gem_swizzle_page(struct page *page)
} }
kunmap(page); kunmap(page);
return 0;
} }
void void
...@@ -440,11 +436,7 @@ i915_gem_object_do_bit_17_swizzle(struct drm_gem_object *obj) ...@@ -440,11 +436,7 @@ i915_gem_object_do_bit_17_swizzle(struct drm_gem_object *obj)
char new_bit_17 = page_to_phys(obj_priv->pages[i]) >> 17; char new_bit_17 = page_to_phys(obj_priv->pages[i]) >> 17;
if ((new_bit_17 & 0x1) != if ((new_bit_17 & 0x1) !=
(test_bit(i, obj_priv->bit_17) != 0)) { (test_bit(i, obj_priv->bit_17) != 0)) {
int ret = i915_gem_swizzle_page(obj_priv->pages[i]); i915_gem_swizzle_page(obj_priv->pages[i]);
if (ret != 0) {
DRM_ERROR("Failed to swizzle page\n");
return;
}
set_page_dirty(obj_priv->pages[i]); set_page_dirty(obj_priv->pages[i]);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment