/* Swap every 64 bytes of this page around, to account for it having a new bit 17 of its physical address and therefore being interpreted differently by the GPU.  */
static int i915_gem_swizzle_page(struct page *page)
/* Swap every 64 bytes of this page around, to account for it having a new bit 17 of its physical address and therefore being interpreted differently by the GPU.  */
static int i915_gem_swizzle_page(struct page *page)
{
	char *vaddr;
	int i;
	char temp[64];
	vaddr = kmap(page);
	if (vaddr == NULL)
		return -ENOMEM;
	for (i = 0; i < PAGE_SIZE; i += 128) {
		memcpy(temp, &vaddr[i], 64);
		memcpy(&vaddr[i], &vaddr[i + 64], 64);
		memcpy(&vaddr[i + 64], temp, 64);
	}
	kunmap(page);
	return 0;
}