From patchwork Wed Jul 2 22:13:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?St=C3=A9phane_Marchesin?= X-Patchwork-Id: 4468261 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 429DDBEEAA for ; Wed, 2 Jul 2014 22:13:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7232F20304 for ; Wed, 2 Jul 2014 22:13:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B858220222 for ; Wed, 2 Jul 2014 22:13:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EF156E665; Wed, 2 Jul 2014 15:13:52 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 2743C6E665 for ; Wed, 2 Jul 2014 15:13:51 -0700 (PDT) Received: by mail-pd0-f171.google.com with SMTP id fp1so12660233pdb.16 for ; Wed, 02 Jul 2014 15:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=/3h/UrWh29/fzYXX7KCTrFL2HGaEYJJi00x9qo4zluk=; b=ZF/8F9I56XmHKXDT/H/tcmTPJmrI4i3TPZJ1u5ja14zhlee5YL8gBbyYSzExIpPp0z fGoPM4a/A+8GJVfCPYQsjwrC98byEgPe9NC7ghhkPL8PMOv0SOnItioXALFqQy0Etx/x wjBILXr7sChNKECHys51SzznPQ4pd5abaL5C0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=/3h/UrWh29/fzYXX7KCTrFL2HGaEYJJi00x9qo4zluk=; b=hmVMBqRUn/F2RysAMtvuZ6QqJQcQ7p5Oe6GFok/Xy4LviFgFelWtE3f0nA0AKo9Zl2 Gzy+vcbYSln3xsWE5c9rCaZISVzN+76S0P5fkDnqktakJzO0/TbaLrFl0Cps1VvmjiRw ZLqdfSATgXcIhxrStxiPsg6AI3M4htMsaCPlEfrRtpxgwk++1H1QO5sI+bIDqj1AG8pa 0l3mTYzlIa8123z5SNwquNHATvO+KtZxSRaxlVbf/DVQOxXv7FThzk5HI0RzRP2mu2W2 xNp8PdQa/fAxXMNLPLynXWsdRJe/y9K3zohxGAUgcj2Cw7mbwVloBUo3j4jxtAEx1Zy0 M+9w== X-Gm-Message-State: ALoCoQlcqeVyqzSteTM1huYGS1UXNGTwpTAc/JBfd5GlrPKlUgKzu6ggO2DiIIsjtqfwJpszPerx X-Received: by 10.70.138.65 with SMTP id qo1mr1986808pdb.155.1404339230965; Wed, 02 Jul 2014 15:13:50 -0700 (PDT) Received: from localhost ([2620:0:1000:1b01:2d7c:dd05:dfb0:fe7]) by mx.google.com with ESMTPSA id qp12sm2801227pdb.82.2014.07.02.15.13.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 02 Jul 2014 15:13:49 -0700 (PDT) From: =?UTF-8?q?St=C3=A9phane=20Marchesin?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/udl: Implement page_flip ioctl Date: Wed, 2 Jul 2014 15:13:43 -0700 Message-Id: <1404339223-7009-2-git-send-email-marcheu@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1404339223-7009-1-git-send-email-marcheu@chromium.org> References: <1404339223-7009-1-git-send-email-marcheu@chromium.org> MIME-Version: 1.0 Cc: =?UTF-8?q?St=C3=A9phane=20Marchesin?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is a very crude page_flip implementation for UDL. There are ways to make it better (make it asynchronous, make it do actual vsynced flips...) but that's for another patch. Signed-off-by: Stéphane Marchesin --- drivers/gpu/drm/udl/udl_modeset.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index cddc4fc..7dc3bd8 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -363,6 +363,26 @@ static void udl_crtc_destroy(struct drm_crtc *crtc) kfree(crtc); } +static int udl_crtc_page_flip(struct drm_crtc *crtc, + struct drm_framebuffer *fb, + struct drm_pending_vblank_event *event, + uint32_t page_flip_flags) +{ + struct udl_framebuffer *ufb = to_udl_fb(fb); + struct drm_device *dev = crtc->dev; + unsigned long flags; + + udl_handle_damage(ufb, 0, 0, fb->width, fb->height); + + spin_lock_irqsave(&dev->event_lock, flags); + if (event) + drm_send_vblank_event(dev, 0, event); + spin_unlock_irqrestore(&dev->event_lock, flags); + crtc->fb = fb; + + return 0; +} + static void udl_crtc_prepare(struct drm_crtc *crtc) { } @@ -384,6 +404,7 @@ static struct drm_crtc_helper_funcs udl_helper_funcs = { static const struct drm_crtc_funcs udl_crtc_funcs = { .set_config = drm_crtc_helper_set_config, .destroy = udl_crtc_destroy, + .page_flip = udl_crtc_page_flip, }; static int udl_crtc_init(struct drm_device *dev)