Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e53f472 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915/opregion: bail out early for systems with no opregion VBT

parent 2f075565
Loading
Loading
Loading
Loading
+32 −32
Original line number Diff line number Diff line
@@ -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,9 +974,8 @@ 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 (dmi_check_system(intel_no_opregion_vbt))
		goto out;

	if (opregion->header->opregion_ver >= 2 && opregion->asle &&
	    opregion->asle->rvda && opregion->asle->rvds) {
@@ -992,13 +993,12 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
	} 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).
		 * 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;
@@ -1009,8 +1009,8 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
			opregion->vbt_size = vbt_size;
		}
	}
	}

out:
	return 0;

err_out: