drm/i915: Propagate errors back from fb set-base
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 3 May 2013 16:36:25 +0000 (17:36 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 21 May 2013 10:15:58 +0000 (12:15 +0200)
Along the modesetting short cut where we skip trying to do a full
modeset and instead simply update the framebuffer base registers, we
failed to handle any errors reported.

This regression has been introduced in

commit 94352cf9a5328bb1a44288e6c2c1276695f8a356
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Jul 5 22:51:56 2012 +0200

    drm/i915: push crtc->fb update into pipe_set_base

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index efe8299197555c1ae5def2bc95bf930a4e041a8b..300942a7d1443d3cb0fe49e1a6fb2daa629cd073 100644 (file)
@@ -8332,11 +8332,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
 
                ret = intel_set_mode(set->crtc, set->mode,
                                     set->x, set->y, set->fb);
-               if (ret) {
-                       DRM_ERROR("failed to set mode on [CRTC:%d], err = %d\n",
-                                 set->crtc->base.id, ret);
-                       goto fail;
-               }
        } else if (config->fb_changed) {
                intel_crtc_wait_for_pending_flips(set->crtc);
 
@@ -8344,18 +8339,18 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
                                          set->x, set->y, set->fb);
        }
 
-       intel_set_config_free(config);
-
-       return 0;
-
+       if (ret) {
+               DRM_ERROR("failed to set mode on [CRTC:%d], err = %d\n",
+                         set->crtc->base.id, ret);
 fail:
-       intel_set_config_restore_state(dev, config);
+               intel_set_config_restore_state(dev, config);
 
-       /* Try to restore the config */
-       if (config->mode_changed &&
-           intel_set_mode(save_set.crtc, save_set.mode,
-                          save_set.x, save_set.y, save_set.fb))
-               DRM_ERROR("failed to restore config after modeset failure\n");
+               /* Try to restore the config */
+               if (config->mode_changed &&
+                   intel_set_mode(save_set.crtc, save_set.mode,
+                                  save_set.x, save_set.y, save_set.fb))
+                       DRM_ERROR("failed to restore config after modeset failure\n");
+       }
 
 out_config:
        intel_set_config_free(config);