From patchwork Wed Jun 2 16:08:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Sneddon X-Patchwork-Id: 12295245 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DBD3C47083 for ; Wed, 2 Jun 2021 16:13:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 26E3C6192C for ; Wed, 2 Jun 2021 16:13:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26E3C6192C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=PhuxcWom6sNtjW2QnaMVlaebYXqH5nns+3GNBpvUo4c=; b=X3OHYcoITMxC/q l/vdWJaTX+3FdgRvJxyba5rzRZ0zoQwtrNdViMsgsu5O1el9g1M8LPGtsmO8nA9rgBV37yh/5kdXa P7RRl5LN+ocSOWao1OJEEYVemWj0dUAKp+oCrTUiMr0CQH064AKhDdr4E1joApatuXjZjhHk1GJi8 OgnnfnTv/JkWAcbwtdvJYfybrpR6AC4MVkEvNO9hVJehncmC8FXgzirLN8fuD0sk/23MiJ8775+oo wUUoR0lSc3QsUsge3kFCskuAbpsDGgQ/56PKcFcG3lqMyWtcvmRaxeBzc3BI3XfHMbSTcmp3pxlZJ 8xRQb6AMrR5RrsT4mKMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loTTF-0053yb-7e; Wed, 02 Jun 2021 16:11:53 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loTQG-0052gb-9C for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 16:08:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1622650129; x=1654186129; h=from:to:cc:subject:date:message-id:mime-version; bh=2gw1LPRHVc5WHx/TLUSAc36JsiCrmgOgMOSM1MRoLSY=; b=goojyr+/85TNofVrIgiRsDajYnHM0T8GhDZ4NM+WZDLXxR1L+04qUT65 0i8z5ueEcbUth5nMoQ7OsGx8cBuoFBR5+v5M4CV/zserX3QYnn9PJeyo4 JIwpgs1yv385bhLrl5nsxo6qQFiif3Gsz9fYhvGq4GiP5qdG4VOykFm8X J7THG3EQCdgCGm3csvMXzXd+5hJRcGM1zcYQ/c5cfJgdBUerwW+rTB7mu ntGfslvUEPTuaCSHcH0aMXtP5vUWcVf1Ro5VIGKfW60jpr6n84mIK+YiT 2ZIunsYZDre0leY7I25AWhei4G3ruELjWr+xokqrapZwNPMrnZ836AYPZ A==; IronPort-SDR: fJiU9Iv86kQyanaDFZQyhjRa8bUG5TM9OX4uwRTFTY4U4xePJz7dC+7cj0ucEJtr5azJXzPgpr cXICT7dlLL7+b/nsP2OdA8Ownbf6Or2W8Ajj1clbzklh7yikbLAHBpAxb0yrGe6sZajb00QNpa UsXfhl8eVkmBanvrXP7G+2UNrxfPM0WxevgJzOLPilxgS8cpFa6JHeHEXyb+c/mv/1p5MrD/1g vq6NrAQnOoHuyCW+qWbDovmqVVatfT5f8XGHZZRLXYadvXgTt3a+4BvZ+IOS5XzYym9TcnMcfX 5Fo= X-IronPort-AV: E=Sophos;i="5.83,242,1616482800"; d="scan'208";a="123275472" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Jun 2021 09:08:48 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 09:08:47 -0700 Received: from dan-linux.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 2 Jun 2021 09:08:47 -0700 From: Dan Sneddon To: Sam Ravnborg , Daniel Vetter , , , Subject: [PATCH] drm:atmel: Enable the crtc vblank prior to crtc usage. Date: Wed, 2 Jun 2021 09:08:45 -0700 Message-ID: <20210602160846.5013-1-dan.sneddon@microchip.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_090848_393306_C9BD8300 X-CRM114-Status: GOOD ( 11.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Belloni , Boris Brezillon , David Airlie , Dan Sneddon , Ludovic Desroches , Daniel Vetter Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 'commit eec44d44a3d2 ("drm/atmel: Use drm_atomic_helper_commit")' removed the home-grown handling of atomic commits and exposed an issue in the crtc atomic commit handling where vblank is expected to be enabled but hasn't yet, causing kernel warnings during boot. This patch cleans up the crtc vblank handling thus removing the warning on boot. Fixes: eec44d44a3d2 ("drm/atmel: Use drm_atomic_helper_commit") Signed-off-by: Dan Sneddon --- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c index 05ad75d155e8..cfe4fc69277e 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c @@ -232,7 +232,6 @@ static void atmel_hlcdc_crtc_atomic_enable(struct drm_crtc *c, pm_runtime_put_sync(dev->dev); - drm_crtc_vblank_on(c); } #define ATMEL_HLCDC_RGB444_OUTPUT BIT(0) @@ -343,8 +342,17 @@ static int atmel_hlcdc_crtc_atomic_check(struct drm_crtc *c, static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c, struct drm_atomic_state *state) +{ + drm_crtc_vblank_on(c); +} + +static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *c, + struct drm_atomic_state *state) { struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c); + unsigned long flags; + + spin_lock_irqsave(&c->dev->event_lock, flags); if (c->state->event) { c->state->event->pipe = drm_crtc_index(c); @@ -354,12 +362,7 @@ static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c, crtc->event = c->state->event; c->state->event = NULL; } -} - -static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc, - struct drm_atomic_state *state) -{ - /* TODO: write common plane control register if available */ + spin_unlock_irqrestore(&c->dev->event_lock, flags); } static const struct drm_crtc_helper_funcs lcdc_crtc_helper_funcs = {