From patchwork Wed Aug 10 21:24:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9274187 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D0FF6022E for ; Wed, 10 Aug 2016 21:24:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5AF8F27E22 for ; Wed, 10 Aug 2016 21:24:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F583283E9; Wed, 10 Aug 2016 21:24:35 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 0F4DA27E22 for ; Wed, 10 Aug 2016 21:24:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 618806E888; Wed, 10 Aug 2016 21:24:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x232.google.com (mail-qk0-x232.google.com [IPv6:2607:f8b0:400d:c09::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 040C46E886 for ; Wed, 10 Aug 2016 21:24:31 +0000 (UTC) Received: by mail-qk0-x232.google.com with SMTP id l2so56862665qkf.3 for ; Wed, 10 Aug 2016 14:24:30 -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; bh=7u8IU4V8SyhKelaenxjzN5Q0Bp8za6U7FEaP09xOtt8=; b=Xc0xd1fR0Xwra/5zG2UdNT3IqWoaVLABgKdLXRDrFsbS2j6HRNPW+jBqi8djHVFiT6 lhO5GzloYkj53uUPupMuaPzNVsgRRK6idIBGaMy1LDJTrbuuGAd0EAdN506HZtFxm91R E34fxU03gjY802UFh2crwnhHfhevb+ymYJsRg= 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; bh=7u8IU4V8SyhKelaenxjzN5Q0Bp8za6U7FEaP09xOtt8=; b=hAJGN9IXB0RX+zn8GST9RmSNqGIRfTVyp1uVcxLqrBXmisUyZSwsKp5hF2km67Nj55 i8RQ5VO0JsXnpqp8XNkptxlEbUBjuBdfZNgDqVLc1yqxjHSR8QP8BuHks4qjhwq3cDug 9hAuwmf8Nqpba24VvmqiDR4evvNiqc+HU6A0ZF8XiYzLIWDvC/6sxvuNiC6Jvc8wuCtf lTXZUTlOkmAmJ1RIQs6Mox4yePGBbirvEg0DadgUsvMViZTmK17DJa7t/wSSI30gD15d xcN/MQdxc27MNI80O1BDeKNfbE/w2HWZ66+t+khr1ZwSz2jozPjAQkunYtCyGtmzcM5d sBOQ== X-Gm-Message-State: AEkoousOloKz8O/vcz/Gx8FW0iszk64ILRM+c/fLadlEgdKA1ex1QsG8ViANrfCmhn989n8M X-Received: by 10.55.209.5 with SMTP id s5mr7434659qki.103.1470864270194; Wed, 10 Aug 2016 14:24:30 -0700 (PDT) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id l32sm24452678qta.23.2016.08.10.14.24.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Aug 2016 14:24:29 -0700 (PDT) From: Sean Paul To: mark.yao@rock-chips.com, dri-devel@lists.freedesktop.org, ykk@rock-chips.com Subject: [PATCH 5/6] drm/rockchip: Enable vblank without event Date: Wed, 10 Aug 2016 17:24:18 -0400 Message-Id: <1470864258-22680-6-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1470864258-22680-1-git-send-email-seanpaul@chromium.org> References: <1470864258-22680-1-git-send-email-seanpaul@chromium.org> Cc: marcheu@chromium.org, dianders@chromium.org, linux-rockchip@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP vblank should be enabled regardless of whether an event is expected back. This is especially important for a cursor plane. Signed-off-by: Sean Paul --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 86d60ff..c0fbe0a 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -111,6 +111,7 @@ struct vop { struct device *dev; struct drm_device *drm_dev; bool is_enabled; + bool vblank_active; /* mutex vsync_ work */ struct mutex vsync_mutex; @@ -961,6 +962,7 @@ static void vop_crtc_cancel_pending_vblank(struct drm_crtc *crtc, unsigned long flags; spin_lock_irqsave(&drm->event_lock, flags); + e = vop->event; if (e && e->base.file_priv == file_priv) { vop->event = NULL; @@ -1108,9 +1110,10 @@ static void vop_crtc_atomic_begin(struct drm_crtc *crtc, { struct vop *vop = to_vop(crtc); - if (crtc->state->event) { - WARN_ON(drm_crtc_vblank_get(crtc) != 0); + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + vop->vblank_active = true; + if (crtc->state->event) { vop->event = crtc->state->event; crtc->state->event = NULL; } @@ -1200,11 +1203,16 @@ static void vop_handle_vblank(struct vop *vop) spin_lock_irqsave(&drm->event_lock, flags); drm_crtc_send_vblank_event(crtc, vop->event); - drm_crtc_vblank_put(crtc); vop->event = NULL; spin_unlock_irqrestore(&drm->event_lock, flags); } + + if (vop->vblank_active) { + vop->vblank_active = false; + drm_crtc_vblank_put(crtc); + } + if (!completion_done(&vop->wait_update_complete)) complete(&vop->wait_update_complete); } @@ -1485,6 +1493,7 @@ static int vop_initial(struct vop *vop) clk_disable(vop->aclk); vop->is_enabled = false; + vop->vblank_active = false; return 0;