From patchwork Thu Jun 30 20:57:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12902218 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2DA36C433EF for ; Thu, 30 Jun 2022 20:57:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6986C1129EC; Thu, 30 Jun 2022 20:57:49 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id F17501129EC for ; Thu, 30 Jun 2022 20:57:46 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (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 17B2183C97; Thu, 30 Jun 2022 22:57:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1656622665; bh=mbUaXcG2W8Dnh4vU/jQ8F9Z5x9++ov8/BuCIXXtckKE=; h=From:To:Cc:Subject:Date:From; b=kVE4N6aavsDMmVjTxFHAsCVIA+f5qRRPn1N4yomUfA5Ux8fTm3VUt2NPJ14nhxKyO bjua+YeBKAz9gbgvo5hvFJ4jtWF+knHX2Uu/+LPM8v6cZkAlDKsrVSIh6UyW2jqrZt M/u97YjEl4xcR6P2o5cSgL/a7H0rg4HJQg4s4x7kwMLiWqh2iSu/u1jhaKjLytZ2UT XpnIRGDtpcI5Ij5/m5K7JSPWSf8hIao1oXn284NNCEe5kNObbZChRalI8pRGeoFgVR /AhNdyTcOzO34STidqjzOl2I0ObURHKSVN8fxqoPJ/ak1DV3fMEjt47lVNHGEkIOb8 lZayvfDBxcpAw== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/lcdif: Clean up headers Date: Thu, 30 Jun 2022 22:57:25 +0200 Message-Id: <20220630205728.128127-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Alexander Stein , robert.foss@linaro.org, Liu Ying , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop unneeded headers, sort rest alphabetically, no functional change. Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Liu Ying Tested-by: Martyn Welch --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 3 --- drivers/gpu/drm/mxsfb/lcdif_drv.h | 1 + drivers/gpu/drm/mxsfb/lcdif_kms.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index befad33dcb959..1370889c6d687 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -16,10 +15,8 @@ #include #include -#include #include #include -#include #include #include #include diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.h b/drivers/gpu/drm/mxsfb/lcdif_drv.h index cb916341e8454..6cdba6e20c02b 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.h +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.h @@ -8,6 +8,7 @@ #ifndef __LCDIF_DRV_H__ #define __LCDIF_DRV_H__ +#include #include #include #include diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index 4005660b0ced8..c9224126e2d54 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -16,9 +16,9 @@ #include #include #include -#include #include #include +#include #include #include #include From patchwork Thu Jun 30 20:57:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12902219 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7D915C43334 for ; Thu, 30 Jun 2022 20:57:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 05D581129FF; Thu, 30 Jun 2022 20:57:54 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id E70E11129EC for ; Thu, 30 Jun 2022 20:57:47 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (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 8F3DC843DC; Thu, 30 Jun 2022 22:57:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1656622665; bh=xWXbTM9QWrfwqvu8ClxHRcbOE1KpyfdNmB/qZ0jn4I0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bIxggh0bXk9ExQc5qgW/ZartgUeic6tWksmdfMcxceW+H1aXGWNQ13uf/S4A0s2wP D4OYvOqk8iXrvBDgUzy/SsJlgxxBoq01LqyF/apE1fKVGIMGtgbt3lAKRFKk/SAYsA aaOZaLcC0/Mav4PM5Eu3JKUOkZJDvdPK8czqEh8N8UdxieFM2gbRBlCT6etqTYRN3Z COboyGn8/oukERteu2d97pmmYhs6Iwc8JHuDa4sylb7xqXRjlc3uJ1CG4vFImsX0H9 38MmxFZoKWjhxrWyNHFsRzVfhJ2M5eH2Kj0ggozCBelK1kR8viIHiLRGOtrwJqaVjd 6Rv2lqNAA6B/g== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] drm/lcdif: Consistently use plane timings Date: Thu, 30 Jun 2022 22:57:26 +0200 Message-Id: <20220630205728.128127-2-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630205728.128127-1-marex@denx.de> References: <20220630205728.128127-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Alexander Stein , robert.foss@linaro.org, Liu Ying , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop the crtc_ prefix from mode, consistently use the plane one. Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Liu Ying --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index c9224126e2d54..df3d1832caae8 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -122,8 +122,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) writel(ctrl, lcdif->base + LCDC_V8_CTRL); - writel(DISP_SIZE_DELTA_Y(m->crtc_vdisplay) | - DISP_SIZE_DELTA_X(m->crtc_hdisplay), + writel(DISP_SIZE_DELTA_Y(m->vdisplay) | + DISP_SIZE_DELTA_X(m->hdisplay), lcdif->base + LCDC_V8_DISP_SIZE); writel(HSYN_PARA_BP_H(m->htotal - m->hsync_end) | @@ -138,8 +138,8 @@ static void lcdif_set_mode(struct lcdif_drm_private *lcdif, u32 bus_flags) VSYN_HSYN_WIDTH_PW_H(m->hsync_end - m->hsync_start), lcdif->base + LCDC_V8_VSYN_HSYN_WIDTH); - writel(CTRLDESCL0_1_HEIGHT(m->crtc_vdisplay) | - CTRLDESCL0_1_WIDTH(m->crtc_hdisplay), + writel(CTRLDESCL0_1_HEIGHT(m->vdisplay) | + CTRLDESCL0_1_WIDTH(m->hdisplay), lcdif->base + LCDC_V8_CTRLDESCL0_1); writel(CTRLDESCL0_3_PITCH(lcdif->crtc.primary->state->fb->pitches[0]), From patchwork Thu Jun 30 20:57:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12902220 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 80614C433EF for ; Thu, 30 Jun 2022 20:57:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75DC71129F4; Thu, 30 Jun 2022 20:57:53 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id E75C61129F4 for ; Thu, 30 Jun 2022 20:57:47 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (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 02433843E8; Thu, 30 Jun 2022 22:57:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1656622666; bh=TAkFMgFOfkGA81QU3BdnD6PmHVnKme7tbKfbqiZgRto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OdgnuS/T4U0+L3aZXUzryLKjPezUJNEYQyKfUK8PmzCmJKhrnhGzZudqjF1j/gcSz dPXH2Re2lnoH83gZo9jyuqZ07AhhwuizNNu/mz4/xNg/VRFRSH5kf+43ZXGQ53Zl2X jAGz7mf6toY24EIprsuGebObW2ep4kuAyGaby9XTnPw7GqdVUh7Y3wbJpj8JIEG+6F tEel7wZMWyAjmOtqh+wzOIpZ5i2OK4Djz8vksqj9yzv1N0jEedHbWLK7EAm4N9kk02 m/xatfgRdLLil9xdBUyZZnrKbnM5ZUfUKfMYcxbXxzf5yhOeHjz/dwQKq/n4EG5Zky Q8G+0EupBtFDg== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/lcdif: Clean up debug prints and comments Date: Thu, 30 Jun 2022 22:57:27 +0200 Message-Id: <20220630205728.128127-3-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630205728.128127-1-marex@denx.de> References: <20220630205728.128127-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Alexander Stein , robert.foss@linaro.org, Liu Ying , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Update debug print to report bridge timings over connector ones. Drop missed comment commit from mxsfb. Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Liu Ying --- drivers/gpu/drm/mxsfb/lcdif_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_kms.c b/drivers/gpu/drm/mxsfb/lcdif_kms.c index df3d1832caae8..4fbb7898ac91d 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c @@ -203,7 +203,7 @@ static void lcdif_crtc_mode_set_nofb(struct lcdif_drm_private *lcdif, DRM_DEV_DEBUG_DRIVER(drm->dev, "Pixel clock: %dkHz (actual: %dkHz)\n", m->crtc_clock, (int)(clk_get_rate(lcdif->clk) / 1000)); - DRM_DEV_DEBUG_DRIVER(drm->dev, "Connector bus_flags: 0x%08X\n", + DRM_DEV_DEBUG_DRIVER(drm->dev, "Bridge bus_flags: 0x%08X\n", bus_flags); DRM_DEV_DEBUG_DRIVER(drm->dev, "Mode flags: 0x%08X\n", m->flags); @@ -295,7 +295,6 @@ static void lcdif_crtc_atomic_enable(struct drm_crtc *crtc, lcdif_crtc_mode_set_nofb(lcdif, bridge_state, bus_format); - /* Write cur_buf as well to avoid an initial corrupt frame */ paddr = drm_fb_cma_get_gem_addr(new_pstate->fb, new_pstate, 0); if (paddr) { writel(lower_32_bits(paddr), From patchwork Thu Jun 30 20:57:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 12902221 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C830DC433EF for ; Thu, 30 Jun 2022 20:58:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C45F6112A01; Thu, 30 Jun 2022 20:58:01 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3331D1129FE for ; Thu, 30 Jun 2022 20:57:48 +0000 (UTC) Received: from tr.lan (ip-86-49-12-201.bb.vodafone.cz [86.49.12.201]) (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 66BDC843F9; Thu, 30 Jun 2022 22:57:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1656622666; bh=doHWW8b5JUx0pqW/ci/iAl4AyBxRtLuEnSD5GG90E6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KwFExp+v3MJc7ZtMYRJ/83R7hj/iEWiag5s/ctP8CYJzgyfYh868M4P0lBcbjuF8A 4MTp7hOMgNMII2fyDfEAEOzfq4T5pclwBoznIP+5KtWj+R5La9sgHXAxCEsNFRD1OX vrS6xCEjVPME+dEOPD5whpUAlsdI5EmR5R7x22kLneV/i98Kj40OBC1j89NoVhptyw aQfK+5/AYHRrOksP0jOKldQrjL6NSVOZZ46zz9ZUINTWFVQdvJ981Djeh1UOI6qyUA 3pax4GJAZ2SqipB7V+dY7YU1kSaKOnRQwpWMVsNClRxTMUgXmTCSztCB+4WvF9/K5o 4AOAmapqKQH7g== From: Marek Vasut To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] drm/lcdif: switch to devm_drm_of_get_bridge Date: Thu, 30 Jun 2022 22:57:28 +0200 Message-Id: <20220630205728.128127-4-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630205728.128127-1-marex@denx.de> References: <20220630205728.128127-1-marex@denx.de> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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: Marek Vasut , Peng Fan , Martyn Welch , Alexander Stein , robert.foss@linaro.org, Liu Ying , Laurent Pinchart , Robby Cai , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The function "drm_of_find_panel_or_bridge" has been deprecated in favor of "devm_drm_of_get_bridge". Switch to the new function and reduce boilerplate. Fixes: 9db35bb349a0e ("drm: lcdif: Add support for i.MX8MP LCDIF variant") Signed-off-by: Marek Vasut Cc: Alexander Stein Cc: Laurent Pinchart Cc: Liu Ying Cc: Lucas Stach Cc: Marek Vasut Cc: Martyn Welch Cc: Peng Fan Cc: Robby Cai Cc: Sam Ravnborg Cc: Stefan Agner Reviewed-by: Liu Ying --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 1370889c6d687..746a4261f3da2 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -42,23 +42,11 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct drm_device *drm = lcdif->drm; struct drm_bridge *bridge; - struct drm_panel *panel; int ret; - ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel, - &bridge); - if (ret) - return ret; - - if (panel) { - bridge = devm_drm_panel_bridge_add_typed(drm->dev, panel, - DRM_MODE_CONNECTOR_DPI); - if (IS_ERR(bridge)) - return PTR_ERR(bridge); - } - - if (!bridge) - return -ENODEV; + bridge = devm_drm_of_get_bridge(drm->dev, drm->dev->of_node, 0, 0); + if (IS_ERR(bridge)) + return PTR_ERR(bridge); ret = drm_bridge_attach(&lcdif->encoder, bridge, NULL, 0); if (ret)