From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: rodrigo.vivi@intel.com, Luca Coelho <luciano.coelho@intel.com>,
jani.nikula@intel.com
Subject: [PATCH v4 3/9] drm/i915: add generic __to_intel_display()
Date: Wed, 17 Apr 2024 16:02:41 +0300 [thread overview]
Message-ID: <a999ff8183659a4df68d439ebd31c19b5c56852a.1713358679.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1713358679.git.jani.nikula@intel.com>
Add generic __to_intel_display() macro that accepts either struct
drm_i915_private * or struct intel_display *. This is to be used for
transitional stuff that eventually needs to be converted to use struct
intel_display *, and therefore is not part of to_intel_display().
Add new intel_display_conversion.h to host the helper to avoid
duplication between xe and i915 drivers.
v2: put it in the new header (Rodrigo)
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> # v1
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
.../i915/display/intel_display_conversion.h | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 drivers/gpu/drm/i915/display/intel_display_conversion.h
diff --git a/drivers/gpu/drm/i915/display/intel_display_conversion.h b/drivers/gpu/drm/i915/display/intel_display_conversion.h
new file mode 100644
index 000000000000..ad8545c8055d
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/intel_display_conversion.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: MIT */
+/* Copyright © 2024 Intel Corporation */
+
+/*
+ * This header is for transitional struct intel_display conversion helpers only.
+ */
+
+#ifndef __INTEL_DISPLAY_CONVERSION__
+#define __INTEL_DISPLAY_CONVERSION__
+
+/*
+ * Transitional macro to optionally convert struct drm_i915_private * to struct
+ * intel_display *, also accepting the latter.
+ */
+#define __to_intel_display(p) \
+ _Generic(p, \
+ const struct drm_i915_private *: (&((const struct drm_i915_private *)(p))->display), \
+ struct drm_i915_private *: (&((struct drm_i915_private *)(p))->display), \
+ const struct intel_display *: (p), \
+ struct intel_display *: (p))
+
+#endif /* __INTEL_DISPLAY_CONVERSION__ */
--
2.39.2
next prev parent reply other threads:[~2024-04-17 13:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 13:02 [PATCH v4 0/9] drm/i915: better high level abstraction for display Jani Nikula
2024-04-17 13:02 ` [PATCH v4 1/9] drm/i915/display: add intel_display -> drm_device backpointer Jani Nikula
2024-04-17 13:02 ` [PATCH v4 2/9] drm/i915/display: add generic to_intel_display() macro Jani Nikula
2024-04-17 13:02 ` Jani Nikula [this message]
2024-04-17 13:02 ` [PATCH v4 4/9] drm/i915/display: accept either i915 or display for feature tests Jani Nikula
2024-04-17 13:58 ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 5/9] drm/i915/quirks: convert struct drm_i915_private to struct intel_display Jani Nikula
2024-04-17 13:02 ` [PATCH v4 6/9] drm/i915/display: rename __intel_wait_for_register_nowl() to indicate intel_de_ Jani Nikula
2024-04-17 13:59 ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 7/9] drm/i915/dmc: convert dmc wakelock interface to struct intel_display Jani Nikula
2024-04-17 14:31 ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 8/9] drm/i915/de: allow intel_display and drm_i915_private for de functions Jani Nikula
2024-04-17 14:00 ` Rodrigo Vivi
2024-04-17 13:02 ` [PATCH v4 9/9] drm/i915/dmc: use struct intel_display more Jani Nikula
2024-04-17 14:31 ` Rodrigo Vivi
2024-04-18 18:21 ` Jani Nikula
2024-04-17 14:25 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: better high level abstraction for display (rev3) Patchwork
2024-04-17 14:25 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-04-17 14:38 ` ✓ Fi.CI.BAT: success " Patchwork
2024-04-18 11:25 ` ✗ Fi.CI.IGT: failure " Patchwork
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=a999ff8183659a4df68d439ebd31c19b5c56852a.1713358679.git.jani.nikula@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=luciano.coelho@intel.com \
--cc=rodrigo.vivi@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox