From patchwork Sun May 29 18:35:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9139949 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 921D960759 for ; Sun, 29 May 2016 18:36:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8732427CF9 for ; Sun, 29 May 2016 18:36:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BFBC28187; Sun, 29 May 2016 18:36:43 +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=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CF77281FF for ; Sun, 29 May 2016 18:36:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AFF76E5B3; Sun, 29 May 2016 18:35:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 613276E5A0 for ; Sun, 29 May 2016 18:35:56 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id n129so16035365wmn.1 for ; Sun, 29 May 2016 11:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2yrrX5J5IcYW9/K1dUD6geWdUmFkSn2FzGkUbAlFrZc=; b=WtGhKlgiwiNTM18u9aGzIuZjRi0JvsnvypnTCAM8DsfZ5n45WmYhHiYWzlwwxPOlfp 7Fhdr5hjEoFBRl/abyMJM7fDDaSFzV/AjqDayn7WUSKSj0tNtQPtfpMbLYRaE6MhEqIJ c3v5MZGqMOtOG5MfMskCylT8LhlIBwHMuLMTw= 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=2yrrX5J5IcYW9/K1dUD6geWdUmFkSn2FzGkUbAlFrZc=; b=fZh6x8m2lOTBlVQ5+61Afs/13CSuOisVzdalhoKlioMHGFOdhm9aCTgWB2PWIzvafZ AdUymiwoLdo/rdMbV2wLUHet4zrmo0A8udUz1Z5e9Jc/ppRI2B/QRZ8ag4XVoNS7J19z iAy2nyOIeojD7ycxhvhCj62FS4VcbDdveFZhqrR+r2o5e/sNewfx4fxD27KwpS15YYrP VupfUQtsWB36hxZ86eISAQ6n7lQR6JU21Rg3SNO8SBC/V8QMz/yD6eXaaWROBovqmDQs syo8QIFczjh89nYOQbdcVbUBQp373dTRrJqJknEfuurWbS3ilMSsqBWP+pdv/GpAJ3RC 26pQ== X-Gm-Message-State: ALyK8tJUve0CE+J6TQb9KRm5hVGAr+jn4S0nHDez9hJ7IDo0knJPtZ7tYMkQT3P3bBZrjw== X-Received: by 10.194.110.137 with SMTP id ia9mr23216790wjb.107.1464546954497; Sun, 29 May 2016 11:35:54 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id h2sm7761550wjv.15.2016.05.29.11.35.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 May 2016 11:35:53 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Sun, 29 May 2016 20:35:22 +0200 Message-Id: <1464546923-13439-26-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1464546923-13439-1-git-send-email-daniel.vetter@ffwll.ch> References: <1464546923-13439-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Daniel Vetter , Intel Graphics Development , Tomeu Vizoso , Mark yao Subject: [Intel-gfx] [PATCH 25/26] drm/rockchip: Nuke pending event handling in preclose X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This is now handled by the core, drivers can totally ignore lifetime issues of drm events. Cc: Tomeu Vizoso Cc: Mark yao Signed-off-by: Daniel Vetter --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 22 ---------------------- drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 -------------------- 3 files changed, 43 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 2fac6799ceb2..2251121343e6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -257,27 +257,6 @@ static int rockchip_drm_unload(struct drm_device *drm_dev) return 0; } -static void rockchip_drm_crtc_cancel_pending_vblank(struct drm_crtc *crtc, - struct drm_file *file_priv) -{ - struct rockchip_drm_private *priv = crtc->dev->dev_private; - int pipe = drm_crtc_index(crtc); - - if (pipe < ROCKCHIP_MAX_CRTC && - priv->crtc_funcs[pipe] && - priv->crtc_funcs[pipe]->cancel_pending_vblank) - priv->crtc_funcs[pipe]->cancel_pending_vblank(crtc, file_priv); -} - -static void rockchip_drm_preclose(struct drm_device *dev, - struct drm_file *file_priv) -{ - struct drm_crtc *crtc; - - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) - rockchip_drm_crtc_cancel_pending_vblank(crtc, file_priv); -} - void rockchip_drm_lastclose(struct drm_device *dev) { struct rockchip_drm_private *priv = dev->dev_private; @@ -303,7 +282,6 @@ static struct drm_driver rockchip_drm_driver = { DRIVER_PRIME | DRIVER_ATOMIC, .load = rockchip_drm_load, .unload = rockchip_drm_unload, - .preclose = rockchip_drm_preclose, .lastclose = rockchip_drm_lastclose, .get_vblank_counter = drm_vblank_no_hw_counter, .enable_vblank = rockchip_drm_crtc_enable_vblank, diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h index 7684503ff765..005634484441 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h @@ -40,7 +40,6 @@ struct rockchip_crtc_funcs { int (*enable_vblank)(struct drm_crtc *crtc); void (*disable_vblank)(struct drm_crtc *crtc); void (*wait_for_update)(struct drm_crtc *crtc); - void (*cancel_pending_vblank)(struct drm_crtc *crtc, struct drm_file *file_priv); }; struct rockchip_crtc_state { diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 8cde1ea62978..37a1339c30ae 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -884,30 +884,10 @@ static void vop_crtc_wait_for_update(struct drm_crtc *crtc) WARN_ON(!wait_for_completion_timeout(&vop->wait_update_complete, 100)); } -static void vop_crtc_cancel_pending_vblank(struct drm_crtc *crtc, - struct drm_file *file_priv) -{ - struct drm_device *drm = crtc->dev; - struct vop *vop = to_vop(crtc); - struct drm_pending_vblank_event *e; - unsigned long flags; - - spin_lock_irqsave(&drm->event_lock, flags); - e = vop->event; - if (e && e->base.file_priv == file_priv) { - vop->event = NULL; - - kfree(&e->base); - file_priv->event_space += sizeof(e->event); - } - spin_unlock_irqrestore(&drm->event_lock, flags); -} - static const struct rockchip_crtc_funcs private_crtc_funcs = { .enable_vblank = vop_crtc_enable_vblank, .disable_vblank = vop_crtc_disable_vblank, .wait_for_update = vop_crtc_wait_for_update, - .cancel_pending_vblank = vop_crtc_cancel_pending_vblank, }; static bool vop_crtc_mode_fixup(struct drm_crtc *crtc,