1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2016 Intel Corporation
6 #ifndef __INTEL_GGTT_FENCING_H__
7 #define __INTEL_GGTT_FENCING_H__
9 #include <linux/list.h>
10 #include <linux/types.h>
12 #include "i915_active.h"
14 struct drm_i915_gem_object;
20 #define I965_FENCE_PAGE 4096UL
22 struct i915_fence_reg {
23 struct list_head link;
24 struct i915_ggtt *ggtt;
27 struct i915_active active;
30 * Whether the tiling parameters for the currently
31 * associated fence register have changed. Note that
32 * for the purposes of tracking tiling changes we also
33 * treat the unfenced register, the register slot that
34 * the object occupies whilst it executes a fenced
35 * command (such as BLT on gen2/3), as a "fence".
44 struct i915_fence_reg *i915_reserve_fence(struct i915_ggtt *ggtt);
45 void i915_unreserve_fence(struct i915_fence_reg *fence);
47 void intel_ggtt_restore_fences(struct i915_ggtt *ggtt);
49 void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
50 struct sg_table *pages);
51 void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
52 struct sg_table *pages);
54 void intel_ggtt_init_fences(struct i915_ggtt *ggtt);
55 void intel_ggtt_fini_fences(struct i915_ggtt *ggtt);
57 void intel_gt_init_swizzling(struct intel_gt *gt);