aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r--drivers/gpu/drm/drm_atomic.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 7ca54cb6b15b..a6caaae40b9e 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -475,7 +475,7 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
475 struct drm_plane_state *state) 475 struct drm_plane_state *state)
476{ 476{
477 unsigned int fb_width, fb_height; 477 unsigned int fb_width, fb_height;
478 unsigned int i; 478 int ret;
479 479
480 /* either *both* CRTC and FB must be set, or neither */ 480 /* either *both* CRTC and FB must be set, or neither */
481 if (WARN_ON(state->crtc && !state->fb)) { 481 if (WARN_ON(state->crtc && !state->fb)) {
@@ -497,13 +497,11 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
497 } 497 }
498 498
499 /* Check whether this plane supports the fb pixel format. */ 499 /* Check whether this plane supports the fb pixel format. */
500 for (i = 0; i < plane->format_count; i++) 500 ret = drm_plane_check_pixel_format(plane, state->fb->pixel_format);
501 if (state->fb->pixel_format == plane->format_types[i]) 501 if (ret) {
502 break;
503 if (i == plane->format_count) {
504 DRM_DEBUG_ATOMIC("Invalid pixel format %s\n", 502 DRM_DEBUG_ATOMIC("Invalid pixel format %s\n",
505 drm_get_format_name(state->fb->pixel_format)); 503 drm_get_format_name(state->fb->pixel_format));
506 return -EINVAL; 504 return ret;
507 } 505 }
508 506
509 /* Give drivers some help against integer overflows */ 507 /* Give drivers some help against integer overflows */