From patchwork Fri May 31 20:27:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 13682130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 28DB1C25B75 for ; Fri, 31 May 2024 20:28:46 +0000 (UTC) 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :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=wD8LtN665FdmHv332UUJ+of1Sq4Ym0sPHahvj9/QCGE=; b=wHU2k46VYJhPnC lGBsBSbeFd6wp8iHFWVv+dsvtIRUNR7DMAYffPWq0Pt/zJsu55U5Y8WxmL0Oindt0mjq4zOY6LWt1 vG1iWLkAVslXsZfxwkhLcE0PfVSwvBGGT8L9OKMrP2wk/QiXicC2szNp0VAGAVOWc3BmZL4jtzayW T5zLf9vjCnXzC61fIla5sVsufep71+74OwAlvyqETn/UXup7naZuJ0Lvy+cUKfwzT68+LYbxcCRRW mg+ETgy8qEXuVPbqEmn6OgUICWR8tMlGdZKC97MaSS52pnyv4GwP9/S4pRvNtTEiqr9FSiTUPGA4r /ru0LYuALthYlfuzHE4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8ra-0000000BNBN-18ld; Fri, 31 May 2024 20:28:34 +0000 Received: from phobos.denx.de ([85.214.62.61]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8rX-0000000BN9X-0RlZ for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 20:28:32 +0000 Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 2F4E0882CD; Fri, 31 May 2024 22:28:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1717187308; bh=+AS08pOYhC0hjeQD7oKsJG2RA/tLALJu0DV65uV4toM=; h=From:To:Cc:Subject:Date:From; b=qQyH6uuaUvY9VWDaDyNQAE6XoPZH0up/wOQg60Vm2ui3VwGwETT07bHlbjGT2e1HC OZ0g6d0XyqEm+0MikIzzOoVINhalN/EQS2P1BvGcx4wMPRH9ZVPZPkV2wU9BaugJJc fJ6EWnJBnUGWy+U+UdmWrXqr6yXb6caUT225m20IjkIv0561DYSN+/z/w/XX2zSqKL HwTmWizTLRiXpgmJhpQ9LkvWjTTOiBQxvMV0t4soKxcSD0S/dbZ7B/p5X1UYDknrhM tNJ/X3sdvgyTXfGZ4GATs3fWCyiC+Zp6PAYuOzXW0q1ExKED7c8Z2RCe8rerAcNWv4 Ksz90X3vwV/Jw== From: Marek Vasut To: dri-devel@lists.freedesktop.org Cc: Marek Vasut , Daniel Vetter , David Airlie , Fabio Estevam , Lucas Stach , "Lukas F . Hartmann" , Maarten Lankhorst , Maxime Ripard , Pengutronix Kernel Team , Sascha Hauer , Shawn Guo , Stefan Agner , Thomas Zimmermann , imx@lists.linux.dev, kernel@dh-electronics.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH] drm: lcdif: Use adjusted_mode .clock instead of .crtc_clock Date: Fri, 31 May 2024 22:27:21 +0200 Message-ID: <20240531202813.277109-1-marex@denx.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_132831_476392_19E5BFBD X-CRM114-Status: GOOD ( 10.36 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In case an upstream bridge modified the required clock frequency in its .atomic_check callback by setting adjusted_mode.clock , make sure that clock frequency is generated by the LCDIFv3 block. This is useful e.g. when LCDIFv3 feeds DSIM which feeds TC358767 with (e)DP output, where the TC358767 expects precise timing on its input side, the precise timing must be generated by the LCDIF. Signed-off-by: Marek Vasut Reviewed-by: Alexander Stein Tested-by: Isaac Scott Tested-by: Isaac Scott --- Cc: Daniel Vetter Cc: David Airlie Cc: Fabio Estevam Cc: Lucas Stach Cc: Lukas F. Hartmann Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Pengutronix Kernel Team Cc: Sascha Hauer Cc: Shawn Guo Cc: Stefan Agner Cc: Thomas Zimmermann Cc: dri-devel@lists.freedesktop.org Cc: imx@lists.linux.dev Cc: kernel@dh-electronics.com Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 2541d2de4e45f..dbd42cc1da87f 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -407,8 +407,7 @@ static void lcdif_crtc_mode_set_nofb(struct drm_crtc_state *crtc_state, struct drm_display_mode *m = &crtc_state->adjusted_mode; DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n", - m->crtc_clock, - (int)(clk_get_rate(lcdif->clk) / 1000)); + m->clock, (int)(clk_get_rate(lcdif->clk) / 1000)); DRM_DEV_DEBUG_DRIVER(drm->dev, "Bridge bus_flags: 0x%08X\n", lcdif_crtc_state->bus_flags); DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags); @@ -538,7 +537,7 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_device *drm = lcdif->drm; dma_addr_t paddr; - clk_set_rate(lcdif->clk, m->crtc_clock * 1000); + clk_set_rate(lcdif->clk, m->clock * 1000); pm_runtime_get_sync(drm->dev);