Submit #2715 ยป restore_i386_i915.diff
| sys/dev/drm/Makefile | ||
|---|---|---|
| 
     SUBDIR = drm mach64 mga r128 radeon radeonfw savage sis tdfx 
   | 
||
| 
     .if ${MACHINE_ARCH} == "x86_64" 
   | 
||
| 
     SUBDIR+= i915 
   | 
||
| 
     .endif 
   | 
||
| 
     SUBDIR = drm mach64 mga r128 radeon radeonfw savage sis tdfx i915 
   | 
||
| 
     .include <bsd.obj.mk> 
   | 
||
| sys/dev/drm/i915/i915_gem_execbuffer.c | ||
|---|---|---|
| 
      * 
   | 
||
| 
      */ 
   | 
||
| 
     #ifndef __x86_64__ 
   | 
||
| 
     #include <sys/limits.h> 
   | 
||
| 
     #include <sys/sfbuf.h> 
   | 
||
| 
     #endif 
   | 
||
| 
     #include <drm/drmP.h> 
   | 
||
| 
     #include <drm/i915_drm.h> 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     #include <linux/highmem.h> 
   | 
||
| 
     #endif /* __x86_64__ */ 
   | 
||
| 
     #include "i915_drv.h" 
   | 
||
| 
     #include "intel_drv.h" 
   | 
||
| ... | ... | |
| 
     	if (use_cpu_reloc(obj)) { 
   | 
||
| 
     		uint32_t page_offset = reloc->offset & PAGE_MASK; 
   | 
||
| 
     		char *vaddr; 
   | 
||
| 
     #ifndef __x86_64__ 
   | 
||
| 
     		struct sf_buf *sf; 
   | 
||
| 
     #endif 
   | 
||
| 
     		ret = i915_gem_object_set_to_cpu_domain(obj, 1); 
   | 
||
| 
     		if (ret) 
   | 
||
| 
     			return ret; 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     		vaddr = kmap_atomic(obj->pages[reloc->offset >> PAGE_SHIFT]); 
   | 
||
| 
     #else /* Pre c77fb2a917 Sync i915_gem_execbuffer.c with Linux 3.8.13 */ 
   | 
||
| 
     		sf = sf_buf_alloc(obj->pages[OFF_TO_IDX(reloc->offset)]); 
   | 
||
| 
     		if (sf == NULL) 
   | 
||
| 
     			return (-ENOMEM); 
   | 
||
| 
     		vaddr = (void *)sf_buf_kva(sf); 
   | 
||
| 
     #endif 
   | 
||
| 
     		*(uint32_t *)(vaddr + page_offset) = reloc->delta; 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     		kunmap_atomic(vaddr); 
   | 
||
| 
     #else /* Pre c77fb2a917 Sync i915_gem_execbuffer.c with Linux 3.8.13 */ 
   | 
||
| 
     		sf_buf_free(sf); 
   | 
||
| 
     #endif 
   | 
||
| 
     	} else { 
   | 
||
| 
     		uint32_t __iomem *reloc_entry; 
   | 
||
| 
     		char __iomem *reloc_page; 
   | 
||
| sys/dev/drm/i915/i915_gem_gtt.c | ||
|---|---|---|
| 
      * 
   | 
||
| 
      */ 
   | 
||
| 
     #ifndef __x86_64__ 
   | 
||
| 
     #include <sys/sfbuf.h> 
   | 
||
| 
     #endif 
   | 
||
| 
     #include <drm/drmP.h> 
   | 
||
| 
     #include <drm/i915_drm.h> 
   | 
||
| 
     #include "i915_drv.h" 
   | 
||
| 
     #include "intel_drv.h" 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     #include <linux/highmem.h> 
   | 
||
| 
     #endif 
   | 
||
| 
     typedef uint32_t gtt_pte_t; 
   | 
||
| ... | ... | |
| 
     { 
   | 
||
| 
     	gtt_pte_t *pt_vaddr; 
   | 
||
| 
     	gtt_pte_t scratch_pte; 
   | 
||
| 
     #ifndef __x86_64__ 
   | 
||
| 
     	struct sf_buf *sf; 
   | 
||
| 
     #endif 
   | 
||
| 
     	unsigned act_pd = first_entry / I915_PPGTT_PT_ENTRIES; 
   | 
||
| 
     	unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES; 
   | 
||
| 
     	unsigned last_pte, i; 
   | 
||
| ... | ... | |
| 
     		if (last_pte > I915_PPGTT_PT_ENTRIES) 
   | 
||
| 
     			last_pte = I915_PPGTT_PT_ENTRIES; 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     		pt_vaddr = kmap_atomic(ppgtt->pt_pages[act_pd]); 
   | 
||
| 
     #else /* Pre 82046b5c4 Fix display corruption issues on Haswell */ 
   | 
||
| 
     		sf = sf_buf_alloc(ppgtt->pt_pages[act_pd]); 
   | 
||
| 
     		pt_vaddr = (uint32_t *)(uintptr_t)sf_buf_kva(sf); 
   | 
||
| 
     #endif 
   | 
||
| 
     		for (i = first_pte; i < last_pte; i++) 
   | 
||
| 
     			pt_vaddr[i] = scratch_pte; 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     		kunmap_atomic(pt_vaddr); 
   | 
||
| 
     #else /* Pre 82046b5c4 Fix display corruption issues on Haswell */ 
   | 
||
| 
     		sf_buf_free(sf); 
   | 
||
| 
     #endif 
   | 
||
| 
     		num_entries -= last_pte - first_pte; 
   | 
||
| 
     		first_pte = 0; 
   | 
||
| 
     		act_pd++; 
   | 
||
| ... | ... | |
| 
         unsigned num_entries, vm_page_t *pages, enum i915_cache_level cache_level) 
   | 
||
| 
     { 
   | 
||
| 
     	uint32_t *pt_vaddr; 
   | 
||
| 
     #ifndef __x86_64__ 
   | 
||
| 
     	struct sf_buf *sf; 
   | 
||
| 
     #endif 
   | 
||
| 
     	unsigned act_pd = first_entry / I915_PPGTT_PT_ENTRIES; 
   | 
||
| 
     	unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES; 
   | 
||
| 
     	unsigned last_pte, i; 
   | 
||
| ... | ... | |
| 
     		if (last_pte > I915_PPGTT_PT_ENTRIES) 
   | 
||
| 
     			last_pte = I915_PPGTT_PT_ENTRIES; 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     		pt_vaddr = kmap_atomic(ppgtt->pt_pages[act_pd]); 
   | 
||
| 
     #else /* Pre 82046b5c4 Fix display corruption issues on Haswell */ 
   | 
||
| 
     		sf = sf_buf_alloc(ppgtt->pt_pages[act_pd]); 
   | 
||
| 
     		pt_vaddr = (uint32_t *)(uintptr_t)sf_buf_kva(sf); 
   | 
||
| 
     #endif 
   | 
||
| 
     		for (i = first_pte; i < last_pte; i++) { 
   | 
||
| 
     			page_addr = VM_PAGE_TO_PHYS(*pages); 
   | 
||
| ... | ... | |
| 
     			pages++; 
   | 
||
| 
     		} 
   | 
||
| 
     #ifdef __x86_64__ 
   | 
||
| 
     		kunmap_atomic(pt_vaddr); 
   | 
||
| 
     #else /* Pre 82046b5c4 Fix display corruption issues on Haswell */ 
   | 
||
| 
     		sf_buf_free(sf); 
   | 
||
| 
     #endif 
   | 
||
| 
     		num_entries -= last_pte - first_pte; 
   | 
||
| 
     		first_pte = 0; 
   | 
||