From: Deepak M <m.deepak@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Deepak M <m.deepak@intel.com>, Jani Nikula <jani.nikula@intel.com>
Subject: [MIPI SEQ PARSING v3 06/13] drm/i915: Parsing VBT if size of VBT exceeds 6KB
Date: Tue, 1 Dec 2015 04:17:09 +0530 [thread overview]
Message-ID: <1448923632-16760-7-git-send-email-m.deepak@intel.com> (raw)
In-Reply-To: <1448923632-16760-1-git-send-email-m.deepak@intel.com>
Currently the iomap for VBT works only if the size of the
VBT is less than 6KB, but if the size of the VBT exceeds
6KB than the physical address and the size of the VBT to
be iomapped is specified in the mailbox3 and is iomapped
accordingly.
v3: -Splitted the patch into small ones
-Handeled memory unmap in intel_opregion_fini
-removed the new file created for opregion macro`s
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Deepak M <m.deepak@intel.com>
---
drivers/gpu/drm/i915/intel_opregion.c | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 7908a1d..b3a5709 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -856,6 +856,8 @@ void intel_opregion_fini(struct drm_device *dev)
}
/* just clear all opregion memory pointers now */
+ if (opregion->header->opregion_ver >= 2 && opregion->asle->rvda)
+ memunmap(opregion->vbt);
memunmap(opregion->header);
opregion->header = NULL;
opregion->acpi = NULL;
@@ -933,7 +935,8 @@ int intel_opregion_setup(struct drm_device *dev)
char buf[sizeof(OPREGION_SIGNATURE)];
const struct vbt_header *vbt = NULL;
int err = 0;
- void *base;
+ void *base, *vbt_base;
+ size_t size;
BUILD_BUG_ON(sizeof(struct opregion_header) != 0x100);
BUILD_BUG_ON(sizeof(struct opregion_acpi) != 0x100);
@@ -963,19 +966,37 @@ int intel_opregion_setup(struct drm_device *dev)
goto err_out;
}
- vbt = validate_vbt(base + OPREGION_VBT_OFFSET,
- MAILBOX_4_SIZE, "OpRegion");
+ /*
+ * Non-zero value in rvda field is an indication to driver that a
+ * valid Raw VBT is stored in that address and driver should not refer
+ * to mailbox4 for getting VBT.
+ */
+ if (opregion->header->opregion_ver >= 2 && opregion->asle->rvda) {
+ size = opregion->asle->rvds;
+ vbt_base = memremap(opregion->asle->rvda,
+ size, MEMREMAP_WB);
+ } else {
+ size = MAILBOX_4_SIZE;
+ vbt_base = base + OPREGION_VBT_OFFSET;
+ }
+
+ vbt = validate_vbt(vbt_base, size, "OpRegion");
if (vbt == NULL) {
err = -EINVAL;
goto err_out;
}
- vbt = (const struct vbt_header *)(base + OPREGION_VBT_OFFSET);
- dev_priv->opregion.vbt_size = vbt->vbt_size;
+ /* Assigning the vbt_size based on the VBT location */
+ if (opregion->header->opregion_ver >= 2 && opregion->asle->rvda)
+ dev_priv->opregion.vbt_size = opregion->asle->rvds;
+ else {
+ vbt = (const struct vbt_header *)(base + OPREGION_VBT_OFFSET);
+ dev_priv->opregion.vbt_size = vbt->vbt_size;
+ }
opregion->header = base;
- opregion->vbt = base + OPREGION_VBT_OFFSET;
+ opregion->vbt = vbt_base;
opregion->lid_state = base + ACPI_CLID;
opregion->asle_ext = base + OPREGION_ASLE_EXT_OFFSET;
--
1.9.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-30 17:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 22:47 [MIPI SEQ PARSING v3 00/13] Patches to support the version 3 of MIPI sequence in VBT Deepak M
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 01/13] drm/i915: Adding the parsing logic for the i2c element Deepak M
2015-12-11 8:40 ` Mika Kahola
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 02/13] drm/i915: Updating asle structure with new fields Deepak M
2015-12-11 8:41 ` Mika Kahola
2015-12-14 11:02 ` Jani Nikula
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 03/13] drm/i915: Add Intel opregion mailbox 5 structure Deepak M
2015-12-11 8:42 ` Mika Kahola
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 04/13] drm/i915: Do opregion VBT validation during opregion setup Deepak M
2015-12-11 8:43 ` Mika Kahola
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 05/13] drm/i915: Add debug entry to get the opregion VBT blob Deepak M
2015-12-11 8:46 ` Mika Kahola
2015-12-14 12:16 ` [PATCH] drm/i915: Parsing VBT if size of VBT exceeds 6KB Deepak M
2015-12-14 9:19 ` Chris Wilson
2015-12-14 10:56 ` Jani Nikula
2015-11-30 22:47 ` Deepak M [this message]
2015-12-11 8:51 ` [MIPI SEQ PARSING v3 06/13] " Mika Kahola
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 07/13] drm/i915: Added support the v3 mipi sequence block Deepak M
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 08/13] drm/i915: Extend gpio read/write to other cores Deepak M
2015-12-15 19:53 ` Ville Syrjälä
2015-11-30 22:47 ` [MIPI SEQ PARSING v3 09/13] drm/i915: Added the generic gpio sequence support and gpio table Deepak M
2015-12-15 20:05 ` Ville Syrjälä
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=1448923632-16760-7-git-send-email-m.deepak@intel.com \
--to=m.deepak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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;
as well as URLs for NNTP newsgroup(s).