From patchwork Wed Aug 17 01:11:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9285063 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 59769600CB for ; Wed, 17 Aug 2016 01:11:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B5AE287C7 for ; Wed, 17 Aug 2016 01:11:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4066A287CC; Wed, 17 Aug 2016 01:11:34 +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 E1DF8287C7 for ; Wed, 17 Aug 2016 01:11:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7C636E781; Wed, 17 Aug 2016 01:11:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 365D46E783 for ; Wed, 17 Aug 2016 01:11:32 +0000 (UTC) Received: by mail-pf0-x22f.google.com with SMTP id p64so32665330pfb.1 for ; Tue, 16 Aug 2016 18:11:32 -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=ZQ36PxXSB1cTyfQYrm8ZK1yjM01y5zfod07XVBG9uPs=; b=oJYjd0O1XYJ8tOhJacgicjxeftJCQjgq3H7Eo9uGvGYO6dFPdFsjeQtJfhu3w7NWIk TSwYjdY53m3PDYiv7Jn+bbDR8EsnlObivAHDqmQ2VPD45RfPFBrw9qo3SnRysS6oGXGd ri+R+c+rsWxalQAeI63rr45tUwKTRdNYRyBa8= 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=ZQ36PxXSB1cTyfQYrm8ZK1yjM01y5zfod07XVBG9uPs=; b=Dw3W/n+NI5ThdbZaDbZFEXBdH53Um4bwxk7asbGwveuPxqQFTNtNqxNVaFBIYKHhEF npwmNtL9wg9uCmMQ0abKcYjs+FkW+mA/b9A/HVUzOW2TacTpytyS+KdolLSTrMafgkg3 UHynZq260O2oVckYYb9g+ztR2bayUMFTbo+/WM6Rm4VZxTMZTPMQI9/nGtmw1MrS1E/3 oAw5YlNf5Z8von6lSPQb/VSQ6e4GenboRj2OA4g67vyhWpgPWQY3DoVeRJ3rY0Jcp9g5 pku4h6PPxxGXy+F6XV0TzIYYKbPOi8eEmDcYsTBIRvbDGDNgHdHtlmE6LsHXdKVokETE 8uLg== X-Gm-Message-State: AEkoouvqS7DvEOHT6llsJuYu0zL4hhO5K1trpNPxa9m4jYN+VfcY1fQT303uqA6AzkwLnwZs X-Received: by 10.98.71.91 with SMTP id u88mr69321765pfa.145.1471396291877; Tue, 16 Aug 2016 18:11:31 -0700 (PDT) Received: from seanpaul0.corp.google.com ([172.22.162.59]) by smtp.gmail.com with ESMTPSA id f6sm42170827pfa.17.2016.08.16.18.11.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 18:11:30 -0700 (PDT) From: Sean Paul To: mark.yao@rock-chips.com, dri-devel@lists.freedesktop.org, ykk@rock-chips.com Subject: [PATCH v2 6/6] drm/rockchip: Enable vblank without event Date: Tue, 16 Aug 2016 18:11:16 -0700 Message-Id: <1471396276-8222-7-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1471396276-8222-1-git-send-email-seanpaul@chromium.org> References: <1471396276-8222-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 Reviewed-by: Yakir Yang Tested-by: Yakir Yang --- Changes in v2: - Rebased on https://cgit.freedesktop.org/~seanpaul/dogwood/log/?h=for-next drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index d1e0e06..1787084 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -112,6 +112,7 @@ struct vop { struct device *dev; struct drm_device *drm_dev; bool is_enabled; + bool vblank_active; /* mutex vsync_ work */ struct mutex vsync_mutex; @@ -1107,10 +1108,11 @@ static void vop_crtc_atomic_begin(struct drm_crtc *crtc, struct vop *vop = to_vop(crtc); spin_lock_irq(&crtc->dev->event_lock); - if (crtc->state->event) { - WARN_ON(drm_crtc_vblank_get(crtc) != 0); - WARN_ON(vop->event); + vop->vblank_active = true; + WARN_ON(drm_crtc_vblank_get(crtc) != 0); + WARN_ON(vop->event); + if (crtc->state->event) { vop->event = crtc->state->event; crtc->state->event = NULL; } @@ -1197,12 +1199,14 @@ static void vop_handle_vblank(struct vop *vop) spin_lock_irqsave(&drm->event_lock, flags); if (vop->event) { - drm_crtc_send_vblank_event(crtc, vop->event); - drm_crtc_vblank_put(crtc); vop->event = NULL; } + if (vop->vblank_active) { + vop->vblank_active = false; + drm_crtc_vblank_put(crtc); + } spin_unlock_irqrestore(&drm->event_lock, flags); if (!completion_done(&vop->wait_update_complete)) @@ -1472,6 +1476,7 @@ static int vop_initial(struct vop *vop) clk_disable(vop->aclk); vop->is_enabled = false; + vop->vblank_active = false; return 0;