Commit d3a46183 authored by Daniel Vetter's avatar Daniel Vetter

drm: Replace fb_helper->atomic with mode_config->atomic_commit

Drivers transitioning to atomic might not yet want to enable full
DRIVER_ATOMIC support when it's not entirely working. But using atomic
internally makes a lot more sense earlier.

Instead of spreading such flags to more places I figured it's simpler
to just check for mode_config->funcs->atomic_commit, and use atomic
paths if that is set. For the only driver currently transitioning
(i915) this does the right thing.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-23-git-send-email-daniel.vetter@ffwll.ch
parent c39032a8
...@@ -385,7 +385,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper) ...@@ -385,7 +385,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)
drm_warn_on_modeset_not_all_locked(dev); drm_warn_on_modeset_not_all_locked(dev);
if (fb_helper->atomic) if (dev->mode_config.funcs->atomic_commit)
return restore_fbdev_mode_atomic(fb_helper); return restore_fbdev_mode_atomic(fb_helper);
drm_for_each_plane(plane, dev) { drm_for_each_plane(plane, dev) {
...@@ -716,8 +716,6 @@ int drm_fb_helper_init(struct drm_device *dev, ...@@ -716,8 +716,6 @@ int drm_fb_helper_init(struct drm_device *dev,
i++; i++;
} }
fb_helper->atomic = !!drm_core_check_feature(dev, DRIVER_ATOMIC);
return 0; return 0;
out_free: out_free:
drm_fb_helper_crtc_free(fb_helper); drm_fb_helper_crtc_free(fb_helper);
...@@ -1344,7 +1342,7 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, ...@@ -1344,7 +1342,7 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
return -EBUSY; return -EBUSY;
} }
if (fb_helper->atomic) { if (dev->mode_config.funcs->atomic_commit) {
ret = pan_display_atomic(var, info); ret = pan_display_atomic(var, info);
goto unlock; goto unlock;
} }
......
...@@ -724,8 +724,6 @@ int intel_fbdev_init(struct drm_device *dev) ...@@ -724,8 +724,6 @@ int intel_fbdev_init(struct drm_device *dev)
return ret; return ret;
} }
ifbdev->helper.atomic = true;
dev_priv->fbdev = ifbdev; dev_priv->fbdev = ifbdev;
INIT_WORK(&dev_priv->fbdev_suspend_work, intel_fbdev_suspend_worker); INIT_WORK(&dev_priv->fbdev_suspend_work, intel_fbdev_suspend_worker);
......
...@@ -212,17 +212,6 @@ struct drm_fb_helper { ...@@ -212,17 +212,6 @@ struct drm_fb_helper {
* needs to be reprobe when fbdev is in control again. * needs to be reprobe when fbdev is in control again.
*/ */
bool delayed_hotplug; bool delayed_hotplug;
/**
* @atomic:
*
* Use atomic updates for restore_fbdev_mode(), etc. This defaults to
* true if driver has DRIVER_ATOMIC feature flag, but drivers can
* override it to true after drm_fb_helper_init() if they support atomic
* modeset but do not yet advertise DRIVER_ATOMIC (note that fb-helper
* does not require ASYNC commits).
*/
bool atomic;
}; };
#ifdef CONFIG_DRM_FBDEV_EMULATION #ifdef CONFIG_DRM_FBDEV_EMULATION
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment