intel_ggtt_fencing.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* SPDX-License-Identifier: MIT */
  2. /*
  3. * Copyright © 2016 Intel Corporation
  4. */
  5. #ifndef __INTEL_GGTT_FENCING_H__
  6. #define __INTEL_GGTT_FENCING_H__
  7. #include <linux/list.h>
  8. #include <linux/types.h>
  9. #include "i915_active.h"
  10. struct drm_i915_gem_object;
  11. struct i915_ggtt;
  12. struct i915_vma;
  13. struct intel_gt;
  14. struct sg_table;
  15. #define I965_FENCE_PAGE 4096UL
  16. struct i915_fence_reg {
  17. struct list_head link;
  18. struct i915_ggtt *ggtt;
  19. struct i915_vma *vma;
  20. atomic_t pin_count;
  21. struct i915_active active;
  22. int id;
  23. /**
  24. * Whether the tiling parameters for the currently
  25. * associated fence register have changed. Note that
  26. * for the purposes of tracking tiling changes we also
  27. * treat the unfenced register, the register slot that
  28. * the object occupies whilst it executes a fenced
  29. * command (such as BLT on gen2/3), as a "fence".
  30. */
  31. bool dirty;
  32. u32 start;
  33. u32 size;
  34. u32 tiling;
  35. u32 stride;
  36. };
  37. struct i915_fence_reg *i915_reserve_fence(struct i915_ggtt *ggtt);
  38. void i915_unreserve_fence(struct i915_fence_reg *fence);
  39. void intel_ggtt_restore_fences(struct i915_ggtt *ggtt);
  40. void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
  41. struct sg_table *pages);
  42. void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
  43. struct sg_table *pages);
  44. void intel_ggtt_init_fences(struct i915_ggtt *ggtt);
  45. void intel_ggtt_fini_fences(struct i915_ggtt *ggtt);
  46. void intel_gt_init_swizzling(struct intel_gt *gt);
  47. #endif