[1/2] drm/i915: Check dual_link instead of port==A|C for DSI
diff mbox

Message ID 1441889581-21334-1-git-send-email-ville.syrjala@linux.intel.com
State New
Headers show

Commit Message

Ville Syrjälä Sept. 10, 2015, 12:53 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Everywhere else we check for intel_dsi->dual_link instead of the
port mask. So do the same when setting up the lane configuration
in MIPI_PORT_CTRL.

Cc: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jani Nikula Sept. 10, 2015, 1:35 p.m. UTC | #1
On Thu, 10 Sep 2015, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Everywhere else we check for intel_dsi->dual_link instead of the
> port mask. So do the same when setting up the lane configuration
> in MIPI_PORT_CTRL.
>
> Cc: Gaurav K Singh <gaurav.k.singh@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 781c267..57768c0 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -304,7 +304,7 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
>  		temp &= ~LANE_CONFIGURATION_MASK;
>  		temp &= ~DUAL_LINK_MODE_MASK;
>  
> -		if (intel_dsi->ports == ((1 << PORT_A) | (1 << PORT_C))) {
> +		if (intel_dsi->dual_link) {

I think having the whole intel_dsi->dual_link field is an unnecessary
extra level of indirection. If there's more than one port, it's dual
link. There could be a helper to get that info from ->ports.

That said, being in line for the time being is more important than doing
the above.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>  			temp |= (intel_dsi->dual_link - 1)
>  						<< DUAL_LINK_MODE_SHIFT;
>  			temp |= intel_crtc->pipe ?
> -- 
> 2.4.6
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä Sept. 10, 2015, 1:37 p.m. UTC | #2
On Thu, Sep 10, 2015 at 04:35:12PM +0300, Jani Nikula wrote:
> On Thu, 10 Sep 2015, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Everywhere else we check for intel_dsi->dual_link instead of the
> > port mask. So do the same when setting up the lane configuration
> > in MIPI_PORT_CTRL.
> >
> > Cc: Gaurav K Singh <gaurav.k.singh@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dsi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> > index 781c267..57768c0 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -304,7 +304,7 @@ static void intel_dsi_port_enable(struct intel_encoder *encoder)
> >  		temp &= ~LANE_CONFIGURATION_MASK;
> >  		temp &= ~DUAL_LINK_MODE_MASK;
> >  
> > -		if (intel_dsi->ports == ((1 << PORT_A) | (1 << PORT_C))) {
> > +		if (intel_dsi->dual_link) {
> 
> I think having the whole intel_dsi->dual_link field is an unnecessary
> extra level of indirection. If there's more than one port, it's dual
> link. There could be a helper to get that info from ->ports.

I considered it, but then I realized that intel_dsi->dual_link actually
houses the dual link mode (of which there are two), so we still need it.

> 
> That said, being in line for the time being is more important than doing
> the above.
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> 
> >  			temp |= (intel_dsi->dual_link - 1)
> >  						<< DUAL_LINK_MODE_SHIFT;
> >  			temp |= intel_crtc->pipe ?
> > -- 
> > 2.4.6
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 781c267..57768c0 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -304,7 +304,7 @@  static void intel_dsi_port_enable(struct intel_encoder *encoder)
 		temp &= ~LANE_CONFIGURATION_MASK;
 		temp &= ~DUAL_LINK_MODE_MASK;
 
-		if (intel_dsi->ports == ((1 << PORT_A) | (1 << PORT_C))) {
+		if (intel_dsi->dual_link) {
 			temp |= (intel_dsi->dual_link - 1)
 						<< DUAL_LINK_MODE_SHIFT;
 			temp |= intel_crtc->pipe ?