All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 1/4] drm/i915/opregion: bail out early for systems with no opregion VBT
@ 2017-03-29 10:32 Jani Nikula
  2017-03-29 10:32 ` [PATCH RESEND 2/4] drm/i915/opregion: try to validate RVDA VBT only if it's there Jani Nikula
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Jani Nikula @ 2017-03-29 10:32 UTC (permalink / raw)
  To: intel-gfx; +Cc: jani.nikula

Reduce indent. No functional changes.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_opregion.c | 64 +++++++++++++++++------------------
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 441c01466384..76a39ee6d005 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -920,6 +920,8 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
 	char buf[sizeof(OPREGION_SIGNATURE)];
 	int err = 0;
 	void *base;
+	const void *vbt = NULL;
+	u32 vbt_size = 0;
 
 	BUILD_BUG_ON(sizeof(struct opregion_header) != 0x100);
 	BUILD_BUG_ON(sizeof(struct opregion_acpi) != 0x100);
@@ -972,45 +974,43 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
 	if (mboxes & MBOX_ASLE_EXT)
 		DRM_DEBUG_DRIVER("ASLE extension supported\n");
 
-	if (!dmi_check_system(intel_no_opregion_vbt)) {
-		const void *vbt = NULL;
-		u32 vbt_size = 0;
-
-		if (opregion->header->opregion_ver >= 2 && opregion->asle &&
-		    opregion->asle->rvda && opregion->asle->rvds) {
-			opregion->rvda = memremap(opregion->asle->rvda,
-						  opregion->asle->rvds,
-						  MEMREMAP_WB);
-			vbt = opregion->rvda;
-			vbt_size = opregion->asle->rvds;
-		}
+	if (dmi_check_system(intel_no_opregion_vbt))
+		goto out;
+
+	if (opregion->header->opregion_ver >= 2 && opregion->asle &&
+	    opregion->asle->rvda && opregion->asle->rvds) {
+		opregion->rvda = memremap(opregion->asle->rvda,
+					  opregion->asle->rvds,
+					  MEMREMAP_WB);
+		vbt = opregion->rvda;
+		vbt_size = opregion->asle->rvds;
+	}
 
+	if (intel_bios_is_valid_vbt(vbt, vbt_size)) {
+		DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion (RVDA)\n");
+		opregion->vbt = vbt;
+		opregion->vbt_size = vbt_size;
+	} else {
+		vbt = base + OPREGION_VBT_OFFSET;
+		/*
+		 * The VBT specification says that if the ASLE ext mailbox is
+		 * not used its area is reserved, but on some CHT boards the VBT
+		 * extends into the ASLE ext area. Allow this even though it is
+		 * against the spec, so we do not end up rejecting the VBT on
+		 * those boards (and end up not finding the LCD panel because of
+		 * this).
+		 */
+		vbt_size = (mboxes & MBOX_ASLE_EXT) ?
+			OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE;
+		vbt_size -= OPREGION_VBT_OFFSET;
 		if (intel_bios_is_valid_vbt(vbt, vbt_size)) {
-			DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion (RVDA)\n");
+			DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion (Mailbox #4)\n");
 			opregion->vbt = vbt;
 			opregion->vbt_size = vbt_size;
-		} else {
-			vbt = base + OPREGION_VBT_OFFSET;
-			/*
-			 * The VBT specification says that if the ASLE ext
-			 * mailbox is not used its area is reserved, but
-			 * on some CHT boards the VBT extends into the
-			 * ASLE ext area. Allow this even though it is
-			 * against the spec, so we do not end up rejecting
-			 * the VBT on those boards (and end up not finding the
-			 * LCD panel because of this).
-			 */
-			vbt_size = (mboxes & MBOX_ASLE_EXT) ?
-				OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE;
-			vbt_size -= OPREGION_VBT_OFFSET;
-			if (intel_bios_is_valid_vbt(vbt, vbt_size)) {
-				DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion (Mailbox #4)\n");
-				opregion->vbt = vbt;
-				opregion->vbt_size = vbt_size;
-			}
 		}
 	}
 
+out:
 	return 0;
 
 err_out:
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-03-30 17:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 10:32 [PATCH RESEND 1/4] drm/i915/opregion: bail out early for systems with no opregion VBT Jani Nikula
2017-03-29 10:32 ` [PATCH RESEND 2/4] drm/i915/opregion: try to validate RVDA VBT only if it's there Jani Nikula
2017-03-29 17:53   ` Bob Paauwe
2017-03-29 10:32 ` [PATCH RESEND 3/4] drm/i915/opregion: debug log about invalid ACPI OpRegion VBT Jani Nikula
2017-03-29 17:54   ` Bob Paauwe
2017-03-29 10:32 ` [PATCH RESEND 4/4] drm/i915/opregion: let user specify override VBT via firmware load Jani Nikula
2017-03-29 17:57   ` Bob Paauwe
2017-03-30  6:22     ` Jani Nikula
2017-03-30 17:31       ` Bob Paauwe
2017-03-29 11:10 ` ✓ Fi.CI.BAT: success for series starting with [RESEND,1/4] drm/i915/opregion: bail out early for systems with no opregion VBT Patchwork
2017-03-29 17:51 ` [PATCH RESEND 1/4] " Bob Paauwe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.