Skip to contentSkip to conversation

Fix compatibility issue for intel_dmc

PATCH Superseded Chaitanya Kumar Borah 3 participants 9 messages Oct 11, 2023

Subsystems (4)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover Fix compatibility issue for intel_dmc

This series reverts hacky #ifdefs from intel_dmc

Chaitanya Kumar Borah (6):
Revert "FIXME: drm/i915/dmc: xe way of getting at stepping" drm/i915: Add wrapper for getting display step fixup! drm/xe/display: Implement display support drm/xe: Add intel_step.h compatibility header drm/xe: Add i915_gpu_error.h compatibility header drm/xe: Add intel_uc_fw.h compatibility header

 drivers/gpu/drm/i915/display/intel_dmc.c      | 19 ++----------------
 drivers/gpu/drm/i915/intel_step.c             |  5 +++++
 drivers/gpu/drm/i915/intel_step.h             |  1 +
 .../gpu/drm/xe/compat-i915-headers/i915_drv.h |  4 +++-
 .../xe/compat-i915-headers/i915_gpu_error.h   | 18 +++++++++++++++++
 .../drm/xe/compat-i915-headers/intel_step.h   | 20 +++++++++++++++++++
 .../drm/xe/compat-i915-headers/intel_uc_fw.h  | 12 +++++++++++
 7 files changed, 61 insertions(+), 18 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_gpu_error.h
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_step.h
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/6 Revert "FIXME: drm/i915/dmc: xe way of getting at stepping"

This reverts commit a0cdbefc3aea03c1d3f30460c1d89678705d57bb.

---
 drivers/gpu/drm/i915/display/intel_dmc.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
drivers/gpu/drm/i915/display/intel_dmc.c +1 -16
index 51e0463518fb..1623c0c5e8a1 100644
@@ -30,18 +30,6 @@
 #include "intel_dmc.h"
 #include "intel_dmc_regs.h"
 
-#ifndef I915
-#include "xe_uc_fw.h"
-
-#define INTEL_UC_FIRMWARE_URL XE_UC_FIRMWARE_URL
-
-__printf(2, 3)
-static inline void
-i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
-{
-}
-#endif
-
 /**
  * DOC: DMC Firmware Support
  *
@@ -321,11 +309,8 @@ static const struct stepping_info *
 intel_get_stepping_info(struct drm_i915_private *i915,
 			struct stepping_info *si)
 {
-#ifdef I915
 	const char *step_name = intel_step_name(RUNTIME_INFO(i915)->step.display_step);
-#else
-	const char *step_name = xe_step_name(i915->info.step.display);
-#endif
+
 	si->stepping = step_name[0];
 	si->substepping = step_name[1];
 	return si;
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/6 drm/i915: Add wrapper for getting display step

In reply to Chaitanya Kumar Borah

Add a wrapper around intel_step_name that takes in driver data as an argument. This wrapper will help maintain compatibility with the proposed xe driver.

---
 drivers/gpu/drm/i915/display/intel_dmc.c | 2 +-
 drivers/gpu/drm/i915/intel_step.c        | 5 +++++
 drivers/gpu/drm/i915/intel_step.h        | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_dmc.c +1 -1
index 1623c0c5e8a1..63e080e07023 100644
@@ -309,7 +309,7 @@ static const struct stepping_info *
 intel_get_stepping_info(struct drm_i915_private *i915,
 			struct stepping_info *si)
 {
-	const char *step_name = intel_step_name(RUNTIME_INFO(i915)->step.display_step);
+	const char *step_name = intel_display_step_name(i915);
 
 	si->stepping = step_name[0];
 	si->substepping = step_name[1];
drivers/gpu/drm/i915/intel_step.c +5 -0
index ee4e5a2c0220..b4162f1be765 100644
@@ -353,3 +353,8 @@ const char *intel_step_name(enum intel_step step)
 		return "**";
 	}
 }
+
+const char *intel_display_step_name(struct drm_i915_private *i915)
+{
+	return intel_step_name(RUNTIME_INFO(i915)->step.display_step);
+}
drivers/gpu/drm/i915/intel_step.h +1 -0
index 96dfca4cba73..b6f43b624774 100644
@@ -78,5 +78,6 @@ enum intel_step {
 
 void intel_step_init(struct drm_i915_private *i915);
 const char *intel_step_name(enum intel_step step);
+const char *intel_display_step_name(struct drm_i915_private *i915);
 
 #endif /* __INTEL_STEP_H__ */
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/6 fixup! drm/xe/display: Implement display support

In reply to Chaitanya Kumar Borah

Remove redundant macro. Stepping will be handled in a separate compat header.

---
 drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h +0 -1
index 918dd27868fa..1223619f5bbf 100644
@@ -204,7 +204,6 @@ static inline void intel_runtime_pm_put(struct xe_runtime_pm *pm, bool wakeref)
 	for ((wf) = intel_runtime_pm_get(rpm); (wf); \
 	     intel_runtime_pm_put((rpm), (wf)), (wf) = 0)
 
-#define intel_step_name xe_step_name
 #define pdev_to_i915 pdev_to_xe_device
 #define DISPLAY_INFO(xe)		((xe)->info.display)
 #define RUNTIME_INFO(xe)		(&(xe)->info.i915_runtime)
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/6 drm/xe: Add intel_step.h compatibility header

In reply to Chaitanya Kumar Borah

Add compatibility header with helpers to get display step name. This is needed to maintain compatibility with intel_dmc code.

---
 .../gpu/drm/xe/compat-i915-headers/i915_drv.h |  1 +
 .../drm/xe/compat-i915-headers/intel_step.h   | 20 +++++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_step.h
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h +1 -0
index 1223619f5bbf..494409849a7d 100644
@@ -20,6 +20,7 @@
 #include "i915_reg_defs.h"
 #include "i915_utils.h"
 #include "intel_gt_types.h"
+#include "intel_step.h"
 #include "intel_uncore.h"
 #include "intel_runtime_pm.h"
 #include <linux/pm_runtime.h>
drivers/gpu/drm/xe/compat-i915-headers/intel_step.h new file +20 -0
new file mode 100644
index 000000000000..0006ef812346
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef __INTEL_STEP_H__
+#define __INTEL_STEP_H__
+
+#include "xe_device_types.h"
+#include "xe_step.h"
+
+#define intel_display_step_name xe_display_step_name
+
+static inline
+const char *xe_display_step_name(struct xe_device *xe)
+{
+	return xe_step_name(xe->info.step.display);
+}
+
+#endif /* __INTEL_STEP_H__ */
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/6 drm/xe: Add i915_gpu_error.h compatibility header

In reply to Chaitanya Kumar Borah

Add empty definitions for i915_error_printf to get rid of ifdefs from intel_dmc code

---
 .../gpu/drm/xe/compat-i915-headers/i915_drv.h  |  1 +
 .../xe/compat-i915-headers/i915_gpu_error.h    | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_gpu_error.h
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h +1 -0
index 494409849a7d..56a9de859bf9 100644
@@ -17,6 +17,7 @@
 #include "xe_step.h"
 #include "i915_gem.h"
 #include "i915_gem_stolen.h"
+#include "i915_gpu_error.h"
 #include "i915_reg_defs.h"
 #include "i915_utils.h"
 #include "intel_gt_types.h"
drivers/gpu/drm/xe/compat-i915-headers/i915_gpu_error.h new file +18 -0
new file mode 100644
index 000000000000..01c1e8d6927d
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _I915_GPU_ERROR_H_
+#define _I915_GPU_ERROR_H_
+
+struct drm_i915_error_state_buf;
+
+__printf(2, 3)
+static inline void
+i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
+{
+}
+
+#endif
+
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/6 drm/xe: Add intel_uc_fw.h compatibility header

In reply to Chaitanya Kumar Borah

Add definition for INTEL_UC_FIRMWARE_URL to maintain compatibility with intel_dmc code.

---
 drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h    |  1 +
 drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h +1 -0
index 56a9de859bf9..5cb8582c9846 100644
@@ -22,6 +22,7 @@
 #include "i915_utils.h"
 #include "intel_gt_types.h"
 #include "intel_step.h"
+#include "intel_uc_fw.h"
 #include "intel_uncore.h"
 #include "intel_runtime_pm.h"
 #include <linux/pm_runtime.h>
drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h new file +12 -0
new file mode 100644
index 000000000000..c0c8d13acd40
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+#ifndef _INTEL_UC_FW_H_
+#define _INTEL_UC_FW_H_
+
+#define INTEL_UC_FIRMWARE_URL "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915"
+
+#endif
+
Signature · 1 line
2.25.1
maintainer Acked-by on the v1 series
#7 lore raw
In reply to Chaitanya Kumar Borah
Quoted 1 line · Chaitanya Kumar Borah

This series reverts hacky #ifdefs from intel_dmc

Quoted 20 lines

Chaitanya Kumar Borah (6):
Revert "FIXME: drm/i915/dmc: xe way of getting at stepping" drm/i915: Add wrapper for getting display step fixup! drm/xe/display: Implement display support drm/xe: Add intel_step.h compatibility header drm/xe: Add i915_gpu_error.h compatibility header drm/xe: Add intel_uc_fw.h compatibility header

 drivers/gpu/drm/i915/display/intel_dmc.c      | 19 ++----------------
 drivers/gpu/drm/i915/intel_step.c             |  5 +++++
 drivers/gpu/drm/i915/intel_step.h             |  1 +
 .../gpu/drm/xe/compat-i915-headers/i915_drv.h |  4 +++-
 .../xe/compat-i915-headers/i915_gpu_error.h   | 18 +++++++++++++++++
 .../drm/xe/compat-i915-headers/intel_step.h   | 20 +++++++++++++++++++
 .../drm/xe/compat-i915-headers/intel_uc_fw.h  | 12 +++++++++++
 7 files changed, 61 insertions(+), 18 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/i915_gpu_error.h
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_step.h
 create mode 100644 drivers/gpu/drm/xe/compat-i915-headers/intel_uc_fw.h
Signature · 1 line
Jani Nikula, Intel
#8 lore raw

[Intel-xe] ✗ CI.Patch_applied: failure for Fix compatibility issue for intel_dmc

In reply to Chaitanya Kumar Borah
== Series Details ==

== Series Details ==

Series: Fix compatibility issue for intel_dmc
URL : https://patchwork.freedesktop.org/series/124969/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: ===
Base commit: 81cbfcc83 Revert "drm/i915/display: Fix a use-after-free when intel_edp_init_connector fails" === git am output follows ===
error: patch failed: drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h:204
error: drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: Revert "FIXME: drm/i915/dmc: xe way of getting at stepping"
Applying: drm/i915: Add wrapper for getting display step
Applying: fixup! drm/xe/display: Implement display support
Patch failed at 0003 fixup! drm/xe/display: Implement display support
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".