Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5045705imu; Wed, 19 Dec 2018 04:49:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/VfL56tO3aBOESqnCQZmYsY32No0HOsDru5f6GUfa/Qw0tP+JRAuHsYruWOK0HlMxQKngsz X-Received: by 2002:aa7:84d3:: with SMTP id x19mr5284598pfn.220.1545223798536; Wed, 19 Dec 2018 04:49:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545223798; cv=none; d=google.com; s=arc-20160816; b=S0ohNxG02e8FjVa8cLapeb9dvsTHWzYY2LFUNSznaiWNoq2tyR2jVIOy53bWSB/pHw 94K/cAZ5e1XyN3IDnyPd4CiEWqoBG7wboODKF64oRcT66b8SAcFKjpdtfujw43g4AtGj bEkMQZwxAAU/ylMr+B5HYUUZYLiUDxElNGpKlDtM9WZ2khs3NFyryWA/4uR6udElpuQQ kPbmRjZelf2hf0DxIcWSFGsauOmHLNc0aKIojiUk8iHzoy+iNrFpK/XNXDoK6qpDlL7Q TtqGiqxxCe/Q31jwTmwNenYZPMrid5I8RTaTcp//iYI1PtZfTn4BYE40ySOwz9TKt91A 2TKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=TlTHDtbF7Gh0szmK+Hwa2yA3ULF9dFD666jMI69F8p4=; b=JWl7yvDu/byfiF3gb0qgpyKLtMXBDAEJ5RVJv2d+8CNIdZoP8F+SOxFyc01kAy0co2 /iETkDasqMbQk0efsiHZp4k814ft2G6DAUmJiZz/rm6nIrwP6gcvIHIaldfaANcuLG03 rGnZO9+7TySJXhCon+ivDleq/jfv0UWNsqI6pR4EAG2G25oi5lKCwI5Yb5NpE8/xcw4N vQPejIhd56+G9FYR1+tCj2XgnhzeSs/J/a/Uzw9Z3GqS2W4g5DF5N/K6zDQBMke38OTl beTETvxgDaM++w1SZjB1MhZdAmiAeprEYVAN39F5EpBtQV6D6dLAQUiCxWHI5m5j6Da3 lPhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a195si3613558pfd.143.2018.12.19.04.49.42; Wed, 19 Dec 2018 04:49:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728475AbeLSLvc (ORCPT + 99 others); Wed, 19 Dec 2018 06:51:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbeLSLvb (ORCPT ); Wed, 19 Dec 2018 06:51:31 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C8CB2D2BF5; Wed, 19 Dec 2018 11:51:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-174.ams2.redhat.com [10.36.117.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2528C2D33D; Wed, 19 Dec 2018 11:51:29 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5CDB28FA8; Wed, 19 Dec 2018 12:51:28 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org, David Airlie Cc: Gerd Hoffmann , David Airlie , virtualization@lists.linux-foundation.org (open list:DRM DRIVER FOR BOCHS VIRTUAL GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 03/14] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks. Date: Wed, 19 Dec 2018 12:51:16 +0100 Message-Id: <20181219115127.31359-4-kraxel@redhat.com> In-Reply-To: <20181219115127.31359-1-kraxel@redhat.com> References: <20181219115127.31359-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 19 Dec 2018 11:51:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c index f7e6d1a9b3..59d469f343 100644 --- a/drivers/gpu/drm/bochs/bochs_kms.c +++ b/drivers/gpu/drm/bochs/bochs_kms.c @@ -115,6 +115,29 @@ static int bochs_crtc_page_flip(struct drm_crtc *crtc, return 0; } +static void bochs_crtc_atomic_enable(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) +{ +} + +static void bochs_crtc_atomic_flush(struct drm_crtc *crtc, + struct drm_crtc_state *old_crtc_state) +{ + struct drm_device *dev = crtc->dev; + struct drm_pending_vblank_event *event; + unsigned long irqflags; + + if (crtc->state && crtc->state->event) { + event = crtc->state->event; + crtc->state->event = NULL; + + spin_lock_irqsave(&dev->event_lock, irqflags); + drm_crtc_send_vblank_event(crtc, event); + spin_unlock_irqrestore(&dev->event_lock, irqflags); + } +} + + /* These provide the minimum set of functions required to handle a CRTC */ static const struct drm_crtc_funcs bochs_crtc_funcs = { .set_config = drm_crtc_helper_set_config, @@ -128,6 +151,8 @@ static const struct drm_crtc_helper_funcs bochs_helper_funcs = { .mode_set_base = bochs_crtc_mode_set_base, .prepare = bochs_crtc_prepare, .commit = bochs_crtc_commit, + .atomic_enable = bochs_crtc_atomic_enable, + .atomic_flush = bochs_crtc_atomic_flush, }; static const uint32_t bochs_formats[] = { -- 2.9.3