diff mbox series

drm/vmwgfx: Don't look at state->allow_modeset

Message ID 20190520223500.6032-1-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series drm/vmwgfx: Don't look at state->allow_modeset | expand

Commit Message

Daniel Vetter May 20, 2019, 10:35 p.m. UTC
That's purely for the uapi layer to implement the ALLOW_MODESET flag.

Drivers should instead look at the state, e.g. through
drm_atomic_crtc_needs_modeset(), which vmwgfx already does. Also remove
the confusing comment, since checking allow_modeset is at best a micro
optimization.

v2: Rebase

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Deepak Singh Rawat May 21, 2019, 2:58 p.m. UTC | #1
Reviewed-by: Deepak Rawat <drawat@vmware.com>

On Tue, 2019-05-21 at 00:35 +0200, Daniel Vetter wrote:
> That's purely for the uapi layer to implement the ALLOW_MODESET flag.
> 
> Drivers should instead look at the state, e.g. through
> drm_atomic_crtc_needs_modeset(), which vmwgfx already does. Also
> remove
> the confusing comment, since checking allow_modeset is at best a
> micro
> optimization.
> 
> v2: Rebase
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
> Cc: Thomas Hellstrom <thellstrom@vmware.com>
> ---
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> index b97bc8e5944b..34284f0f5084 100644
> --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> @@ -1704,14 +1704,6 @@ vmw_kms_atomic_check_modeset(struct drm_device
> *dev,
>  	if (ret)
>  		return ret;
>  
> -	if (!state->allow_modeset)
> -		return ret;
> -
> -	/*
> -	 * Legacy path do not set allow_modeset properly like
> -	 * @drm_atomic_helper_update_plane, This will result in
> unnecessary call
> -	 * to vmw_kms_check_topology. So extra set of check.
> -	 */
>  	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
>  		if (drm_atomic_crtc_needs_modeset(crtc_state))
>  			need_modeset = true;
Daniel Vetter June 28, 2019, 5:02 p.m. UTC | #2
On Tue, May 21, 2019 at 02:58:36PM +0000, Deepak Singh Rawat wrote:
> Reviewed-by: Deepak Rawat <drawat@vmware.com>

Thanks for your review, I've merged this into drm-misc-next so it won't
get lost again. Should land for 5.4.
-Daniel

> 
> On Tue, 2019-05-21 at 00:35 +0200, Daniel Vetter wrote:
> > That's purely for the uapi layer to implement the ALLOW_MODESET flag.
> > 
> > Drivers should instead look at the state, e.g. through
> > drm_atomic_crtc_needs_modeset(), which vmwgfx already does. Also
> > remove
> > the confusing comment, since checking allow_modeset is at best a
> > micro
> > optimization.
> > 
> > v2: Rebase
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
> > Cc: Thomas Hellstrom <thellstrom@vmware.com>
> > ---
> >  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 --------
> >  1 file changed, 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > index b97bc8e5944b..34284f0f5084 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > @@ -1704,14 +1704,6 @@ vmw_kms_atomic_check_modeset(struct drm_device
> > *dev,
> >  	if (ret)
> >  		return ret;
> >  
> > -	if (!state->allow_modeset)
> > -		return ret;
> > -
> > -	/*
> > -	 * Legacy path do not set allow_modeset properly like
> > -	 * @drm_atomic_helper_update_plane, This will result in
> > unnecessary call
> > -	 * to vmw_kms_check_topology. So extra set of check.
> > -	 */
> >  	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
> >  		if (drm_atomic_crtc_needs_modeset(crtc_state))
> >  			need_modeset = true;
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index b97bc8e5944b..34284f0f5084 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1704,14 +1704,6 @@  vmw_kms_atomic_check_modeset(struct drm_device *dev,
 	if (ret)
 		return ret;
 
-	if (!state->allow_modeset)
-		return ret;
-
-	/*
-	 * Legacy path do not set allow_modeset properly like
-	 * @drm_atomic_helper_update_plane, This will result in unnecessary call
-	 * to vmw_kms_check_topology. So extra set of check.
-	 */
 	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
 		if (drm_atomic_crtc_needs_modeset(crtc_state))
 			need_modeset = true;