diff mbox series

[1/7] drm/ch7006: Stop using drm_crtc_force_disable

Message ID 20181210100359.22507-2-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series legacy helper cleanup | expand

Commit Message

Daniel Vetter Dec. 10, 2018, 10:03 a.m. UTC
The correct way for legacy drivers to update properties that need to
do a full modeset, is to do a full modeset.

Note that we don't need to call the drm_mode_config_internal helper
because we're not changing any of the refcounted paramters.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i2c/ch7006_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ville Syrjälä Dec. 10, 2018, 4:20 p.m. UTC | #1
On Mon, Dec 10, 2018 at 11:03:53AM +0100, Daniel Vetter wrote:
> The correct way for legacy drivers to update properties that need to
> do a full modeset, is to do a full modeset.
> 
> Note that we don't need to call the drm_mode_config_internal helper
> because we're not changing any of the refcounted paramters.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i2c/ch7006_drv.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
> index 544a8a2d3562..719c79d3fac9 100644
> --- a/drivers/gpu/drm/i2c/ch7006_drv.c
> +++ b/drivers/gpu/drm/i2c/ch7006_drv.c
> @@ -359,10 +359,10 @@ static int ch7006_encoder_set_property(struct drm_encoder *encoder,
>  	if (modes_changed) {
>  		drm_helper_probe_single_connector_modes(connector, 0, 0);
>  
> -		/* Disable the crtc to ensure a full modeset is
> -		 * performed whenever it's turned on again. */
>  		if (crtc)
> -			drm_crtc_force_disable(crtc);
> +			return drm_crtc_helper_set_mode(crtc, &crtc->mode,
> +							crtc->x, crtc->y,
> +							crtc->primary->fb);

That guy seems to return a bool.

>  	}
>  
>  	return 0;
> -- 
> 2.20.0.rc1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter Dec. 12, 2018, 10:54 a.m. UTC | #2
On Mon, Dec 10, 2018 at 06:20:41PM +0200, Ville Syrjälä wrote:
> On Mon, Dec 10, 2018 at 11:03:53AM +0100, Daniel Vetter wrote:
> > The correct way for legacy drivers to update properties that need to
> > do a full modeset, is to do a full modeset.
> > 
> > Note that we don't need to call the drm_mode_config_internal helper
> > because we're not changing any of the refcounted paramters.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/i2c/ch7006_drv.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
> > index 544a8a2d3562..719c79d3fac9 100644
> > --- a/drivers/gpu/drm/i2c/ch7006_drv.c
> > +++ b/drivers/gpu/drm/i2c/ch7006_drv.c
> > @@ -359,10 +359,10 @@ static int ch7006_encoder_set_property(struct drm_encoder *encoder,
> >  	if (modes_changed) {
> >  		drm_helper_probe_single_connector_modes(connector, 0, 0);
> >  
> > -		/* Disable the crtc to ensure a full modeset is
> > -		 * performed whenever it's turned on again. */
> >  		if (crtc)
> > -			drm_crtc_force_disable(crtc);
> > +			return drm_crtc_helper_set_mode(crtc, &crtc->mode,
> > +							crtc->x, crtc->y,
> > +							crtc->primary->fb);
> 
> That guy seems to return a bool.

Indeed, thanks for spotting this. Will respin.
-Daniel

> 
> >  	}
> >  
> >  	return 0;
> > -- 
> > 2.20.0.rc1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i2c/ch7006_drv.c b/drivers/gpu/drm/i2c/ch7006_drv.c
index 544a8a2d3562..719c79d3fac9 100644
--- a/drivers/gpu/drm/i2c/ch7006_drv.c
+++ b/drivers/gpu/drm/i2c/ch7006_drv.c
@@ -359,10 +359,10 @@  static int ch7006_encoder_set_property(struct drm_encoder *encoder,
 	if (modes_changed) {
 		drm_helper_probe_single_connector_modes(connector, 0, 0);
 
-		/* Disable the crtc to ensure a full modeset is
-		 * performed whenever it's turned on again. */
 		if (crtc)
-			drm_crtc_force_disable(crtc);
+			return drm_crtc_helper_set_mode(crtc, &crtc->mode,
+							crtc->x, crtc->y,
+							crtc->primary->fb);
 	}
 
 	return 0;