diff mbox series

[3/3] drm/i915/csr: bypass firmware request on i915.dmc_firmware_path=""

Message ID 20180906082126.15539-3-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915/csr: keep firmware name and required version together | expand

Commit Message

Jani Nikula Sept. 6, 2018, 8:21 a.m. UTC
With i915.dmc_firmware_path="" it's obvious the intention is to disable
CSR firmware loading. Bypass the firmware request altogether in this
case, with more obvious debug logging.

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

Comments

Chris Wilson Sept. 6, 2018, 9:08 a.m. UTC | #1
Quoting Jani Nikula (2018-09-06 09:21:26)
> With i915.dmc_firmware_path="" it's obvious the intention is to disable
> CSR firmware loading. Bypass the firmware request altogether in this
> case, with more obvious debug logging.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_csr.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 956ac8bbf5e4..dbaeffddb5e7 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -476,6 +476,12 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>         }
>  
>         if (i915_modparams.dmc_firmware_path) {
> +               if (strlen(i915_modparams.dmc_firmware_path) == 0) {
> +                       csr->fw_path = NULL;
> +                       DRM_DEBUG_KMS("Disabling CSR firmare and runtime PM\n");

In response to a user parameter, could even be DRM_INFO().
-Chris
Chris Wilson Sept. 6, 2018, 9:40 a.m. UTC | #2
Quoting Chris Wilson (2018-09-06 10:08:37)
> Quoting Jani Nikula (2018-09-06 09:21:26)
> > With i915.dmc_firmware_path="" it's obvious the intention is to disable
> > CSR firmware loading. Bypass the firmware request altogether in this
> > case, with more obvious debug logging.
> > 
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_csr.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> > index 956ac8bbf5e4..dbaeffddb5e7 100644
> > --- a/drivers/gpu/drm/i915/intel_csr.c
> > +++ b/drivers/gpu/drm/i915/intel_csr.c
> > @@ -476,6 +476,12 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
> >         }
> >  
> >         if (i915_modparams.dmc_firmware_path) {
> > +               if (strlen(i915_modparams.dmc_firmware_path) == 0) {
> > +                       csr->fw_path = NULL;
> > +                       DRM_DEBUG_KMS("Disabling CSR firmare and runtime PM\n");
> 
> In response to a user parameter, could even be DRM_INFO().

Either way (but my preference here is for DRM_INFO),
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 956ac8bbf5e4..dbaeffddb5e7 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -476,6 +476,12 @@  void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
 	}
 
 	if (i915_modparams.dmc_firmware_path) {
+		if (strlen(i915_modparams.dmc_firmware_path) == 0) {
+			csr->fw_path = NULL;
+			DRM_DEBUG_KMS("Disabling CSR firmare and runtime PM\n");
+			return;
+		}
+
 		csr->fw_path = i915_modparams.dmc_firmware_path;
 		/* Bypass version check for firmware override. */
 		csr->required_version = 0;