restore_i386_i915.diff

davshao, 08/16/2014 07:44 PM

Download (4.36 KB)

View differences:

sys/dev/drm/Makefile
1
SUBDIR = drm mach64 mga r128 radeon radeonfw savage sis tdfx
2

  
3
.if ${MACHINE_ARCH} == "x86_64"
4
SUBDIR+= i915
5
.endif
1
SUBDIR = drm mach64 mga r128 radeon radeonfw savage sis tdfx i915
6 2

  
7 3
.include <bsd.obj.mk>
8 4

  
sys/dev/drm/i915/i915_gem_execbuffer.c
26 26
 *
27 27
 */
28 28

  
29
#ifndef __x86_64__
30
#include <sys/limits.h>
31
#include <sys/sfbuf.h>
32
#endif
33

  
29 34
#include <drm/drmP.h>
30 35
#include <drm/i915_drm.h>
36
#ifdef __x86_64__
31 37
#include <linux/highmem.h>
38
#endif /* __x86_64__ */
32 39
#include "i915_drv.h"
33 40
#include "intel_drv.h"
34 41

  
......
194 201
	if (use_cpu_reloc(obj)) {
195 202
		uint32_t page_offset = reloc->offset & PAGE_MASK;
196 203
		char *vaddr;
204
#ifndef __x86_64__
205
		struct sf_buf *sf;
206
#endif
197 207

  
198 208
		ret = i915_gem_object_set_to_cpu_domain(obj, 1);
199 209
		if (ret)
200 210
			return ret;
201 211

  
212
#ifdef __x86_64__
202 213
		vaddr = kmap_atomic(obj->pages[reloc->offset >> PAGE_SHIFT]);
214
#else /* Pre c77fb2a917 Sync i915_gem_execbuffer.c with Linux 3.8.13 */
215
		sf = sf_buf_alloc(obj->pages[OFF_TO_IDX(reloc->offset)]);
216
		if (sf == NULL)
217
			return (-ENOMEM);
218
		vaddr = (void *)sf_buf_kva(sf);
219
#endif
203 220
		*(uint32_t *)(vaddr + page_offset) = reloc->delta;
221
#ifdef __x86_64__
204 222
		kunmap_atomic(vaddr);
223
#else /* Pre c77fb2a917 Sync i915_gem_execbuffer.c with Linux 3.8.13 */
224
		sf_buf_free(sf);
225
#endif
205 226
	} else {
206 227
		uint32_t __iomem *reloc_entry;
207 228
		char __iomem *reloc_page;
sys/dev/drm/i915/i915_gem_gtt.c
22 22
 *
23 23
 */
24 24

  
25
#ifndef __x86_64__
26
#include <sys/sfbuf.h>
27
#endif
28

  
25 29
#include <drm/drmP.h>
26 30
#include <drm/i915_drm.h>
27 31
#include "i915_drv.h"
28 32
#include "intel_drv.h"
29 33

  
34
#ifdef __x86_64__
30 35
#include <linux/highmem.h>
36
#endif
31 37

  
32 38
typedef uint32_t gtt_pte_t;
33 39

  
......
84 90
{
85 91
	gtt_pte_t *pt_vaddr;
86 92
	gtt_pte_t scratch_pte;
93
#ifndef __x86_64__
94
	struct sf_buf *sf;
95
#endif
87 96
	unsigned act_pd = first_entry / I915_PPGTT_PT_ENTRIES;
88 97
	unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES;
89 98
	unsigned last_pte, i;
......
96 105
		if (last_pte > I915_PPGTT_PT_ENTRIES)
97 106
			last_pte = I915_PPGTT_PT_ENTRIES;
98 107

  
108
#ifdef __x86_64__
99 109
		pt_vaddr = kmap_atomic(ppgtt->pt_pages[act_pd]);
110
#else /* Pre 82046b5c4 Fix display corruption issues on Haswell */
111
		sf = sf_buf_alloc(ppgtt->pt_pages[act_pd]);
112
		pt_vaddr = (uint32_t *)(uintptr_t)sf_buf_kva(sf);
113
#endif
100 114

  
101 115
		for (i = first_pte; i < last_pte; i++)
102 116
			pt_vaddr[i] = scratch_pte;
103 117

  
118
#ifdef __x86_64__
104 119
		kunmap_atomic(pt_vaddr);
105

  
120
#else /* Pre 82046b5c4 Fix display corruption issues on Haswell */
121
		sf_buf_free(sf);
122
#endif
106 123
		num_entries -= last_pte - first_pte;
107 124
		first_pte = 0;
108 125
		act_pd++;
......
179 196
    unsigned num_entries, vm_page_t *pages, enum i915_cache_level cache_level)
180 197
{
181 198
	uint32_t *pt_vaddr;
199
#ifndef __x86_64__
200
	struct sf_buf *sf;
201
#endif
182 202
	unsigned act_pd = first_entry / I915_PPGTT_PT_ENTRIES;
183 203
	unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES;
184 204
	unsigned last_pte, i;
......
189 209
		if (last_pte > I915_PPGTT_PT_ENTRIES)
190 210
			last_pte = I915_PPGTT_PT_ENTRIES;
191 211

  
212
#ifdef __x86_64__
192 213
		pt_vaddr = kmap_atomic(ppgtt->pt_pages[act_pd]);
214
#else /* Pre 82046b5c4 Fix display corruption issues on Haswell */
215
		sf = sf_buf_alloc(ppgtt->pt_pages[act_pd]);
216
		pt_vaddr = (uint32_t *)(uintptr_t)sf_buf_kva(sf);
217
#endif
193 218

  
194 219
		for (i = first_pte; i < last_pte; i++) {
195 220
			page_addr = VM_PAGE_TO_PHYS(*pages);
......
199 224
			pages++;
200 225
		}
201 226

  
227
#ifdef __x86_64__
202 228
		kunmap_atomic(pt_vaddr);
229
#else /* Pre 82046b5c4 Fix display corruption issues on Haswell */
230
		sf_buf_free(sf);
231
#endif
203 232

  
204 233
		num_entries -= last_pte - first_pte;
205 234
		first_pte = 0;