diff mbox

[v3,04/11] drm/i915: move check of intel_crtc_cursor_set_obj() out

Message ID 1411579232-8668-4-git-send-email-gustavo@padovan.org (mailing list archive)
State New, archived
Headers show

Commit Message

Gustavo Padovan Sept. 24, 2014, 5:20 p.m. UTC
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Move check inside intel_crtc_cursor_set_obj() to
intel_check_cursor_plane(), we only use it there so move them out to
make the merge of intel_crtc_cursor_set_obj() into
intel_check_cursor_plane() easier.

This is another step toward the atomic modesetting support and unification
of plane operations such pin/unpin of fb objects on i915.

v2: take Ville's comment: move crtc_{w,h} assignment a bit down in the
code
v3: take Ville's comment: kept only the restructuring changes, the rest of
the code was moved to a separated patch since it is a bug fix (we weren't
checking sizes when the fb was the same)

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ville Syrjala Oct. 7, 2014, 2:47 p.m. UTC | #1
On Wed, Sep 24, 2014 at 02:20:25PM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Move check inside intel_crtc_cursor_set_obj() to
> intel_check_cursor_plane(), we only use it there so move them out to
> make the merge of intel_crtc_cursor_set_obj() into
> intel_check_cursor_plane() easier.
> 
> This is another step toward the atomic modesetting support and unification
> of plane operations such pin/unpin of fb objects on i915.
> 
> v2: take Ville's comment: move crtc_{w,h} assignment a bit down in the
> code
> v3: take Ville's comment: kept only the restructuring changes, the rest of
> the code was moved to a separated patch since it is a bug fix (we weren't
> checking sizes when the fb was the same)
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Looks like the commit messages for patches 2 and 3 got somehow swapped
around. With that fixed patches 2 and 3 get:
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 20be2ed..f91a5b0 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11928,9 +11928,6 @@ intel_check_cursor_plane(struct drm_plane *plane,
>  	if (!obj)
>  		return 0;
>  
> -	if (fb == crtc->cursor->fb)
> -		return 0;
> -
>  	/* Check for which cursor types we support */
>  	crtc_w = drm_rect_width(&state->orig_dst);
>  	crtc_h = drm_rect_height(&state->orig_dst);
> @@ -11945,6 +11942,9 @@ intel_check_cursor_plane(struct drm_plane *plane,
>  		return -ENOMEM;
>  	}
>  
> +	if (fb == crtc->cursor->fb)
> +		return 0;
> +
>  	/* we only need to pin inside GTT if cursor is non-phy */
>  	mutex_lock(&dev->struct_mutex);
>  	if (!INTEL_INFO(dev)->cursor_needs_physical && obj->tiling_mode) {
> -- 
> 1.9.3
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Ville Syrjala Oct. 7, 2014, 3:01 p.m. UTC | #2
On Tue, Oct 07, 2014 at 05:47:52PM +0300, Ville Syrjälä wrote:
> On Wed, Sep 24, 2014 at 02:20:25PM -0300, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > Move check inside intel_crtc_cursor_set_obj() to
> > intel_check_cursor_plane(), we only use it there so move them out to
> > make the merge of intel_crtc_cursor_set_obj() into
> > intel_check_cursor_plane() easier.
> > 
> > This is another step toward the atomic modesetting support and unification
> > of plane operations such pin/unpin of fb objects on i915.
> > 
> > v2: take Ville's comment: move crtc_{w,h} assignment a bit down in the
> > code
> > v3: take Ville's comment: kept only the restructuring changes, the rest of
> > the code was moved to a separated patch since it is a bug fix (we weren't
> > checking sizes when the fb was the same)
> > 
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Looks like the commit messages for patches 2 and 3 got somehow swapped
> around. With that fixed patches 2 and 3 get:

And make that patches 3 and 4 and we're actaully talking about the
correct two patches.

> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 20be2ed..f91a5b0 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -11928,9 +11928,6 @@ intel_check_cursor_plane(struct drm_plane *plane,
> >  	if (!obj)
> >  		return 0;
> >  
> > -	if (fb == crtc->cursor->fb)
> > -		return 0;
> > -
> >  	/* Check for which cursor types we support */
> >  	crtc_w = drm_rect_width(&state->orig_dst);
> >  	crtc_h = drm_rect_height(&state->orig_dst);
> > @@ -11945,6 +11942,9 @@ intel_check_cursor_plane(struct drm_plane *plane,
> >  		return -ENOMEM;
> >  	}
> >  
> > +	if (fb == crtc->cursor->fb)
> > +		return 0;
> > +
> >  	/* we only need to pin inside GTT if cursor is non-phy */
> >  	mutex_lock(&dev->struct_mutex);
> >  	if (!INTEL_INFO(dev)->cursor_needs_physical && obj->tiling_mode) {
> > -- 
> > 1.9.3
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter Oct. 8, 2014, 9:03 a.m. UTC | #3
On Tue, Oct 07, 2014 at 06:01:10PM +0300, Ville Syrjälä wrote:
> On Tue, Oct 07, 2014 at 05:47:52PM +0300, Ville Syrjälä wrote:
> > On Wed, Sep 24, 2014 at 02:20:25PM -0300, Gustavo Padovan wrote:
> > > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > >
> > > Move check inside intel_crtc_cursor_set_obj() to
> > > intel_check_cursor_plane(), we only use it there so move them out to
> > > make the merge of intel_crtc_cursor_set_obj() into
> > > intel_check_cursor_plane() easier.
> > >
> > > This is another step toward the atomic modesetting support and unification
> > > of plane operations such pin/unpin of fb objects on i915.
> > >
> > > v2: take Ville's comment: move crtc_{w,h} assignment a bit down in the
> > > code
> > > v3: take Ville's comment: kept only the restructuring changes, the rest of
> > > the code was moved to a separated patch since it is a bug fix (we weren't
> > > checking sizes when the fb was the same)
> > >
> > > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> >
> > Looks like the commit messages for patches 2 and 3 got somehow swapped
> > around. With that fixed patches 2 and 3 get:
>
> And make that patches 3 and 4 and we're actaully talking about the
> correct two patches.

Ok, I think I've fixed it up.
>
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Merged up to this patch to dinq.
-Daniel

> >
> > > ---
> > >  drivers/gpu/drm/i915/intel_display.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index 20be2ed..f91a5b0 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -11928,9 +11928,6 @@ intel_check_cursor_plane(struct drm_plane *plane,
> > >   if (!obj)
> > >   return 0;
> > >
> > > - if (fb == crtc->cursor->fb)
> > > - return 0;
> > > -
> > >   /* Check for which cursor types we support */
> > >   crtc_w = drm_rect_width(&state->orig_dst);
> > >   crtc_h = drm_rect_height(&state->orig_dst);
> > > @@ -11945,6 +11942,9 @@ intel_check_cursor_plane(struct drm_plane *plane,
> > >   return -ENOMEM;
> > >   }
> > >
> > > + if (fb == crtc->cursor->fb)
> > > + return 0;
> > > +
> > >   /* we only need to pin inside GTT if cursor is non-phy */
> > >   mutex_lock(&dev->struct_mutex);
> > >   if (!INTEL_INFO(dev)->cursor_needs_physical && obj->tiling_mode) {
> > > --
> > > 1.9.3
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> >
> > --
> > Ville Syrjälä
> > Intel OTC
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 20be2ed..f91a5b0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11928,9 +11928,6 @@  intel_check_cursor_plane(struct drm_plane *plane,
 	if (!obj)
 		return 0;
 
-	if (fb == crtc->cursor->fb)
-		return 0;
-
 	/* Check for which cursor types we support */
 	crtc_w = drm_rect_width(&state->orig_dst);
 	crtc_h = drm_rect_height(&state->orig_dst);
@@ -11945,6 +11942,9 @@  intel_check_cursor_plane(struct drm_plane *plane,
 		return -ENOMEM;
 	}
 
+	if (fb == crtc->cursor->fb)
+		return 0;
+
 	/* we only need to pin inside GTT if cursor is non-phy */
 	mutex_lock(&dev->struct_mutex);
 	if (!INTEL_INFO(dev)->cursor_needs_physical && obj->tiling_mode) {