From: Tomi Valkeinen Subject: Re: [PATCH 0/6] omapdrm: drm_bridge and drm_panel support Date: Thu, 20 Dec 2018 14:49:15 +0200 Message-ID: References: <20181210010623.3233-1-laurent.pinchart@ideasonboard.com> <20181220121726.gzx53dr7d7gerdfm@earth.universe> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------69AEAF39B4AC3816554BF680" Return-path: Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71F2B6E392 for ; Thu, 20 Dec 2018 12:49:25 +0000 (UTC) In-Reply-To: <20181220121726.gzx53dr7d7gerdfm@earth.universe> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Sebastian Reichel , Laurent Pinchart Cc: Thierry Reding , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --------------69AEAF39B4AC3816554BF680 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, On 20/12/18 14:17, Sebastian Reichel wrote: > Hi, > > On Mon, Dec 10, 2018 at 03:06:17AM +0200, Laurent Pinchart wrote: >> This patch series hooks up support for drm_bridge and drm_panel in the omapdrm >> driver. >> >> [...] > > The series is > > Reviewed-by: Sebastian Reichel > > At the same time it is tested to break display on Droid 4. I don't > know the exact reason yet. Debugging this is annoyingly hard, since > the patches for manual display update still have not been merged > making the testing process cumbersome. I found a few issues while trying to get a DSI video mode panel working. Attached WIP patches. Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki --------------69AEAF39B4AC3816554BF680 Content-Type: text/x-patch; name="0001-drm-omap-fix-crash-in-DSI-debug-dumps.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-drm-omap-fix-crash-in-DSI-debug-dumps.patch" >From d840733d13a9a723824d78aa871e3d847fdf954a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 18 Dec 2018 14:02:16 +0200 Subject: [PATCH 1/3] drm/omap: fix crash in DSI debug dumps Reading any of the DSI debugfs files results in a crash, as wrong pointer is passed to the dump functions, and the dump functions use a wrong pointer. This patch fixes DSI debug dumps. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dsi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 00a9c2ab9e6c..277f9dd2ec8c 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -1406,7 +1406,7 @@ static void dsi_pll_disable(struct dss_pll *pll) static int dsi_dump_dsi_clocks(struct seq_file *s, void *p) { - struct dsi_data *dsi = p; + struct dsi_data *dsi = s->private; struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo; enum dss_clk_source dispc_clk_src, dsi_clk_src; int dsi_module = dsi->module_id; @@ -1467,7 +1467,7 @@ static int dsi_dump_dsi_clocks(struct seq_file *s, void *p) #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS static int dsi_dump_dsi_irqs(struct seq_file *s, void *p) { - struct dsi_data *dsi = p; + struct dsi_data *dsi = s->private; unsigned long flags; struct dsi_irq_stats stats; @@ -1558,7 +1558,7 @@ static int dsi_dump_dsi_irqs(struct seq_file *s, void *p) static int dsi_dump_dsi_regs(struct seq_file *s, void *p) { - struct dsi_data *dsi = p; + struct dsi_data *dsi = s->private; if (dsi_runtime_get(dsi)) return 0; @@ -5083,15 +5083,15 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) snprintf(name, sizeof(name), "dsi%u_regs", dsi->module_id + 1); dsi->debugfs.regs = dss_debugfs_create_file(dss, name, - dsi_dump_dsi_regs, &dsi); + dsi_dump_dsi_regs, dsi); #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS snprintf(name, sizeof(name), "dsi%u_irqs", dsi->module_id + 1); dsi->debugfs.irqs = dss_debugfs_create_file(dss, name, - dsi_dump_dsi_irqs, &dsi); + dsi_dump_dsi_irqs, dsi); #endif snprintf(name, sizeof(name), "dsi%u_clks", dsi->module_id + 1); dsi->debugfs.clks = dss_debugfs_create_file(dss, name, - dsi_dump_dsi_clocks, &dsi); + dsi_dump_dsi_clocks, dsi); return 0; } -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki --------------69AEAF39B4AC3816554BF680 Content-Type: text/x-patch; name="0002-drm-omap-hackfix-dsi-bus-flags.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0002-drm-omap-hackfix-dsi-bus-flags.patch" >From 05091e15215098083dfc9d0b0c2fe68dcc620e3d Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 18 Dec 2018 16:16:34 +0200 Subject: [PATCH 2/3] drm/omap: hackfix dsi bus flags --- drivers/gpu/drm/omapdrm/dss/dsi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index 277f9dd2ec8c..c7166a55d3e4 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -4751,6 +4751,12 @@ static int dsi_set_config(struct omap_dss_device *dssdev, dsi->vm.flags |= DISPLAY_FLAGS_HSYNC_HIGH; dsi->vm.flags &= ~DISPLAY_FLAGS_VSYNC_LOW; dsi->vm.flags |= DISPLAY_FLAGS_VSYNC_HIGH; + dsi->vm.flags &= ~DISPLAY_FLAGS_PIXDATA_NEGEDGE; + dsi->vm.flags |= DISPLAY_FLAGS_PIXDATA_POSEDGE; + dsi->vm.flags &= ~DISPLAY_FLAGS_DE_LOW; + dsi->vm.flags |= DISPLAY_FLAGS_DE_HIGH; + dsi->vm.flags &= ~DISPLAY_FLAGS_SYNC_POSEDGE; + dsi->vm.flags |= DISPLAY_FLAGS_SYNC_NEGEDGE; dss_mgr_set_timings(&dsi->output, &dsi->vm); -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki --------------69AEAF39B4AC3816554BF680 Content-Type: text/x-patch; name="0003-fix-dsi-depopulate.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0003-fix-dsi-depopulate.patch" >From 23c95dff188a17c6bc93cb5199c9dd35f7df9ecd Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 19 Dec 2018 11:08:27 +0200 Subject: [PATCH 3/3] fix dsi depopulate --- drivers/gpu/drm/omapdrm/dss/dsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c index c7166a55d3e4..22df0353a7c3 100644 --- a/drivers/gpu/drm/omapdrm/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -5110,8 +5110,6 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data) dss_debugfs_remove_file(dsi->debugfs.irqs); dss_debugfs_remove_file(dsi->debugfs.regs); - of_platform_depopulate(dev); - WARN_ON(dsi->scp_clk_refcount > 0); dss_pll_unregister(&dsi->pll); @@ -5463,6 +5461,8 @@ static int dsi_remove(struct platform_device *pdev) dsi_uninit_output(dsi); + of_platform_depopulate(&pdev->dev); + pm_runtime_disable(&pdev->dev); if (dsi->vdds_dsi_reg != NULL && dsi->vdds_dsi_enabled) { -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki --------------69AEAF39B4AC3816554BF680 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --------------69AEAF39B4AC3816554BF680--