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

Commit f1e6b336 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Chris Wilson
Browse files

drm/i915/uc: Use GuC firmware status helper



We already have helper function for checking GuC firmware
load status. Replace existing open-coded checks.

v2: drop redundant USES_GUC check

Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190522193203.23932-7-michal.wajdeczko@intel.com
parent 89195bab
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ void intel_uc_runtime_suspend(struct drm_i915_private *i915)
	struct intel_guc *guc = &i915->guc;
	int err;

	if (guc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
	if (!intel_guc_is_loaded(guc))
		return;

	err = intel_guc_suspend(guc);
@@ -509,7 +509,7 @@ void intel_uc_suspend(struct drm_i915_private *i915)
	struct intel_guc *guc = &i915->guc;
	intel_wakeref_t wakeref;

	if (guc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
	if (!intel_guc_is_loaded(guc))
		return;

	with_intel_runtime_pm(i915, wakeref)
@@ -521,10 +521,7 @@ int intel_uc_resume(struct drm_i915_private *i915)
	struct intel_guc *guc = &i915->guc;
	int err;

	if (!USES_GUC(i915))
		return 0;

	if (guc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
	if (!intel_guc_is_loaded(guc))
		return 0;

	guc_enable_communication(guc);