Subversion Repositories Kolibri OS

Rev

Rev 6937 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6937 Rev 7144
Line 42... Line 42...
42
typedef uint64_t gen8_ppgtt_pdpe_t;
42
typedef uint64_t gen8_ppgtt_pdpe_t;
43
typedef uint64_t gen8_ppgtt_pml4e_t;
43
typedef uint64_t gen8_ppgtt_pml4e_t;
Line 44... Line 44...
44
 
44
 
Line 45... Line -...
45
#define gtt_total_entries(gtt) ((gtt).base.total >> PAGE_SHIFT)
-
 
46
 
45
#define gtt_total_entries(gtt) ((gtt).base.total >> PAGE_SHIFT)
47
 
46
 
48
/* gen6-hsw has bit 11-4 for physical addr bit 39-32 */
47
/* gen6-hsw has bit 11-4 for physical addr bit 39-32 */
49
#define GEN6_GTT_ADDR_ENCODE(addr)	((addr) | (((addr) >> 28) & 0xff0))
48
#define GEN6_GTT_ADDR_ENCODE(addr)	((addr) | (((addr) >> 28) & 0xff0))
50
#define GEN6_PTE_ADDR_ENCODE(addr)	GEN6_GTT_ADDR_ENCODE(addr)
49
#define GEN6_PTE_ADDR_ENCODE(addr)	GEN6_GTT_ADDR_ENCODE(addr)
Line 154... Line 153...
154
	union {
153
	union {
155
		struct {
154
		struct {
156
			u64 offset;
155
			u64 offset;
157
			unsigned int size;
156
			unsigned int size;
158
		} partial;
157
		} partial;
159
		struct intel_rotation_info rotation_info;
158
		struct intel_rotation_info rotated;
160
	} params;
159
	} params;
Line 161... Line 160...
161
 
160
 
162
	struct sg_table *pages;
161
	struct sg_table *pages;
Line 182... Line 181...
182
 
181
 
183
	/** Flags and address space this VMA is bound to */
182
	/** Flags and address space this VMA is bound to */
184
#define GLOBAL_BIND	(1<<0)
183
#define GLOBAL_BIND	(1<<0)
185
#define LOCAL_BIND	(1<<1)
184
#define LOCAL_BIND	(1<<1)
-
 
185
	unsigned int bound : 4;
Line 186... Line 186...
186
	unsigned int bound : 4;
186
	bool is_ggtt : 1;
187
 
187
 
188
	/**
188
	/**
189
	 * Support different GGTT views into the same object.
189
	 * Support different GGTT views into the same object.
Line 193... Line 193...
193
	 * assumed in GEM functions which take no ggtt view parameter.
193
	 * assumed in GEM functions which take no ggtt view parameter.
194
	 */
194
	 */
195
	struct i915_ggtt_view ggtt_view;
195
	struct i915_ggtt_view ggtt_view;
Line 196... Line 196...
196
 
196
 
197
	/** This object's place on the active/inactive lists */
197
	/** This object's place on the active/inactive lists */
Line 198... Line 198...
198
	struct list_head mm_list;
198
	struct list_head vm_link;
Line 199... Line 199...
199
 
199
 
200
	struct list_head vma_link; /* Link in the object's VMA list */
200
	struct list_head obj_link; /* Link in the object's VMA list */
Line 201... Line 201...
201
 
201
 
Line 274... Line 274...
274
	struct drm_device *dev;
274
	struct drm_device *dev;
275
	struct list_head global_link;
275
	struct list_head global_link;
276
	u64 start;		/* Start offset always 0 for dri2 */
276
	u64 start;		/* Start offset always 0 for dri2 */
277
	u64 total;		/* size addr space maps (ex. 2GB for ggtt) */
277
	u64 total;		/* size addr space maps (ex. 2GB for ggtt) */
Line -... Line 278...
-
 
278
 
-
 
279
	bool is_ggtt;
278
 
280
 
279
	struct i915_page_scratch *scratch_page;
281
	struct i915_page_scratch *scratch_page;
280
	struct i915_page_table *scratch_pt;
282
	struct i915_page_table *scratch_pt;
281
	struct i915_page_directory *scratch_pd;
283
	struct i915_page_directory *scratch_pd;
Line 329... Line 331...
329
	int (*bind_vma)(struct i915_vma *vma,
331
	int (*bind_vma)(struct i915_vma *vma,
330
			enum i915_cache_level cache_level,
332
			enum i915_cache_level cache_level,
331
			u32 flags);
333
			u32 flags);
332
};
334
};
Line -... Line 335...
-
 
335
 
-
 
336
#define i915_is_ggtt(V) ((V)->is_ggtt)
333
 
337
 
334
/* The Graphics Translation Table is the way in which GEN hardware translates a
338
/* The Graphics Translation Table is the way in which GEN hardware translates a
335
 * Graphics Virtual Address into a Physical Address. In addition to the normal
339
 * Graphics Virtual Address into a Physical Address. In addition to the normal
336
 * collateral associated with any va->pa translations GEN hardware also has a
340
 * collateral associated with any va->pa translations GEN hardware also has a
337
 * portion of the GTT which can be mapped by the CPU and remain both coherent
341
 * portion of the GTT which can be mapped by the CPU and remain both coherent
Line 341... Line 345...
341
struct i915_gtt {
345
struct i915_gtt {
342
	struct i915_address_space base;
346
	struct i915_address_space base;
Line 343... Line 347...
343
 
347
 
344
	size_t stolen_size;		/* Total size of stolen memory */
348
	size_t stolen_size;		/* Total size of stolen memory */
-
 
349
	size_t stolen_usable_size;	/* Total size minus BIOS reserved */
-
 
350
	size_t stolen_reserved_base;
345
	size_t stolen_usable_size;	/* Total size minus BIOS reserved */
351
	size_t stolen_reserved_size;
346
	u64 mappable_end;		/* End offset that we can CPU map */
352
	u64 mappable_end;		/* End offset that we can CPU map */
347
	struct io_mapping *mappable;	/* Mapping to our CPU mappable region */
353
	struct io_mapping *mappable;	/* Mapping to our CPU mappable region */
Line 348... Line 354...
348
	phys_addr_t mappable_base;	/* PA of our GMADR */
354
	phys_addr_t mappable_base;	/* PA of our GMADR */
Line 415... Line 421...
415
 * GEN6_PTES for GEN6, and GEN8_PTES for GEN8.
421
 * GEN6_PTES for GEN6, and GEN8_PTES for GEN8.
416
*/
422
*/
417
static inline uint32_t i915_pte_count(uint64_t addr, size_t length,
423
static inline uint32_t i915_pte_count(uint64_t addr, size_t length,
418
				      uint32_t pde_shift)
424
				      uint32_t pde_shift)
419
{
425
{
420
	const uint64_t mask = ~((1 << pde_shift) - 1);
426
	const uint64_t mask = ~((1ULL << pde_shift) - 1);
421
	uint64_t end;
427
	uint64_t end;
Line 422... Line 428...
422
 
428
 
423
	WARN_ON(length == 0);
429
	WARN_ON(length == 0);