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: 13682128 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7FC628DA0 for ; Fri, 31 May 2024 20:28:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717187312; cv=none; b=kr125fIZk8rQLG85E6PSM5zWuQVeQKAscIcuqEYeLHFdxwFmlEr04K/OF3ThceEQca5RPyklXynnaYnPqHeeyDL7bdXsvHuQvnEygcFmHSspF0+kkpxUWj3cr2LWjQGHR4uNGUf9E/jPYAaaxac3E3m2ObjMSP2JRzAd9xW666E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717187312; c=relaxed/simple; bh=sD5bR/nj4EUSz7HeYPqrdPfgShTNncId10MKNI3+39I=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lhVuyfa9ZFBT+BNlEayCLW0DG9+b3SGU2AbwHV49J426WJX76yN78DXRKh1wvC3/oopBrpTbdZM2/Ov/as7EokkJVSei++QLkiUUDxxRwzU9HLuFdAcA1JI/bIUsRNSmMCLrtm9DVB0e3ph8uOZwGNd3lp82hngAZmhoFiBQJG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=qQyH6uua; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="qQyH6uua" 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 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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);