public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, lucas.demarchi@intel.com, rodrigo.vivi@intel.com
Subject: [Intel-gfx] [PATCH v3 3/6] drm/i915/opregion: Add dgfx opregion func
Date: Sun, 20 Feb 2022 22:07:27 +0530	[thread overview]
Message-ID: <20220220163730.5021-4-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20220220163730.5021-1-anshuman.gupta@intel.com>

Adding DGFX opregion dummy functions.
These will be setup later to support dgfx opregion.

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_opregion.c | 34 +++++++++++++++++--
 1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c
index 94eb7c23fcb4..eca2d3a4f72b 100644
--- a/drivers/gpu/drm/i915/display/intel_opregion.c
+++ b/drivers/gpu/drm/i915/display/intel_opregion.c
@@ -1312,16 +1312,46 @@ static const struct i915_opregion_func igfx_opregion_func = {
 	.free_opregion = intel_igfx_free_opregion,
 };
 
+static void *intel_dgfx_alloc_opregion(struct drm_i915_private *i915)
+{
+	return ERR_PTR(-EOPNOTSUPP);
+}
+
+static void *intel_dgfx_alloc_rvda(struct drm_i915_private *i915)
+{
+	return ERR_PTR(-EOPNOTSUPP);
+}
+
+static void intel_dgfx_free_rvda(struct drm_i915_private *i915)
+{
+}
+
+static void intel_dgfx_free_opregion(struct drm_i915_private *i915)
+{
+}
+
+static const struct i915_opregion_func dgfx_opregion_func = {
+	.alloc_opregion = intel_dgfx_alloc_opregion,
+	.alloc_rvda = intel_dgfx_alloc_rvda,
+	.free_rvda = intel_dgfx_free_rvda,
+	.free_opregion = intel_dgfx_free_opregion,
+};
+
 /**
  * intel_opregion_init() - Init ACPI opregion.
  * @i915 i915 device priv data.
- * opregion init wrapper function, which encapsulate intel_opregion_setup.
+ * opregion init wrapper function.
+ * It initialize the dgfx/igfx opregion function pointers,
+ * and encapsulate intel_opregion_setup.
  */
 int intel_opregion_init(struct drm_i915_private *i915)
 {
 	struct intel_opregion *opregion = &i915->opregion;
 
-	opregion->opregion_func = &igfx_opregion_func;
+	if (IS_DGFX(i915))
+		opregion->opregion_func = &dgfx_opregion_func;
+	else
+		opregion->opregion_func = &igfx_opregion_func;
 
 	return intel_opregion_setup(i915);
 }
-- 
2.26.2


  parent reply	other threads:[~2022-02-20 16:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-20 16:37 [Intel-gfx] [PATCH v3 0/6] DGFX OpRegion Anshuman Gupta
2022-02-20 16:37 ` [Intel-gfx] [PATCH v3 1/6] drm/i915/opregion: Add intel_opregion_init() wrapper Anshuman Gupta
2022-02-20 16:37 ` [Intel-gfx] [PATCH v3 2/6] drm/i915/opregion: Abstract opregion function Anshuman Gupta
2022-03-16  9:25   ` Jani Nikula
2022-04-01 13:26     ` Anshuman Gupta
2022-03-16  9:26   ` Jani Nikula
2022-02-20 16:37 ` Anshuman Gupta [this message]
2022-02-20 16:37 ` [Intel-gfx] [PATCH v3 4/6] drm/i915/opregion: Cond dgfx opregion func registration Anshuman Gupta
2022-03-16  9:30   ` Jani Nikula
2022-02-20 16:37 ` [Intel-gfx] [PATCH v3 5/6] drm/i915/dgfx: OPROM OpRegion Setup Anshuman Gupta
2022-02-20 16:37 ` [Intel-gfx] [PATCH v3 6/6] drm/i915/dgfx: Get VBT from rvda Anshuman Gupta
2022-02-20 17:00 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for DGFX OpRegion (rev3) Patchwork
2022-02-20 17:01 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-20 17:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-20 18:49 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20220220163730.5021-4-anshuman.gupta@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=lucas.demarchi@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