diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-02-11 08:25:09 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-02-19 21:21:12 -0500 |
commit | 5c3b82e2b229e78eb32f4ea12d16f3ebeeab3fc7 (patch) | |
tree | 1717b0b529629df1287e5a4ce08501fd92415a56 /drivers/gpu/drm/drm_crtc_helper.c | |
parent | e62fb64e6187ea9d8bcedb17ccaa045ed92d4b55 (diff) |
drm: Propagate failure from setting crtc base.
Check the error paths within intel_pipe_set_base() to first cleanup and
then report back the error.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 8ba22c039a11..733028b4d45e 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -512,8 +512,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
512 | if (drm_mode_equal(&saved_mode, &crtc->mode)) { | 512 | if (drm_mode_equal(&saved_mode, &crtc->mode)) { |
513 | if (saved_x != crtc->x || saved_y != crtc->y || | 513 | if (saved_x != crtc->x || saved_y != crtc->y || |
514 | depth_changed || bpp_changed) { | 514 | depth_changed || bpp_changed) { |
515 | crtc_funcs->mode_set_base(crtc, crtc->x, crtc->y, | 515 | ret = !crtc_funcs->mode_set_base(crtc, crtc->x, crtc->y, |
516 | old_fb); | 516 | old_fb); |
517 | goto done; | 517 | goto done; |
518 | } | 518 | } |
519 | } | 519 | } |
@@ -552,7 +552,9 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | |||
552 | /* Set up the DPLL and any encoders state that needs to adjust or depend | 552 | /* Set up the DPLL and any encoders state that needs to adjust or depend |
553 | * on the DPLL. | 553 | * on the DPLL. |
554 | */ | 554 | */ |
555 | crtc_funcs->mode_set(crtc, mode, adjusted_mode, x, y, old_fb); | 555 | ret = !crtc_funcs->mode_set(crtc, mode, adjusted_mode, x, y, old_fb); |
556 | if (!ret) | ||
557 | goto done; | ||
556 | 558 | ||
557 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 559 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
558 | 560 | ||
@@ -752,6 +754,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
752 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, | 754 | if (!drm_crtc_helper_set_mode(set->crtc, set->mode, |
753 | set->x, set->y, | 755 | set->x, set->y, |
754 | old_fb)) { | 756 | old_fb)) { |
757 | DRM_ERROR("failed to set mode on crtc %p\n", | ||
758 | set->crtc); | ||
755 | ret = -EINVAL; | 759 | ret = -EINVAL; |
756 | goto fail_set_mode; | 760 | goto fail_set_mode; |
757 | } | 761 | } |
@@ -765,7 +769,10 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
765 | old_fb = set->crtc->fb; | 769 | old_fb = set->crtc->fb; |
766 | if (set->crtc->fb != set->fb) | 770 | if (set->crtc->fb != set->fb) |
767 | set->crtc->fb = set->fb; | 771 | set->crtc->fb = set->fb; |
768 | crtc_funcs->mode_set_base(set->crtc, set->x, set->y, old_fb); | 772 | ret = crtc_funcs->mode_set_base(set->crtc, |
773 | set->x, set->y, old_fb); | ||
774 | if (ret != 0) | ||
775 | goto fail_set_mode; | ||
769 | } | 776 | } |
770 | 777 | ||
771 | kfree(save_encoders); | 778 | kfree(save_encoders); |