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) /*
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
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
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
dri-devel@lists.freedesktop.org