Lines Matching full:tile
30 struct tile { struct
44 static u64 tiled_offset(const struct tile *tile, u64 v) in tiled_offset() argument
48 if (tile->tiling == I915_TILING_NONE) in tiled_offset()
51 y = div64_u64_rem(v, tile->stride, &x); in tiled_offset()
52 v = div64_u64_rem(y, tile->height, &y) * tile->stride * tile->height; in tiled_offset()
54 if (tile->tiling == I915_TILING_X) { in tiled_offset()
55 v += y * tile->width; in tiled_offset()
56 v += div64_u64_rem(x, tile->width, &x) << tile->size; in tiled_offset()
58 } else if (tile->width == 128) { in tiled_offset()
74 switch (tile->swizzle) { in tiled_offset()
93 const struct tile *tile, in check_partial_mapping() argument
108 err = i915_gem_object_set_tiling(obj, tile->tiling, tile->stride); in check_partial_mapping()
111 tile->tiling, tile->stride, err); in check_partial_mapping()
115 GEM_BUG_ON(i915_gem_object_get_tiling(obj) != tile->tiling); in check_partial_mapping()
116 GEM_BUG_ON(i915_gem_object_get_stride(obj) != tile->stride); in check_partial_mapping()
151 offset = tiled_offset(tile, page << PAGE_SHIFT); in check_partial_mapping()
166 tile->tiling ? tile_row_pages(obj) : 0, in check_partial_mapping()
167 vma->fence ? vma->fence->id : -1, tile->tiling, tile->stride, in check_partial_mapping()
186 const struct tile *tile, in check_partial_mappings() argument
196 err = i915_gem_object_set_tiling(obj, tile->tiling, tile->stride); in check_partial_mappings()
199 tile->tiling, tile->stride, err); in check_partial_mappings()
203 GEM_BUG_ON(i915_gem_object_get_tiling(obj) != tile->tiling); in check_partial_mappings()
204 GEM_BUG_ON(i915_gem_object_get_stride(obj) != tile->stride); in check_partial_mappings()
247 offset = tiled_offset(tile, page << PAGE_SHIFT); in check_partial_mappings()
262 tile->tiling ? tile_row_pages(obj) : 0, in check_partial_mappings()
263 vma->fence ? vma->fence->id : -1, tile->tiling, tile->stride, in check_partial_mappings()
282 __func__, tile->tiling, tile->stride)) in check_partial_mappings()
290 setup_tile_size(struct tile *tile, struct drm_i915_private *i915) in setup_tile_size() argument
293 tile->height = 16; in setup_tile_size()
294 tile->width = 128; in setup_tile_size()
295 tile->size = 11; in setup_tile_size()
296 } else if (tile->tiling == I915_TILING_Y && in setup_tile_size()
298 tile->height = 32; in setup_tile_size()
299 tile->width = 128; in setup_tile_size()
300 tile->size = 12; in setup_tile_size()
302 tile->height = 8; in setup_tile_size()
303 tile->width = 512; in setup_tile_size()
304 tile->size = 12; in setup_tile_size()
308 return 8192 / tile->width; in setup_tile_size()
310 return 128 * I965_FENCE_MAX_PITCH_VAL / tile->width; in setup_tile_size()
312 return 128 * GEN7_FENCE_MAX_PITCH_VAL / tile->width; in setup_tile_size()
317 const unsigned int nreal = 1 << 12; /* largest tile row x2 */ in igt_partial_tiling()
352 struct tile tile; in igt_partial_tiling() local
354 tile.height = 1; in igt_partial_tiling()
355 tile.width = 1; in igt_partial_tiling()
356 tile.size = 0; in igt_partial_tiling()
357 tile.stride = 0; in igt_partial_tiling()
358 tile.swizzle = I915_BIT_6_SWIZZLE_NONE; in igt_partial_tiling()
359 tile.tiling = I915_TILING_NONE; in igt_partial_tiling()
361 err = check_partial_mappings(obj, &tile, end); in igt_partial_tiling()
370 struct tile tile; in igt_partial_tiling() local
380 tile.tiling = tiling; in igt_partial_tiling()
383 tile.swizzle = to_gt(i915)->ggtt->bit_6_swizzle_x; in igt_partial_tiling()
386 tile.swizzle = to_gt(i915)->ggtt->bit_6_swizzle_y; in igt_partial_tiling()
390 GEM_BUG_ON(tile.swizzle == I915_BIT_6_SWIZZLE_UNKNOWN); in igt_partial_tiling()
391 if (tile.swizzle == I915_BIT_6_SWIZZLE_9_17 || in igt_partial_tiling()
392 tile.swizzle == I915_BIT_6_SWIZZLE_9_10_17) in igt_partial_tiling()
395 max_pitch = setup_tile_size(&tile, i915); in igt_partial_tiling()
398 tile.stride = tile.width * pitch; in igt_partial_tiling()
399 err = check_partial_mappings(obj, &tile, end); in igt_partial_tiling()
406 tile.stride = tile.width * (pitch - 1); in igt_partial_tiling()
407 err = check_partial_mappings(obj, &tile, end); in igt_partial_tiling()
415 tile.stride = tile.width * (pitch + 1); in igt_partial_tiling()
416 err = check_partial_mappings(obj, &tile, end); in igt_partial_tiling()
426 tile.stride = tile.width * pitch; in igt_partial_tiling()
427 err = check_partial_mappings(obj, &tile, end); in igt_partial_tiling()
448 const unsigned int nreal = 1 << 12; /* largest tile row x2 */ in igt_smoke_tiling()
489 struct tile tile; in igt_smoke_tiling() local
491 tile.tiling = in igt_smoke_tiling()
493 switch (tile.tiling) { in igt_smoke_tiling()
495 tile.height = 1; in igt_smoke_tiling()
496 tile.width = 1; in igt_smoke_tiling()
497 tile.size = 0; in igt_smoke_tiling()
498 tile.stride = 0; in igt_smoke_tiling()
499 tile.swizzle = I915_BIT_6_SWIZZLE_NONE; in igt_smoke_tiling()
503 tile.swizzle = to_gt(i915)->ggtt->bit_6_swizzle_x; in igt_smoke_tiling()
506 tile.swizzle = to_gt(i915)->ggtt->bit_6_swizzle_y; in igt_smoke_tiling()
510 if (tile.swizzle == I915_BIT_6_SWIZZLE_9_17 || in igt_smoke_tiling()
511 tile.swizzle == I915_BIT_6_SWIZZLE_9_10_17) in igt_smoke_tiling()
514 if (tile.tiling != I915_TILING_NONE) { in igt_smoke_tiling()
515 unsigned int max_pitch = setup_tile_size(&tile, i915); in igt_smoke_tiling()
517 tile.stride = in igt_smoke_tiling()
519 tile.stride = (1 + tile.stride) * tile.width; in igt_smoke_tiling()
521 tile.stride = rounddown_pow_of_two(tile.stride); in igt_smoke_tiling()
524 err = check_partial_mapping(obj, &tile, &prng); in igt_smoke_tiling()