From patchwork Sat Sep 29 12:18:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 10620787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3761916B1 for ; Sat, 29 Sep 2018 12:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38E1C2A658 for ; Sat, 29 Sep 2018 12:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CF2F2A65D; Sat, 29 Sep 2018 12:19:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAEA82A658 for ; Sat, 29 Sep 2018 12:19:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AA356E25A; Sat, 29 Sep 2018 12:18:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id CC8AE6E1FA for ; Sat, 29 Sep 2018 12:18:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 675F68666B; Sat, 29 Sep 2018 12:18:42 +0000 (UTC) Received: from shalem.localdomain.com (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C4523091373; Sat, 29 Sep 2018 12:18:41 +0000 (UTC) From: Hans de Goede To: Greg Kroah-Hartman Subject: [PATCH resend 10/15] staging: vboxvideo: Restore page-flip support Date: Sat, 29 Sep 2018 14:18:20 +0200 Message-Id: <20180929121825.25765-11-hdegoede@redhat.com> In-Reply-To: <20180929121825.25765-1-hdegoede@redhat.com> References: <20180929121825.25765-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 29 Sep 2018 12:18:42 +0000 (UTC) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Hans de Goede , Michael Thayer , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/staging/vboxvideo/vbox_mode.c | 7 +++++-- 1 file 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 */ #include +#include #include #include #include @@ -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,