2021-01-22 19:29:04 +00:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
2016-11-11 10:43:54 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2016 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
2020-03-16 11:38:43 +00:00
|
|
|
#ifndef __INTEL_GGTT_FENCING_H__
|
|
|
|
#define __INTEL_GGTT_FENCING_H__
|
2016-11-11 10:43:54 +00:00
|
|
|
|
|
|
|
#include <linux/list.h>
|
2019-06-13 07:32:54 +00:00
|
|
|
#include <linux/types.h>
|
2016-11-11 10:43:54 +00:00
|
|
|
|
2020-04-01 21:01:02 +00:00
|
|
|
#include "i915_active.h"
|
|
|
|
|
2019-06-13 07:32:54 +00:00
|
|
|
struct drm_i915_gem_object;
|
|
|
|
struct i915_ggtt;
|
2016-11-11 10:43:54 +00:00
|
|
|
struct i915_vma;
|
2019-06-21 07:07:45 +00:00
|
|
|
struct intel_gt;
|
2019-06-13 07:32:54 +00:00
|
|
|
struct sg_table;
|
2016-11-11 10:43:54 +00:00
|
|
|
|
2017-01-10 14:47:34 +00:00
|
|
|
#define I965_FENCE_PAGE 4096UL
|
|
|
|
|
2019-06-13 07:32:54 +00:00
|
|
|
struct i915_fence_reg {
|
2016-11-11 10:43:54 +00:00
|
|
|
struct list_head link;
|
2019-10-16 14:32:33 +00:00
|
|
|
struct i915_ggtt *ggtt;
|
2016-11-11 10:43:54 +00:00
|
|
|
struct i915_vma *vma;
|
2019-08-22 06:09:12 +00:00
|
|
|
atomic_t pin_count;
|
2020-04-01 21:01:02 +00:00
|
|
|
struct i915_active active;
|
2016-11-11 10:43:54 +00:00
|
|
|
int id;
|
|
|
|
/**
|
|
|
|
* Whether the tiling parameters for the currently
|
|
|
|
* associated fence register have changed. Note that
|
|
|
|
* for the purposes of tracking tiling changes we also
|
|
|
|
* treat the unfenced register, the register slot that
|
|
|
|
* the object occupies whilst it executes a fenced
|
|
|
|
* command (such as BLT on gen2/3), as a "fence".
|
|
|
|
*/
|
|
|
|
bool dirty;
|
2020-04-01 21:01:03 +00:00
|
|
|
u32 start;
|
|
|
|
u32 size;
|
|
|
|
u32 tiling;
|
|
|
|
u32 stride;
|
2016-11-11 10:43:54 +00:00
|
|
|
};
|
|
|
|
|
2019-10-16 14:32:33 +00:00
|
|
|
struct i915_fence_reg *i915_reserve_fence(struct i915_ggtt *ggtt);
|
2019-06-13 07:32:54 +00:00
|
|
|
void i915_unreserve_fence(struct i915_fence_reg *fence);
|
|
|
|
|
2020-03-16 11:38:43 +00:00
|
|
|
void intel_ggtt_restore_fences(struct i915_ggtt *ggtt);
|
2019-06-13 07:32:54 +00:00
|
|
|
|
|
|
|
void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
|
|
|
|
struct sg_table *pages);
|
|
|
|
void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
|
|
|
|
struct sg_table *pages);
|
|
|
|
|
2020-03-16 11:38:43 +00:00
|
|
|
void intel_ggtt_init_fences(struct i915_ggtt *ggtt);
|
2020-03-16 11:38:46 +00:00
|
|
|
void intel_ggtt_fini_fences(struct i915_ggtt *ggtt);
|
2019-06-13 07:32:54 +00:00
|
|
|
|
2019-06-21 07:07:45 +00:00
|
|
|
void intel_gt_init_swizzling(struct intel_gt *gt);
|
|
|
|
|
2016-11-11 10:43:54 +00:00
|
|
|
#endif
|