diff mbox series

[v5] drm/i915: use for_each_pipe loop to assign crtc_mask

Message ID 20180919083126.31805-1-mahesh1.kumar@intel.com (mailing list archive)
State New, archived
Headers show
Series [v5] drm/i915: use for_each_pipe loop to assign crtc_mask | expand

Commit Message

Kumar, Mahesh Sept. 19, 2018, 8:31 a.m. UTC
This cleanup patch makes changes to use for_each_pipe loop
during bit-mask assignment of allowed crtc with encoder.

changes:
 - use BIT(i) macro instead of (1 << i) (Chris)
changes from V2:
 - use int for consistency (Jani)
changes from V3:
 - instead use enum pipe (Ville)
changes from V4:
 - drop DP/HDMI changes, as already part of patch from ville

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Lucas De Marchi Sept. 21, 2018, 7:14 p.m. UTC | #1
On Wed, Sep 19, 2018 at 02:01:26PM +0530, Mahesh Kumar wrote:
> This cleanup patch makes changes to use for_each_pipe loop
> during bit-mask assignment of allowed crtc with encoder.
> 
> changes:
>  - use BIT(i) macro instead of (1 << i) (Chris)
> changes from V2:
>  - use int for consistency (Jani)
> changes from V3:
>  - instead use enum pipe (Ville)
> changes from V4:
>  - drop DP/HDMI changes, as already part of patch from ville
> 
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>


Lucas De Marchi

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index cd01a09c5e0f..0ef2448fd350 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -3751,6 +3751,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  	struct intel_encoder *intel_encoder;
>  	struct drm_encoder *encoder;
>  	bool init_hdmi, init_dp, init_lspcon = false;
> +	enum pipe pipe;
>  
>  
>  	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
> @@ -3801,8 +3802,9 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>  	intel_encoder->type = INTEL_OUTPUT_DDI;
>  	intel_encoder->power_domain = intel_port_to_power_domain(port);
>  	intel_encoder->port = port;
> -	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
>  	intel_encoder->cloneable = 0;
> +	for_each_pipe(dev_priv, pipe)
> +		intel_encoder->crtc_mask |= BIT(pipe);
>  
>  	if (INTEL_GEN(dev_priv) >= 11)
>  		intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
> -- 
> 2.16.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula Sept. 25, 2018, 9:21 a.m. UTC | #2
On Fri, 21 Sep 2018, Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:
> On Wed, Sep 19, 2018 at 02:01:26PM +0530, Mahesh Kumar wrote:
>> This cleanup patch makes changes to use for_each_pipe loop
>> during bit-mask assignment of allowed crtc with encoder.
>> 
>> changes:
>>  - use BIT(i) macro instead of (1 << i) (Chris)
>> changes from V2:
>>  - use int for consistency (Jani)
>> changes from V3:
>>  - instead use enum pipe (Ville)
>> changes from V4:
>>  - drop DP/HDMI changes, as already part of patch from ville
>> 
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
>> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

Pushed, thanks for the patch and review.

BR,
Jani.

>
>
> Lucas De Marchi
>
>> ---
>>  drivers/gpu/drm/i915/intel_ddi.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
>> index cd01a09c5e0f..0ef2448fd350 100644
>> --- a/drivers/gpu/drm/i915/intel_ddi.c
>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> @@ -3751,6 +3751,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>  	struct intel_encoder *intel_encoder;
>>  	struct drm_encoder *encoder;
>>  	bool init_hdmi, init_dp, init_lspcon = false;
>> +	enum pipe pipe;
>>  
>>  
>>  	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
>> @@ -3801,8 +3802,9 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
>>  	intel_encoder->type = INTEL_OUTPUT_DDI;
>>  	intel_encoder->power_domain = intel_port_to_power_domain(port);
>>  	intel_encoder->port = port;
>> -	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
>>  	intel_encoder->cloneable = 0;
>> +	for_each_pipe(dev_priv, pipe)
>> +		intel_encoder->crtc_mask |= BIT(pipe);
>>  
>>  	if (INTEL_GEN(dev_priv) >= 11)
>>  		intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
>> -- 
>> 2.16.2
>> 
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index cd01a09c5e0f..0ef2448fd350 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -3751,6 +3751,7 @@  void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 	struct intel_encoder *intel_encoder;
 	struct drm_encoder *encoder;
 	bool init_hdmi, init_dp, init_lspcon = false;
+	enum pipe pipe;
 
 
 	init_hdmi = (dev_priv->vbt.ddi_port_info[port].supports_dvi ||
@@ -3801,8 +3802,9 @@  void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port)
 	intel_encoder->type = INTEL_OUTPUT_DDI;
 	intel_encoder->power_domain = intel_port_to_power_domain(port);
 	intel_encoder->port = port;
-	intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
 	intel_encoder->cloneable = 0;
+	for_each_pipe(dev_priv, pipe)
+		intel_encoder->crtc_mask |= BIT(pipe);
 
 	if (INTEL_GEN(dev_priv) >= 11)
 		intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &