diff mbox series

[09/10] drm/vkms: plane_state->fb iff plane_state->crtc

Message ID 20191213172612.1514842-9-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series [01/10] drm/todo: Add item for the plane->atomic_check confusion | expand

Commit Message

Daniel Vetter Dec. 13, 2019, 5:26 p.m. UTC
Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rodrigo Siqueira Jan. 14, 2020, 11:50 p.m. UTC | #1
On 12/13, Daniel Vetter wrote:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index 5fc8f85aaf3d..6d31265a2ab7 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
>  	bool can_position = false;
>  	int ret;
>  
> -	if (!state->fb | !state->crtc)
> +	if (!state->fb || WARN_ON(!state->crtc))
>  		return 0;
>  
>  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
> -- 
> 2.24.0
>

Hi,

Sorry, the delay in taking a look at this patch.

I tried to find the whole series for getting the context related to this
patch, but I could not find it in my mailbox. Could you shed some light
here? Why check fb and crtc is too much? How the WARN_ON fix the issue?

Best Regards

Ps.: in the commit message: "stope" -> "stop"
Sam Ravnborg Jan. 15, 2020, 1:27 a.m. UTC | #2
Hi Rodrigo.

On Tue, Jan 14, 2020 at 06:50:13PM -0500, Rodrigo Siqueira wrote:
> On 12/13, Daniel Vetter wrote:
> > Checking both is one too much, so wrap a WARN_ON around it to stope
> > the copypasta.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > ---
> >  drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> > index 5fc8f85aaf3d..6d31265a2ab7 100644
> > --- a/drivers/gpu/drm/vkms/vkms_plane.c
> > +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> > @@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
> >  	bool can_position = false;
> >  	int ret;
> >  
> > -	if (!state->fb | !state->crtc)
> > +	if (!state->fb || WARN_ON(!state->crtc))
> >  		return 0;
> >  
> >  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
> > -- 
> > 2.24.0
> >
> 
> Hi,
> 
> Sorry, the delay in taking a look at this patch.
> 
> I tried to find the whole series for getting the context related to this
> patch, but I could not find it in my mailbox. Could you shed some light
> here? Why check fb and crtc is too much? How the WARN_ON fix the issue?

You can find some background in the first patch:
https://lists.freedesktop.org/archives/dri-devel/2019-December/248981.html

Hope this sched enough light on the topic.

	Sam
Rodrigo Siqueira Jan. 15, 2020, 11:16 p.m. UTC | #3
Hi Sam,

On 01/15, Sam Ravnborg wrote:
> Hi Rodrigo.
> 
> On Tue, Jan 14, 2020 at 06:50:13PM -0500, Rodrigo Siqueira wrote:
> > On 12/13, Daniel Vetter wrote:
> > > Checking both is one too much, so wrap a WARN_ON around it to stope
> > > the copypasta.
> > > 
> > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > ---
> > >  drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> > > index 5fc8f85aaf3d..6d31265a2ab7 100644
> > > --- a/drivers/gpu/drm/vkms/vkms_plane.c
> > > +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> > > @@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
> > >  	bool can_position = false;
> > >  	int ret;
> > >  
> > > -	if (!state->fb | !state->crtc)
> > > +	if (!state->fb || WARN_ON(!state->crtc))
> > >  		return 0;
> > >  
> > >  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
> > > -- 
> > > 2.24.0
> > >
> > 
> > Hi,
> > 
> > Sorry, the delay in taking a look at this patch.
> > 
> > I tried to find the whole series for getting the context related to this
> > patch, but I could not find it in my mailbox. Could you shed some light
> > here? Why check fb and crtc is too much? How the WARN_ON fix the issue?
> 
> You can find some background in the first patch:
> https://lists.freedesktop.org/archives/dri-devel/2019-December/248981.html

Thanks for the link.

Reviewed-by: Rodrigo Siqueira <rodrigosiqueira@gmail.com>
Tested-by: Rodrigo Siqueira <rodrigosiqueira@gmail.com>

Best Regards
 
> Hope this sched enough light on the topic.
> 
> 	Sam
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 5fc8f85aaf3d..6d31265a2ab7 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -117,7 +117,7 @@  static int vkms_plane_atomic_check(struct drm_plane *plane,
 	bool can_position = false;
 	int ret;
 
-	if (!state->fb | !state->crtc)
+	if (!state->fb || WARN_ON(!state->crtc))
 		return 0;
 
 	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);