diff mbox series

[3/3] drm/i915: Remove the hardware readout path for DSI panel orientation

Message ID 20181019195948.26811-3-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915: Fix the VLV/CHV DSI panel orientation hw readout | expand

Commit Message

Ville Syrjälä Oct. 19, 2018, 7:59 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Now that we can actually grab the rotation data from the VBT,
maybe we can get rid of the hardware readout path? My VLV
FFRD is still happy.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/vlv_dsi.c | 42 ----------------------------------
 1 file changed, 42 deletions(-)

Comments

Chris Wilson Oct. 19, 2018, 8:11 p.m. UTC | #1
Quoting Ville Syrjala (2018-10-19 20:59:48)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Now that we can actually grab the rotation data from the VBT,
> maybe we can get rid of the hardware readout path? My VLV
> FFRD is still happy.

Module reload? kexec? hibernation?
-Chris
Chris Wilson Oct. 19, 2018, 8:12 p.m. UTC | #2
Quoting Chris Wilson (2018-10-19 21:11:11)
> Quoting Ville Syrjala (2018-10-19 20:59:48)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Now that we can actually grab the rotation data from the VBT,
> > maybe we can get rid of the hardware readout path? My VLV
> > FFRD is still happy.
> 
> Module reload? kexec? hibernation?

Panel orientation, not fb orientation. Apologies for the noise.
-Chris
Jani Nikula Oct. 22, 2018, 1:09 p.m. UTC | #3
On Fri, 19 Oct 2018, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Now that we can actually grab the rotation data from the VBT,
> maybe we can get rid of the hardware readout path? My VLV
> FFRD is still happy.
>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

I think we need input from Hans on this for the reality check.

Whatever you decide,

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

One note below.

> ---
>  drivers/gpu/drm/i915/vlv_dsi.c | 42 ----------------------------------
>  1 file changed, 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
> index a3119ec3189a..6f25571b5800 100644
> --- a/drivers/gpu/drm/i915/vlv_dsi.c
> +++ b/drivers/gpu/drm/i915/vlv_dsi.c
> @@ -1668,54 +1668,12 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
>  	.atomic_duplicate_state = intel_digital_connector_duplicate_state,
>  };
>  
> -static enum drm_panel_orientation
> -vlv_dsi_get_hw_panel_orientation(struct intel_connector *connector)
> -{
> -	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
> -	struct intel_encoder *encoder = connector->encoder;
> -	enum intel_display_power_domain power_domain;
> -	enum drm_panel_orientation orientation;
> -	struct intel_plane *plane;
> -	struct intel_crtc *crtc;
> -	enum pipe pipe;
> -	u32 val;
> -
> -	if (!encoder->get_hw_state(encoder, &pipe))
> -		return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> -
> -	crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
> -	plane = to_intel_plane(crtc->base.primary);
> -
> -	power_domain = POWER_DOMAIN_PIPE(pipe);
> -	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
> -		return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> -
> -	val = I915_READ(DSPCNTR(plane->i9xx_plane));
> -
> -	if (!(val & DISPLAY_PLANE_ENABLE))
> -		orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> -	else if (val & DISPPLANE_ROTATE_180)
> -		orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
> -	else
> -		orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
> -
> -	intel_display_power_put(dev_priv, power_domain);
> -
> -	return orientation;
> -}
> -
>  static enum drm_panel_orientation
>  intel_dsi_get_panel_orientation(struct intel_connector *connector)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>  	enum drm_panel_orientation orientation;
>  
> -	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
> -		orientation = vlv_dsi_get_hw_panel_orientation(connector);
> -		if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
> -			return orientation;
> -	}
> -

After this, the function definitely belongs in intel_dsi.c.

>  	orientation = dev_priv->vbt.dsi.orientation;
>  	if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
>  		return orientation;
Hans de Goede Oct. 22, 2018, 2:02 p.m. UTC | #4
Hi,

On 22-10-18 15:09, Jani Nikula wrote:
> On Fri, 19 Oct 2018, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> Now that we can actually grab the rotation data from the VBT,
>> maybe we can get rid of the hardware readout path? My VLV
>> FFRD is still happy.
>>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> I think we need input from Hans on this for the reality check.

Yes please wait a bit with merging this, I will try to give this a
test run sometime the coming days.

Regards,

Hans



> 
> Whatever you decide,
> 
> Acked-by: Jani Nikula <jani.nikula@intel.com>
> 
> One note below.
> 
>> ---
>>   drivers/gpu/drm/i915/vlv_dsi.c | 42 ----------------------------------
>>   1 file changed, 42 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
>> index a3119ec3189a..6f25571b5800 100644
>> --- a/drivers/gpu/drm/i915/vlv_dsi.c
>> +++ b/drivers/gpu/drm/i915/vlv_dsi.c
>> @@ -1668,54 +1668,12 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
>>   	.atomic_duplicate_state = intel_digital_connector_duplicate_state,
>>   };
>>   
>> -static enum drm_panel_orientation
>> -vlv_dsi_get_hw_panel_orientation(struct intel_connector *connector)
>> -{
>> -	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>> -	struct intel_encoder *encoder = connector->encoder;
>> -	enum intel_display_power_domain power_domain;
>> -	enum drm_panel_orientation orientation;
>> -	struct intel_plane *plane;
>> -	struct intel_crtc *crtc;
>> -	enum pipe pipe;
>> -	u32 val;
>> -
>> -	if (!encoder->get_hw_state(encoder, &pipe))
>> -		return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
>> -
>> -	crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
>> -	plane = to_intel_plane(crtc->base.primary);
>> -
>> -	power_domain = POWER_DOMAIN_PIPE(pipe);
>> -	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
>> -		return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
>> -
>> -	val = I915_READ(DSPCNTR(plane->i9xx_plane));
>> -
>> -	if (!(val & DISPLAY_PLANE_ENABLE))
>> -		orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
>> -	else if (val & DISPPLANE_ROTATE_180)
>> -		orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
>> -	else
>> -		orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
>> -
>> -	intel_display_power_put(dev_priv, power_domain);
>> -
>> -	return orientation;
>> -}
>> -
>>   static enum drm_panel_orientation
>>   intel_dsi_get_panel_orientation(struct intel_connector *connector)
>>   {
>>   	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>>   	enum drm_panel_orientation orientation;
>>   
>> -	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
>> -		orientation = vlv_dsi_get_hw_panel_orientation(connector);
>> -		if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
>> -			return orientation;
>> -	}
>> -
> 
> After this, the function definitely belongs in intel_dsi.c.
> 
>>   	orientation = dev_priv->vbt.dsi.orientation;
>>   	if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
>>   		return orientation;
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
index a3119ec3189a..6f25571b5800 100644
--- a/drivers/gpu/drm/i915/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/vlv_dsi.c
@@ -1668,54 +1668,12 @@  static const struct drm_connector_funcs intel_dsi_connector_funcs = {
 	.atomic_duplicate_state = intel_digital_connector_duplicate_state,
 };
 
-static enum drm_panel_orientation
-vlv_dsi_get_hw_panel_orientation(struct intel_connector *connector)
-{
-	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
-	struct intel_encoder *encoder = connector->encoder;
-	enum intel_display_power_domain power_domain;
-	enum drm_panel_orientation orientation;
-	struct intel_plane *plane;
-	struct intel_crtc *crtc;
-	enum pipe pipe;
-	u32 val;
-
-	if (!encoder->get_hw_state(encoder, &pipe))
-		return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
-
-	crtc = intel_get_crtc_for_pipe(dev_priv, pipe);
-	plane = to_intel_plane(crtc->base.primary);
-
-	power_domain = POWER_DOMAIN_PIPE(pipe);
-	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
-		return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
-
-	val = I915_READ(DSPCNTR(plane->i9xx_plane));
-
-	if (!(val & DISPLAY_PLANE_ENABLE))
-		orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
-	else if (val & DISPPLANE_ROTATE_180)
-		orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
-	else
-		orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL;
-
-	intel_display_power_put(dev_priv, power_domain);
-
-	return orientation;
-}
-
 static enum drm_panel_orientation
 intel_dsi_get_panel_orientation(struct intel_connector *connector)
 {
 	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
 	enum drm_panel_orientation orientation;
 
-	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
-		orientation = vlv_dsi_get_hw_panel_orientation(connector);
-		if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
-			return orientation;
-	}
-
 	orientation = dev_priv->vbt.dsi.orientation;
 	if (orientation != DRM_MODE_PANEL_ORIENTATION_UNKNOWN)
 		return orientation;