Intel-GFX Archive on lore.kernel.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
Subject: [Intel-gfx] [PATCH 4/4] drm/i915/dgfx: Get VBT from rvda
Date: Sun,  6 Feb 2022 20:13:11 +0530	[thread overview]
Message-ID: <20220206144311.5053-5-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20220206144311.5053-1-anshuman.gupta@intel.com>

Since OpRegion ver 2.1 MBOX3 RVDA field is Relative address of Raw
VBT data from OpRegion Base.
Populate the opreion->rvda accordingly.
As Intel DGFX cards supports OpRegion version 2.2 or greater,
RVDA as an absolute VBT physical address (Ver 2.0) doesn't applicable
to DGFX cards.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Badal Nilawar <badal.nilawar@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_opregion.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c
index 5554b107900c..ea8b6ff41151 100644
--- a/drivers/gpu/drm/i915/display/intel_opregion.c
+++ b/drivers/gpu/drm/i915/display/intel_opregion.c
@@ -1558,11 +1558,28 @@ static void *intel_dgfx_alloc_opregion(struct drm_i915_private *i915)
 
 static void *intel_dgfx_alloc_rvda(struct drm_i915_private *i915)
 {
-	return ERR_PTR(-EOPNOTSUPP);
+	struct intel_opregion *opregion = &i915->opregion;
+	void *opreg_rvda;
+
+	if (!opregion->dgfx_oprom_opreg)
+		return ERR_PTR(-EINVAL);
+
+	opreg_rvda = kzalloc(opregion->asle->rvds, GFP_KERNEL);
+	memcpy(opreg_rvda, opregion->dgfx_oprom_opreg + opregion->asle->rvda, opregion->asle->rvds);
+
+	/* We got RVDA, OPROM opregion + vbt image not nedded anymore */
+	kfree(opregion->dgfx_oprom_opreg);
+	opregion->dgfx_oprom_opreg = NULL;
+
+	return opreg_rvda;
 }
 
 static void intel_dgfx_free_rvda(struct drm_i915_private *i915)
 {
+	struct intel_opregion *opregion = &i915->opregion;
+
+	kfree(opregion->rvda);
+	opregion->rvda = NULL;
 }
 
 static void intel_dgfx_free_opregion(struct drm_i915_private *i915)
-- 
2.26.2


  parent reply	other threads:[~2022-02-06 14:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06 14:43 [Intel-gfx] [PATCH 0/4] DGFX OpRegion Anshuman Gupta
2022-02-06 14:43 ` [Intel-gfx] [PATCH 1/4] drm/i915/opregion: Abstract opregion function Anshuman Gupta
2022-02-07 10:59   ` Jani Nikula
2022-02-06 14:43 ` [Intel-gfx] [PATCH 2/4] drm/i915/opregion: Register opreg func only for disp parts Anshuman Gupta
2022-02-07 11:02   ` Jani Nikula
2022-02-06 14:43 ` [Intel-gfx] [PATCH 3/4] drm/i915/dgfx: OPROM OpRegion Setup Anshuman Gupta
2022-02-06 14:43 ` Anshuman Gupta [this message]
2022-02-06 15:14 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for DGFX OpRegion Patchwork
2022-02-06 15:15 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-06 15:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-06 17:05 ` [Intel-gfx] ✗ 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=20220206144311.5053-5-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 \
    /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