[06/11] drm/i915: Mark ns2501 as LVDS without a fixed mode
diff mbox series

Message ID 20200121171100.4370-7-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • drm/i915: Hotplug cleanups
Related show

Commit Message

Ville Syrjälä Jan. 21, 2020, 5:10 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

ns2501 has a builtin scaler so it doesn't need a fixed mode, but
let's still mark it as LVDS instead of TMDS/DVI to make life less
confusing.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dvo.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Jani Nikula Jan. 28, 2020, 8:42 a.m. UTC | #1
On Tue, 21 Jan 2020, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> ns2501 has a builtin scaler so it doesn't need a fixed mode, but
> let's still mark it as LVDS instead of TMDS/DVI to make life less
> confusing.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dvo.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c
> index 86a337c9d85d..0d4719daec8e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_dvo.c
> @@ -44,6 +44,7 @@
>  #define INTEL_DVO_CHIP_LVDS	1
>  #define INTEL_DVO_CHIP_TMDS	2
>  #define INTEL_DVO_CHIP_TVOUT	4
> +#define INTEL_DVO_CHIP_LVDS_NO_FIXED	5
>  
>  #define SIL164_ADDR	0x38
>  #define CH7xxx_ADDR	0x76
> @@ -101,13 +102,13 @@ static const struct intel_dvo_device intel_dvo_devices[] = {
>  		.dev_ops = &ch7017_ops,
>  	},
>  	{
> -	        .type = INTEL_DVO_CHIP_TMDS,
> +		.type = INTEL_DVO_CHIP_LVDS_NO_FIXED,
>  		.name = "ns2501",
>  		.dvo_reg = DVOB,
>  		.dvo_srcdim_reg = DVOB_SRCDIM,
>  		.slave_addr = NS2501_ADDR,
>  		.dev_ops = &ns2501_ops,
> -       }
> +	},
>  };
>  
>  struct intel_dvo {
> @@ -507,17 +508,19 @@ void intel_dvo_init(struct drm_i915_private *dev_priv)
>  		intel_encoder->port = port;
>  		intel_encoder->pipe_mask = ~0;
>  
> -		switch (dvo->type) {
> -		case INTEL_DVO_CHIP_TMDS:
> +		if (dvo->type != INTEL_DVO_CHIP_LVDS)
>  			intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) |
>  				(1 << INTEL_OUTPUT_DVO);
> +
> +		switch (dvo->type) {
> +		case INTEL_DVO_CHIP_TMDS:
>  			drm_connector_init(&dev_priv->drm, connector,
>  					   &intel_dvo_connector_funcs,
>  					   DRM_MODE_CONNECTOR_DVII);
>  			encoder_type = DRM_MODE_ENCODER_TMDS;
>  			break;
> +		case INTEL_DVO_CHIP_LVDS_NO_FIXED:
>  		case INTEL_DVO_CHIP_LVDS:
> -			intel_encoder->cloneable = 0;
>  			drm_connector_init(&dev_priv->drm, connector,
>  					   &intel_dvo_connector_funcs,
>  					   DRM_MODE_CONNECTOR_LVDS);

Not sure if the consecutive if and switch here make this part less
confusing, but perhaps the higher level semantic change is more
important? *shrug*

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

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c
index 86a337c9d85d..0d4719daec8e 100644
--- a/drivers/gpu/drm/i915/display/intel_dvo.c
+++ b/drivers/gpu/drm/i915/display/intel_dvo.c
@@ -44,6 +44,7 @@ 
 #define INTEL_DVO_CHIP_LVDS	1
 #define INTEL_DVO_CHIP_TMDS	2
 #define INTEL_DVO_CHIP_TVOUT	4
+#define INTEL_DVO_CHIP_LVDS_NO_FIXED	5
 
 #define SIL164_ADDR	0x38
 #define CH7xxx_ADDR	0x76
@@ -101,13 +102,13 @@  static const struct intel_dvo_device intel_dvo_devices[] = {
 		.dev_ops = &ch7017_ops,
 	},
 	{
-	        .type = INTEL_DVO_CHIP_TMDS,
+		.type = INTEL_DVO_CHIP_LVDS_NO_FIXED,
 		.name = "ns2501",
 		.dvo_reg = DVOB,
 		.dvo_srcdim_reg = DVOB_SRCDIM,
 		.slave_addr = NS2501_ADDR,
 		.dev_ops = &ns2501_ops,
-       }
+	},
 };
 
 struct intel_dvo {
@@ -507,17 +508,19 @@  void intel_dvo_init(struct drm_i915_private *dev_priv)
 		intel_encoder->port = port;
 		intel_encoder->pipe_mask = ~0;
 
-		switch (dvo->type) {
-		case INTEL_DVO_CHIP_TMDS:
+		if (dvo->type != INTEL_DVO_CHIP_LVDS)
 			intel_encoder->cloneable = (1 << INTEL_OUTPUT_ANALOG) |
 				(1 << INTEL_OUTPUT_DVO);
+
+		switch (dvo->type) {
+		case INTEL_DVO_CHIP_TMDS:
 			drm_connector_init(&dev_priv->drm, connector,
 					   &intel_dvo_connector_funcs,
 					   DRM_MODE_CONNECTOR_DVII);
 			encoder_type = DRM_MODE_ENCODER_TMDS;
 			break;
+		case INTEL_DVO_CHIP_LVDS_NO_FIXED:
 		case INTEL_DVO_CHIP_LVDS:
-			intel_encoder->cloneable = 0;
 			drm_connector_init(&dev_priv->drm, connector,
 					   &intel_dvo_connector_funcs,
 					   DRM_MODE_CONNECTOR_LVDS);