diff mbox series

[v2,04/49] drm/omap: dsi: Hack-fix DSI bus flags

Message ID 20190111035120.20668-5-laurent.pinchart@ideasonboard.com
State New
Headers show
Series None | expand

Commit Message

Laurent Pinchart Jan. 11, 2019, 3:50 a.m. UTC
From: Tomi Valkeinen <tomi.valkeinen@ti.com>

Since commit b4935e3a3cfa ("drm/omap: Store bus flags in the
omap_dss_device structure") video mode flags are managed by the omapdss
(and later omapdrm) core based on bus flags stored in omap_dss_device.
This works fine for all devices whose video modes are set by the omapdss
and omapdrm core, but breaks DSI operation as the DSI still uses legacy
code paths and sets the DISPC timings manually.

To fix the problem properly we should move the DSI encoder to the new
encoder model. This will however require a considerable amount of work.
Restore DSI operation by adding back video mode flags handling in the
DSI encoder driver as a hack in the meantime.

Fixes: b4935e3a3cfa ("drm/omap: Store bus flags in the omap_dss_device structure")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/dsi.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Sebastian Reichel Feb. 9, 2019, 2:04 a.m. UTC | #1
Hi,

On Fri, Jan 11, 2019 at 05:50:35AM +0200, Laurent Pinchart wrote:
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>

> 

> Since commit b4935e3a3cfa ("drm/omap: Store bus flags in the

> omap_dss_device structure") video mode flags are managed by the omapdss

> (and later omapdrm) core based on bus flags stored in omap_dss_device.

> This works fine for all devices whose video modes are set by the omapdss

> and omapdrm core, but breaks DSI operation as the DSI still uses legacy

> code paths and sets the DISPC timings manually.

> 

> To fix the problem properly we should move the DSI encoder to the new

> encoder model. This will however require a considerable amount of work.

> Restore DSI operation by adding back video mode flags handling in the

> DSI encoder driver as a hack in the meantime.

> 

> Fixes: b4935e3a3cfa ("drm/omap: Store bus flags in the omap_dss_device structure")

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---


Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>


-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dsi.c | 11 +++++++++++

>  1 file changed, 11 insertions(+)

> 

> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c

> index b5685018d830..64fb788b6647 100644

> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c

> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c

> @@ -4751,6 +4751,17 @@ 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;

> +	/*

> +	 * HACK: These flags should be handled through the omap_dss_device bus

> +	 * flags, but this will only be possible when the DSI encoder will be

> +	 * converted to the omapdrm-managed encoder model.

> +	 */

> +	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);

>  

> -- 

> Regards,

> 

> Laurent Pinchart

> 

> _______________________________________________

> dri-devel mailing list

> dri-devel@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index b5685018d830..64fb788b6647 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4751,6 +4751,17 @@  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;
+	/*
+	 * HACK: These flags should be handled through the omap_dss_device bus
+	 * flags, but this will only be possible when the DSI encoder will be
+	 * converted to the omapdrm-managed encoder model.
+	 */
+	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);