diff mbox

[4/6] drm/i915: Code cleanup to use dev_priv and INTEL_GEN

Message ID 1473984244-4349-5-git-send-email-manasi.d.navare@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Navare, Manasi Sept. 16, 2016, 12:04 a.m. UTC
Replace dev with dev_priv and INTEL_INFO with INTEL_GEN

Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Kahola, Mika Sept. 16, 2016, 7:40 a.m. UTC | #1
Reviewed-by: Mika Kahola <mika.kahola@intel.com>

On Thu, 2016-09-15 at 17:04 -0700, Manasi Navare wrote:
> Replace dev with dev_priv and INTEL_INFO with INTEL_GEN
> 
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 61d71fa..8061e32 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -230,13 +230,13 @@ static int
>  intel_dp_source_rates(struct intel_dp *intel_dp, const int
> **source_rates)
>  {
>  	struct intel_digital_port *dig_port =
> dp_to_dig_port(intel_dp);
> -	struct drm_device *dev = dig_port->base.base.dev;
> +	struct drm_i915_private *dev_priv = to_i915(dig_port-
> >base.base.dev);
>  	int size;
>  
> -	if (IS_BROXTON(dev)) {
> +	if (IS_BROXTON(dev_priv)) {
>  		*source_rates = bxt_rates;
>  		size = ARRAY_SIZE(bxt_rates);
> -	} else if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) {
> +	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
>  		*source_rates = skl_rates;
>  		size = ARRAY_SIZE(skl_rates);
>  	} else {
> @@ -1359,14 +1359,14 @@ intel_dp_aux_init(struct intel_dp *intel_dp)
>  bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
>  {
>  	struct intel_digital_port *dig_port =
> dp_to_dig_port(intel_dp);
> -	struct drm_device *dev = dig_port->base.base.dev;
> +	struct drm_i915_private *dev_priv = to_i915(dig_port-
> >base.base.dev);
>  
>  	/* WaDisableHBR2:skl */
> -	if (IS_SKL_REVID(dev, 0, SKL_REVID_B0))
> +	if (IS_SKL_REVID(dev_priv, 0, SKL_REVID_B0))
>  		return false;
>  
> -	if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) ||
> IS_BROADWELL(dev) ||
> -	    (INTEL_INFO(dev)->gen >= 9))
> +	if ((IS_HASWELL(dev_priv) && !IS_HSW_ULX(dev_priv)) ||
> +	    IS_BROADWELL(dev_priv) || (INTEL_GEN(dev_priv) >= 9))
>  		return true;
>  	else
>  		return false;
Jani Nikula Sept. 26, 2016, 1:45 p.m. UTC | #2
On Fri, 16 Sep 2016, Manasi Navare <manasi.d.navare@intel.com> wrote:
> Replace dev with dev_priv and INTEL_INFO with INTEL_GEN

Patches like this could easily sent separately, or at the very least as
the first patches in the series. Then we could have merged this
already. Now it conflicts, please rebase.

BR,
Jani.

>
> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 61d71fa..8061e32 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -230,13 +230,13 @@ static int
>  intel_dp_source_rates(struct intel_dp *intel_dp, const int **source_rates)
>  {
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> -	struct drm_device *dev = dig_port->base.base.dev;
> +	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
>  	int size;
>  
> -	if (IS_BROXTON(dev)) {
> +	if (IS_BROXTON(dev_priv)) {
>  		*source_rates = bxt_rates;
>  		size = ARRAY_SIZE(bxt_rates);
> -	} else if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) {
> +	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
>  		*source_rates = skl_rates;
>  		size = ARRAY_SIZE(skl_rates);
>  	} else {
> @@ -1359,14 +1359,14 @@ intel_dp_aux_init(struct intel_dp *intel_dp)
>  bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
>  {
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> -	struct drm_device *dev = dig_port->base.base.dev;
> +	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
>  
>  	/* WaDisableHBR2:skl */
> -	if (IS_SKL_REVID(dev, 0, SKL_REVID_B0))
> +	if (IS_SKL_REVID(dev_priv, 0, SKL_REVID_B0))
>  		return false;
>  
> -	if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
> -	    (INTEL_INFO(dev)->gen >= 9))
> +	if ((IS_HASWELL(dev_priv) && !IS_HSW_ULX(dev_priv)) ||
> +	    IS_BROADWELL(dev_priv) || (INTEL_GEN(dev_priv) >= 9))
>  		return true;
>  	else
>  		return false;
Navare, Manasi Sept. 28, 2016, 12:03 a.m. UTC | #3
On Mon, Sep 26, 2016 at 04:45:05PM +0300, Jani Nikula wrote:
> On Fri, 16 Sep 2016, Manasi Navare <manasi.d.navare@intel.com> wrote:
> > Replace dev with dev_priv and INTEL_INFO with INTEL_GEN
> 
> Patches like this could easily sent separately, or at the very least as
> the first patches in the series. Then we could have merged this
> already. Now it conflicts, please rebase.
> 
> BR,
> Jani.
>

Thanks for your feedback. Yes I have sent it as a separate patch.

Regards
Manasi 
> >
> > Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dp.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > index 61d71fa..8061e32 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -230,13 +230,13 @@ static int
> >  intel_dp_source_rates(struct intel_dp *intel_dp, const int **source_rates)
> >  {
> >  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> > -	struct drm_device *dev = dig_port->base.base.dev;
> > +	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
> >  	int size;
> >  
> > -	if (IS_BROXTON(dev)) {
> > +	if (IS_BROXTON(dev_priv)) {
> >  		*source_rates = bxt_rates;
> >  		size = ARRAY_SIZE(bxt_rates);
> > -	} else if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) {
> > +	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
> >  		*source_rates = skl_rates;
> >  		size = ARRAY_SIZE(skl_rates);
> >  	} else {
> > @@ -1359,14 +1359,14 @@ intel_dp_aux_init(struct intel_dp *intel_dp)
> >  bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
> >  {
> >  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> > -	struct drm_device *dev = dig_port->base.base.dev;
> > +	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
> >  
> >  	/* WaDisableHBR2:skl */
> > -	if (IS_SKL_REVID(dev, 0, SKL_REVID_B0))
> > +	if (IS_SKL_REVID(dev_priv, 0, SKL_REVID_B0))
> >  		return false;
> >  
> > -	if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
> > -	    (INTEL_INFO(dev)->gen >= 9))
> > +	if ((IS_HASWELL(dev_priv) && !IS_HSW_ULX(dev_priv)) ||
> > +	    IS_BROADWELL(dev_priv) || (INTEL_GEN(dev_priv) >= 9))
> >  		return true;
> >  	else
> >  		return false;
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 61d71fa..8061e32 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -230,13 +230,13 @@  static int
 intel_dp_source_rates(struct intel_dp *intel_dp, const int **source_rates)
 {
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
-	struct drm_device *dev = dig_port->base.base.dev;
+	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
 	int size;
 
-	if (IS_BROXTON(dev)) {
+	if (IS_BROXTON(dev_priv)) {
 		*source_rates = bxt_rates;
 		size = ARRAY_SIZE(bxt_rates);
-	} else if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) {
+	} else if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
 		*source_rates = skl_rates;
 		size = ARRAY_SIZE(skl_rates);
 	} else {
@@ -1359,14 +1359,14 @@  intel_dp_aux_init(struct intel_dp *intel_dp)
 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp)
 {
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
-	struct drm_device *dev = dig_port->base.base.dev;
+	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
 
 	/* WaDisableHBR2:skl */
-	if (IS_SKL_REVID(dev, 0, SKL_REVID_B0))
+	if (IS_SKL_REVID(dev_priv, 0, SKL_REVID_B0))
 		return false;
 
-	if ((IS_HASWELL(dev) && !IS_HSW_ULX(dev)) || IS_BROADWELL(dev) ||
-	    (INTEL_INFO(dev)->gen >= 9))
+	if ((IS_HASWELL(dev_priv) && !IS_HSW_ULX(dev_priv)) ||
+	    IS_BROADWELL(dev_priv) || (INTEL_GEN(dev_priv) >= 9))
 		return true;
 	else
 		return false;