All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: [Intel-xe] [PATCH v2 8/9] drm/i915/fbc: Add function to get number of fences for gt
Date: Tue, 30 May 2023 13:47:12 +0300	[thread overview]
Message-ID: <20230530104713.2570554-9-jouni.hogander@intel.com> (raw)
In-Reply-To: <20230530104713.2570554-1-jouni.hogander@intel.com>

Add new function to get number of fences for gt. This allows removing
couple of ifdefs.

Signed-off-by: Jouni Högander <jouni.hogander@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 +++
 .../gpu/drm/xe/compat-i915-headers/intel_gt_types.h   | 11 +++++++++++
 4 files changed, 17 insertions(+), 3 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_gt_types.h

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);
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/intel_gt_types.h b/drivers/gpu/drm/xe/compat-i915-headers/intel_gt_types.h
new file mode 100644
index 000000000000..183f5c3a1bd1
--- /dev/null
+++ b/drivers/gpu/drm/xe/compat-i915-headers/intel_gt_types.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef __INTEL_GT_TYPES__
+#define __INTEL_GT_TYPES__
+
+#define intel_gt_fence_count(gt) 0
+
+#endif
-- 
2.34.1


  parent reply	other threads:[~2023-05-30 10:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 10:47 [Intel-xe] [PATCH v2 0/9] Clean-up Xe FBC additions Jouni Högander
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 1/9] fixup! drm/i915/display: Implement FBC support Jouni Högander
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 2/9] drivers/xe: Add new type for compressed fb Jouni Högander
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 3/9] drm/i915/fbc: Add common type for compressed fb to avoid ifdefs Jouni Högander
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 4/9] drm/xe: Add i915_gem.h compatibility header Jouni Högander
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 5/9] drivers/xe: Move Xe stolen memory handling away form fbc code Jouni Högander
2023-05-30 14:13   ` Maarten Lankhorst
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 6/9] drm/i915: Move stolen memory handling into i915_gem_stolen Jouni Högander
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 7/9] drm/i915/fbc: Stolen initialize can be checked in plane check for i915 as well Jouni Högander
2023-05-30 10:47 ` Jouni Högander [this message]
2023-05-30 10:47 ` [Intel-xe] [PATCH v2 9/9] Add new fence_id and fence count functions Jouni Högander
2023-05-30 14:01   ` Maarten Lankhorst
2023-05-30 10:49 ` [Intel-xe] ✓ CI.Patch_applied: success for Clean-up Xe FBC additions (rev2) Patchwork
2023-05-30 10:51 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-05-30 10:55 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-05-30 11:23 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-05-30 12:52 ` [Intel-xe] [PATCH v2 0/9] Clean-up Xe FBC additions Jani Nikula
2023-05-30 13:57   ` Hogander, Jouni
2023-05-31 11:27     ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230530104713.2570554-9-jouni.hogander@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.