From patchwork Tue Jun 2 09:51:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11583491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 664D9739 for ; Tue, 2 Jun 2020 09:52:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4522820679 for ; Tue, 2 Jun 2020 09:52:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="i+OdYT4k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4522820679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91E526E124; Tue, 2 Jun 2020 09:51:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id F19236E0F8 for ; Tue, 2 Jun 2020 09:51:53 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id x14so2736732wrp.2 for ; Tue, 02 Jun 2020 02:51:53 -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:mime-version :content-transfer-encoding; bh=+TUQlURBiYUvX4eGj1cmnygFBEIqoBCMKPSr5vwFyYk=; b=i+OdYT4kLo1/b2shX9NxpycnXGOHsI3rZsaVnWOdzITJvXO5gFAWmpKtZqPyupqMFD M6ib1JemUVtn9Hw8BFc2WCjBh+qkBr4tpUAL/SjeWMQpnu98ZGSsOUVZMKTw6i8KRCMk 92oJBMisxnekYBP5clqL/6nt91hi8i2nDOh50= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+TUQlURBiYUvX4eGj1cmnygFBEIqoBCMKPSr5vwFyYk=; b=aZUMUvwJG2hGPtyjVehWWtevaAce7wmQHzQ+PySsijD/QHqGL2tSUgCWwL/OR0jSdX Ykj3cvKsmJeIQW8m2OIHd3lWB6kqemqBvdfYawO1uEm9wn5/V5qEw6jrz4VMv5qUWvl+ 3kKviDHMMJ2yVDpeL1YLm+GSvE3HDYURAzw2cScKSuNAwNd5p2BKAnKq4ngLqxhfJFK2 CYxjT3cGqtJ8bBzmZ6qMOaGU0KmyqVT6Uh9HQNjrjfgrIIeePOfBxXrQU1JtWzfMyYU+ c7nnnLDrIwz4TboxAABPVg1Jrx2Pwkxwq3ePttkHUU5BogtdS6H6Gq9RVk4G/C9qg9Uz AEAg== X-Gm-Message-State: AOAM532uxTePjtPsmUrR1AG0uGIgtZqia6rEdp7uKzR1Wb1HpE/idI8y MLnaUcw61L22J9otJf1xiOtHHy/hVTE= X-Google-Smtp-Source: ABdhPJwGhsG45NVOnFfrcSqMCGUUP5Na6EQs7omzLU2JngUUImZOWaj0hrPPGW7fd1TjkTghzVGsVA== X-Received: by 2002:a5d:4b85:: with SMTP id b5mr25214853wrt.8.1591091512202; Tue, 02 Jun 2020 02:51:52 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id a6sm2996443wrn.38.2020.06.02.02.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 02:51:51 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/3] drm/atomic-helper: reset vblank on crtc reset Date: Tue, 2 Jun 2020 11:51:38 +0200 Message-Id: <20200602095140.36678-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Tetsuo Handa , Daniel Vetter , Liviu Dudau , Thierry Reding , Laurent Pinchart , Daniel Vetter , Mihail Atanassov , Sam Ravnborg , Emil Velikov , Jonathan Hunter , David Airlie , Ludovic Desroches , Tomi Valkeinen , "James \(Qian\) Wang" , Thierry Reding , syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com, Thomas Zimmermann , Intel Graphics Development , Sean Paul , Jyri Sarha , linux-tegra@vger.kernel.org, Thomas Gleixner , Boris Brezillon , Nicolas Ferre , zhengbin , Boris Brezillon , Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Only when vblanks are supported ofc. Some drivers do this already, but most unfortunately missed it. This opens up bugs after driver load, before the crtc is enabled for the first time. syzbot spotted this when loading vkms as a secondary output. Given how many drivers are buggy it's best to solve this once and for all in shared helper code. Aside from moving the few existing calls to drm_crtc_vblank_reset into helpers (i915 doesn't use helpers, so keeps its own) I think the regression risk is minimal: atomic helpers already rely on drivers calling drm_crtc_vblank_on/off correctly in their hooks when they support vblanks. And driver that's failing to handle vblanks after this is missing those calls already, and vblanks could only work by accident when enabling a CRTC for the first time right after boot. Big thanks to Tetsuo for helping track down what's going wrong here. There's only a few drivers which already had the necessary call and needed some updating: - komeda, atmel and tidss also needed to be changed to call __drm_atomic_helper_crtc_reset() intead of open coding it - tegra and msm even had it in the same place already, just code motion, and malidp already uses __drm_atomic_helper_crtc_reset(). Only call left is in i915, which doesn't use drm_mode_config_reset, but has its own fastboot infrastructure. So that's the only case where we actually want this in the driver still. I've also reviewed all other drivers which set up vblank support with drm_vblank_init. After the previous patch fixing mxsfb all atomic drivers do call drm_crtc_vblank_on/off as they should, the remaining drivers are either legacy kms or legacy dri1 drivers, so not affected by this change to atomic helpers. v2: Use the drm_dev_has_vblank() helper. v3: Laurent pointed out that omap and rcar-du used drm_crtc_vblank_off instead of drm_crtc_vblank_reset. Adjust them too. Cc: Laurent Pinchart Reviewed-by: Laurent Pinchart Reviewed-by: Boris Brezillon Acked-by: Liviu Dudau Acked-by: Thierry Reding Link: https://syzkaller.appspot.com/bug?id=0ba17d70d062b2595e1f061231474800f076c7cb Reported-by: Tetsuo Handa Reported-by: syzbot+0871b14ca2e2fb64f6e3@syzkaller.appspotmail.com Cc: Tetsuo Handa Cc: "James (Qian) Wang" Cc: Liviu Dudau Cc: Mihail Atanassov Cc: Brian Starkey Cc: Sam Ravnborg Cc: Boris Brezillon Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Thierry Reding Cc: Jonathan Hunter Cc: Jyri Sarha Cc: Tomi Valkeinen Cc: Rob Clark Cc: Sean Paul Cc: Brian Masney Cc: Emil Velikov Cc: zhengbin Cc: Thomas Gleixner Cc: linux-tegra@vger.kernel.org Signed-off-by: Daniel Vetter --- drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 7 ++----- drivers/gpu/drm/arm/malidp_drv.c | 1 - drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 7 ++----- drivers/gpu/drm/drm_atomic_state_helper.c | 4 ++++ drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 -- drivers/gpu/drm/omapdrm/omap_drv.c | 3 --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 3 --- drivers/gpu/drm/tegra/dc.c | 1 - drivers/gpu/drm/tidss/tidss_crtc.c | 3 +-- drivers/gpu/drm/tidss/tidss_kms.c | 4 ---- 10 files changed, 9 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c index 56bd938961ee..f33418d6e1a0 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -492,10 +492,8 @@ static void komeda_crtc_reset(struct drm_crtc *crtc) crtc->state = NULL; state = kzalloc(sizeof(*state), GFP_KERNEL); - if (state) { - crtc->state = &state->base; - crtc->state->crtc = crtc; - } + if (state) + __drm_atomic_helper_crtc_reset(crtc, &state->base); } static struct drm_crtc_state * @@ -616,7 +614,6 @@ static int komeda_crtc_add(struct komeda_kms_dev *kms, return err; drm_crtc_helper_add(crtc, &komeda_crtc_helper_funcs); - drm_crtc_vblank_reset(crtc); crtc->port = kcrtc->master->of_output_port; diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index c2507b7d8512..02904392e370 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -870,7 +870,6 @@ static int malidp_bind(struct device *dev) drm->irq_enabled = true; ret = drm_vblank_init(drm, drm->mode_config.num_crtc); - drm_crtc_vblank_reset(&malidp->crtc); if (ret < 0) { DRM_ERROR("failed to initialise vblank\n"); goto vblank_fail; diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 10985134ce0b..ce246b96330b 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -411,10 +411,8 @@ static void atmel_hlcdc_crtc_reset(struct drm_crtc *crtc) } state = kzalloc(sizeof(*state), GFP_KERNEL); - if (state) { - crtc->state = &state->base; - crtc->state->crtc = crtc; - } + if (state) + __drm_atomic_helper_crtc_reset(crtc, &state->base); } static struct drm_crtc_state * @@ -528,7 +526,6 @@ int atmel_hlcdc_crtc_create(struct drm_device *dev) } drm_crtc_helper_add(&crtc->base, &lcdc_crtc_helper_funcs); - drm_crtc_vblank_reset(&crtc->base); drm_mode_crtc_set_gamma_size(&crtc->base, ATMEL_HLCDC_CLUT_SIZE); drm_crtc_enable_color_mgmt(&crtc->base, 0, false, diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c index 8fce6a115dfe..9ad74045158e 100644 --- a/drivers/gpu/drm/drm_atomic_state_helper.c +++ b/drivers/gpu/drm/drm_atomic_state_helper.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -93,6 +94,9 @@ __drm_atomic_helper_crtc_reset(struct drm_crtc *crtc, if (crtc_state) __drm_atomic_helper_crtc_state_reset(crtc_state, crtc); + if (drm_dev_has_vblank(crtc->dev)) + drm_crtc_vblank_reset(crtc); + crtc->state = crtc_state; } EXPORT_SYMBOL(__drm_atomic_helper_crtc_reset); diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index ca3368c828d0..9606185c284b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -1117,8 +1117,6 @@ static void mdp5_crtc_reset(struct drm_crtc *crtc) mdp5_crtc_destroy_state(crtc, crtc->state); __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base); - - drm_crtc_vblank_reset(crtc); } static const struct drm_crtc_funcs mdp5_crtc_funcs = { diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 242d28281784..7a7066cded79 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -642,9 +642,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) goto err_cleanup_modeset; } - for (i = 0; i < priv->num_pipes; i++) - drm_crtc_vblank_off(priv->pipes[i].crtc); - omap_fbdev_init(ddev); drm_kms_helper_poll_init(ddev); diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index d73e88ddecd0..e2959e32fd19 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -1271,9 +1271,6 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex, drm_crtc_helper_add(crtc, &crtc_helper_funcs); - /* Start with vertical blanking interrupt reporting disabled. */ - drm_crtc_vblank_off(crtc); - /* Register the interrupt handler. */ if (rcar_du_has(rcdu, RCAR_DU_FEATURE_CRTC_IRQ_CLOCK)) { /* The IRQ's are associated with the CRTC (sw)index. */ diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 83f31c6e891c..9b308b572eac 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1168,7 +1168,6 @@ static void tegra_crtc_reset(struct drm_crtc *crtc) tegra_crtc_atomic_destroy_state(crtc, crtc->state); __drm_atomic_helper_crtc_reset(crtc, &state->base); - drm_crtc_vblank_reset(crtc); } static struct drm_crtc_state * diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 89a226912de8..4d01c4af61cd 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -352,8 +352,7 @@ static void tidss_crtc_reset(struct drm_crtc *crtc) return; } - crtc->state = &tcrtc->base; - crtc->state->crtc = crtc; + __drm_atomic_helper_crtc_reset(crtc, &tcrtc->base); } static struct drm_crtc_state *tidss_crtc_duplicate_state(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tidss_kms.c index 4b99e9fa84a5..e6ab59eed259 100644 --- a/drivers/gpu/drm/tidss/tidss_kms.c +++ b/drivers/gpu/drm/tidss/tidss_kms.c @@ -278,10 +278,6 @@ int tidss_modeset_init(struct tidss_device *tidss) if (ret) return ret; - /* Start with vertical blanking interrupt reporting disabled. */ - for (i = 0; i < tidss->num_crtcs; ++i) - drm_crtc_vblank_reset(tidss->crtcs[i]); - drm_mode_config_reset(ddev); dev_dbg(tidss->dev, "%s done\n", __func__); From patchwork Tue Jun 2 09:51:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11583493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1528B912 for ; Tue, 2 Jun 2020 09:52:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E96EF20679 for ; Tue, 2 Jun 2020 09:52:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="J2O3xlXA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E96EF20679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9097A6E123; Tue, 2 Jun 2020 09:51:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id A23306E0F8 for ; Tue, 2 Jun 2020 09:51:54 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id x6so2667744wrm.13 for ; Tue, 02 Jun 2020 02:51:54 -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 :mime-version:content-transfer-encoding; bh=oZCX7aP5skMs1QZGNYbvejJPa9/Eiu5Qr/CWi7xzV1k=; b=J2O3xlXAth+t+Ol4fW8PEM7q3aJ8QTEw8dgcvfmG1GVybtkn8/J2J6dD00DuasRXkG m+fSfZaqFjxj0UwZwq4nHCwbAmvlNhKCSyfgUS0pw6Ipz6CIpiM9m0/OfgSy0uJMMpO3 wLbKzWPni9dX40KaCABPPhoGr3nG5r6CsHhE4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oZCX7aP5skMs1QZGNYbvejJPa9/Eiu5Qr/CWi7xzV1k=; b=fufsKTaM8JgZyQYCv7yoCUfoBRzUzq007RcEnfSfSi235bbKhGeenRqvmee0Zv0Xsk ZRtFUUNmYHwuIpPFgvuPAHqzRFZsstFIGjRVCEHwqiOUkwHJwmO2opfWEPvV5MGtfM5p w43McD+cSseGOKrpZlHq2tx2QfSksfo1mn+9nRuJrUuZKeciZv1z7MeD8lxFAE3bzcir SzykjwH+4CKtA0xH2umw3uOSngResZ00IPndc1y2R30wkYwwLTINX8xUrXlpM5rAgAkn C8LH6/MO1a0KBO+OVrmOiGfDcMyK0oLqYbTHxpOmDnvOij4lXtl7DfkNwxilA+fNN1qh cpgQ== X-Gm-Message-State: AOAM533l7kPMzrnTns4IjgIpqGnPGcuqSgE0p4HwYVdYkxBTFCF7iW19 XKipaQZQ1yHHvFAcKxT0SsGJH8N3p6g= X-Google-Smtp-Source: ABdhPJxOTxGK5LwxDbdhktUyYdeYEYORTX/UTTXjl3/yDTUBMXajiDd+bs8jE6TX+IqPXNBuou2sdw== X-Received: by 2002:a05:6000:47:: with SMTP id k7mr24437210wrx.233.1591091513116; Tue, 02 Jun 2020 02:51:53 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id a6sm2996443wrn.38.2020.06.02.02.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 02:51:52 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/3] drm/malidp: Don't call drm_crtc_vblank_off on unbind Date: Tue, 2 Jun 2020 11:51:39 +0200 Message-Id: <20200602095140.36678-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200602095140.36678-1-daniel.vetter@ffwll.ch> References: <20200602095140.36678-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Liviu Dudau , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is already done as part of the drm_atomic_helper_shutdown(), and in that case only for the crtc which are actually on. Signed-off-by: Daniel Vetter Cc: Liviu Dudau Cc: Brian Starkey Cc: Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/malidp_drv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 02904392e370..db6ba5c78042 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -928,7 +928,6 @@ static void malidp_unbind(struct device *dev) drm_dev_unregister(drm); drm_kms_helper_poll_fini(drm); pm_runtime_get_sync(dev); - drm_crtc_vblank_off(&malidp->crtc); malidp_se_irq_fini(hwdev); malidp_de_irq_fini(hwdev); drm->irq_enabled = false; From patchwork Tue Jun 2 09:51:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11583499 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D012F739 for ; Tue, 2 Jun 2020 09:52:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B011920679 for ; Tue, 2 Jun 2020 09:52:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="OMB/lHCd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B011920679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A9D256E129; Tue, 2 Jun 2020 09:51:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED9366E117 for ; Tue, 2 Jun 2020 09:51:55 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x6so2667794wrm.13 for ; Tue, 02 Jun 2020 02:51:55 -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 :mime-version:content-transfer-encoding; bh=zBJStSFyGwXYFshx7uTxuda0k6lYRaHuTLZX4FygES0=; b=OMB/lHCdSerDMq5F3y0UdSeHZ1ySwvyYooKPapUvZTfZu7LNtNnovnTNxvMpuczG6U HnSjsqYfil3JP3XgX2Zmf7kLid3N9MrQxQ4dC6FZot6Uoy5eMCmh56mfszctvWhGsWpi RaZqz5ifvDVqRksaho9/inr0SJdqwLkdXgcq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zBJStSFyGwXYFshx7uTxuda0k6lYRaHuTLZX4FygES0=; b=j8DSad4V15HjTJ466QBe0txjZqw8ps5F8zLZImzggdu5boGjf4RYAvxD43tsAwOKdG JsNnnLEDczkDh+sRTUASVEfLS4BAqWsSfovjENlhjtgwC5nM91MWl6b3TY+DMOJ9SEk5 aBFdhsbhm8xamPeJqPc5v4FsxBtEx2jsPNifLJELE+HVmOVgyYATmQn6CILmLctmcemo JHsB7QDZHLcfEUL3isgSEPPzzCjwPKmCTEZoo6Z3NGBWFpmRxQ7osYDg8pUfTLynGvQJ Ob8ffUfn3BZ6mYIuDRGyzlaRZ/yzWJIZEScS72q6Pjwn7II4TEBVLqulhphcqYmtLBrC 1EhQ== X-Gm-Message-State: AOAM530sfvPBYNZdV3lhH7IaDWUEQ3ImGJkmKSv7fWhtsCqjrvX3EoXL IaFAAHZLshYWOkqbhhOLGxT3WHo6vgM= X-Google-Smtp-Source: ABdhPJxuFjAFdXbTEEKA3QY6AgrPXluPeV2VnPbk43I0VIgYZ1wE1DPthaEbQ3kpgkImnXdTgRMjkg== X-Received: by 2002:adf:f552:: with SMTP id j18mr24368390wrp.279.1591091514182; Tue, 02 Jun 2020 02:51:54 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id a6sm2996443wrn.38.2020.06.02.02.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 02:51:53 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/3] drm/hdlcd: Don't call drm_crtc_vblank_off on unbind Date: Tue, 2 Jun 2020 11:51:40 +0200 Message-Id: <20200602095140.36678-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200602095140.36678-1-daniel.vetter@ffwll.ch> References: <20200602095140.36678-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Liviu Dudau , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is already taken care of by drm_atomic_helper_shutdown(), and in that case only for the CRTC which are actually on. Only tricky bit here is that we kill the interrupt handling before we shut down crtc, so need to reorder that. Signed-off-by: Daniel Vetter Cc: Liviu Dudau Cc: Brian Starkey Cc: Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/hdlcd_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index 194419f47c5e..26bc5d7766f5 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -347,9 +347,8 @@ static void hdlcd_drm_unbind(struct device *dev) of_node_put(hdlcd->crtc.port); hdlcd->crtc.port = NULL; pm_runtime_get_sync(dev); - drm_crtc_vblank_off(&hdlcd->crtc); - drm_irq_uninstall(drm); drm_atomic_helper_shutdown(drm); + drm_irq_uninstall(drm); pm_runtime_put(dev); if (pm_runtime_enabled(dev)) pm_runtime_disable(dev);