From patchwork Wed Aug 10 21:24: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: 9274185 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 3970C6022E for ; Wed, 10 Aug 2016 21:24:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2732327E22 for ; Wed, 10 Aug 2016 21:24:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B962283E9; Wed, 10 Aug 2016 21:24: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 C8C8127E22 for ; Wed, 10 Aug 2016 21:24:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 13CE36E886; 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-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) by gabe.freedesktop.org (Postfix) with ESMTPS id 502B26E884 for ; Wed, 10 Aug 2016 21:24:28 +0000 (UTC) Received: by mail-qk0-x235.google.com with SMTP id p186so56877650qkd.1 for ; Wed, 10 Aug 2016 14:24:28 -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=BIvnjHpxcr+vTR7bRJ7ULMvTJP1nZc/OVk55jSD2oow=; b=XyJ8YZyE/mTiCX0ju99vmxP3xdXEeE19KGFiaXFRcr4RPvZPnZIezh1FSrvupX+N0P Y9PbJSAKLAmOr/zo1zM06tZvMaeEWFPyNs5PBc8clfehCXwfDUnjJ7SSrly9/MwLQmP5 DvoXf6o0w1/nj9y5mIyM5fhcQ5bpcNu8nfzsw= 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=BIvnjHpxcr+vTR7bRJ7ULMvTJP1nZc/OVk55jSD2oow=; b=k9DRbR0+bsut+wZ+c84BSF8BrIHPn0CvYU5aBOhEFiXMDjd0hyVxyegll8a1Blo/c5 aNhYgkN6HjkvXVHptZ+fpk51bYdle1gSQnWrIm2gDqBdcQhtJhu0fcANleZyIM2Ph5Sr BBU2sDG45YjI5AHl0tVac457mTmyRPoUfVoxVE3YumBGLIctmyaZBNNQBmwj1ykq/Npm xwFiasi2BNO1V1oyqT/Pejg31mPzqdFpM5VHnXFhgOVsoYJhnEKZUBr5dbTRYGtp1IOJ jVs6EoGzIr3AEnZ2IuGeVLt53+zQ9GJCObIULbuRUbhPE8o8ae4Cvpv4qi5avTHUheUC wARw== X-Gm-Message-State: AEkoouvV5Z5JgtNSPxkMoaYRUi7iAkFWhKPA2j8Mtrw6IbalKe33jr//jqBV/hJ1gX/rGp5k X-Received: by 10.55.18.9 with SMTP id c9mr6768210qkh.245.1470864267540; Wed, 10 Aug 2016 14:24:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Aug 2016 14:24:26 -0700 (PDT) From: Sean Paul To: mark.yao@rock-chips.com, dri-devel@lists.freedesktop.org, ykk@rock-chips.com Subject: [PATCH 3/6] drm/rockchip: Remove delayed work to enable/disable psr Date: Wed, 10 Aug 2016 17:24:16 -0400 Message-Id: <1470864258-22680-4-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 There's no need for this to be in a worker, much less a delayed worker. Signed-off-by: Sean Paul --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index c179933..86d60ff 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -88,7 +88,6 @@ #define to_vop_win(x) container_of(x, struct vop_win, base) #define to_vop_plane_state(x) container_of(x, struct vop_plane_state, base) -#define VOP_PSR_SET_DELAY_TIME msecs_to_jiffies(10) struct vop_plane_state { struct drm_plane_state base; @@ -120,9 +119,6 @@ struct vop { struct completion wait_update_complete; struct drm_pending_vblank_event *event; - bool psr_enabled; - struct delayed_work psr_work; - struct completion line_flag_completion; const struct vop_data *data; @@ -628,10 +624,7 @@ static void vop_crtc_disable(struct drm_crtc *crtc) clk_disable(vop->hclk); pm_runtime_put(vop->dev); - if (vop->psr_enabled) { - vop->psr_enabled = false; - schedule_delayed_work(&vop->psr_work, VOP_PSR_SET_DELAY_TIME); - } + rockchip_drm_psr_disable(&vop->crtc); } static void vop_plane_destroy(struct drm_plane *plane) @@ -915,16 +908,6 @@ static const struct drm_plane_funcs vop_plane_funcs = { .atomic_destroy_state = vop_atomic_plane_destroy_state, }; -static void vop_psr_work(struct work_struct *work) -{ - struct vop *vop = container_of(work, typeof(*vop), psr_work.work); - - if (vop->psr_enabled) - rockchip_drm_psr_enable(&vop->crtc); - else - rockchip_drm_psr_disable(&vop->crtc); -} - static int vop_crtc_enable_vblank(struct drm_crtc *crtc) { struct vop *vop = to_vop(crtc); @@ -939,8 +922,7 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc) spin_unlock_irqrestore(&vop->irq_lock, flags); - vop->psr_enabled = false; - schedule_delayed_work(&vop->psr_work, VOP_PSR_SET_DELAY_TIME); + rockchip_drm_psr_disable(&vop->crtc); return 0; } @@ -959,8 +941,7 @@ static void vop_crtc_disable_vblank(struct drm_crtc *crtc) spin_unlock_irqrestore(&vop->irq_lock, flags); - vop->psr_enabled = true; - schedule_delayed_work(&vop->psr_work, VOP_PSR_SET_DELAY_TIME); + rockchip_drm_psr_enable(&vop->crtc); } static void vop_crtc_wait_for_update(struct drm_crtc *crtc) @@ -1645,8 +1626,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data) pm_runtime_enable(&pdev->dev); - vop->psr_enabled = false; - INIT_DELAYED_WORK(&vop->psr_work, vop_psr_work); + rockchip_drm_psr_disable(&vop->crtc); return 0; }