[Intel-xe] [PATCH 8/9] drm/i915/fbc: Add function to get number of fences for gt
Jouni Högander
jouni.hogander at intel.com
Tue May 30 10:34:19 UTC 2023
Add new function to get number of fences for gt. This allows removing
couple of ifdefs.
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 4 +---
drivers/gpu/drm/i915/gt/intel_gt_types.h | 2 ++
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h | 3 +++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 109f86bb19ef..2cb537504c2f 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -607,10 +607,8 @@ static void ivb_fbc_activate(struct intel_fbc *fbc)
else if (DISPLAY_VER(i915) == 9)
skl_fbc_program_cfb_stride(fbc);
-#ifdef I915
- if (to_gt(i915)->ggtt->num_fences)
+ if (intel_gt_fence_count(to_gt(i915)))
snb_fbc_program_fence(fbc);
-#endif
intel_de_write(i915, ILK_DPFC_CONTROL(fbc->id),
DPFC_CTL_EN | ivb_dpfc_ctl(fbc));
diff --git a/drivers/gpu/drm/i915/gt/intel_gt_types.h b/drivers/gpu/drm/i915/gt/intel_gt_types.h
index f08c2556aa25..76bc88d974b2 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_types.h
+++ b/drivers/gpu/drm/i915/gt/intel_gt_types.h
@@ -306,4 +306,6 @@ enum intel_gt_scratch_field {
INTEL_GT_SCRATCH_FIELD_COHERENTL3_WA = 256,
};
+#define intel_gt_fence_count(gt) gt->ggtt->num_fences
+
#endif /* __INTEL_GT_TYPES_H__ */
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
index 0ccc97fb9e90..89ff4e984e6b 100644
--- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
+++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
@@ -19,9 +19,12 @@
#include "i915_reg_defs.h"
#include "intel_pch.h"
#include "i915_utils.h"
+#include "intel_gt_types.h"
#include "intel_uncore.h"
#include <linux/pm_runtime.h>
+#define intel_gt_fence_count(gt) 0
+
static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
{
return container_of(dev, struct drm_i915_private, drm);
--
2.34.1
More information about the Intel-xe
mailing list