drm: make sure visible is set to false if fb is null
Subsystems (3)
PATCH 1/2 drm: make sure visible is set to false if fb is null
From: Gustavo Padovan <[email protected]>
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.
--- drivers/gpu/drm/drm_plane_helper.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/drm_plane_helper.c +5 -0
@@ -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)/*
Signature · 1 line
1.9.3
PATCH 2/2 drm/i915: remove unneeded visible check
From: Gustavo Padovan <[email protected]>
The fb check introduced to drm_plane_helper_check_update() just make this check impossible to branch in.
--- drivers/gpu/drm/i915/intel_display.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/intel_display.c +5 -16
@@ -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
Signature · 1 line
1.9.3
Quoted 6 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
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 <[email protected]>
For the series:
Quoted 27 lines
--- drivers/gpu/drm/drm_plane_helper.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/drm_plane_helper.c +5
-0@@ -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)/* Signature · 6 lines
1.9.3 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Ville Syrjälä
Quoted 6 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
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 <[email protected]>For the series:
Reviewed-by Ville Syrjälä <[email protected]>
Both merged to dinq, thanks.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx