drm/i915: Invert fastboot check
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 15 Jul 2015 12:15:52 +0000 (14:15 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 15 Jul 2015 15:18:29 +0000 (17:18 +0200)
Fastboot should only downgrade a modeset if we have a match, not be
used to upgrade to a full modeset. Otherwise we can only use it in a
very restricted way: Initial modeset when the request mode is the
preferred one of the panel and there's still a pfit active. And that
only works because our mode_from_pipe_config fills in the wrong mode
(it takes the adjusted mode, not the requested one).

But we want fast modesets everywhere even after boot-up (especially
for testing, but not only there). Hence we need to be able to make any
modeset a fast one, which means we need to invert the logic and
optionally downgrade a modeset.

Note that this needs ->connector_changed split out from ->mode_changed
otherwise it's not going to work (because we might loose a modeset
because connectors changed but otherwise the config matches). As soon
as that's merged we can drop the i915.fastboot check from this code.

Also make sure that we don't accidentally clear any_ms and that we add
the planes for any kind of modeset.

Finally rename fastboot to fastset (yeah it's a silly name) since this
really isn't about booting all that much.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index ce71552d4498e3ca992b08b65f50542b688ce589..af0bcfee4771fd1af6ed0d2f06a5a9d4cf500f65 100644 (file)
@@ -13161,7 +13161,6 @@ static int intel_atomic_check(struct drm_device *dev,
        for_each_crtc_in_state(state, crtc, crtc_state, i) {
                struct intel_crtc_state *pipe_config =
                        to_intel_crtc_state(crtc_state);
-               bool modeset;
 
                /* Catch I915_MODE_FLAG_INHERITED */
                if (crtc_state->mode.private_flags != crtc->state->mode.private_flags)
@@ -13173,11 +13172,12 @@ static int intel_atomic_check(struct drm_device *dev,
                        continue;
                }
 
-               modeset = needs_modeset(crtc_state);
-
-               if (!modeset)
+               if (!needs_modeset(crtc_state))
                        continue;
 
+               /* FIXME: For only active_changed we shouldn't need to do any
+                * state recomputation at all. */
+
                ret = drm_atomic_add_affected_connectors(state, crtc);
                if (ret)
                        return ret;
@@ -13186,21 +13186,24 @@ static int intel_atomic_check(struct drm_device *dev,
                if (ret)
                        return ret;
 
-               if (!i915.fastboot ||
-                   !intel_pipe_config_compare(state->dev,
+               if (i915.fastboot &&
+                   intel_pipe_config_compare(state->dev,
                                        to_intel_crtc_state(crtc->state),
                                        pipe_config, true)) {
-                       modeset = crtc_state->mode_changed = true;
+                       crtc_state->mode_changed = false;
+               }
+
+               if (needs_modeset(crtc_state)) {
+                       any_ms = true;
 
                        ret = drm_atomic_add_affected_planes(state, crtc);
                        if (ret)
                                return ret;
                }
 
-               any_ms = modeset;
-               intel_dump_pipe_config(to_intel_crtc(crtc),
-                                      pipe_config,
-                                      modeset ? "[modeset]" : "[fastboot]");
+               intel_dump_pipe_config(to_intel_crtc(crtc), pipe_config,
+                                      needs_modeset(crtc_state) ?
+                                      "[modeset]" : "[fastset]");
        }
 
        if (any_ms) {