[v2,RESEND] drm/i915: add support for specifying DMC firmware override by module param

Submitted by Jani Nikula on April 24, 2018, 12:20 p.m.

Details

Message ID 20180424122016.2416-1-jani.nikula@intel.com
State New
Headers show
Series "drm/i915: add support for specifying DMC firmware override by module param" ( rev: 3 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula April 24, 2018, 12:20 p.m.
Use i915.dmc_firmware_path to override default firmware for the platform
and bypassing version checks.

v2: add missing param struct member declaration (David)

Tested-by: David Weinehall <david.weinehall@linux.intel.com>
Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: David Weinehall <david.weinehall@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_params.c | 3 +++
 drivers/gpu/drm/i915/i915_params.h | 1 +
 drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
 3 files changed, 11 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 08108ce5be21..66ea3552c63e 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -164,6 +164,9 @@  i915_param_named_unsafe(guc_firmware_path, charp, 0400,
 i915_param_named_unsafe(huc_firmware_path, charp, 0400,
 	"HuC firmware path to use instead of the default one");
 
+i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
+	"DMC firmware path to use instead of the default one");
+
 i915_param_named_unsafe(enable_dp_mst, bool, 0600,
 	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
 
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index c96360398072..6684025b7af8 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -51,6 +51,7 @@  struct drm_printer;
 	param(int, guc_log_level, -1) \
 	param(char *, guc_firmware_path, NULL) \
 	param(char *, huc_firmware_path, NULL) \
+	param(char *, dmc_firmware_path, NULL) \
 	param(int, mmio_debug, 0) \
 	param(int, edp_vswing, 0) \
 	param(int, reset, 2) \
diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 41e6c75a7f3c..d81673250d3b 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -297,7 +297,10 @@  static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
 
 	csr->version = css_header->version;
 
-	if (IS_CANNONLAKE(dev_priv)) {
+	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
+		/* Bypass version check for firmware override. */
+		required_version = csr->version;
+	} else if (IS_CANNONLAKE(dev_priv)) {
 		required_version = CNL_CSR_VERSION_REQUIRED;
 	} else if (IS_GEMINILAKE(dev_priv)) {
 		required_version = GLK_CSR_VERSION_REQUIRED;
@@ -452,7 +455,9 @@  void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
 	if (!HAS_CSR(dev_priv))
 		return;
 
-	if (IS_CANNONLAKE(dev_priv))
+	if (i915_modparams.dmc_firmware_path)
+		csr->fw_path = i915_modparams.dmc_firmware_path;
+	else if (IS_CANNONLAKE(dev_priv))
 		csr->fw_path = I915_CSR_CNL;
 	else if (IS_GEMINILAKE(dev_priv))
 		csr->fw_path = I915_CSR_GLK;

Comments

On Tue, Apr 24, 2018 at 03:20:16PM +0300, Jani Nikula wrote:
> Use i915.dmc_firmware_path to override default firmware for the platform
> and bypassing version checks.
> 
> v2: add missing param struct member declaration (David)
> 
> Tested-by: David Weinehall <david.weinehall@linux.intel.com>
> Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>

Re-tested against latest drm-tip; still works fine.

> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_params.c | 3 +++
>  drivers/gpu/drm/i915/i915_params.h | 1 +
>  drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
>  3 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index 08108ce5be21..66ea3552c63e 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -164,6 +164,9 @@ i915_param_named_unsafe(guc_firmware_path, charp, 0400,
>  i915_param_named_unsafe(huc_firmware_path, charp, 0400,
>  	"HuC firmware path to use instead of the default one");
>  
> +i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
> +	"DMC firmware path to use instead of the default one");
> +
>  i915_param_named_unsafe(enable_dp_mst, bool, 0600,
>  	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
>  
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index c96360398072..6684025b7af8 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -51,6 +51,7 @@ struct drm_printer;
>  	param(int, guc_log_level, -1) \
>  	param(char *, guc_firmware_path, NULL) \
>  	param(char *, huc_firmware_path, NULL) \
> +	param(char *, dmc_firmware_path, NULL) \
>  	param(int, mmio_debug, 0) \
>  	param(int, edp_vswing, 0) \
>  	param(int, reset, 2) \
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 41e6c75a7f3c..d81673250d3b 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -297,7 +297,10 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
>  
>  	csr->version = css_header->version;
>  
> -	if (IS_CANNONLAKE(dev_priv)) {
> +	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
> +		/* Bypass version check for firmware override. */
> +		required_version = csr->version;
> +	} else if (IS_CANNONLAKE(dev_priv)) {
>  		required_version = CNL_CSR_VERSION_REQUIRED;
>  	} else if (IS_GEMINILAKE(dev_priv)) {
>  		required_version = GLK_CSR_VERSION_REQUIRED;
> @@ -452,7 +455,9 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>  	if (!HAS_CSR(dev_priv))
>  		return;
>  
> -	if (IS_CANNONLAKE(dev_priv))
> +	if (i915_modparams.dmc_firmware_path)
> +		csr->fw_path = i915_modparams.dmc_firmware_path;
> +	else if (IS_CANNONLAKE(dev_priv))
>  		csr->fw_path = I915_CSR_CNL;
>  	else if (IS_GEMINILAKE(dev_priv))
>  		csr->fw_path = I915_CSR_GLK;
> -- 
> 2.11.0
>
On Tue, 24 Apr 2018, Jani Nikula <jani.nikula@intel.com> wrote:
> Use i915.dmc_firmware_path to override default firmware for the platform
> and bypassing version checks.
>
> v2: add missing param struct member declaration (David)
>
> Tested-by: David Weinehall <david.weinehall@linux.intel.com>
> Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

So *I* don't need this patch. Please someone tell me this is useful to
you, and I'll merge.

Thanks,
Jani.


> ---
>  drivers/gpu/drm/i915/i915_params.c | 3 +++
>  drivers/gpu/drm/i915/i915_params.h | 1 +
>  drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
>  3 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index 08108ce5be21..66ea3552c63e 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -164,6 +164,9 @@ i915_param_named_unsafe(guc_firmware_path, charp, 0400,
>  i915_param_named_unsafe(huc_firmware_path, charp, 0400,
>  	"HuC firmware path to use instead of the default one");
>  
> +i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
> +	"DMC firmware path to use instead of the default one");
> +
>  i915_param_named_unsafe(enable_dp_mst, bool, 0600,
>  	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
>  
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index c96360398072..6684025b7af8 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -51,6 +51,7 @@ struct drm_printer;
>  	param(int, guc_log_level, -1) \
>  	param(char *, guc_firmware_path, NULL) \
>  	param(char *, huc_firmware_path, NULL) \
> +	param(char *, dmc_firmware_path, NULL) \
>  	param(int, mmio_debug, 0) \
>  	param(int, edp_vswing, 0) \
>  	param(int, reset, 2) \
> diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> index 41e6c75a7f3c..d81673250d3b 100644
> --- a/drivers/gpu/drm/i915/intel_csr.c
> +++ b/drivers/gpu/drm/i915/intel_csr.c
> @@ -297,7 +297,10 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
>  
>  	csr->version = css_header->version;
>  
> -	if (IS_CANNONLAKE(dev_priv)) {
> +	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
> +		/* Bypass version check for firmware override. */
> +		required_version = csr->version;
> +	} else if (IS_CANNONLAKE(dev_priv)) {
>  		required_version = CNL_CSR_VERSION_REQUIRED;
>  	} else if (IS_GEMINILAKE(dev_priv)) {
>  		required_version = GLK_CSR_VERSION_REQUIRED;
> @@ -452,7 +455,9 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>  	if (!HAS_CSR(dev_priv))
>  		return;
>  
> -	if (IS_CANNONLAKE(dev_priv))
> +	if (i915_modparams.dmc_firmware_path)
> +		csr->fw_path = i915_modparams.dmc_firmware_path;
> +	else if (IS_CANNONLAKE(dev_priv))
>  		csr->fw_path = I915_CSR_CNL;
>  	else if (IS_GEMINILAKE(dev_priv))
>  		csr->fw_path = I915_CSR_GLK;
On Mon, Apr 30, 2018 at 01:47:15PM +0300, Jani Nikula wrote:
> On Tue, 24 Apr 2018, Jani Nikula <jani.nikula@intel.com> wrote:
> > Use i915.dmc_firmware_path to override default firmware for the platform
> > and bypassing version checks.
> >
> > v2: add missing param struct member declaration (David)
> >
> > Tested-by: David Weinehall <david.weinehall@linux.intel.com>
> > Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
> > Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
> > Cc: David Weinehall <david.weinehall@linux.intel.com>
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> 
> So *I* don't need this patch. Please someone tell me this is useful to
> you, and I'll merge.

It's useful for us (PnP team), and I believe Anusha has expressed
interest too, correct?


Kind regards, David

> 
> Thanks,
> Jani.
> 
> 
> > ---
> >  drivers/gpu/drm/i915/i915_params.c | 3 +++
> >  drivers/gpu/drm/i915/i915_params.h | 1 +
> >  drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
> >  3 files changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> > index 08108ce5be21..66ea3552c63e 100644
> > --- a/drivers/gpu/drm/i915/i915_params.c
> > +++ b/drivers/gpu/drm/i915/i915_params.c
> > @@ -164,6 +164,9 @@ i915_param_named_unsafe(guc_firmware_path, charp, 0400,
> >  i915_param_named_unsafe(huc_firmware_path, charp, 0400,
> >  	"HuC firmware path to use instead of the default one");
> >  
> > +i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
> > +	"DMC firmware path to use instead of the default one");
> > +
> >  i915_param_named_unsafe(enable_dp_mst, bool, 0600,
> >  	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
> >  
> > diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> > index c96360398072..6684025b7af8 100644
> > --- a/drivers/gpu/drm/i915/i915_params.h
> > +++ b/drivers/gpu/drm/i915/i915_params.h
> > @@ -51,6 +51,7 @@ struct drm_printer;
> >  	param(int, guc_log_level, -1) \
> >  	param(char *, guc_firmware_path, NULL) \
> >  	param(char *, huc_firmware_path, NULL) \
> > +	param(char *, dmc_firmware_path, NULL) \
> >  	param(int, mmio_debug, 0) \
> >  	param(int, edp_vswing, 0) \
> >  	param(int, reset, 2) \
> > diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
> > index 41e6c75a7f3c..d81673250d3b 100644
> > --- a/drivers/gpu/drm/i915/intel_csr.c
> > +++ b/drivers/gpu/drm/i915/intel_csr.c
> > @@ -297,7 +297,10 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
> >  
> >  	csr->version = css_header->version;
> >  
> > -	if (IS_CANNONLAKE(dev_priv)) {
> > +	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
> > +		/* Bypass version check for firmware override. */
> > +		required_version = csr->version;
> > +	} else if (IS_CANNONLAKE(dev_priv)) {
> >  		required_version = CNL_CSR_VERSION_REQUIRED;
> >  	} else if (IS_GEMINILAKE(dev_priv)) {
> >  		required_version = GLK_CSR_VERSION_REQUIRED;
> > @@ -452,7 +455,9 @@ void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
> >  	if (!HAS_CSR(dev_priv))
> >  		return;
> >  
> > -	if (IS_CANNONLAKE(dev_priv))
> > +	if (i915_modparams.dmc_firmware_path)
> > +		csr->fw_path = i915_modparams.dmc_firmware_path;
> > +	else if (IS_CANNONLAKE(dev_priv))
> >  		csr->fw_path = I915_CSR_CNL;
> >  	else if (IS_GEMINILAKE(dev_priv))
> >  		csr->fw_path = I915_CSR_GLK;
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
>-----Original Message-----
>From: Nikula, Jani
>Sent: Monday, April 30, 2018 3:47 AM
>To: intel-gfx@lists.freedesktop.org
>Cc: Srivatsa, Anusha <anusha.srivatsa@intel.com>; David Weinehall
><david.weinehall@linux.intel.com>
>Subject: Re: [PATCH v2 RESEND] drm/i915: add support for specifying DMC
>firmware override by module param
>
>On Tue, 24 Apr 2018, Jani Nikula <jani.nikula@intel.com> wrote:
>> Use i915.dmc_firmware_path to override default firmware for the
>> platform and bypassing version checks.
>>
>> v2: add missing param struct member declaration (David)
>>
>> Tested-by: David Weinehall <david.weinehall@linux.intel.com>
>> Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
>> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
>> Cc: David Weinehall <david.weinehall@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
>So *I* don't need this patch. Please someone tell me this is useful to you, and I'll
>merge.

Jani, we need this patch!. This will be very useful. I am glad it made back to the ML.

Anusha 
>Thanks,
>Jani.
>
>
>> ---
>>  drivers/gpu/drm/i915/i915_params.c | 3 +++
>> drivers/gpu/drm/i915/i915_params.h | 1 +
>>  drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
>>  3 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_params.c
>> b/drivers/gpu/drm/i915/i915_params.c
>> index 08108ce5be21..66ea3552c63e 100644
>> --- a/drivers/gpu/drm/i915/i915_params.c
>> +++ b/drivers/gpu/drm/i915/i915_params.c
>> @@ -164,6 +164,9 @@ i915_param_named_unsafe(guc_firmware_path,
>charp,
>> 0400,  i915_param_named_unsafe(huc_firmware_path, charp, 0400,
>>  	"HuC firmware path to use instead of the default one");
>>
>> +i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
>> +	"DMC firmware path to use instead of the default one");
>> +
>>  i915_param_named_unsafe(enable_dp_mst, bool, 0600,
>>  	"Enable multi-stream transport (MST) for new DisplayPort sinks.
>> (default: true)");
>>
>> diff --git a/drivers/gpu/drm/i915/i915_params.h
>> b/drivers/gpu/drm/i915/i915_params.h
>> index c96360398072..6684025b7af8 100644
>> --- a/drivers/gpu/drm/i915/i915_params.h
>> +++ b/drivers/gpu/drm/i915/i915_params.h
>> @@ -51,6 +51,7 @@ struct drm_printer;
>>  	param(int, guc_log_level, -1) \
>>  	param(char *, guc_firmware_path, NULL) \
>>  	param(char *, huc_firmware_path, NULL) \
>> +	param(char *, dmc_firmware_path, NULL) \
>>  	param(int, mmio_debug, 0) \
>>  	param(int, edp_vswing, 0) \
>>  	param(int, reset, 2) \
>> diff --git a/drivers/gpu/drm/i915/intel_csr.c
>> b/drivers/gpu/drm/i915/intel_csr.c
>> index 41e6c75a7f3c..d81673250d3b 100644
>> --- a/drivers/gpu/drm/i915/intel_csr.c
>> +++ b/drivers/gpu/drm/i915/intel_csr.c
>> @@ -297,7 +297,10 @@ static uint32_t *parse_csr_fw(struct
>> drm_i915_private *dev_priv,
>>
>>  	csr->version = css_header->version;
>>
>> -	if (IS_CANNONLAKE(dev_priv)) {
>> +	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
>> +		/* Bypass version check for firmware override. */
>> +		required_version = csr->version;
>> +	} else if (IS_CANNONLAKE(dev_priv)) {
>>  		required_version = CNL_CSR_VERSION_REQUIRED;
>>  	} else if (IS_GEMINILAKE(dev_priv)) {
>>  		required_version = GLK_CSR_VERSION_REQUIRED; @@ -452,7
>+455,9 @@
>> void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>>  	if (!HAS_CSR(dev_priv))
>>  		return;
>>
>> -	if (IS_CANNONLAKE(dev_priv))
>> +	if (i915_modparams.dmc_firmware_path)
>> +		csr->fw_path = i915_modparams.dmc_firmware_path;
>> +	else if (IS_CANNONLAKE(dev_priv))
>>  		csr->fw_path = I915_CSR_CNL;
>>  	else if (IS_GEMINILAKE(dev_priv))
>>  		csr->fw_path = I915_CSR_GLK;
>
>--
>Jani Nikula, Intel Open Source Technology Center
>-----Original Message-----
>From: Nikula, Jani
>Sent: Monday, April 30, 2018 3:47 AM
>To: intel-gfx@lists.freedesktop.org
>Cc: Srivatsa, Anusha <anusha.srivatsa@intel.com>; David Weinehall
><david.weinehall@linux.intel.com>
>Subject: Re: [PATCH v2 RESEND] drm/i915: add support for specifying DMC
>firmware override by module param
>
>On Tue, 24 Apr 2018, Jani Nikula <jani.nikula@intel.com> wrote:
>> Use i915.dmc_firmware_path to override default firmware for the
>> platform and bypassing version checks.
>>
>> v2: add missing param struct member declaration (David)
>>
>> Tested-by: David Weinehall <david.weinehall@linux.intel.com>
>> Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
>> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
>> Cc: David Weinehall <david.weinehall@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Ack-by: Anusha Srivatsa <anusha.srivatsa@intel.com>

>So *I* don't need this patch. Please someone tell me this is useful to you, and I'll
>merge.
>
>Thanks,
>Jani.
>
>
>> ---
>>  drivers/gpu/drm/i915/i915_params.c | 3 +++
>> drivers/gpu/drm/i915/i915_params.h | 1 +
>>  drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
>>  3 files changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_params.c
>> b/drivers/gpu/drm/i915/i915_params.c
>> index 08108ce5be21..66ea3552c63e 100644
>> --- a/drivers/gpu/drm/i915/i915_params.c
>> +++ b/drivers/gpu/drm/i915/i915_params.c
>> @@ -164,6 +164,9 @@ i915_param_named_unsafe(guc_firmware_path,
>charp,
>> 0400,  i915_param_named_unsafe(huc_firmware_path, charp, 0400,
>>  	"HuC firmware path to use instead of the default one");
>>
>> +i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
>> +	"DMC firmware path to use instead of the default one");
>> +
>>  i915_param_named_unsafe(enable_dp_mst, bool, 0600,
>>  	"Enable multi-stream transport (MST) for new DisplayPort sinks.
>> (default: true)");
>>
>> diff --git a/drivers/gpu/drm/i915/i915_params.h
>> b/drivers/gpu/drm/i915/i915_params.h
>> index c96360398072..6684025b7af8 100644
>> --- a/drivers/gpu/drm/i915/i915_params.h
>> +++ b/drivers/gpu/drm/i915/i915_params.h
>> @@ -51,6 +51,7 @@ struct drm_printer;
>>  	param(int, guc_log_level, -1) \
>>  	param(char *, guc_firmware_path, NULL) \
>>  	param(char *, huc_firmware_path, NULL) \
>> +	param(char *, dmc_firmware_path, NULL) \
>>  	param(int, mmio_debug, 0) \
>>  	param(int, edp_vswing, 0) \
>>  	param(int, reset, 2) \
>> diff --git a/drivers/gpu/drm/i915/intel_csr.c
>> b/drivers/gpu/drm/i915/intel_csr.c
>> index 41e6c75a7f3c..d81673250d3b 100644
>> --- a/drivers/gpu/drm/i915/intel_csr.c
>> +++ b/drivers/gpu/drm/i915/intel_csr.c
>> @@ -297,7 +297,10 @@ static uint32_t *parse_csr_fw(struct
>> drm_i915_private *dev_priv,
>>
>>  	csr->version = css_header->version;
>>
>> -	if (IS_CANNONLAKE(dev_priv)) {
>> +	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
>> +		/* Bypass version check for firmware override. */
>> +		required_version = csr->version;
>> +	} else if (IS_CANNONLAKE(dev_priv)) {
>>  		required_version = CNL_CSR_VERSION_REQUIRED;
>>  	} else if (IS_GEMINILAKE(dev_priv)) {
>>  		required_version = GLK_CSR_VERSION_REQUIRED; @@ -452,7
>+455,9 @@
>> void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>>  	if (!HAS_CSR(dev_priv))
>>  		return;
>>
>> -	if (IS_CANNONLAKE(dev_priv))
>> +	if (i915_modparams.dmc_firmware_path)
>> +		csr->fw_path = i915_modparams.dmc_firmware_path;
>> +	else if (IS_CANNONLAKE(dev_priv))
>>  		csr->fw_path = I915_CSR_CNL;
>>  	else if (IS_GEMINILAKE(dev_priv))
>>  		csr->fw_path = I915_CSR_GLK;
>
>--
>Jani Nikula, Intel Open Source Technology Center
On Mon, 30 Apr 2018, "Srivatsa, Anusha" <anusha.srivatsa@intel.com> wrote:
>>-----Original Message-----
>>From: Nikula, Jani
>>Sent: Monday, April 30, 2018 3:47 AM
>>To: intel-gfx@lists.freedesktop.org
>>Cc: Srivatsa, Anusha <anusha.srivatsa@intel.com>; David Weinehall
>><david.weinehall@linux.intel.com>
>>Subject: Re: [PATCH v2 RESEND] drm/i915: add support for specifying DMC
>>firmware override by module param
>>
>>On Tue, 24 Apr 2018, Jani Nikula <jani.nikula@intel.com> wrote:
>>> Use i915.dmc_firmware_path to override default firmware for the
>>> platform and bypassing version checks.
>>>
>>> v2: add missing param struct member declaration (David)
>>>
>>> Tested-by: David Weinehall <david.weinehall@linux.intel.com>
>>> Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>
>>> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
>>> Cc: David Weinehall <david.weinehall@linux.intel.com>
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> Ack-by: Anusha Srivatsa <anusha.srivatsa@intel.com>

Usually written Acked-by. But thanks, and thanks to David for testing
and review, pushed to dinq.

BR,
Jani.


>
>>So *I* don't need this patch. Please someone tell me this is useful to you, and I'll
>>merge.
>>
>>Thanks,
>>Jani.
>>
>>
>>> ---
>>>  drivers/gpu/drm/i915/i915_params.c | 3 +++
>>> drivers/gpu/drm/i915/i915_params.h | 1 +
>>>  drivers/gpu/drm/i915/intel_csr.c   | 9 +++++++--
>>>  3 files changed, 11 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_params.c
>>> b/drivers/gpu/drm/i915/i915_params.c
>>> index 08108ce5be21..66ea3552c63e 100644
>>> --- a/drivers/gpu/drm/i915/i915_params.c
>>> +++ b/drivers/gpu/drm/i915/i915_params.c
>>> @@ -164,6 +164,9 @@ i915_param_named_unsafe(guc_firmware_path,
>>charp,
>>> 0400,  i915_param_named_unsafe(huc_firmware_path, charp, 0400,
>>>  	"HuC firmware path to use instead of the default one");
>>>
>>> +i915_param_named_unsafe(dmc_firmware_path, charp, 0400,
>>> +	"DMC firmware path to use instead of the default one");
>>> +
>>>  i915_param_named_unsafe(enable_dp_mst, bool, 0600,
>>>  	"Enable multi-stream transport (MST) for new DisplayPort sinks.
>>> (default: true)");
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_params.h
>>> b/drivers/gpu/drm/i915/i915_params.h
>>> index c96360398072..6684025b7af8 100644
>>> --- a/drivers/gpu/drm/i915/i915_params.h
>>> +++ b/drivers/gpu/drm/i915/i915_params.h
>>> @@ -51,6 +51,7 @@ struct drm_printer;
>>>  	param(int, guc_log_level, -1) \
>>>  	param(char *, guc_firmware_path, NULL) \
>>>  	param(char *, huc_firmware_path, NULL) \
>>> +	param(char *, dmc_firmware_path, NULL) \
>>>  	param(int, mmio_debug, 0) \
>>>  	param(int, edp_vswing, 0) \
>>>  	param(int, reset, 2) \
>>> diff --git a/drivers/gpu/drm/i915/intel_csr.c
>>> b/drivers/gpu/drm/i915/intel_csr.c
>>> index 41e6c75a7f3c..d81673250d3b 100644
>>> --- a/drivers/gpu/drm/i915/intel_csr.c
>>> +++ b/drivers/gpu/drm/i915/intel_csr.c
>>> @@ -297,7 +297,10 @@ static uint32_t *parse_csr_fw(struct
>>> drm_i915_private *dev_priv,
>>>
>>>  	csr->version = css_header->version;
>>>
>>> -	if (IS_CANNONLAKE(dev_priv)) {
>>> +	if (csr->fw_path == i915_modparams.dmc_firmware_path) {
>>> +		/* Bypass version check for firmware override. */
>>> +		required_version = csr->version;
>>> +	} else if (IS_CANNONLAKE(dev_priv)) {
>>>  		required_version = CNL_CSR_VERSION_REQUIRED;
>>>  	} else if (IS_GEMINILAKE(dev_priv)) {
>>>  		required_version = GLK_CSR_VERSION_REQUIRED; @@ -452,7
>>+455,9 @@
>>> void intel_csr_ucode_init(struct drm_i915_private *dev_priv)
>>>  	if (!HAS_CSR(dev_priv))
>>>  		return;
>>>
>>> -	if (IS_CANNONLAKE(dev_priv))
>>> +	if (i915_modparams.dmc_firmware_path)
>>> +		csr->fw_path = i915_modparams.dmc_firmware_path;
>>> +	else if (IS_CANNONLAKE(dev_priv))
>>>  		csr->fw_path = I915_CSR_CNL;
>>>  	else if (IS_GEMINILAKE(dev_priv))
>>>  		csr->fw_path = I915_CSR_GLK;
>>
>>--
>>Jani Nikula, Intel Open Source Technology Center