Commit fce43315 authored by Jani Nikula's avatar Jani Nikula

drm/i915/uc: add dev_priv parameter to intel_uc_is_using_* functions

Reveals the build fail fixed in the last hunk. Also prep work.

v2: name it i915 instead of dev_priv (Michal)
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8e02dcf1b85462d17e96fb183440dd90261b7411.1545920737.git.jani.nikula@intel.com
parent 16cabb12
...@@ -2489,9 +2489,9 @@ intel_info(const struct drm_i915_private *dev_priv) ...@@ -2489,9 +2489,9 @@ intel_info(const struct drm_i915_private *dev_priv)
#define HAS_HUC_UCODE(dev_priv) (HAS_GUC(dev_priv)) #define HAS_HUC_UCODE(dev_priv) (HAS_GUC(dev_priv))
/* Having a GuC is not the same as using a GuC */ /* Having a GuC is not the same as using a GuC */
#define USES_GUC(dev_priv) intel_uc_is_using_guc() #define USES_GUC(dev_priv) intel_uc_is_using_guc(dev_priv)
#define USES_GUC_SUBMISSION(dev_priv) intel_uc_is_using_guc_submission() #define USES_GUC_SUBMISSION(dev_priv) intel_uc_is_using_guc_submission(dev_priv)
#define USES_HUC(dev_priv) intel_uc_is_using_huc() #define USES_HUC(dev_priv) intel_uc_is_using_huc(dev_priv)
#define HAS_POOLED_EU(dev_priv) ((dev_priv)->info.has_pooled_eu) #define HAS_POOLED_EU(dev_priv) ((dev_priv)->info.has_pooled_eu)
......
...@@ -71,7 +71,7 @@ static int __get_default_guc_log_level(struct drm_i915_private *i915) ...@@ -71,7 +71,7 @@ static int __get_default_guc_log_level(struct drm_i915_private *i915)
{ {
int guc_log_level; int guc_log_level;
if (!HAS_GUC(i915) || !intel_uc_is_using_guc()) if (!HAS_GUC(i915) || !intel_uc_is_using_guc(i915))
guc_log_level = GUC_LOG_LEVEL_DISABLED; guc_log_level = GUC_LOG_LEVEL_DISABLED;
else if (IS_ENABLED(CONFIG_DRM_I915_DEBUG) || else if (IS_ENABLED(CONFIG_DRM_I915_DEBUG) ||
IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)) IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
...@@ -112,11 +112,11 @@ static void sanitize_options_early(struct drm_i915_private *i915) ...@@ -112,11 +112,11 @@ static void sanitize_options_early(struct drm_i915_private *i915)
DRM_DEBUG_DRIVER("enable_guc=%d (submission:%s huc:%s)\n", DRM_DEBUG_DRIVER("enable_guc=%d (submission:%s huc:%s)\n",
i915_modparams.enable_guc, i915_modparams.enable_guc,
yesno(intel_uc_is_using_guc_submission()), yesno(intel_uc_is_using_guc_submission(i915)),
yesno(intel_uc_is_using_huc())); yesno(intel_uc_is_using_huc(i915)));
/* Verify GuC firmware availability */ /* Verify GuC firmware availability */
if (intel_uc_is_using_guc() && !intel_uc_fw_is_selected(guc_fw)) { if (intel_uc_is_using_guc(i915) && !intel_uc_fw_is_selected(guc_fw)) {
DRM_WARN("Incompatible option detected: %s=%d, %s!\n", DRM_WARN("Incompatible option detected: %s=%d, %s!\n",
"enable_guc", i915_modparams.enable_guc, "enable_guc", i915_modparams.enable_guc,
!HAS_GUC(i915) ? "no GuC hardware" : !HAS_GUC(i915) ? "no GuC hardware" :
...@@ -124,7 +124,7 @@ static void sanitize_options_early(struct drm_i915_private *i915) ...@@ -124,7 +124,7 @@ static void sanitize_options_early(struct drm_i915_private *i915)
} }
/* Verify HuC firmware availability */ /* Verify HuC firmware availability */
if (intel_uc_is_using_huc() && !intel_uc_fw_is_selected(huc_fw)) { if (intel_uc_is_using_huc(i915) && !intel_uc_fw_is_selected(huc_fw)) {
DRM_WARN("Incompatible option detected: %s=%d, %s!\n", DRM_WARN("Incompatible option detected: %s=%d, %s!\n",
"enable_guc", i915_modparams.enable_guc, "enable_guc", i915_modparams.enable_guc,
!HAS_HUC(i915) ? "no HuC hardware" : !HAS_HUC(i915) ? "no HuC hardware" :
...@@ -136,7 +136,7 @@ static void sanitize_options_early(struct drm_i915_private *i915) ...@@ -136,7 +136,7 @@ static void sanitize_options_early(struct drm_i915_private *i915)
i915_modparams.guc_log_level = i915_modparams.guc_log_level =
__get_default_guc_log_level(i915); __get_default_guc_log_level(i915);
if (i915_modparams.guc_log_level > 0 && !intel_uc_is_using_guc()) { if (i915_modparams.guc_log_level > 0 && !intel_uc_is_using_guc(i915)) {
DRM_WARN("Incompatible option detected: %s=%d, %s!\n", DRM_WARN("Incompatible option detected: %s=%d, %s!\n",
"guc_log_level", i915_modparams.guc_log_level, "guc_log_level", i915_modparams.guc_log_level,
!HAS_GUC(i915) ? "no GuC hardware" : !HAS_GUC(i915) ? "no GuC hardware" :
......
...@@ -41,19 +41,19 @@ void intel_uc_fini(struct drm_i915_private *dev_priv); ...@@ -41,19 +41,19 @@ void intel_uc_fini(struct drm_i915_private *dev_priv);
int intel_uc_suspend(struct drm_i915_private *dev_priv); int intel_uc_suspend(struct drm_i915_private *dev_priv);
int intel_uc_resume(struct drm_i915_private *dev_priv); int intel_uc_resume(struct drm_i915_private *dev_priv);
static inline bool intel_uc_is_using_guc(void) static inline bool intel_uc_is_using_guc(struct drm_i915_private *i915)
{ {
GEM_BUG_ON(i915_modparams.enable_guc < 0); GEM_BUG_ON(i915_modparams.enable_guc < 0);
return i915_modparams.enable_guc > 0; return i915_modparams.enable_guc > 0;
} }
static inline bool intel_uc_is_using_guc_submission(void) static inline bool intel_uc_is_using_guc_submission(struct drm_i915_private *i915)
{ {
GEM_BUG_ON(i915_modparams.enable_guc < 0); GEM_BUG_ON(i915_modparams.enable_guc < 0);
return i915_modparams.enable_guc & ENABLE_GUC_SUBMISSION; return i915_modparams.enable_guc & ENABLE_GUC_SUBMISSION;
} }
static inline bool intel_uc_is_using_huc(void) static inline bool intel_uc_is_using_huc(struct drm_i915_private *i915)
{ {
GEM_BUG_ON(i915_modparams.enable_guc < 0); GEM_BUG_ON(i915_modparams.enable_guc < 0);
return i915_modparams.enable_guc & ENABLE_GUC_LOAD_HUC; return i915_modparams.enable_guc & ENABLE_GUC_LOAD_HUC;
......
...@@ -163,7 +163,7 @@ int intel_wopcm_init(struct intel_wopcm *wopcm) ...@@ -163,7 +163,7 @@ int intel_wopcm_init(struct intel_wopcm *wopcm)
u32 guc_wopcm_rsvd; u32 guc_wopcm_rsvd;
int err; int err;
if (!USES_GUC(dev_priv)) if (!USES_GUC(i915))
return 0; return 0;
GEM_BUG_ON(!wopcm->size); GEM_BUG_ON(!wopcm->size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment