All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: make sure visible is set to false if fb is null
@ 2014-10-24 18:00 Gustavo Padovan
  2014-10-24 18:00 ` [PATCH 2/2] drm/i915: remove unneeded visible check Gustavo Padovan
  2014-10-27 14:23 ` [PATCH 1/2] drm: make sure visible is set to false if fb is null Ville Syrjälä
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo Padovan @ 2014-10-24 18:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: Gustavo Padovan, dri-devel

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

We can't let visible set true while the fb is null, some places of
the code only check for visible to base its decisions.

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

diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 827ec1a..fe4d1fb 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -127,6 +127,11 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
 		return -ERANGE;
 	}
 
+	if (!fb) {
+		*visible = false;
+		return 0;
+	}
+
 	*visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale);
 	if (!*visible)
 		/*
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] drm/i915: remove unneeded visible check
  2014-10-24 18:00 [PATCH 1/2] drm: make sure visible is set to false if fb is null Gustavo Padovan
@ 2014-10-24 18:00 ` Gustavo Padovan
  2014-10-27 14:23 ` [PATCH 1/2] drm: make sure visible is set to false if fb is null Ville Syrjälä
  1 sibling, 0 replies; 4+ messages in thread
From: Gustavo Padovan @ 2014-10-24 18:00 UTC (permalink / raw)
  To: intel-gfx; +Cc: Gustavo Padovan, dri-devel

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

The fb check introduced to drm_plane_helper_check_update() just make this
check impossible to branch in.

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

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ef2107f..5372b73 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11484,23 +11484,12 @@ intel_check_primary_plane(struct drm_plane *plane,
 	struct drm_rect *dest = &state->dst;
 	struct drm_rect *src = &state->src;
 	const struct drm_rect *clip = &state->clip;
-	int ret;
-
-	ret = drm_plane_helper_check_update(plane, crtc, fb,
-					    src, dest, clip,
-					    DRM_PLANE_HELPER_NO_SCALING,
-					    DRM_PLANE_HELPER_NO_SCALING,
-					    false, true, &state->visible);
-	if (ret)
-		return ret;
-
-	/* no fb bound */
-	if (state->visible && !fb) {
-		DRM_ERROR("No FB bound\n");
-		return -EINVAL;
-	}
 
-	return 0;
+	return drm_plane_helper_check_update(plane, crtc, fb,
+					     src, dest, clip,
+					     DRM_PLANE_HELPER_NO_SCALING,
+					     DRM_PLANE_HELPER_NO_SCALING,
+					     false, true, &state->visible);
 }
 
 static int
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] drm: make sure visible is set to false if fb is null
  2014-10-24 18:00 [PATCH 1/2] drm: make sure visible is set to false if fb is null Gustavo Padovan
  2014-10-24 18:00 ` [PATCH 2/2] drm/i915: remove unneeded visible check Gustavo Padovan
@ 2014-10-27 14:23 ` Ville Syrjälä
  2014-10-27 14:27   ` Daniel Vetter
  1 sibling, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2014-10-27 14:23 UTC (permalink / raw)
  To: Gustavo Padovan; +Cc: intel-gfx, Gustavo Padovan, dri-devel

On Fri, Oct 24, 2014 at 07:00:17PM +0100, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> We can't let visible set true while the fb is null, some places of
> the code only check for visible to base its decisions.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

For the series:
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/drm_plane_helper.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
> index 827ec1a..fe4d1fb 100644
> --- a/drivers/gpu/drm/drm_plane_helper.c
> +++ b/drivers/gpu/drm/drm_plane_helper.c
> @@ -127,6 +127,11 @@ int drm_plane_helper_check_update(struct drm_plane *plane,
>  		return -ERANGE;
>  	}
>  
> +	if (!fb) {
> +		*visible = false;
> +		return 0;
> +	}
> +
>  	*visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale);
>  	if (!*visible)
>  		/*
> -- 
> 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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] drm: make sure visible is set to false if fb is null
  2014-10-27 14:23 ` [PATCH 1/2] drm: make sure visible is set to false if fb is null Ville Syrjälä
@ 2014-10-27 14:27   ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-10-27 14:27 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx, Gustavo Padovan, dri-devel

On Mon, Oct 27, 2014 at 04:23:26PM +0200, Ville Syrjälä wrote:
> On Fri, Oct 24, 2014 at 07:00:17PM +0100, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > We can't let visible set true while the fb is null, some places of
> > the code only check for visible to base its decisions.
> > 
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> For the series:
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Both merged to dinq, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-27 14:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-24 18:00 [PATCH 1/2] drm: make sure visible is set to false if fb is null Gustavo Padovan
2014-10-24 18:00 ` [PATCH 2/2] drm/i915: remove unneeded visible check Gustavo Padovan
2014-10-27 14:23 ` [PATCH 1/2] drm: make sure visible is set to false if fb is null Ville Syrjälä
2014-10-27 14:27   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.