diff options
author | Hans de Goede <hdegoede@redhat.com> | 2018-09-29 14:18:19 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-29 05:31:32 -0700 |
commit | 438340aa20975ffd37a685aa99c610b63f49a7ba (patch) | |
tree | 46ba928bf375d9430fe46f2a1a108d4283b6b333 /drivers/staging/vboxvideo/vbox_mode.c | |
parent | staging: vboxvideo: Atomic phase 2: Stop using plane->fb and crtc->* (diff) | |
download | linux-dev-438340aa20975ffd37a685aa99c610b63f49a7ba.tar.xz linux-dev-438340aa20975ffd37a685aa99c610b63f49a7ba.zip |
staging: vboxvideo: Atomic phase 3: Switch last bits over to atomic
Now that the state objects are wired up, we can:
1) Move to the final atomic handlers
2) Wire up atomic set_config helper
3) Switch to drm_mode_config_helper_suspend/resume for suspend/resume
4) Enable atomic modesetting ioctl
This is all done in one commit because doing this piecemeal leads to
an intermediate state which triggers WARN_ONs in the atomic code because
e.g. plane->fb is still being set.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vboxvideo/vbox_mode.c')
-rw-r--r-- | drivers/staging/vboxvideo/vbox_mode.c | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c index 54e6aac784f7..69a1e6c163b9 100644 --- a/drivers/staging/vboxvideo/vbox_mode.c +++ b/drivers/staging/vboxvideo/vbox_mode.c @@ -148,13 +148,6 @@ static void vbox_crtc_dpms(struct drm_crtc *crtc, int mode) mutex_unlock(&vbox->hw_mutex); } -static bool vbox_crtc_mode_fixup(struct drm_crtc *crtc, - const struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - return true; -} - /* * Try to map the layout of virtual screens to the range of the input device. * Return true if we need to re-set the crtc modes due to screen offset @@ -260,19 +253,10 @@ static void vbox_crtc_disable(struct drm_crtc *crtc) { } -static void vbox_crtc_prepare(struct drm_crtc *crtc) -{ -} - static void vbox_crtc_commit(struct drm_crtc *crtc) { } -static void vbox_crtc_mode_set_nofb(struct drm_crtc *crtc) -{ - /* We always set the mode when we set the fb/base */ -} - static void vbox_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_crtc_state) { @@ -291,11 +275,7 @@ static void vbox_crtc_atomic_flush(struct drm_crtc *crtc, static const struct drm_crtc_helper_funcs vbox_crtc_helper_funcs = { .dpms = vbox_crtc_dpms, - .mode_fixup = vbox_crtc_mode_fixup, - .mode_set = drm_helper_crtc_mode_set, - .mode_set_nofb = vbox_crtc_mode_set_nofb, .disable = vbox_crtc_disable, - .prepare = vbox_crtc_prepare, .commit = vbox_crtc_commit, .atomic_flush = vbox_crtc_atomic_flush, }; @@ -307,7 +287,7 @@ static void vbox_crtc_destroy(struct drm_crtc *crtc) } static const struct drm_crtc_funcs vbox_crtc_funcs = { - .set_config = drm_crtc_helper_set_config, + .set_config = drm_atomic_helper_set_config, /* .gamma_set = vbox_crtc_gamma_set, */ .destroy = vbox_crtc_destroy, .reset = drm_atomic_helper_crtc_reset, @@ -521,8 +501,8 @@ static const struct drm_plane_helper_funcs vbox_cursor_helper_funcs = { }; static const struct drm_plane_funcs vbox_cursor_plane_funcs = { - .update_plane = drm_plane_helper_update, - .disable_plane = drm_plane_helper_disable, + .update_plane = drm_atomic_helper_update_plane, + .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_primary_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, @@ -543,8 +523,8 @@ static const struct drm_plane_helper_funcs vbox_primary_helper_funcs = { }; static const struct drm_plane_funcs vbox_primary_plane_funcs = { - .update_plane = drm_plane_helper_update, - .disable_plane = drm_primary_helper_disable, + .update_plane = drm_atomic_helper_update_plane, + .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_primary_helper_destroy, .reset = drm_atomic_helper_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, @@ -882,6 +862,9 @@ static const struct drm_connector_funcs vbox_connector_funcs = { .detect = vbox_connector_detect, .fill_modes = vbox_fill_modes, .destroy = vbox_connector_destroy, + .reset = drm_atomic_helper_connector_reset, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; static int vbox_connector_init(struct drm_device *dev, @@ -950,6 +933,8 @@ err_unref_obj: static const struct drm_mode_config_funcs vbox_mode_funcs = { .fb_create = vbox_user_framebuffer_create, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = drm_atomic_helper_commit, }; int vbox_mode_init(struct vbox_private *vbox) |