From patchwork Wed Apr 2 13:30:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 14036037 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 1D68EC3601B for ; Wed, 2 Apr 2025 13:37:52 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sJvI34xiFjRXVlrRx0CfhPncbxfVw9QzOIS8v8AAplw=; b=MUurD7vmPgUPN1 hlAsVrg7EtDg8EP88ea4FpR80kln7XpMEFrEZ2LOy8gjdXBij9+76IxCW8NdpcV+OL8OId4kP+in4 uBfxfNyyztL0V+B3CxWcUNhFPsu6InDBs/ihWSWAroEcySkrVrElmHDWFFdXgUfl4vdJjdSvpQtJD umNFtrMizxlJOkT+1bBxH0J/I2zY2ESr6/XojoCjJSfuYl08252lHd15HD00fLttbZs5lsEqTME/M Y61PYUOcoTh+jemwru5bcXK9tETKQTmlgd9kOthCzwGJlvW8Dq9kax5/W5xgwQak97tkoay+Ff3Zx QLlDHWRfoPMgJkCcp3Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzyHv-00000006Gjp-3UxT; Wed, 02 Apr 2025 13:37:51 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzyBb-00000006F7O-0MQA for linux-phy@lists.infradead.org; Wed, 02 Apr 2025 13:31:20 +0000 Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 18666109A; Wed, 2 Apr 2025 15:29:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1743600565; bh=lEa3BxN/6LhqthWXir58vTyZRT4d8BUmsi3iv05b4SI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Hy0ZYv7+3NqqgAW6ebTLNj5eH6r2ENeyc/blyhhqBpSlqnBwwUqwXlwD49+yrFSLs IMPf0B6XfIpmyQpLcXQ/vhpXR9lqE4Ww/Q1ShnLm0L1sO7kt9RqcZqZJC+Cgv1sPGV fi2pmDfwqoHy9ZO6DIjEz1eB3HGiy/Rqpeq60okE= From: Tomi Valkeinen Date: Wed, 02 Apr 2025 16:30:44 +0300 Subject: [PATCH v2 02/18] drm/tidss: Use the crtc_* timings when programming the HW MIME-Version: 1.0 Message-Id: <20250402-cdns-dsi-impro-v2-2-4a093eaa5e27@ideasonboard.com> References: <20250402-cdns-dsi-impro-v2-0-4a093eaa5e27@ideasonboard.com> In-Reply-To: <20250402-cdns-dsi-impro-v2-0-4a093eaa5e27@ideasonboard.com> To: Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Vinod Koul , Kishon Vijay Abraham I , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, Francesco Dolcini , Aradhya Bhatia , Devarsh Thakkar , Tomi Valkeinen X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2447; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=lEa3BxN/6LhqthWXir58vTyZRT4d8BUmsi3iv05b4SI=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBn7TwbvLVB3NSmEEZTKu2mPkd4cA53AxHiHX+cu 5bfLMU8TS6JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZ+08GwAKCRD6PaqMvJYe 9YhAEACdn7Oov1vXfnvsqQzBPL5vwo3aQ+a4r7+ThgX72vDWUZGEOsnceOUSZQ/kOBrq/jD+6E6 YMTaSawx/zRswAAP7WZE1bFd+6z1cXCmNPG2n32uuK5ZCmqObJsOeFBjwfjFvaj/MF+EsGpUyUq e7LY81lqAZ3D1GDP6xBRytSabDoObPpXq/flP7O5Fp21I414UcJ0KOHpY5W6l5T5nEgmbDuw8+O oobEl38xV/8siHif2loJz2WG9Lcjt3uwtd6GpX1HlWOJ4sM8xeWcQWQcuDA82qt+iyM9SrXUT8/ bOBc15mxhN8Xccl4UwTQ2bArkFjt4pr5+efjgUK3Pf9lpEuJufM8msXpAtfIAhTHRrKX1Z9VsxA rOLBWEAMtg5Df5q+4/T6x9pJI6z4luCbY490q3vDxJEfARQNso96i0EgwDylPGnJ26FyAfuML0O 822FOJzLMxiEhd1In7hO3gDL/U5OuEixME7uxHVP5piFfNNM1jBLULEU4dBSbDPOXmIg1cC+x/T AztfKErMNF60ODMLK12eSIKYKZJkFeFHX+Zy/visWKf1kA6rqhnsbqf8itA/ZDPv6kuvG/23B4M NU6JU8R90kccucxKjhv8ERWCeIPRWEDVKUPpjHR+H6P+sZHoX+ftCTkpIQGau+0WrCqLkIH/sCw Xvv81vKlzLHxMdA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250402_063119_282254_B22CA7B0 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Use the crtc_* fields from drm_display_mode, instead of the "logical" fields. This shouldn't change anything in practice, but afaiu the crtc_* fields are the correct ones to use here. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_crtc.c | 2 +- drivers/gpu/drm/tidss/tidss_dispc.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 94f8e3178df5..1604eca265ef 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -225,7 +225,7 @@ static void tidss_crtc_atomic_enable(struct drm_crtc *crtc, tidss_runtime_get(tidss); r = dispc_vp_set_clk_rate(tidss->dispc, tcrtc->hw_videoport, - mode->clock * 1000); + mode->crtc_clock * 1000); if (r != 0) return; diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index cacb5f3d8085..a5107f2732b1 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -1084,13 +1084,13 @@ void dispc_vp_enable(struct dispc_device *dispc, u32 hw_videoport, dispc_set_num_datalines(dispc, hw_videoport, fmt->data_width); - hfp = mode->hsync_start - mode->hdisplay; - hsw = mode->hsync_end - mode->hsync_start; - hbp = mode->htotal - mode->hsync_end; + hfp = mode->crtc_hsync_start - mode->crtc_hdisplay; + hsw = mode->crtc_hsync_end - mode->crtc_hsync_start; + hbp = mode->crtc_htotal - mode->crtc_hsync_end; - vfp = mode->vsync_start - mode->vdisplay; - vsw = mode->vsync_end - mode->vsync_start; - vbp = mode->vtotal - mode->vsync_end; + vfp = mode->crtc_vsync_start - mode->crtc_vdisplay; + vsw = mode->crtc_vsync_end - mode->crtc_vsync_start; + vbp = mode->crtc_vtotal - mode->crtc_vsync_end; dispc_vp_write(dispc, hw_videoport, DISPC_VP_TIMING_H, FLD_VAL(hsw - 1, 7, 0) | @@ -1132,8 +1132,8 @@ void dispc_vp_enable(struct dispc_device *dispc, u32 hw_videoport, FLD_VAL(ivs, 12, 12)); dispc_vp_write(dispc, hw_videoport, DISPC_VP_SIZE_SCREEN, - FLD_VAL(mode->hdisplay - 1, 11, 0) | - FLD_VAL(mode->vdisplay - 1, 27, 16)); + FLD_VAL(mode->crtc_hdisplay - 1, 11, 0) | + FLD_VAL(mode->crtc_vdisplay - 1, 27, 16)); VP_REG_FLD_MOD(dispc, hw_videoport, DISPC_VP_CONTROL, 1, 0, 0); }