drm: Wrap the check for atomic_commit implementation
This check is useful for drivers that do not have DRIVER_ATOMIC set but have atomic modesetting internally implemented. Wrap the check into a function since this is used in many places and as a bonus, the function name helps to document what the check is for. v2: Change return type to bool (Ville) Move the function drm_atomic.h (Daniel) Fixed comment marker for documentation Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> [danvet: Move back to drmP.h because include hell.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1482396643-32456-1-git-send-email-dhinakaran.pandiyan@intel.com
This commit is contained in:

committed by
Daniel Vetter

parent
f79f26921e
commit
a743d7582d
@@ -405,7 +405,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)
|
||||
|
||||
drm_warn_on_modeset_not_all_locked(dev);
|
||||
|
||||
if (dev->mode_config.funcs->atomic_commit)
|
||||
if (drm_drv_uses_atomic_modeset(dev))
|
||||
return restore_fbdev_mode_atomic(fb_helper);
|
||||
|
||||
drm_for_each_plane(plane, dev) {
|
||||
@@ -1444,7 +1444,7 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
if (dev->mode_config.funcs->atomic_commit) {
|
||||
if (drm_drv_uses_atomic_modeset(dev)) {
|
||||
ret = pan_display_atomic(var, info);
|
||||
goto unlock;
|
||||
}
|
||||
@@ -2060,7 +2060,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
|
||||
* NULL we fallback to the default drm_atomic_helper_best_encoder()
|
||||
* helper.
|
||||
*/
|
||||
if (fb_helper->dev->mode_config.funcs->atomic_commit &&
|
||||
if (drm_drv_uses_atomic_modeset(fb_helper->dev) &&
|
||||
!connector_funcs->best_encoder)
|
||||
encoder = drm_atomic_helper_best_encoder(connector);
|
||||
else
|
||||
|
Reference in New Issue
Block a user