summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vboxvideo
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-09-29 14:18:20 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-29 05:31:32 -0700
commit5cf5332d529bf7fd1f66378bb9611387c3e02b05 (patch)
tree0a5243883596cd994f4b85813855743ed1b58527 /drivers/staging/vboxvideo
parent438340aa20975ffd37a685aa99c610b63f49a7ba (diff)
downloadlinux-5cf5332d529bf7fd1f66378bb9611387c3e02b05.tar.gz
linux-5cf5332d529bf7fd1f66378bb9611387c3e02b05.tar.bz2
linux-5cf5332d529bf7fd1f66378bb9611387c3e02b05.zip
staging: vboxvideo: Restore page-flip support
Restore page-flip support now that the atomic conversion is complete. Since the mode parameter to vbox_crtc_set_base_and_mode() now never is NULL call drm_atomic_crtc_needs_modeset() to check if we need to check for input-mapping changes, to avoid doing unnecesarry work on a flip. And hookup the drm_atomic_helper_page_flip helper to implement the page_flip callback. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vboxvideo')
-rw-r--r--drivers/staging/vboxvideo/vbox_mode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c
index 69a1e6c163b9..c4ec3fa49782 100644
--- a/drivers/staging/vboxvideo/vbox_mode.c
+++ b/drivers/staging/vboxvideo/vbox_mode.c
@@ -32,6 +32,7 @@
* Hans de Goede <hdegoede@redhat.com>
*/
#include <linux/export.h>
+#include <drm/drm_atomic.h>
#include <drm/drm_crtc_helper.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_atomic_helper.h>
@@ -217,6 +218,7 @@ static void vbox_crtc_set_base_and_mode(struct drm_crtc *crtc,
struct vbox_bo *bo = gem_to_vbox_bo(to_vbox_framebuffer(fb)->obj);
struct vbox_private *vbox = crtc->dev->dev_private;
struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
+ bool needs_modeset = drm_atomic_crtc_needs_modeset(crtc->state);
mutex_lock(&vbox->hw_mutex);
@@ -227,7 +229,7 @@ static void vbox_crtc_set_base_and_mode(struct drm_crtc *crtc,
vbox_crtc->fb_offset = vbox_bo_gpu_offset(bo);
/* vbox_do_modeset() checks vbox->single_framebuffer so update it now */
- if (mode && vbox_set_up_input_mapping(vbox)) {
+ if (needs_modeset && vbox_set_up_input_mapping(vbox)) {
struct drm_crtc *crtci;
list_for_each_entry(crtci, &vbox->ddev.mode_config.crtc_list,
@@ -241,7 +243,7 @@ static void vbox_crtc_set_base_and_mode(struct drm_crtc *crtc,
vbox_set_view(crtc);
vbox_do_modeset(crtc);
- if (mode)
+ if (needs_modeset)
hgsmi_update_input_mapping(vbox->guest_pool, 0, 0,
vbox->input_mapping_width,
vbox->input_mapping_height);
@@ -288,6 +290,7 @@ static void vbox_crtc_destroy(struct drm_crtc *crtc)
static const struct drm_crtc_funcs vbox_crtc_funcs = {
.set_config = drm_atomic_helper_set_config,
+ .page_flip = drm_atomic_helper_page_flip,
/* .gamma_set = vbox_crtc_gamma_set, */
.destroy = vbox_crtc_destroy,
.reset = drm_atomic_helper_crtc_reset,