Skip to contentSkip to conversation

OMAPDSS: Misc DSS clean ups

PATCH In review Archit Taneja 3 participants 27 messages Jun 26, 2012 – Jun 27, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover OMAPDSS: Misc DSS clean ups

This series does the following things:

- Remove passive matrix LCD support: There are no panel drivers with passive matrix LCD drivers in DSS2. There are no passive matrix panels even available to test with DSS. Since no one is using passive matrix panels, stop trying to support it. It cleans up the DSS driver.

- Add some new fields to omap_video_timings: There were some standard panel timing fields missing from omap_video_timings. Namely Hsync/Vsync/DE levels and interlace. Add these to omap_video_timings to align it more with xorg modeline. Add some other OMAP DSS specific fields to omap_video_timings.

- Remove some hacks done because omap_video_timings didn't have the above fields.

A branch with the patch set:

git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git dss_cleanup

This tree is based on:

git://gitorious.org/linux-omap-dss2/linux.git work/dss-rework-base

Tested on 3430sdp, 4430spd, Pandaboard ES.

Archit Taneja (17):
OMAPDSS: Remove passive matrix LCD support (part 1)
OMAPDSS: Remove passive matrix LCD support (part 2)
OMAPDSS: Remove passive matrix LCD support (part 3)
OMAPDSS: Remove passive matrix LCD support (part 4)
OMAPDSS: Add some new fields to omap_video_timings
OMAPDSS: DISPLAY: Ignore newly added omap_video_timings fields for
display timings sysfs file
OMAPDSS: DISPC: Configure newly added omap_video_timing fields
OMAPDSS: DISPC: Remove dispc_mgr_set_pol_freq()
OMAPFB: Map the newly added omap_video_timings fields with fb sync
flags
OMAPDRM: Map the newly added omap_video_timings fields with drm mode
flags
OMAPDSS: Remove omap_panel_config enum from omap_dss_device
OMAPDSS: Add interlace parameter to omap_video_timings
OMAPDSS: DISPC/APPLY: Use interlace info in manager timings for
dispc_ovl_setup()
OMAPFB: Map interlace field in omap_video_timings with fb vmode flags
OMAPDRM: Map interlace field in omap_video_timings with drm mode
flags
OMAPDSS: HDMI: Remove custom hdmi_video_timings struct
OMAPDSS: DSI: Remove redundant fields in omap_dss_dsi_videomode_data

 drivers/staging/omapdrm/omap_connector.c           |   27 ++-
 drivers/video/omap2/displays/panel-acx565akm.c     |    6 +-
 drivers/video/omap2/displays/panel-generic-dpi.c   |  118 +++++-----
 .../omap2/displays/panel-lgphilips-lb035q02.c      |    5 +-
 drivers/video/omap2/displays/panel-n8x0.c          |    1 -
 .../omap2/displays/panel-nec-nl8048hl11-01b.c      |    7 +-
 drivers/video/omap2/displays/panel-picodlp.c       |    7 +-
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |    6 +-
 drivers/video/omap2/displays/panel-taal.c          |    1 -
 drivers/video/omap2/displays/panel-tfp410.c        |    1 -
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    6 +-
 drivers/video/omap2/dss/apply.c                    |    6 +-
 drivers/video/omap2/dss/dispc.c                    |  114 ++++-----
 drivers/video/omap2/dss/display.c                  |    6 +-
 drivers/video/omap2/dss/dpi.c                      |   39 ++--
 drivers/video/omap2/dss/dsi.c                      |   28 ++-
 drivers/video/omap2/dss/dss.c                      |    7 +-
 drivers/video/omap2/dss/dss.h                      |   17 +-
 drivers/video/omap2/dss/hdmi.c                     |  241 +++++++++++++++++---
 drivers/video/omap2/dss/hdmi_panel.c               |    8 +-
 drivers/video/omap2/dss/rfbi.c                     |    3 +-
 drivers/video/omap2/dss/sdi.c                      |   11 +-
 drivers/video/omap2/dss/ti_hdmi.h                  |   19 +-
 drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c          |    8 +-
 drivers/video/omap2/dss/venc.c                     |    4 +
 drivers/video/omap2/omapfb/omapfb-main.c           |   32 ++-
 include/video/omapdss.h                            |   55 +++--
 27 files changed, 474 insertions(+), 309 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/17 OMAPDSS: Remove passive matrix LCD support (part 1)

Remove clock constraints related to passive matrix displays.

There is a constraint (pcd_min should be 3) for passive matrix displays. Remove this constraint in clock divider calculations as we won't support passive matrix displays any more.

This cleans up the functions which calculate the clock dividers with DSI's PLL or DSS_FCLK as the clock source.

---
 drivers/video/omap2/dss/dispc.c |    5 +----
 drivers/video/omap2/dss/dpi.c   |   28 +++++++++++-----------------
 drivers/video/omap2/dss/dsi.c   |    8 ++++----
 drivers/video/omap2/dss/dss.c   |    7 +++----
 drivers/video/omap2/dss/dss.h   |    9 ++++-----
 drivers/video/omap2/dss/sdi.c   |    3 +--
 6 files changed, 24 insertions(+), 36 deletions(-)
drivers/video/omap2/dss/dispc.c +1 -4
index 0858024..3aa8c9c 100644
@@ -3127,7 +3127,7 @@ void dispc_mgr_set_pol_freq(enum omap_channel channel,
 }
 
 /* with fck as input clock rate, find dispc dividers that produce req_pck */
-void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+void dispc_find_clk_divs(unsigned long req_pck, unsigned long fck,
 		struct dispc_clock_info *cinfo)
 {
 	u16 pcd_min, pcd_max;
@@ -3138,9 +3138,6 @@ void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
 	pcd_min = dss_feat_get_param_min(FEAT_PARAM_DSS_PCD);
 	pcd_max = dss_feat_get_param_max(FEAT_PARAM_DSS_PCD);
 
-	if (!is_tft)
-		pcd_min = 3;
-
 	best_pck = 0;
 	best_ld = 0;
 	best_pd = 0;
drivers/video/omap2/dss/dpi.c +11 -17
index 43bffc7..ca0e45a 100644
@@ -78,7 +78,7 @@ static bool dpi_use_dsi_pll(struct omap_dss_device *dssdev)
 		lcd_src == OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC;
 }
 
-static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, bool is_tft,
+static int dpi_set_dsi_clk(struct omap_dss_device *dssdev,
 		unsigned long pck_req, unsigned long *fck, int *lck_div,
 		int *pck_div)
 {
@@ -87,8 +87,8 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, bool is_tft,
 	struct dispc_clock_info dispc_cinfo;
 	int r;
 
-	r = dsi_pll_calc_clock_div_pck(dpi.dsidev, is_tft, pck_req,
-			&dsi_cinfo, &dispc_cinfo);
+	r = dsi_pll_calc_clock_div_pck(dpi.dsidev, pck_req, &dsi_cinfo,
+			&dispc_cinfo);
 	if (r)
 		return r;
 
@@ -113,7 +113,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev, bool is_tft,
 	return 0;
 }
 
-static int dpi_set_dispc_clk(struct omap_dss_device *dssdev, bool is_tft,
+static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,
 		unsigned long pck_req, unsigned long *fck, int *lck_div,
 		int *pck_div)
 {
@@ -121,7 +121,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev, bool is_tft,
 	struct dispc_clock_info dispc_cinfo;
 	int r;
 
-	r = dss_calc_clock_div(is_tft, pck_req, &dss_cinfo, &dispc_cinfo);
+	r = dss_calc_clock_div(pck_req, &dss_cinfo, &dispc_cinfo);
 	if (r)
 		return r;
 
@@ -146,20 +146,17 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
 	int lck_div = 0, pck_div = 0;
 	unsigned long fck = 0;
 	unsigned long pck;
-	bool is_tft;
 	int r = 0;
 
 	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
 			dssdev->panel.acbi, dssdev->panel.acb);
 
-	is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
-
 	if (dpi_use_dsi_pll(dssdev))
-		r = dpi_set_dsi_clk(dssdev, is_tft, t->pixel_clock * 1000,
-				&fck, &lck_div, &pck_div);
+		r = dpi_set_dsi_clk(dssdev, t->pixel_clock * 1000, &fck,
+				&lck_div, &pck_div);
 	else
-		r = dpi_set_dispc_clk(dssdev, is_tft, t->pixel_clock * 1000,
-				&fck, &lck_div, &pck_div);
+		r = dpi_set_dispc_clk(dssdev, t->pixel_clock * 1000, &fck,
+				&lck_div, &pck_div);
 	if (r)
 		return r;
 
@@ -315,7 +312,6 @@ EXPORT_SYMBOL(dpi_set_timings);
 int dpi_check_timings(struct omap_dss_device *dssdev,
 			struct omap_video_timings *timings)
 {
-	bool is_tft;
 	int r;
 	int lck_div, pck_div;
 	unsigned long fck;
@@ -328,11 +324,9 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
 	if (timings->pixel_clock == 0)
 		return -EINVAL;
 
-	is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
-
 	if (dpi_use_dsi_pll(dssdev)) {
 		struct dsi_clock_info dsi_cinfo;
-		r = dsi_pll_calc_clock_div_pck(dpi.dsidev, is_tft,
+		r = dsi_pll_calc_clock_div_pck(dpi.dsidev,
 				timings->pixel_clock * 1000,
 				&dsi_cinfo, &dispc_cinfo);
 
@@ -342,7 +336,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
 		fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk;
 	} else {
 		struct dss_clock_info dss_cinfo;
-		r = dss_calc_clock_div(is_tft, timings->pixel_clock * 1000,
+		r = dss_calc_clock_div(timings->pixel_clock * 1000,
 				&dss_cinfo, &dispc_cinfo);
 
 		if (r)
drivers/video/omap2/dss/dsi.c +4 -4
index cad72db..0eb5452 100644
@@ -1313,7 +1313,7 @@ static int dsi_calc_clock_rates(struct platform_device *dsidev,
 	return 0;
 }
 
-int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev, bool is_tft,
+int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
 		unsigned long req_pck, struct dsi_clock_info *dsi_cinfo,
 		struct dispc_clock_info *dispc_cinfo)
 {
@@ -1332,8 +1332,8 @@ int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev, bool is_tft,
 			dsi->cache_cinfo.clkin == dss_sys_clk) {
 		DSSDBG("DSI clock info found from cache\n");
 		*dsi_cinfo = dsi->cache_cinfo;
-		dispc_find_clk_divs(is_tft, req_pck,
-			dsi_cinfo->dsi_pll_hsdiv_dispc_clk, dispc_cinfo);
+		dispc_find_clk_divs(req_pck, dsi_cinfo->dsi_pll_hsdiv_dispc_clk,
+			dispc_cinfo);
 		return 0;
 	}
 
@@ -1399,7 +1399,7 @@ retry:
 
 				match = 1;
 
-				dispc_find_clk_divs(is_tft, req_pck,
+				dispc_find_clk_divs(req_pck,
 						cur.dsi_pll_hsdiv_dispc_clk,
 						&cur_dispc);
 
drivers/video/omap2/dss/dss.c +3 -4
index 7706323..4ff0b8f 100644
@@ -502,8 +502,7 @@ unsigned long dss_get_dpll4_rate(void)
 		return 0;
 }
 
-int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
-		struct dss_clock_info *dss_cinfo,
+int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo,
 		struct dispc_clock_info *dispc_cinfo)
 {
 	unsigned long prate;
@@ -551,7 +550,7 @@ retry:
 		fck = clk_get_rate(dss.dss_clk);
 		fck_div = 1;
 
-		dispc_find_clk_divs(is_tft, req_pck, fck, &cur_dispc);
+		dispc_find_clk_divs(req_pck, fck, &cur_dispc);
 		match = 1;
 
 		best_dss.fck = fck;
@@ -581,7 +580,7 @@ retry:
 
 			match = 1;
 
-			dispc_find_clk_divs(is_tft, req_pck, fck, &cur_dispc);
+			dispc_find_clk_divs(req_pck, fck, &cur_dispc);
 
 			if (abs(cur_dispc.pck - req_pck) <
 					abs(best_dispc.pck - req_pck)) {
drivers/video/omap2/dss/dss.h +4 -5
index c6d8c68..d33df16 100644
@@ -265,8 +265,7 @@ unsigned long dss_get_dpll4_rate(void);
 int dss_calc_clock_rates(struct dss_clock_info *cinfo);
 int dss_set_clock_div(struct dss_clock_info *cinfo);
 int dss_get_clock_div(struct dss_clock_info *cinfo);
-int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
-		struct dss_clock_info *dss_cinfo,
+int dss_calc_clock_div(unsigned long req_pck, struct dss_clock_info *dss_cinfo,
 		struct dispc_clock_info *dispc_cinfo);
 
 /* SDI */
@@ -293,7 +292,7 @@ u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt);
 unsigned long dsi_get_pll_hsdiv_dispc_rate(struct platform_device *dsidev);
 int dsi_pll_set_clock_div(struct platform_device *dsidev,
 		struct dsi_clock_info *cinfo);
-int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev, bool is_tft,
+int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
 		unsigned long req_pck, struct dsi_clock_info *cinfo,
 		struct dispc_clock_info *dispc_cinfo);
 int dsi_pll_init(struct platform_device *dsidev, bool enable_hsclk,
@@ -327,7 +326,7 @@ static inline int dsi_pll_set_clock_div(struct platform_device *dsidev,
 	return -ENODEV;
 }
 static inline int dsi_pll_calc_clock_div_pck(struct platform_device *dsidev,
-		bool is_tft, unsigned long req_pck,
+		unsigned long req_pck,
 		struct dsi_clock_info *dsi_cinfo,
 		struct dispc_clock_info *dispc_cinfo)
 {
@@ -384,7 +383,7 @@ void dispc_set_loadmode(enum omap_dss_load_mode mode);
 bool dispc_mgr_timings_ok(enum omap_channel channel,
 		const struct omap_video_timings *timings);
 unsigned long dispc_fclk_rate(void);
-void dispc_find_clk_divs(bool is_tft, unsigned long req_pck, unsigned long fck,
+void dispc_find_clk_divs(unsigned long req_pck, unsigned long fck,
 		struct dispc_clock_info *cinfo);
 int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,
 		struct dispc_clock_info *cinfo);
drivers/video/omap2/dss/sdi.c +1 -2
index 3a43dc2..d07ecc4 100644
@@ -84,8 +84,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
 			dssdev->panel.acbi, dssdev->panel.acb);
 
-	r = dss_calc_clock_div(1, t->pixel_clock * 1000,
-			&dss_cinfo, &dispc_cinfo);
+	r = dss_calc_clock_div(t->pixel_clock * 1000, &dss_cinfo, &dispc_cinfo);
 	if (r)
 		goto err_calc_clock_div;
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/17 OMAPDSS: Remove passive matrix lcd support (part 2)

In reply to Archit Taneja

Remove OMAP_DSS_LCD_TFT as a omap_panel_config flag.

We don't support passive matrix displays any more. Remove this flag from all the panel drivers.

Force the display_type to OMAP_DSS_LCD_DISPLAY_TFT in the interface drivers.

---
 drivers/video/omap2/displays/panel-acx565akm.c     |    4 +-
 drivers/video/omap2/displays/panel-generic-dpi.c   |   61 ++++++++------------
 .../omap2/displays/panel-lgphilips-lb035q02.c      |    3 +-
 drivers/video/omap2/displays/panel-n8x0.c          |    1 -
 .../omap2/displays/panel-nec-nl8048hl11-01b.c      |    5 +-
 drivers/video/omap2/displays/panel-picodlp.c       |    4 +-
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |    3 +-
 drivers/video/omap2/displays/panel-taal.c          |    1 -
 drivers/video/omap2/displays/panel-tfp410.c        |    1 -
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    4 +-
 drivers/video/omap2/dss/display.c                  |    4 --
 drivers/video/omap2/dss/dpi.c                      |    8 +--
 drivers/video/omap2/dss/hdmi_panel.c               |    3 +-
 include/video/omapdss.h                            |    2 -
 14 files changed, 37 insertions(+), 67 deletions(-)
drivers/video/omap2/displays/panel-acx565akm.c +2 -2
index f7821f7..8264043 100644
@@ -498,8 +498,8 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 
 	dev_dbg(&dssdev->dev, "%s\n", __func__);
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-					OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
+
 	/* FIXME AC bias ? */
 	dssdev->panel.timings = acx_panel_timings;
 
drivers/video/omap2/displays/panel-generic-dpi.c +24 -37

175 lines not on this page · raw message

drivers/video/omap2/displays/panel-lgphilips-lb035q02.c +1 -2
index b4a1555..474a003 100644
@@ -82,8 +82,7 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
 	struct lb035q02_data *ld;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 	dssdev->panel.timings = lb035q02_timings;
 
 	ld = kzalloc(sizeof(*ld), GFP_KERNEL);
drivers/video/omap2/displays/panel-n8x0.c +0 -1
index dcbd00e..e68d11d 100644
@@ -473,7 +473,6 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
 
 	mutex_init(&ddata->lock);
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
 	dssdev->panel.timings.x_res = 800;
 	dssdev->panel.timings.y_res = 480;
 	dssdev->ctrl.pixel_size = 16;
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c +2 -3
index 8717b43..e4153f3 100644
@@ -116,9 +116,8 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-				OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_RF |
-				OMAP_DSS_LCD_ONOFF;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
+				OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
 	dssdev->panel.timings = nec_8048_panel_timings;
 
 	necd = kzalloc(sizeof(*necd), GFP_KERNEL);
drivers/video/omap2/displays/panel-picodlp.c +2 -2
index 13012f9..44627f9 100644
@@ -414,8 +414,8 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
 	struct i2c_client *picodlp_i2c_client;
 	int r = 0, picodlp_adapter_id;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_ONOFF |
-				OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS;
+	dssdev->panel.config = OMAP_DSS_LCD_ONOFF | OMAP_DSS_LCD_IHS |
+				OMAP_DSS_LCD_IVS;
 	dssdev->panel.acb = 0x0;
 	dssdev->panel.timings = pico_ls_timings;
 
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +1 -2
index 47ea1d1..98a0ff5 100644
@@ -86,8 +86,7 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
 	struct sharp_data *sd;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 	dssdev->panel.acb = 0x28;
 	dssdev->panel.timings = sharp_ls_timings;
 
drivers/video/omap2/displays/panel-taal.c +0 -1
index 463a682..a31cba4 100644
@@ -882,7 +882,6 @@ static int taal_probe(struct omap_dss_device *dssdev)
 		goto err;
 	}
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
 	dssdev->panel.timings = panel_config->timings;
 	dssdev->panel.dsi_pix_fmt = OMAP_DSS_DSI_FMT_RGB888;
 
drivers/video/omap2/displays/panel-tfp410.c +0 -1
index 423f73e..6abadb6 100644
@@ -95,7 +95,6 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
 		return -ENOMEM;
 
 	dssdev->panel.timings = tfp410_default_timings;
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
 
 	ddata->dssdev = dssdev;
 	mutex_init(&ddata->lock);
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +2 -2
index 9dbc5e3..9b43714 100644
@@ -405,8 +405,8 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
 		return -ENODEV;
 	}
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS |
-				OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IPC;
+	dssdev->panel.config = OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS |
+				OMAP_DSS_LCD_IPC;
 	dssdev->panel.timings = tpo_td043_timings;
 	dssdev->ctrl.pixel_size = 24;
 
drivers/video/omap2/dss/display.c +0 -4
index 8aa6f23..37d6504 100644
@@ -327,10 +327,6 @@ bool dss_use_replication(struct omap_dss_device *dssdev,
 	if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
 		return false;
 
-	if (dssdev->type == OMAP_DISPLAY_TYPE_DPI &&
-			(dssdev->panel.config & OMAP_DSS_LCD_TFT) == 0)
-		return false;
-
 	switch (dssdev->type) {
 	case OMAP_DISPLAY_TYPE_DPI:
 		bpp = dssdev->phy.dpi.data_lines;
drivers/video/omap2/dss/dpi.c +2 -6
index ca0e45a..e21955c 100644
@@ -177,15 +177,11 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
 
 static void dpi_basic_init(struct omap_dss_device *dssdev)
 {
-	bool is_tft;
-
-	is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
-
 	dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS);
 	dispc_mgr_enable_stallmode(dssdev->manager->id, false);
 
-	dispc_mgr_set_lcd_display_type(dssdev->manager->id, is_tft ?
-			OMAP_DSS_LCD_DISPLAY_TFT : OMAP_DSS_LCD_DISPLAY_STN);
+	dispc_mgr_set_lcd_display_type(dssdev->manager->id,
+			OMAP_DSS_LCD_DISPLAY_TFT);
 	dispc_mgr_set_tft_data_lines(dssdev->manager->id,
 			dssdev->phy.dpi.data_lines);
 }
drivers/video/omap2/dss/hdmi_panel.c +1 -2
index 266b361..b902218 100644
@@ -43,8 +43,7 @@ static int hdmi_panel_probe(struct omap_dss_device *dssdev)
 {
 	DSSDBG("ENTER hdmi_panel_probe\n");
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 
 	dssdev->panel.timings = (struct omap_video_timings){640, 480, 25175, 96, 16, 48, 2 , 11, 31};
 
include/video/omapdss.h +0 -2
index 5d0f432..e3b7dd1 100644
@@ -128,8 +128,6 @@ enum omap_panel_config {
 	OMAP_DSS_LCD_IEO		= 1<<3,
 	OMAP_DSS_LCD_RF			= 1<<4,
 	OMAP_DSS_LCD_ONOFF		= 1<<5,
-
-	OMAP_DSS_LCD_TFT		= 1<<20,
 };
 
 enum omap_dss_venc_type {
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 2/17 OMAPDSS: Remove passive matrix LCD support (part 2)

In reply to Archit Taneja

Remove OMAP_DSS_LCD_TFT as a omap_panel_config flag.

We don't support passive matrix displays any more. Remove this flag from all the panel drivers.

Force the display_type to OMAP_DSS_LCD_DISPLAY_TFT in the interface drivers.

---
 drivers/video/omap2/displays/panel-acx565akm.c     |    4 +-
 drivers/video/omap2/displays/panel-generic-dpi.c   |   61 ++++++++------------
 .../omap2/displays/panel-lgphilips-lb035q02.c      |    3 +-
 drivers/video/omap2/displays/panel-n8x0.c          |    1 -
 .../omap2/displays/panel-nec-nl8048hl11-01b.c      |    5 +-
 drivers/video/omap2/displays/panel-picodlp.c       |    4 +-
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |    3 +-
 drivers/video/omap2/displays/panel-taal.c          |    1 -
 drivers/video/omap2/displays/panel-tfp410.c        |    1 -
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    4 +-
 drivers/video/omap2/dss/display.c                  |    4 --
 drivers/video/omap2/dss/dpi.c                      |    8 +--
 drivers/video/omap2/dss/hdmi_panel.c               |    3 +-
 include/video/omapdss.h                            |    2 -
 14 files changed, 37 insertions(+), 67 deletions(-)
drivers/video/omap2/displays/panel-acx565akm.c +2 -2
index f7821f7..8264043 100644
@@ -498,8 +498,8 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 
 	dev_dbg(&dssdev->dev, "%s\n", __func__);
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-					OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
+
 	/* FIXME AC bias ? */
 	dssdev->panel.timings = acx_panel_timings;
 
drivers/video/omap2/displays/panel-generic-dpi.c +24 -37

175 lines not on this page · raw message

drivers/video/omap2/displays/panel-lgphilips-lb035q02.c +1 -2
index b4a1555..474a003 100644
@@ -82,8 +82,7 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
 	struct lb035q02_data *ld;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 	dssdev->panel.timings = lb035q02_timings;
 
 	ld = kzalloc(sizeof(*ld), GFP_KERNEL);
drivers/video/omap2/displays/panel-n8x0.c +0 -1
index dcbd00e..e68d11d 100644
@@ -473,7 +473,6 @@ static int n8x0_panel_probe(struct omap_dss_device *dssdev)
 
 	mutex_init(&ddata->lock);
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
 	dssdev->panel.timings.x_res = 800;
 	dssdev->panel.timings.y_res = 480;
 	dssdev->ctrl.pixel_size = 16;
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c +2 -3
index 8717b43..e4153f3 100644
@@ -116,9 +116,8 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-				OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_RF |
-				OMAP_DSS_LCD_ONOFF;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
+				OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
 	dssdev->panel.timings = nec_8048_panel_timings;
 
 	necd = kzalloc(sizeof(*necd), GFP_KERNEL);
drivers/video/omap2/displays/panel-picodlp.c +2 -2
index 13012f9..44627f9 100644
@@ -414,8 +414,8 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
 	struct i2c_client *picodlp_i2c_client;
 	int r = 0, picodlp_adapter_id;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_ONOFF |
-				OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS;
+	dssdev->panel.config = OMAP_DSS_LCD_ONOFF | OMAP_DSS_LCD_IHS |
+				OMAP_DSS_LCD_IVS;
 	dssdev->panel.acb = 0x0;
 	dssdev->panel.timings = pico_ls_timings;
 
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +1 -2
index 47ea1d1..98a0ff5 100644
@@ -86,8 +86,7 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
 	struct sharp_data *sd;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |
-		OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 	dssdev->panel.acb = 0x28;
 	dssdev->panel.timings = sharp_ls_timings;
 
drivers/video/omap2/displays/panel-taal.c +0 -1
index 463a682..a31cba4 100644
@@ -882,7 +882,6 @@ static int taal_probe(struct omap_dss_device *dssdev)
 		goto err;
 	}
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
 	dssdev->panel.timings = panel_config->timings;
 	dssdev->panel.dsi_pix_fmt = OMAP_DSS_DSI_FMT_RGB888;
 
drivers/video/omap2/displays/panel-tfp410.c +0 -1
index 423f73e..6abadb6 100644
@@ -95,7 +95,6 @@ static int tfp410_probe(struct omap_dss_device *dssdev)
 		return -ENOMEM;
 
 	dssdev->panel.timings = tfp410_default_timings;
-	dssdev->panel.config = OMAP_DSS_LCD_TFT;
 
 	ddata->dssdev = dssdev;
 	mutex_init(&ddata->lock);
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +2 -2
index 9dbc5e3..9b43714 100644
@@ -405,8 +405,8 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
 		return -ENODEV;
 	}
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IHS |
-				OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IPC;
+	dssdev->panel.config = OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS |
+				OMAP_DSS_LCD_IPC;
 	dssdev->panel.timings = tpo_td043_timings;
 	dssdev->ctrl.pixel_size = 24;
 
drivers/video/omap2/dss/display.c +0 -4
index 8aa6f23..37d6504 100644
@@ -327,10 +327,6 @@ bool dss_use_replication(struct omap_dss_device *dssdev,
 	if (mode != OMAP_DSS_COLOR_RGB12U && mode != OMAP_DSS_COLOR_RGB16)
 		return false;
 
-	if (dssdev->type == OMAP_DISPLAY_TYPE_DPI &&
-			(dssdev->panel.config & OMAP_DSS_LCD_TFT) == 0)
-		return false;
-
 	switch (dssdev->type) {
 	case OMAP_DISPLAY_TYPE_DPI:
 		bpp = dssdev->phy.dpi.data_lines;
drivers/video/omap2/dss/dpi.c +2 -6
index ca0e45a..e21955c 100644
@@ -177,15 +177,11 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
 
 static void dpi_basic_init(struct omap_dss_device *dssdev)
 {
-	bool is_tft;
-
-	is_tft = (dssdev->panel.config & OMAP_DSS_LCD_TFT) != 0;
-
 	dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS);
 	dispc_mgr_enable_stallmode(dssdev->manager->id, false);
 
-	dispc_mgr_set_lcd_display_type(dssdev->manager->id, is_tft ?
-			OMAP_DSS_LCD_DISPLAY_TFT : OMAP_DSS_LCD_DISPLAY_STN);
+	dispc_mgr_set_lcd_display_type(dssdev->manager->id,
+			OMAP_DSS_LCD_DISPLAY_TFT);
 	dispc_mgr_set_tft_data_lines(dssdev->manager->id,
 			dssdev->phy.dpi.data_lines);
 }
drivers/video/omap2/dss/hdmi_panel.c +1 -2
index 266b361..b902218 100644
@@ -43,8 +43,7 @@ static int hdmi_panel_probe(struct omap_dss_device *dssdev)
 {
 	DSSDBG("ENTER hdmi_panel_probe\n");
 
-	dssdev->panel.config = OMAP_DSS_LCD_TFT |
-			OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
+	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 
 	dssdev->panel.timings = (struct omap_video_timings){640, 480, 25175, 96, 16, 48, 2 , 11, 31};
 
include/video/omapdss.h +0 -2
index 5d0f432..e3b7dd1 100644
@@ -128,8 +128,6 @@ enum omap_panel_config {
 	OMAP_DSS_LCD_IEO		= 1<<3,
 	OMAP_DSS_LCD_RF			= 1<<4,
 	OMAP_DSS_LCD_ONOFF		= 1<<5,
-
-	OMAP_DSS_LCD_TFT		= 1<<20,
 };
 
 enum omap_dss_venc_type {
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 3/17 OMAPDSS: Remove passive matrix LCD support (part 3)

In reply to Archit Taneja

Remove omap_lcd_display_type enum

The enum omap_lcd_display_type is used to configure the lcd display type in DISPC. Remove this enum and always set display type to TFT by creating function dss_mgr_set_lcd_type_tft().

---
 drivers/video/omap2/dss/dispc.c |   23 +++--------------------
 drivers/video/omap2/dss/dpi.c   |    4 ++--
 drivers/video/omap2/dss/dsi.c   |    9 +++++----
 drivers/video/omap2/dss/dss.h   |    3 +--
 drivers/video/omap2/dss/rfbi.c  |    3 +--
 drivers/video/omap2/dss/sdi.c   |    3 +--
 include/video/omapdss.h         |    5 -----
 7 files changed, 13 insertions(+), 37 deletions(-)
drivers/video/omap2/dss/dispc.c +3 -20
index 3aa8c9c..01c81a7 100644
@@ -2439,29 +2439,12 @@ void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable)
 }
 
 
-void dispc_mgr_set_lcd_display_type(enum omap_channel channel,
-		enum omap_lcd_display_type type)
+void dispc_mgr_set_lcd_type_tft(enum omap_channel channel)
 {
-	int mode;
-
-	switch (type) {
-	case OMAP_DSS_LCD_DISPLAY_STN:
-		mode = 0;
-		break;
-
-	case OMAP_DSS_LCD_DISPLAY_TFT:
-		mode = 1;
-		break;
-
-	default:
-		BUG();
-		return;
-	}
-
 	if (channel == OMAP_DSS_CHANNEL_LCD2)
-		REG_FLD_MOD(DISPC_CONTROL2, mode, 3, 3);
+		REG_FLD_MOD(DISPC_CONTROL2, 1, 3, 3);
 	else
-		REG_FLD_MOD(DISPC_CONTROL, mode, 3, 3);
+		REG_FLD_MOD(DISPC_CONTROL, 1, 3, 3);
 }
 
 void dispc_set_loadmode(enum omap_dss_load_mode mode)
drivers/video/omap2/dss/dpi.c +2 -2
index e21955c..018be20 100644
@@ -180,8 +180,8 @@ static void dpi_basic_init(struct omap_dss_device *dssdev)
 	dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS);
 	dispc_mgr_enable_stallmode(dssdev->manager->id, false);
 
-	dispc_mgr_set_lcd_display_type(dssdev->manager->id,
-			OMAP_DSS_LCD_DISPLAY_TFT);
+	dispc_mgr_set_lcd_type_tft(dssdev->manager->id);
+
 	dispc_mgr_set_tft_data_lines(dssdev->manager->id,
 			dssdev->phy.dpi.data_lines);
 }
drivers/video/omap2/dss/dsi.c +5 -4
index 0eb5452..061bf53 100644
@@ -4383,10 +4383,11 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
 		dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings);
 	}
 
-		dispc_mgr_set_lcd_display_type(dssdev->manager->id,
-			OMAP_DSS_LCD_DISPLAY_TFT);
-		dispc_mgr_set_tft_data_lines(dssdev->manager->id,
-			dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt));
+	dispc_mgr_set_lcd_type_tft(dssdev->manager->id);
+
+	dispc_mgr_set_tft_data_lines(dssdev->manager->id,
+		dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt));
+
 	return 0;
 }
 
drivers/video/omap2/dss/dss.h +1 -2
index d33df16..ffbff49 100644
@@ -411,8 +411,7 @@ bool dispc_mgr_is_channel_enabled(enum omap_channel channel);
 void dispc_mgr_set_io_pad_mode(enum dss_io_pad_mode mode);
 void dispc_mgr_enable_stallmode(enum omap_channel channel, bool enable);
 void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines);
-void dispc_mgr_set_lcd_display_type(enum omap_channel channel,
-		enum omap_lcd_display_type type);
+void dispc_mgr_set_lcd_type_tft(enum omap_channel channel);
 void dispc_mgr_set_timings(enum omap_channel channel,
 		struct omap_video_timings *timings);
 void dispc_mgr_set_pol_freq(enum omap_channel channel,
drivers/video/omap2/dss/rfbi.c +1 -2
index 3d8c206..45084d8 100644
@@ -885,8 +885,7 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 		goto err1;
 	}
 
-	dispc_mgr_set_lcd_display_type(dssdev->manager->id,
-			OMAP_DSS_LCD_DISPLAY_TFT);
+	dispc_mgr_set_lcd_type_tft(dssdev->manager->id);
 
 	dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_RFBI);
 	dispc_mgr_enable_stallmode(dssdev->manager->id, true);
drivers/video/omap2/dss/sdi.c +1 -2
index d07ecc4..1a369de 100644
@@ -40,8 +40,7 @@ static void sdi_basic_init(struct omap_dss_device *dssdev)
 	dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS);
 	dispc_mgr_enable_stallmode(dssdev->manager->id, false);
 
-	dispc_mgr_set_lcd_display_type(dssdev->manager->id,
-			OMAP_DSS_LCD_DISPLAY_TFT);
+	dispc_mgr_set_lcd_type_tft(dssdev->manager->id);
 
 	dispc_mgr_set_tft_data_lines(dssdev->manager->id, 24);
 	dispc_lcd_enable_signal_polarity(1);
include/video/omapdss.h +0 -5
index e3b7dd1..b9a180f 100644
@@ -99,11 +99,6 @@ enum omap_color_mode {
 	OMAP_DSS_COLOR_XRGB16_1555	= 1 << 18, /* xRGB16 - 1555 */
 };
 
-enum omap_lcd_display_type {
-	OMAP_DSS_LCD_DISPLAY_STN,
-	OMAP_DSS_LCD_DISPLAY_TFT,
-};
-
 enum omap_dss_load_mode {
 	OMAP_DSS_LOAD_CLUT_AND_FRAME	= 0,
 	OMAP_DSS_LOAD_CLUT_ONLY		= 1,
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 4/17 OMAPDSS: Remove passive matrix LCD support (part 4)

In reply to Archit Taneja

Remove configuration of Ac-bias pins

Ac-bias pins need to be configured only for passive matrix displays. Remove acbi and acb fields in omap_dss_device and their configuration in panel drivers. Don't program these fields in DISP_POL_FREQo register any more.

The panel driver for sharp-ls037v7dw01, and the panel config for Innolux AT070TN8 in generic dpi panel driver set acb to a non zero value. This is most likely carried over from the old omapfb driver which supported passive matrix displays.

---
 drivers/video/omap2/displays/panel-generic-dpi.c   |   23 --------------------
 drivers/video/omap2/displays/panel-picodlp.c       |    1 -
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |    1 -
 drivers/video/omap2/dss/dispc.c                    |   14 +++++-------
 drivers/video/omap2/dss/dpi.c                      |    3 +--
 drivers/video/omap2/dss/dss.h                      |    2 +-
 drivers/video/omap2/dss/sdi.c                      |    3 +--
 7 files changed, 8 insertions(+), 39 deletions(-)
drivers/video/omap2/displays/panel-generic-dpi.c +0 -23
index 3e47490..fe7e48c 100644
@@ -40,10 +40,6 @@
 struct panel_config {
 	struct omap_video_timings timings;
 
-	int acbi;	/* ac-bias pin transitions per interrupt */
-	/* Unit: line clocks */
-	int acb;	/* ac-bias pin frequency */
-
 	enum omap_panel_config config;
 
 	int power_on_delay;
@@ -74,8 +70,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 3,
 			.vbp		= 2,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
 						OMAP_DSS_LCD_IEO,
 		.power_on_delay		= 50,
@@ -99,8 +93,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 1,
 			.vbp		= 1,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x28,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 50,
 		.power_off_delay	= 100,
@@ -123,8 +115,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsw		= 2,
 			.vbp		= 2,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
 						OMAP_DSS_LCD_IPC |
 						OMAP_DSS_LCD_ONOFF,
@@ -149,8 +139,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsw		= 10,
 			.vbp		= 12 - 10,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
@@ -173,8 +161,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 4,
 			.vbp		= 11,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
@@ -197,8 +183,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 2,
 			.vbp		= 2,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
 						OMAP_DSS_LCD_IEO,
 		.power_on_delay		= 0,
@@ -222,8 +206,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 12,
 			.vbp		= 25,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x28,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
@@ -325,8 +307,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 1,
 			.vbp		= 1,
 		},
-		.acbi			= 0x0,
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
 						OMAP_DSS_LCD_IPC,
 		.power_on_delay		= 0,
@@ -369,7 +349,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vfp		= 12,
 			.vbp		= 23,
 		},
-		.acb			= 0x0,
 		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
 						OMAP_DSS_LCD_IEO,
 
@@ -562,8 +541,6 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
 
 	dssdev->panel.config = panel_config->config;
 	dssdev->panel.timings = panel_config->timings;
-	dssdev->panel.acb = panel_config->acb;
-	dssdev->panel.acbi = panel_config->acbi;
 
 	drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL);
 	if (!drv_data)
drivers/video/omap2/displays/panel-picodlp.c +0 -1
index 44627f9..91e44c6 100644
@@ -416,7 +416,6 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
 
 	dssdev->panel.config = OMAP_DSS_LCD_ONOFF | OMAP_DSS_LCD_IHS |
 				OMAP_DSS_LCD_IVS;
-	dssdev->panel.acb = 0x0;
 	dssdev->panel.timings = pico_ls_timings;
 
 	picod =  kzalloc(sizeof(struct picodlp_data), GFP_KERNEL);
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +0 -1
index 98a0ff5..8070b88 100644
@@ -87,7 +87,6 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
 	int r;
 
 	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
-	dssdev->panel.acb = 0x28;
 	dssdev->panel.timings = sharp_ls_timings;
 
 	sd = kzalloc(sizeof(*sd), GFP_KERNEL);
drivers/video/omap2/dss/dispc.c +5 -9
index 01c81a7..d974be9 100644
@@ -3077,13 +3077,12 @@ static void dispc_dump_regs(struct seq_file *s)
 }
 
 static void _dispc_mgr_set_pol_freq(enum omap_channel channel, bool onoff,
-		bool rf, bool ieo, bool ipc, bool ihs, bool ivs, u8 acbi,
-		u8 acb)
+		bool rf, bool ieo, bool ipc, bool ihs, bool ivs)
 {
 	u32 l = 0;
 
-	DSSDBG("onoff %d rf %d ieo %d ipc %d ihs %d ivs %d acbi %d acb %d\n",
-			onoff, rf, ieo, ipc, ihs, ivs, acbi, acb);
+	DSSDBG("onoff %d rf %d ieo %d ipc %d ihs %d ivs %d\n",
+			onoff, rf, ieo, ipc, ihs, ivs);
 
 	l |= FLD_VAL(onoff, 17, 17);
 	l |= FLD_VAL(rf, 16, 16);
@@ -3091,22 +3090,19 @@ static void _dispc_mgr_set_pol_freq(enum omap_channel channel, bool onoff,
 	l |= FLD_VAL(ipc, 14, 14);
 	l |= FLD_VAL(ihs, 13, 13);
 	l |= FLD_VAL(ivs, 12, 12);
-	l |= FLD_VAL(acbi, 11, 8);
-	l |= FLD_VAL(acb, 7, 0);
 
 	dispc_write_reg(DISPC_POL_FREQ(channel), l);
 }
 
 void dispc_mgr_set_pol_freq(enum omap_channel channel,
-		enum omap_panel_config config, u8 acbi, u8 acb)
+		enum omap_panel_config config)
 {
 	_dispc_mgr_set_pol_freq(channel, (config & OMAP_DSS_LCD_ONOFF) != 0,
 			(config & OMAP_DSS_LCD_RF) != 0,
 			(config & OMAP_DSS_LCD_IEO) != 0,
 			(config & OMAP_DSS_LCD_IPC) != 0,
 			(config & OMAP_DSS_LCD_IHS) != 0,
-			(config & OMAP_DSS_LCD_IVS) != 0,
-			acbi, acb);
+			(config & OMAP_DSS_LCD_IVS) != 0);
 }
 
 /* with fck as input clock rate, find dispc dividers that produce req_pck */
drivers/video/omap2/dss/dpi.c +1 -2
index 018be20..d8cc440 100644
@@ -148,8 +148,7 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
 	unsigned long pck;
 	int r = 0;
 
-	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
-			dssdev->panel.acbi, dssdev->panel.acb);
+	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config);
 
 	if (dpi_use_dsi_pll(dssdev))
 		r = dpi_set_dsi_clk(dssdev, t->pixel_clock * 1000, &fck,
drivers/video/omap2/dss/dss.h +1 -1
index ffbff49..d64f894 100644
@@ -415,7 +415,7 @@ void dispc_mgr_set_lcd_type_tft(enum omap_channel channel);
 void dispc_mgr_set_timings(enum omap_channel channel,
 		struct omap_video_timings *timings);
 void dispc_mgr_set_pol_freq(enum omap_channel channel,
-		enum omap_panel_config config, u8 acbi, u8 acb);
+		enum omap_panel_config config);
 unsigned long dispc_mgr_lclk_rate(enum omap_channel channel);
 unsigned long dispc_mgr_pclk_rate(enum omap_channel channel);
 unsigned long dispc_core_clk_rate(void);
drivers/video/omap2/dss/sdi.c +1 -2
index 1a369de..5268fdb 100644
@@ -80,8 +80,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 	/* 15.5.9.1.2 */
 	dssdev->panel.config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
 
-	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config,
-			dssdev->panel.acbi, dssdev->panel.acb);
+	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config);
 
 	r = dss_calc_clock_div(t->pixel_clock * 1000, &dss_cinfo, &dispc_cinfo);
 	if (r)
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 5/17 OMAPDSS: Add some new fields to omap_video_timings

In reply to Archit Taneja

Some panel timing related fields are contained in omap_panel_config in the form of flags. The fields are:

- Hsync logic level
- Vsync logic level
- Data driven on rising/falling edge of pixel clock
- Output enable/Data enable logic level
- HSYNC/VSYNC driven on rising/falling edge of pixel clock

Out of these parameters, Hsync and Vsync logic levels are a part of the timings in the Xorg modeline configuration. So it makes sense to move the to omap_video_timings. The rest aren't a part of modeline, but it still makes sense to move these since they are related to panel timings.

These fields stored in omap_panel_config in dssdev are configured for LCD panels, and the corresponding LCD managers in the DISPC_POL_FREQo registers.

Add the above fields in omap_video_timings. Represent their state via new enums. The parameter pclk_edge is configured via omap_dss_signal_level, however it actually configures whether data is driven on the rising or falling edge. This is a bit unclean, but it prevents us from creating another enum.

Add these parameters to the omap_video_timings instances in the panel drivers. Keep the corresponding IVS, IHS, IPC, IEO, RF and ONOFF flags in omap_panel_config for now. The struct will be removed later.

---
 drivers/video/omap2/displays/panel-acx565akm.c     |    3 ++
 drivers/video/omap2/displays/panel-generic-dpi.c   |   53 ++++++++++++++++++++
 .../omap2/displays/panel-lgphilips-lb035q02.c      |    3 ++
 .../omap2/displays/panel-nec-nl8048hl11-01b.c      |    4 ++
 drivers/video/omap2/displays/panel-picodlp.c       |    4 ++
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |    3 ++
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    4 ++
 drivers/video/omap2/dss/hdmi_panel.c               |    5 +-
 drivers/video/omap2/dss/sdi.c                      |    2 +
 include/video/omapdss.h                            |   37 ++++++++++++++
 10 files changed, 117 insertions(+), 1 deletion(-)
drivers/video/omap2/displays/panel-acx565akm.c +3 -0
index 8264043..067c8a8 100644
@@ -487,6 +487,9 @@ static struct omap_video_timings acx_panel_timings = {
 	.vfp		= 3,
 	.vsw		= 3,
 	.vbp		= 4,
+
+	.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 };
 
 static int acx_panel_probe(struct omap_dss_device *dssdev)
drivers/video/omap2/displays/panel-generic-dpi.c +53 -0

143 lines not on this page · raw message

drivers/video/omap2/displays/panel-lgphilips-lb035q02.c +3 -0
index 474a003..d9565c4e 100644
@@ -40,6 +40,9 @@ static struct omap_video_timings lb035q02_timings = {
 	.vsw		= 2,
 	.vfp		= 4,
 	.vbp		= 18,
+
+	.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 };
 
 static int lb035q02_panel_power_on(struct omap_dss_device *dssdev)
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c +4 -0
index e4153f3..ff863d1 100644
@@ -76,6 +76,10 @@ static struct omap_video_timings nec_8048_panel_timings = {
 	.vfp		= 3,
 	.vsw		= 1,
 	.vbp		= 4,
+
+	.vsync_level		= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_level		= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_vsync_edge	= OMAPDSS_DRIVE_SIG_RISING_EDGE,
 };
 
 static int nec_8048_bl_update_status(struct backlight_device *bl)
drivers/video/omap2/displays/panel-picodlp.c +4 -0
index 91e44c6..95fda38 100644
@@ -69,6 +69,10 @@ static struct omap_video_timings pico_ls_timings = {
 	.vsw		= 2,
 	.vfp		= 3,
 	.vbp		= 14,
+
+	.vsync_level		= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_level		= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_vsync_edge	= OMAPDSS_DRIVE_SIG_FALLING_EDGE,
 };
 
 static inline struct picodlp_panel_data
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +3 -0
index 8070b88..9854f35 100644
@@ -44,6 +44,9 @@ static struct omap_video_timings sharp_ls_timings = {
 	.vsw		= 1,
 	.vfp		= 1,
 	.vbp		= 1,
+
+	.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 };
 
 static int sharp_ls_bl_update_status(struct backlight_device *bl)
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +4 -0
index 9b43714..446cef6 100644
@@ -267,6 +267,10 @@ static const struct omap_video_timings tpo_td043_timings = {
 	.vsw		= 1,
 	.vfp		= 39,
 	.vbp		= 34,
+
+	.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
+	.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
+	.pclk_edge	= OMAPDSS_SIG_ACTIVE_LOW,
 };
 
 static int tpo_td043_power_on(struct tpo_td043_device *tpo_td043)
drivers/video/omap2/dss/hdmi_panel.c +4 -1
index b902218..aa0f3c2 100644
@@ -45,7 +45,10 @@ static int hdmi_panel_probe(struct omap_dss_device *dssdev)
 
 	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 
-	dssdev->panel.timings = (struct omap_video_timings){640, 480, 25175, 96, 16, 48, 2 , 11, 31};
+	dssdev->panel.timings = (struct omap_video_timings)
+			{ 640, 480, 25175, 96, 16, 48, 2, 11, 31,
+				OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			};
 
 	DSSDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
 		dssdev->panel.timings.x_res,
drivers/video/omap2/dss/sdi.c +2 -0
index 5268fdb..9330410 100644
@@ -80,6 +80,8 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 	/* 15.5.9.1.2 */
 	dssdev->panel.config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
 
+	dssdev->panel.timings.hsync_vsync_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
+
 	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config);
 
 	r = dss_calc_clock_div(t->pixel_clock * 1000, &dss_cinfo, &dispc_cinfo);
include/video/omapdss.h +37 -0
index b9a180f..1d1a2be 100644
@@ -125,6 +125,17 @@ enum omap_panel_config {
 	OMAP_DSS_LCD_ONOFF		= 1<<5,
 };
 
+enum omap_dss_signal_level {
+	OMAPDSS_SIG_ACTIVE_HIGH,
+	OMAPDSS_SIG_ACTIVE_LOW,
+};
+
+enum omap_dss_signal_edge {
+	OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES,
+	OMAPDSS_DRIVE_SIG_RISING_EDGE,
+	OMAPDSS_DRIVE_SIG_FALLING_EDGE,
+};
+
 enum omap_dss_venc_type {
 	OMAP_DSS_VENC_TYPE_COMPOSITE,
 	OMAP_DSS_VENC_TYPE_SVIDEO,
@@ -377,6 +388,32 @@ struct omap_video_timings {
 	u16 vfp;	/* Vertical front porch */
 	/* Unit: line clocks */
 	u16 vbp;	/* Vertical back porch */
+
+	/*
+	 * Vsync logic level
+	 * default value: OMAPDSS_SIG_ACTIVE_HIGH
+	 */
+	enum omap_dss_signal_level vsync_level;
+	/*
+	 * Hsync logic level
+	 * default value: OMAPDSS_SIG_ACTIVE_HIGH
+	 */
+	enum omap_dss_signal_level hsync_level;
+	/*
+	 * Pixel clock edge to drive LCD data
+	 * default value: OMAPDSS_SIG_ACTIVE_HIGH
+	 */
+	enum omap_dss_signal_level pclk_edge;
+	/*
+	 * Data enable logic level
+	 * default value: OMAPDSS_SIG_ACTIVE_HIGH
+	 */
+	enum omap_dss_signal_level de_level;
+	/*
+	 * Pixel clock edges to drive HSYNC and VSYNC pins
+	 * default value: OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES
+	 */
+	enum omap_dss_signal_edge hsync_vsync_edge;
 };
 
 #ifdef CONFIG_OMAP2_DSS_VENC
Signature · 1 line
1.7.9.5
#7 lore raw

Re: [PATCH 05/17] OMAPDSS: Add some new fields to omap_video_timings

Quoted 14 lines · Archit Taneja

Some panel timing related fields are contained in omap_panel_config in the form of flags. The fields are:

- Hsync logic level
- Vsync logic level
- Data driven on rising/falling edge of pixel clock
- Output enable/Data enable logic level
- HSYNC/VSYNC driven on rising/falling edge of pixel clock

Out of these parameters, Hsync and Vsync logic levels are a part of the timings in the Xorg modeline configuration. So it makes sense to move the to omap_video_timings. The rest aren't a part of modeline, but it still makes sense to move these since they are related to panel timings.

Quoted 7 lines

These fields stored in omap_panel_config in dssdev are configured for LCD panels, and the corresponding LCD managers in the DISPC_POL_FREQo registers.

Add the above fields in omap_video_timings. Represent their state via new enums. The parameter pclk_edge is configured via omap_dss_signal_level, however it actually configures whether data is driven on the rising or falling edge. This is a bit unclean, but it prevents us from creating another enum.

Hmm, why can't omap_dss_signal_edge be used for pclk_edge? I think it'd fit fine, except OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES would be an illegal value for it.

Tomi

#8 lore raw

Re: [PATCH 05/17] OMAPDSS: Add some new fields to omap_video_timings

Quoted 18 lines · Tomi Valkeinen
Quoted 17 lines · Archit Taneja

Some panel timing related fields are contained in omap_panel_config in the form of flags. The fields are:

- Hsync logic level
- Vsync logic level
- Data driven on rising/falling edge of pixel clock
- Output enable/Data enable logic level
- HSYNC/VSYNC driven on rising/falling edge of pixel clock

Out of these parameters, Hsync and Vsync logic levels are a part of the timings in the Xorg modeline configuration. So it makes sense to move the to omap_video_timings. The rest aren't a part of modeline, but it still makes sense to move these since they are related to panel timings.

These fields stored in omap_panel_config in dssdev are configured for LCD panels, and the corresponding LCD managers in the DISPC_POL_FREQo registers.

Quoted 8 lines
Quoted 4 lines

Add the above fields in omap_video_timings. Represent their state via new enums. The parameter pclk_edge is configured via omap_dss_signal_level, however it actually configures whether data is driven on the rising or falling edge. This is a bit unclean, but it prevents us from creating another enum.

Hmm, why can't omap_dss_signal_edge be used for pclk_edge? I think it'd fit fine, except OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES would be an illegal value for it.

I think my paragraph is a bit misleading. The issue is more about the default value. For hsync_vsync_edge(which programs ONOFF and RF), the default value is OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES, and is the case for most panels. But for pclk_edge, the value for most panels is OMAPDSS_DRIVE_SIG_ACTIVE_HIGH.

So if I use the same enum for both, I'll need to populate either pclk_edge or hsync_vsync_edge for almost every panel. With my approach, I only need to populate these fields for panels having the non-default requirements. The negative thing is that it's a bit misleading to represent pclk_edge with the omap_dss_signal_level enum.

Archit

#9 lore raw

Re: [PATCH 05/17] OMAPDSS: Add some new fields to omap_video_timings

Quoted 34 lines · Archit Taneja
Quoted 18 lines · Tomi Valkeinen
Quoted 17 lines · Archit Taneja

Some panel timing related fields are contained in omap_panel_config in the form of flags. The fields are:

- Hsync logic level
- Vsync logic level
- Data driven on rising/falling edge of pixel clock
- Output enable/Data enable logic level
- HSYNC/VSYNC driven on rising/falling edge of pixel clock

Out of these parameters, Hsync and Vsync logic levels are a part of the timings in the Xorg modeline configuration. So it makes sense to move the to omap_video_timings. The rest aren't a part of modeline, but it still makes sense to move these since they are related to panel timings.

These fields stored in omap_panel_config in dssdev are configured for LCD panels, and the corresponding LCD managers in the DISPC_POL_FREQo registers.

Quoted 8 lines
Quoted 4 lines

Add the above fields in omap_video_timings. Represent their state via new enums. The parameter pclk_edge is configured via omap_dss_signal_level, however it actually configures whether data is driven on the rising or falling edge. This is a bit unclean, but it prevents us from creating another enum.

Hmm, why can't omap_dss_signal_edge be used for pclk_edge? I think it'd fit fine, except OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES would be an illegal value for it.

I think my paragraph is a bit misleading. The issue is more about the default value. For hsync_vsync_edge(which programs ONOFF and RF), the default value is OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES, and is the case for most panels. But for pclk_edge, the value for most panels is OMAPDSS_DRIVE_SIG_ACTIVE_HIGH.

Quoted 5 lines

So if I use the same enum for both, I'll need to populate either pclk_edge or hsync_vsync_edge for almost every panel. With my approach, I only need to populate these fields for panels having the non-default requirements. The negative thing is that it's a bit misleading to represent pclk_edge with the omap_dss_signal_level enum.

Ah, I see.

I really think using the ACTIVE_LOW/HIGH for pclk_edge is quite ugly =).

Well, one option is to add new entry for the enums, "UNDEFINED" or perhaps "DEFAULT", which would have value 0. Then omapdss would know that it should use the default value, whatever that is.

Another option is to have all panels define the pclk_edge, so that there's no default value needed.

Also, related thing, I see you're writing enum values directly to the registers. If you do that, it'd be good to explicitly set the number value of the enums. Otherwise it's quite easy to add a new enum value later between the old ones, breaking everything (perhaps not a problem here, though).

Tomi

#10 lore raw

Re: [PATCH 05/17] OMAPDSS: Add some new fields to omap_video_timings

Quoted 43 lines · Tomi Valkeinen
Quoted 34 lines · Archit Taneja
Quoted 18 lines · Tomi Valkeinen
Quoted 17 lines · Archit Taneja

Some panel timing related fields are contained in omap_panel_config in the form of flags. The fields are:

- Hsync logic level
- Vsync logic level
- Data driven on rising/falling edge of pixel clock
- Output enable/Data enable logic level
- HSYNC/VSYNC driven on rising/falling edge of pixel clock

Out of these parameters, Hsync and Vsync logic levels are a part of the timings in the Xorg modeline configuration. So it makes sense to move the to omap_video_timings. The rest aren't a part of modeline, but it still makes sense to move these since they are related to panel timings.

These fields stored in omap_panel_config in dssdev are configured for LCD panels, and the corresponding LCD managers in the DISPC_POL_FREQo registers.

Quoted 8 lines
Quoted 4 lines

Add the above fields in omap_video_timings. Represent their state via new enums. The parameter pclk_edge is configured via omap_dss_signal_level, however it actually configures whether data is driven on the rising or falling edge. This is a bit unclean, but it prevents us from creating another enum.

Hmm, why can't omap_dss_signal_edge be used for pclk_edge? I think it'd fit fine, except OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES would be an illegal value for it.

I think my paragraph is a bit misleading. The issue is more about the default value. For hsync_vsync_edge(which programs ONOFF and RF), the default value is OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES, and is the case for most panels. But for pclk_edge, the value for most panels is OMAPDSS_DRIVE_SIG_ACTIVE_HIGH.

Quoted 5 lines

So if I use the same enum for both, I'll need to populate either pclk_edge or hsync_vsync_edge for almost every panel. With my approach, I only need to populate these fields for panels having the non-default requirements. The negative thing is that it's a bit misleading to represent pclk_edge with the omap_dss_signal_level enum.

Ah, I see.

Quoted 8 lines

I really think using the ACTIVE_LOW/HIGH for pclk_edge is quite ugly =).

Well, one option is to add new entry for the enums, "UNDEFINED" or perhaps "DEFAULT", which would have value 0. Then omapdss would know that it should use the default value, whatever that is.

Another option is to have all panels define the pclk_edge, so that there's no default value needed.

I think I'll go with this.

Quoted 6 lines

Also, related thing, I see you're writing enum values directly to the registers. If you do that, it'd be good to explicitly set the number value of the enums. Otherwise it's quite easy to add a new enum value later between the old ones, breaking everything (perhaps not a problem here, though).

Yes, that's true. I'll set the numbers anyway, for clarity.

Archit

#11 lore raw

Re: [PATCH 05/17] OMAPDSS: Add some new fields to omap_video_timings

Quoted 46 lines · Archit Taneja
Quoted 45 lines · Tomi Valkeinen
Quoted 34 lines · Archit Taneja
Quoted 18 lines · Tomi Valkeinen
Quoted 17 lines · Archit Taneja

Some panel timing related fields are contained in omap_panel_config in the form of flags. The fields are:

- Hsync logic level
- Vsync logic level
- Data driven on rising/falling edge of pixel clock
- Output enable/Data enable logic level
- HSYNC/VSYNC driven on rising/falling edge of pixel clock

Out of these parameters, Hsync and Vsync logic levels are a part of the timings in the Xorg modeline configuration. So it makes sense to move the to omap_video_timings. The rest aren't a part of modeline, but it still makes sense to move these since they are related to panel timings.

These fields stored in omap_panel_config in dssdev are configured for LCD panels, and the corresponding LCD managers in the DISPC_POL_FREQo registers.

Quoted 8 lines
Quoted 4 lines

Add the above fields in omap_video_timings. Represent their state via new enums. The parameter pclk_edge is configured via omap_dss_signal_level, however it actually configures whether data is driven on the rising or falling edge. This is a bit unclean, but it prevents us from creating another enum.

Hmm, why can't omap_dss_signal_edge be used for pclk_edge? I think it'd fit fine, except OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES would be an illegal value for it.

I think my paragraph is a bit misleading. The issue is more about the default value. For hsync_vsync_edge(which programs ONOFF and RF), the default value is OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES, and is the case for most panels. But for pclk_edge, the value for most panels is OMAPDSS_DRIVE_SIG_ACTIVE_HIGH.

Quoted 5 lines

So if I use the same enum for both, I'll need to populate either pclk_edge or hsync_vsync_edge for almost every panel. With my approach, I only need to populate these fields for panels having the non-default requirements. The negative thing is that it's a bit misleading to represent pclk_edge with the omap_dss_signal_level enum.

Ah, I see.

I really think using the ACTIVE_LOW/HIGH for pclk_edge is quite ugly =).

Quoted 8 lines
Quoted 6 lines

Well, one option is to add new entry for the enums, "UNDEFINED" or perhaps "DEFAULT", which would have value 0. Then omapdss would know that it should use the default value, whatever that is.

Another option is to have all panels define the pclk_edge, so that there's no default value needed.

I think I'll go with this.

Ok. But if you do this, then perhaps you should fill all the other properties also. It looks a bit strange to require only one particular to be always entered, while the others have default values.

But I guess that's not a bad thing at all. If the panel doesn't define what kind of signal it wants, and trusts that the defaults are always the same, it may break later or perhaps with other platforms.

So I think the panel drivers should define all the signal properties, and not leave them to default values. That's the safest option, although a bit verbose.

Tomi

#12 lore raw

PATCH 6/17 OMAPDSS: DISPLAY: Ignore newly added omap_video_timings fields for display timings sys

In reply to Archit Taneja

The display sysfs file for viewing/storing display timings is something which will be deprecated. The new omap_video_timings fields (hsync_level, vsync_level and others) are not configurable or viewable via this sysfs file.

This prevents the need to make the input more configurable to take the new fields and at the same time work without these fields for backward compatibility.

In display_timings_store, the omap_video_timings struct used to set the timings is initialized to the existing panel timings so that the new fields are taken in correctly. The other fields are taken from the user as before.

---
 drivers/video/omap2/dss/display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/omap2/dss/display.c +1 -1
index 37d6504..1d8198e 100644
@@ -116,7 +116,7 @@ static ssize_t display_timings_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t size)
 {
 	struct omap_dss_device *dssdev = to_dss_device(dev);
-	struct omap_video_timings t;
+	struct omap_video_timings t = dssdev->panel.timings;
 	int r, found;
 
 	if (!dssdev->driver->set_timings || !dssdev->driver->check_timings)
Signature · 1 line
1.7.9.5
#13 lore raw

PATCH 7/17 OMAPDSS: DISPC: Configure newly added omap_video_timing fields

In reply to Archit Taneja

Hsync, Vsync, Data enable enable logic levels and latching info of Data lanes, Hsync and Vsync signals(with respect to pixel clock) are newly added parameters in omap_video_timings.

Program these in dispc_mgr_set_lcd_timings. These will be configured when the manager's timings are set via dss_mgr_set_timings().

---
 drivers/video/omap2/dss/dispc.c |   43 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
drivers/video/omap2/dss/dispc.c +40 -3
index d974be9..184d37b 100644
@@ -2620,9 +2620,16 @@ bool dispc_mgr_timings_ok(enum omap_channel channel,
 }
 
 static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw,
-		int hfp, int hbp, int vsw, int vfp, int vbp)
+		int hfp, int hbp, int vsw, int vfp, int vbp,
+		enum omap_dss_signal_level vsync_level,
+		enum omap_dss_signal_level hsync_level,
+		enum omap_dss_signal_level pclk_edge,
+		enum omap_dss_signal_level de_level,
+		enum omap_dss_signal_edge hsync_vsync_edge)
+
 {
-	u32 timing_h, timing_v;
+	u32 timing_h, timing_v, l;
+	bool onoff, rf;
 
 	if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) {
 		timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
@@ -2640,6 +2647,32 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw,
 
 	dispc_write_reg(DISPC_TIMING_H(channel), timing_h);
 	dispc_write_reg(DISPC_TIMING_V(channel), timing_v);
+
+	switch (hsync_vsync_edge) {
+	case OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES:
+		onoff = false;
+		rf = false;
+		break;
+	case OMAPDSS_DRIVE_SIG_FALLING_EDGE:
+		onoff = true;
+		rf = false;
+		break;
+	case OMAPDSS_DRIVE_SIG_RISING_EDGE:
+		onoff = true;
+		rf = true;
+		break;
+	default:
+		BUG();
+	};
+
+	l = dispc_read_reg(DISPC_POL_FREQ(channel));
+	l |= FLD_VAL(onoff, 17, 17);
+	l |= FLD_VAL(rf, 16, 16);
+	l |= FLD_VAL(de_level, 15, 15);
+	l |= FLD_VAL(pclk_edge, 14, 14);
+	l |= FLD_VAL(hsync_level, 13, 13);
+	l |= FLD_VAL(vsync_level, 12, 12);
+	dispc_write_reg(DISPC_POL_FREQ(channel), l);
 }
 
 /* change name to mode? */
@@ -2659,7 +2692,8 @@ void dispc_mgr_set_timings(enum omap_channel channel,
 
 	if (dispc_mgr_is_lcd(channel)) {
 		_dispc_mgr_set_lcd_timings(channel, t.hsw, t.hfp, t.hbp, t.vsw,
-				t.vfp, t.vbp);
+				t.vfp, t.vbp, t.vsync_level, t.hsync_level,
+				t.pclk_edge, t.de_level, t.hsync_vsync_edge);
 
 		xtot = t.x_res + t.hfp + t.hsw + t.hbp;
 		ytot = t.y_res + t.vfp + t.vsw + t.vbp;
@@ -2670,6 +2704,9 @@ void dispc_mgr_set_timings(enum omap_channel channel,
 		DSSDBG("pck %u\n", timings->pixel_clock);
 		DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n",
 			t.hsw, t.hfp, t.hbp, t.vsw, t.vfp, t.vbp);
+		DSSDBG("vsync_level %d hsync_level %d pclk_edge %d de_level %d hsync_vsync_edge %d\n",
+			t.vsync_level, t.hsync_level, t.pclk_edge, t.de_level,
+			t.hsync_vsync_edge);
 
 		DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt);
 	} else {
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH 8/17 OMAPDSS: DISPC: Remove dispc_mgr_set_pol_freq()

In reply to Archit Taneja

dispc_mgr_set_pol_freq() configures the fields in the register DISPC_POL_FREQo. All these fields have been moved to omap_video_timings struct, and are now programmed in dispc_mgr_set_lcd_timings(). These will be configured when timings are applied via dss_mgr_set_timings().

Remove dispc_mgr_set_pol_freq() and it's calls from the interface drivers.

---
 drivers/video/omap2/dss/dispc.c |   29 -----------------------------
 drivers/video/omap2/dss/dpi.c   |    2 --
 drivers/video/omap2/dss/dss.h   |    2 --
 drivers/video/omap2/dss/sdi.c   |    2 --
 4 files changed, 35 deletions(-)
drivers/video/omap2/dss/dispc.c +0 -29
index 184d37b..9b22563 100644
@@ -3113,35 +3113,6 @@ static void dispc_dump_regs(struct seq_file *s)
 #undef DUMPREG
 }
 
-static void _dispc_mgr_set_pol_freq(enum omap_channel channel, bool onoff,
-		bool rf, bool ieo, bool ipc, bool ihs, bool ivs)
-{
-	u32 l = 0;
-
-	DSSDBG("onoff %d rf %d ieo %d ipc %d ihs %d ivs %d\n",
-			onoff, rf, ieo, ipc, ihs, ivs);
-
-	l |= FLD_VAL(onoff, 17, 17);
-	l |= FLD_VAL(rf, 16, 16);
-	l |= FLD_VAL(ieo, 15, 15);
-	l |= FLD_VAL(ipc, 14, 14);
-	l |= FLD_VAL(ihs, 13, 13);
-	l |= FLD_VAL(ivs, 12, 12);
-
-	dispc_write_reg(DISPC_POL_FREQ(channel), l);
-}
-
-void dispc_mgr_set_pol_freq(enum omap_channel channel,
-		enum omap_panel_config config)
-{
-	_dispc_mgr_set_pol_freq(channel, (config & OMAP_DSS_LCD_ONOFF) != 0,
-			(config & OMAP_DSS_LCD_RF) != 0,
-			(config & OMAP_DSS_LCD_IEO) != 0,
-			(config & OMAP_DSS_LCD_IPC) != 0,
-			(config & OMAP_DSS_LCD_IHS) != 0,
-			(config & OMAP_DSS_LCD_IVS) != 0);
-}
-
 /* with fck as input clock rate, find dispc dividers that produce req_pck */
 void dispc_find_clk_divs(unsigned long req_pck, unsigned long fck,
 		struct dispc_clock_info *cinfo)
drivers/video/omap2/dss/dpi.c +0 -2
index d8cc440..046a6fb 100644
@@ -148,8 +148,6 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)
 	unsigned long pck;
 	int r = 0;
 
-	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config);
-
 	if (dpi_use_dsi_pll(dssdev))
 		r = dpi_set_dsi_clk(dssdev, t->pixel_clock * 1000, &fck,
 				&lck_div, &pck_div);
drivers/video/omap2/dss/dss.h +0 -2
index d64f894..3d23a23 100644
@@ -414,8 +414,6 @@ void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines);
 void dispc_mgr_set_lcd_type_tft(enum omap_channel channel);
 void dispc_mgr_set_timings(enum omap_channel channel,
 		struct omap_video_timings *timings);
-void dispc_mgr_set_pol_freq(enum omap_channel channel,
-		enum omap_panel_config config);
 unsigned long dispc_mgr_lclk_rate(enum omap_channel channel);
 unsigned long dispc_mgr_pclk_rate(enum omap_channel channel);
 unsigned long dispc_core_clk_rate(void);
drivers/video/omap2/dss/sdi.c +0 -2
index 9330410..264efd5 100644
@@ -82,8 +82,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 
 	dssdev->panel.timings.hsync_vsync_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
 
-	dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config);
-
 	r = dss_calc_clock_div(t->pixel_clock * 1000, &dss_cinfo, &dispc_cinfo);
 	if (r)
 		goto err_calc_clock_div;
Signature · 1 line
1.7.9.5
#15 lore raw

PATCH 9/17 OMAPFB: Map the newly added omap_video_timings fields with fb sync flags

In reply to Archit Taneja

Use the newly added fields in omap_video_timings(hsync, vsync and data_enable logic levels and data, hsync and vsync latching related info) to configure/retrieve corresponding sync flags in fb_var_screeninfo and fb_videomode.

Out of the new fields, hsync_level and vsync_level can be mapped to the fb sync flags FB_SYNC_HOR_HIGH_ACT and FB_SYNC_VERT_HIGH_ACT.

When converting fb mode to omap_video_timings, the fields which don't have an equivalent parameter in fb are set to the default values.

---
 drivers/video/omap2/omapfb/omapfb-main.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/video/omap2/omapfb/omapfb-main.c +23 -1
index 1dd8f2c..7c99725 100644
@@ -733,6 +733,10 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 		var->lower_margin = timings.vfp;
 		var->hsync_len = timings.hsw;
 		var->vsync_len = timings.vsw;
+		var->sync |= timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
+				FB_SYNC_HOR_HIGH_ACT : 0;
+		var->sync |= timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
+				FB_SYNC_VERT_HIGH_ACT : 0;
 	} else {
 		var->pixclock = 0;
 		var->left_margin = 0;
@@ -741,11 +745,11 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 		var->lower_margin = 0;
 		var->hsync_len = 0;
 		var->vsync_len = 0;
+		var->sync = 0;
 	}
 
 	/* TODO: get these from panel->config */
 	var->vmode              = FB_VMODE_NONINTERLACED;
-	var->sync               = 0;
 
 	return 0;
 }
@@ -2053,6 +2057,15 @@ static int omapfb_mode_to_timings(const char *mode_str,
 	timings->vsw = var->vsync_len;
 	timings->x_res = var->xres;
 	timings->y_res = var->yres;
+	timings->hsync_level = var->sync & FB_SYNC_HOR_HIGH_ACT ?
+				OMAPDSS_SIG_ACTIVE_HIGH :
+				OMAPDSS_SIG_ACTIVE_LOW;
+	timings->vsync_level = var->sync & FB_SYNC_VERT_HIGH_ACT ?
+				OMAPDSS_SIG_ACTIVE_HIGH :
+				OMAPDSS_SIG_ACTIVE_LOW;
+	timings->pclk_edge = OMAPDSS_SIG_ACTIVE_HIGH;
+	timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
+	timings->hsync_vsync_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
 
 	switch (var->bits_per_pixel) {
 	case 16:
@@ -2187,6 +2200,15 @@ static void fb_videomode_to_omap_timings(struct fb_videomode *m,
 	t->vsw = m->vsync_len;
 	t->vfp = m->lower_margin;
 	t->vbp = m->upper_margin;
+	t->hsync_level = m->sync & FB_SYNC_HOR_HIGH_ACT ?
+				OMAPDSS_SIG_ACTIVE_HIGH :
+				OMAPDSS_SIG_ACTIVE_LOW;
+	t->vsync_level = m->sync & FB_SYNC_VERT_HIGH_ACT ?
+				OMAPDSS_SIG_ACTIVE_HIGH :
+				OMAPDSS_SIG_ACTIVE_LOW;
+	t->pclk_edge = OMAPDSS_SIG_ACTIVE_HIGH;
+	t->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
+	t->hsync_vsync_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
 }
 
 static int omapfb_find_best_mode(struct omap_dss_device *display,
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH 10/17 OMAPDRM: Map the newly added omap_video_timings fields with drm mode flags

In reply to Archit Taneja

Use the newly added fields in omap_video_timings(hsync, vsync and data_enable logic levels and data, hsync and vsync latching related info) to configure/retrieve corresponding drm mode flags in drm_display_mode.

Out of the new fields, hsync_level and vsync_level can be mapped to the drm mode flags DRM_MODE_FLAG_PHSYNC, DRM_MODE_FLAG_NHSYNC, DRM_MODE_FLAG_PVSYNC and DRM_MODE_FLAG_NVSYNC

When converting drm mode to omap_video_timings, the fields which don't have an equivalent parameter in drm mode are set to the default values.

---
 drivers/staging/omapdrm/omap_connector.c |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/staging/omapdrm/omap_connector.c +15 -7
index 5e2856c..157f6ec 100644
@@ -48,13 +48,11 @@ static inline void copy_timings_omap_to_drm(struct drm_display_mode *mode,
 	mode->vsync_end = mode->vsync_start + timings->vsw;
 	mode->vtotal = mode->vsync_end + timings->vbp;
 
-	/* note: whether or not it is interlaced, +/- h/vsync, etc,
-	 * which should be set in the mode flags, is not exposed in
-	 * the omap_video_timings struct.. but hdmi driver tracks
-	 * those separately so all we have to have to set the mode
-	 * is the way to recover these timings values, and the
-	 * omap_dss_driver would do the rest.
-	 */
+	mode->flags |= timings->hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
+			DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC;
+
+	mode->flags |= timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
+			DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
 }
 
 static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
@@ -71,6 +69,16 @@ static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
 	timings->vfp = mode->vsync_start - mode->vdisplay;
 	timings->vsw = mode->vsync_end - mode->vsync_start;
 	timings->vbp = mode->vtotal - mode->vsync_end;
+
+	timings->hsync_level = mode->flags & DRM_MODE_FLAG_PHSYNC ?
+			OMAPDSS_SIG_ACTIVE_HIGH : OMAPDSS_SIG_ACTIVE_LOW;
+
+	timings->vsync_level = mode->flags & DRM_MODE_FLAG_PVSYNC ?
+			OMAPDSS_SIG_ACTIVE_HIGH : OMAPDSS_SIG_ACTIVE_LOW;
+
+	timings->pclk_edge = OMAPDSS_SIG_ACTIVE_HIGH;
+	timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
+	timings->hsync_vsync_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
 }
 
 static void omap_connector_dpms(struct drm_connector *connector, int mode)
Signature · 1 line
1.7.9.5
#17 lore raw

PATCH 11/17 OMAPDSS: Remove omap_panel_config enum from omap_dss_device

In reply to Archit Taneja

omap_panel_config contains fields which are finally written to DISPC_POL_FREQo registers. These are now held by omap_video_timings and are set when the manager timings are applied.

Remove the omap_panel_config enum, and remove all it's references from panel or interface drivers.

---
 drivers/video/omap2/displays/panel-acx565akm.c     |    1 -
 drivers/video/omap2/displays/panel-generic-dpi.c   |   29 --------------------
 .../omap2/displays/panel-lgphilips-lb035q02.c      |    1 -
 .../omap2/displays/panel-nec-nl8048hl11-01b.c      |    2 --
 drivers/video/omap2/displays/panel-picodlp.c       |    2 --
 .../video/omap2/displays/panel-sharp-ls037v7dw01.c |    1 -
 .../video/omap2/displays/panel-tpo-td043mtea1.c    |    2 --
 drivers/video/omap2/dss/hdmi_panel.c               |    2 --
 drivers/video/omap2/dss/sdi.c                      |    2 --
 include/video/omapdss.h                            |   11 --------
 10 files changed, 53 deletions(-)
drivers/video/omap2/displays/panel-acx565akm.c +0 -1
index 067c8a8..c6a2d51 100644
@@ -501,7 +501,6 @@ static int acx_panel_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 
 	dev_dbg(&dssdev->dev, "%s\n", __func__);
-	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 
 	/* FIXME AC bias ? */
 	dssdev->panel.timings = acx_panel_timings;
drivers/video/omap2/displays/panel-generic-dpi.c +0 -29
index e5bba0b..96e3d2b 100644
@@ -40,8 +40,6 @@
 struct panel_config {
 	struct omap_video_timings timings;
 
-	enum omap_panel_config config;
-
 	int power_on_delay;
 	int power_off_delay;
 
@@ -73,8 +71,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IEO,
 		.power_on_delay		= 50,
 		.power_off_delay	= 100,
 		.name			= "sharp_lq",
@@ -99,7 +95,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 50,
 		.power_off_delay	= 100,
 		.name			= "sharp_ls",
@@ -126,9 +121,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.pclk_edge		= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_vsync_edge	= OMAPDSS_DRIVE_SIG_FALLING_EDGE,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IPC |
-						OMAP_DSS_LCD_ONOFF,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
 		.name			= "toppoly_tdo35s",
@@ -153,7 +145,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
 		.name			= "samsung_lte430wq_f0c",
@@ -178,7 +169,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
 		.name			= "seiko_70wvw1tz3",
@@ -204,8 +194,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.de_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IEO,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
 		.name			= "powertip_ph480272t",
@@ -230,7 +218,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
 		.name			= "innolux_at070tn83",
@@ -255,7 +242,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.name			= "nec_nl2432dr22-11b",
 	},
 
@@ -297,8 +283,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
-
 		.name			= "apollon",
 	},
 	/* FocalTech ETM070003DH6 */
@@ -320,7 +304,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.vsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS,
 		.name			= "focaltech_etm070003dh6",
 	},
 
@@ -344,8 +327,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.pclk_edge	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IPC,
 		.power_on_delay		= 0,
 		.power_off_delay	= 0,
 		.name			= "microtips_umsh_8173md",
@@ -390,9 +371,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.de_level	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IEO,
-
 		.name			= "innolux_at080tn52",
 	},
 
@@ -451,8 +429,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.pclk_edge	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IPC,
 		.name			= "primeview_pd050vl1",
 	},
 
@@ -476,8 +452,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.pclk_edge	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IPC,
 		.name			= "primeview_pm070wl4",
 	},
 
@@ -501,8 +475,6 @@ static struct panel_config generic_dpi_panels[] = {
 			.hsync_level	= OMAPDSS_SIG_ACTIVE_LOW,
 			.pclk_edge	= OMAPDSS_SIG_ACTIVE_LOW,
 		},
-		.config			= OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-						OMAP_DSS_LCD_IPC,
 		.name			= "primeview_pd104slf",
 	},
 };
@@ -592,7 +564,6 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
 	if (!panel_config)
 		return -EINVAL;
 
-	dssdev->panel.config = panel_config->config;
 	dssdev->panel.timings = panel_config->timings;
 
 	drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL);
drivers/video/omap2/displays/panel-lgphilips-lb035q02.c +0 -1
index d9565c4e..d8cfc83 100644
@@ -85,7 +85,6 @@ static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
 	struct lb035q02_data *ld;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 	dssdev->panel.timings = lb035q02_timings;
 
 	ld = kzalloc(sizeof(*ld), GFP_KERNEL);
drivers/video/omap2/displays/panel-nec-nl8048hl11-01b.c +0 -2
index ff863d1..bccd451 100644
@@ -120,8 +120,6 @@ static int nec_8048_panel_probe(struct omap_dss_device *dssdev)
 	struct backlight_properties props;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS |
-				OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
 	dssdev->panel.timings = nec_8048_panel_timings;
 
 	necd = kzalloc(sizeof(*necd), GFP_KERNEL);
drivers/video/omap2/displays/panel-picodlp.c +0 -2
index 95fda38..29705cf 100644
@@ -418,8 +418,6 @@ static int picodlp_panel_probe(struct omap_dss_device *dssdev)
 	struct i2c_client *picodlp_i2c_client;
 	int r = 0, picodlp_adapter_id;
 
-	dssdev->panel.config = OMAP_DSS_LCD_ONOFF | OMAP_DSS_LCD_IHS |
-				OMAP_DSS_LCD_IVS;
 	dssdev->panel.timings = pico_ls_timings;
 
 	picod =  kzalloc(sizeof(struct picodlp_data), GFP_KERNEL);
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c +0 -1
index 9854f35..6d54a1a 100644
@@ -89,7 +89,6 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
 	struct sharp_data *sd;
 	int r;
 
-	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
 	dssdev->panel.timings = sharp_ls_timings;
 
 	sd = kzalloc(sizeof(*sd), GFP_KERNEL);
drivers/video/omap2/displays/panel-tpo-td043mtea1.c +0 -2
index 446cef6..c5a0868 100644
@@ -409,8 +409,6 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev)
 		return -ENODEV;
 	}
 
-	dssdev->panel.config = OMAP_DSS_LCD_IHS | OMAP_DSS_LCD_IVS |
-				OMAP_DSS_LCD_IPC;
 	dssdev->panel.timings = tpo_td043_timings;
 	dssdev->ctrl.pixel_size = 24;
 
drivers/video/omap2/dss/hdmi_panel.c +0 -2
index aa0f3c2..a991840 100644
@@ -43,8 +43,6 @@ static int hdmi_panel_probe(struct omap_dss_device *dssdev)
 {
 	DSSDBG("ENTER hdmi_panel_probe\n");
 
-	dssdev->panel.config = OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS;
-
 	dssdev->panel.timings = (struct omap_video_timings)
 			{ 640, 480, 25175, 96, 16, 48, 2, 11, 31,
 				OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
drivers/video/omap2/dss/sdi.c +0 -2
index 264efd5..2fd8540 100644
@@ -78,8 +78,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
 	sdi_basic_init(dssdev);
 
 	/* 15.5.9.1.2 */
-	dssdev->panel.config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF;
-
 	dssdev->panel.timings.hsync_vsync_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE;
 
 	r = dss_calc_clock_div(t->pixel_clock * 1000, &dss_cinfo, &dispc_cinfo);
include/video/omapdss.h +0 -11
index 1d1a2be..5de5c9c 100644
@@ -116,15 +116,6 @@ enum omap_rfbi_te_mode {
 	OMAP_DSS_RFBI_TE_MODE_2 = 2,
 };
 
-enum omap_panel_config {
-	OMAP_DSS_LCD_IVS		= 1<<0,
-	OMAP_DSS_LCD_IHS		= 1<<1,
-	OMAP_DSS_LCD_IPC		= 1<<2,
-	OMAP_DSS_LCD_IEO		= 1<<3,
-	OMAP_DSS_LCD_RF			= 1<<4,
-	OMAP_DSS_LCD_ONOFF		= 1<<5,
-};
-
 enum omap_dss_signal_level {
 	OMAPDSS_SIG_ACTIVE_HIGH,
 	OMAPDSS_SIG_ACTIVE_LOW,
@@ -598,8 +589,6 @@ struct omap_dss_device {
 		/* Unit: line clocks */
 		int acb;	/* ac-bias pin frequency */
 
-		enum omap_panel_config config;
-
 		enum omap_dss_dsi_pixel_format dsi_pix_fmt;
 		enum omap_dss_dsi_mode dsi_mode;
 		struct omap_dss_dsi_videomode_data dsi_vm_data;
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH 12/17 OMAPDSS: Add interlace parameter to omap_video_timings

In reply to Archit Taneja

Add a parameter called interlace which tells whether the timings are in interlaced or progressive mode. This aligns the omap_video_timings struct with the Xorg modeline configuration.

It also removes the hack needed to write to divide the manager height by 2 if the connected interface is VENC.

---
 drivers/video/omap2/dss/dispc.c |    6 +-----
 drivers/video/omap2/dss/venc.c  |    4 ++++
 include/video/omapdss.h         |    3 +++
 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/video/omap2/dss/dispc.c +1 -5
index 9b22563..92b6428 100644
@@ -2710,11 +2710,7 @@ void dispc_mgr_set_timings(enum omap_channel channel,
 
 		DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt);
 	} else {
-		enum dss_hdmi_venc_clk_source_select source;
-
-		source = dss_get_hdmi_venc_clk_source();
-
-		if (source == DSS_VENC_TV_CLK)
+		if (t.interlace == true)
 			t.y_res /= 2;
 	}
 
drivers/video/omap2/dss/venc.c +4 -0
index 3552305..494f763 100644
@@ -272,6 +272,8 @@ const struct omap_video_timings omap_dss_pal_timings = {
 	.vsw		= 5,
 	.vfp		= 5,
 	.vbp		= 41,
+
+	.interlace	= true,
 };
 EXPORT_SYMBOL(omap_dss_pal_timings);
 
@@ -285,6 +287,8 @@ const struct omap_video_timings omap_dss_ntsc_timings = {
 	.vsw		= 6,
 	.vfp		= 6,
 	.vbp		= 31,
+
+	.interlace	= true,
 };
 EXPORT_SYMBOL(omap_dss_ntsc_timings);
 
include/video/omapdss.h +3 -0
index 5de5c9c..1498bb3 100644
@@ -390,6 +390,9 @@ struct omap_video_timings {
 	 * default value: OMAPDSS_SIG_ACTIVE_HIGH
 	 */
 	enum omap_dss_signal_level hsync_level;
+
+	/* Interlaced or Progressive timings */
+	bool interlace;
 	/*
 	 * Pixel clock edge to drive LCD data
 	 * default value: OMAPDSS_SIG_ACTIVE_HIGH
Signature · 1 line
1.7.9.5
#19 lore raw

PATCH 13/17 OMAPDSS: DISPC/APPLY: Use interlace info in manager timings for dispc_ovl_setup()

In reply to Archit Taneja

Currently the interlace parameter passed to dispc_ovl_setup() is configured by checking the display type, and set to true if the display type is VENC.

This isn't correct as other panels can take interlaced content too. The omap_video_timings struct in manager's private data contains the info whether the panel is in interlaced mode or not.

---
 drivers/video/omap2/dss/apply.c |    6 ++----
 drivers/video/omap2/dss/dispc.c |    4 ++--
 drivers/video/omap2/dss/dss.h   |    3 +--
 3 files changed, 5 insertions(+), 8 deletions(-)
drivers/video/omap2/dss/apply.c +2 -4
index ab22cc2..3ce7a3e 100644
@@ -537,7 +537,7 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl)
 {
 	struct ovl_priv_data *op = get_ovl_priv(ovl);
 	struct omap_overlay_info *oi;
-	bool ilace, replication;
+	bool replication;
 	struct mgr_priv_data *mp;
 	int r;
 
@@ -552,9 +552,7 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl)
 
 	replication = dss_use_replication(ovl->manager->device, oi->color_mode);
 
-	ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC;
-
-	r = dispc_ovl_setup(ovl->id, oi, ilace, replication, &mp->timings);
+	r = dispc_ovl_setup(ovl->id, oi, replication, &mp->timings);
 	if (r) {
 		/*
 		 * We can't do much here, as this function can be called from
drivers/video/omap2/dss/dispc.c +2 -2
index 92b6428..c0b82c6 100644
@@ -2086,8 +2086,7 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane,
 }
 
 int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
-		bool ilace, bool replication,
-		const struct omap_video_timings *mgr_timings)
+		bool replication, const struct omap_video_timings *mgr_timings)
 {
 	struct omap_overlay *ovl = omap_dss_get_overlay(plane);
 	bool five_taps = true;
@@ -2103,6 +2102,7 @@ int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
 	u16 out_width, out_height;
 	enum omap_channel channel;
 	int x_predecim = 1, y_predecim = 1;
+	bool ilace = mgr_timings->interlace;
 
 	channel = dispc_ovl_get_channel_out(plane);
 
drivers/video/omap2/dss/dss.h +1 -2
index 3d23a23..20151d5 100644
@@ -394,8 +394,7 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane,
 		u32 *fifo_low, u32 *fifo_high, bool use_fifomerge,
 		bool manual_update);
 int dispc_ovl_setup(enum omap_plane plane, struct omap_overlay_info *oi,
-		bool ilace, bool replication,
-		const struct omap_video_timings *mgr_timings);
+		bool replication, const struct omap_video_timings *mgr_timings);
 int dispc_ovl_enable(enum omap_plane plane, bool enable);
 void dispc_ovl_set_channel_out(enum omap_plane plane,
 		enum omap_channel channel);
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH 14/17 OMAPFB: Map interlace field in omap_video_timings with fb vmode flags

In reply to Archit Taneja

Use the interlace field in omap_video_timings to configure/retrieve corresponding fb mode flags in fb_var_screeninfo and fb_videomode.

The interlace field maps with the fb mode flags FB_VMODE_INTERLACED and FB_VMODE_NONINTERLACED.

---
 drivers/video/omap2/omapfb/omapfb-main.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/video/omap2/omapfb/omapfb-main.c +5 -3
index 7c99725..434aa9a 100644
@@ -737,6 +737,8 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 				FB_SYNC_HOR_HIGH_ACT : 0;
 		var->sync |= timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
 				FB_SYNC_VERT_HIGH_ACT : 0;
+		var->vmode = timings.interlace ?
+				FB_VMODE_INTERLACED : FB_VMODE_NONINTERLACED;
 	} else {
 		var->pixclock = 0;
 		var->left_margin = 0;
@@ -746,11 +748,9 @@ int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var)
 		var->hsync_len = 0;
 		var->vsync_len = 0;
 		var->sync = 0;
+		var->vmode = FB_VMODE_NONINTERLACED;
 	}
 
-	/* TODO: get these from panel->config */
-	var->vmode              = FB_VMODE_NONINTERLACED;
-
 	return 0;
 }
 
@@ -2063,6 +2063,7 @@ static int omapfb_mode_to_timings(const char *mode_str,
 	timings->vsync_level = var->sync & FB_SYNC_VERT_HIGH_ACT ?
 				OMAPDSS_SIG_ACTIVE_HIGH :
 				OMAPDSS_SIG_ACTIVE_LOW;
+	timings->interlace = var->vmode & FB_VMODE_INTERLACED;
 	timings->pclk_edge = OMAPDSS_SIG_ACTIVE_HIGH;
 	timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
 	timings->hsync_vsync_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
@@ -2206,6 +2207,7 @@ static void fb_videomode_to_omap_timings(struct fb_videomode *m,
 	t->vsync_level = m->sync & FB_SYNC_VERT_HIGH_ACT ?
 				OMAPDSS_SIG_ACTIVE_HIGH :
 				OMAPDSS_SIG_ACTIVE_LOW;
+	t->interlace = m->vmode & FB_VMODE_INTERLACED;
 	t->pclk_edge = OMAPDSS_SIG_ACTIVE_HIGH;
 	t->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
 	t->hsync_vsync_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH 15/17 OMAPDRM: Map interlace field in omap_video_timings with drm mode flags

In reply to Archit Taneja

Use the interlace field in omap_video_timings to configure/retrieve corresponding flags in drm_display_mode.

The interlace field maps with the drm mode flag DRM_MODE_FLAG_INTERLACE.

---
 drivers/staging/omapdrm/omap_connector.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/staging/omapdrm/omap_connector.c +5 -0
index 157f6ec..05dda41 100644
@@ -53,6 +53,8 @@ static inline void copy_timings_omap_to_drm(struct drm_display_mode *mode,
 
 	mode->flags |= timings->vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ?
 			DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC;
+
+	mode->flags |= timings->interlace ? DRM_MODE_FLAG_INTERLACE : 0;
 }
 
 static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
@@ -76,6 +78,9 @@ static inline void copy_timings_drm_to_omap(struct omap_video_timings *timings,
 	timings->vsync_level = mode->flags & DRM_MODE_FLAG_PVSYNC ?
 			OMAPDSS_SIG_ACTIVE_HIGH : OMAPDSS_SIG_ACTIVE_LOW;
 
+	timings->interlace = mode->flags & DRM_MODE_FLAG_INTERLACE ?
+			true : false;
+
 	timings->pclk_edge = OMAPDSS_SIG_ACTIVE_HIGH;
 	timings->de_level = OMAPDSS_SIG_ACTIVE_HIGH;
 	timings->hsync_vsync_edge = OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES;
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH 16/17 OMAPDSS: HDMI: Remove custom hdmi_video_timings struct

In reply to Archit Taneja

The hdmi CEA and VESA timings were represented by the struct hdmi_video_timings, omap_video_timings couldn't be used as it didn't contain the fields hsync/vsync polarities and interlaced/progressive information.

Remove hdmi_video_timings, and use omap_video_timings instead.

---
 drivers/video/omap2/dss/hdmi.c            |  241 ++++++++++++++++++++++++-----
 drivers/video/omap2/dss/ti_hdmi.h         |   19 +--
 drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c |    8 +-
 3 files changed, 213 insertions(+), 55 deletions(-)
drivers/video/omap2/dss/hdmi.c +206 -35
index 34910bc..46fb1be 100644
@@ -78,43 +78,214 @@ static struct {
  */
 
 static const struct hdmi_config cea_timings[] = {
-{ {640, 480, 25200, 96, 16, 48, 2, 10, 33, 0, 0, 0}, {1, HDMI_HDMI} },
-{ {720, 480, 27027, 62, 16, 60, 6, 9, 30, 0, 0, 0}, {2, HDMI_HDMI} },
-{ {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {4, HDMI_HDMI} },
-{ {1920, 540, 74250, 44, 88, 148, 5, 2, 15, 1, 1, 1}, {5, HDMI_HDMI} },
-{ {1440, 240, 27027, 124, 38, 114, 3, 4, 15, 0, 0, 1}, {6, HDMI_HDMI} },
-{ {1920, 1080, 148500, 44, 88, 148, 5, 4, 36, 1, 1, 0}, {16, HDMI_HDMI} },
-{ {720, 576, 27000, 64, 12, 68, 5, 5, 39, 0, 0, 0}, {17, HDMI_HDMI} },
-{ {1280, 720, 74250, 40, 440, 220, 5, 5, 20, 1, 1, 0}, {19, HDMI_HDMI} },
-{ {1920, 540, 74250, 44, 528, 148, 5, 2, 15, 1, 1, 1}, {20, HDMI_HDMI} },
-{ {1440, 288, 27000, 126, 24, 138, 3, 2, 19, 0, 0, 1}, {21, HDMI_HDMI} },
-{ {1440, 576, 54000, 128, 24, 136, 5, 5, 39, 0, 0, 0}, {29, HDMI_HDMI} },
-{ {1920, 1080, 148500, 44, 528, 148, 5, 4, 36, 1, 1, 0}, {31, HDMI_HDMI} },
-{ {1920, 1080, 74250, 44, 638, 148, 5, 4, 36, 1, 1, 0}, {32, HDMI_HDMI} },
-{ {2880, 480, 108108, 248, 64, 240, 6, 9, 30, 0, 0, 0}, {35, HDMI_HDMI} },
-{ {2880, 576, 108000, 256, 48, 272, 5, 5, 39, 0, 0, 0}, {37, HDMI_HDMI} },
+	{
+		{ 640, 480, 25200, 96, 16, 48, 2, 10, 33,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 1, HDMI_HDMI },
+	},
+	{
+		{ 720, 480, 27027, 62, 16, 60, 6, 9, 30,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 2, HDMI_HDMI },
+	},
+	{
+		{ 1280, 720, 74250, 40, 110, 220, 5, 5, 20,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 4, HDMI_HDMI },
+	},
+	{
+		{ 1920, 540, 74250, 44, 88, 148, 5, 2, 15,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			true, },
+		{ 5, HDMI_HDMI },
+	},
+	{
+		{ 1440, 240, 27027, 124, 38, 114, 3, 4, 15,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			true, },
+		{ 6, HDMI_HDMI },
+	},
+	{
+		{ 1920, 1080, 148500, 44, 88, 148, 5, 4, 36,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 16, HDMI_HDMI },
+	},
+	{
+		{ 720, 576, 27000, 64, 12, 68, 5, 5, 39,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 17, HDMI_HDMI },
+	},
+	{
+		{ 1280, 720, 74250, 40, 440, 220, 5, 5, 20,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 19, HDMI_HDMI },
+	},
+	{
+		{ 1920, 540, 74250, 44, 528, 148, 5, 2, 15,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			true, },
+		{ 20, HDMI_HDMI },
+	},
+	{
+		{ 1440, 288, 27000, 126, 24, 138, 3, 2, 19,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			true, },
+		{ 21, HDMI_HDMI },
+	},
+	{
+		{ 1440, 576, 54000, 128, 24, 136, 5, 5, 39,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 29, HDMI_HDMI },
+	},
+	{
+		{ 1920, 1080, 148500, 44, 528, 148, 5, 4, 36,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 31, HDMI_HDMI },
+	},
+	{
+		{ 1920, 1080, 74250, 44, 638, 148, 5, 4, 36,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 32, HDMI_HDMI },
+	},
+	{
+		{ 2880, 480, 108108, 248, 64, 240, 6, 9, 30,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 35, HDMI_HDMI },
+	},
+	{
+		{ 2880, 576, 108000, 256, 48, 272, 5, 5, 39,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 37, HDMI_HDMI },
+	},
 };
+
 static const struct hdmi_config vesa_timings[] = {
 /* VESA From Here */
-{ {640, 480, 25175, 96, 16, 48, 2 , 11, 31, 0, 0, 0}, {4, HDMI_DVI} },
-{ {800, 600, 40000, 128, 40, 88, 4 , 1, 23, 1, 1, 0}, {9, HDMI_DVI} },
-{ {848, 480, 33750, 112, 16, 112, 8 , 6, 23, 1, 1, 0}, {0xE, HDMI_DVI} },
-{ {1280, 768, 79500, 128, 64, 192, 7 , 3, 20, 1, 0, 0}, {0x17, HDMI_DVI} },
-{ {1280, 800, 83500, 128, 72, 200, 6 , 3, 22, 1, 0, 0}, {0x1C, HDMI_DVI} },
-{ {1360, 768, 85500, 112, 64, 256, 6 , 3, 18, 1, 1, 0}, {0x27, HDMI_DVI} },
-{ {1280, 960, 108000, 112, 96, 312, 3 , 1, 36, 1, 1, 0}, {0x20, HDMI_DVI} },
-{ {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38, 1, 1, 0}, {0x23, HDMI_DVI} },
-{ {1024, 768, 65000, 136, 24, 160, 6, 3, 29, 0, 0, 0}, {0x10, HDMI_DVI} },
-{ {1400, 1050, 121750, 144, 88, 232, 4, 3, 32, 1, 0, 0}, {0x2A, HDMI_DVI} },
-{ {1440, 900, 106500, 152, 80, 232, 6, 3, 25, 1, 0, 0}, {0x2F, HDMI_DVI} },
-{ {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30, 1, 0, 0}, {0x3A, HDMI_DVI} },
-{ {1366, 768, 85500, 143, 70, 213, 3, 3, 24, 1, 1, 0}, {0x51, HDMI_DVI} },
-{ {1920, 1080, 148500, 44, 148, 80, 5, 4, 36, 1, 1, 0}, {0x52, HDMI_DVI} },
-{ {1280, 768, 68250, 32, 48, 80, 7, 3, 12, 0, 1, 0}, {0x16, HDMI_DVI} },
-{ {1400, 1050, 101000, 32, 48, 80, 4, 3, 23, 0, 1, 0}, {0x29, HDMI_DVI} },
-{ {1680, 1050, 119000, 32, 48, 80, 6, 3, 21, 0, 1, 0}, {0x39, HDMI_DVI} },
-{ {1280, 800, 79500, 32, 48, 80, 6, 3, 14, 0, 1, 0}, {0x1B, HDMI_DVI} },
-{ {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {0x55, HDMI_DVI} }
+	{
+		{ 640, 480, 25175, 96, 16, 48, 2, 11, 31,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 4, HDMI_DVI },
+	},
+	{
+		{ 800, 600, 40000, 128, 40, 88, 4, 1, 23,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 9, HDMI_DVI },
+	},
+	{
+		{ 848, 480, 33750, 112, 16, 112, 8, 6, 23,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0xE, HDMI_DVI },
+	},
+	{
+		{ 1280, 768, 79500, 128, 64, 192, 7, 3, 20,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 0x17, HDMI_DVI },
+	},
+	{
+		{ 1280, 800, 83500, 128, 72, 200, 6, 3, 22,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 0x1C, HDMI_DVI },
+	},
+	{
+		{ 1360, 768, 85500, 112, 64, 256, 6, 3, 18,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x27, HDMI_DVI },
+	},
+	{
+		{ 1280, 960, 108000, 112, 96, 312, 3, 1, 36,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x20, HDMI_DVI },
+	},
+	{
+		{ 1280, 1024, 108000, 112, 48, 248, 3, 1, 38,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x23, HDMI_DVI },
+	},
+	{
+		{ 1024, 768, 65000, 136, 24, 160, 6, 3, 29,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 0x10, HDMI_DVI },
+	},
+	{
+		{ 1400, 1050, 121750, 144, 88, 232, 4, 3, 32,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 0x2A, HDMI_DVI },
+	},
+	{
+		{ 1440, 900, 106500, 152, 80, 232, 6, 3, 25,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 0x2F, HDMI_DVI },
+	},
+	{
+		{ 1680, 1050, 146250, 176 , 104, 280, 6, 3, 30,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_LOW,
+			false, },
+		{ 0x3A, HDMI_DVI },
+	},
+	{
+		{ 1366, 768, 85500, 143, 70, 213, 3, 3, 24,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x51, HDMI_DVI },
+	},
+	{
+		{ 1920, 1080, 148500, 44, 148, 80, 5, 4, 36,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x52, HDMI_DVI },
+	},
+	{
+		{ 1280, 768, 68250, 32, 48, 80, 7, 3, 12,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x16, HDMI_DVI },
+	},
+	{
+		{ 1400, 1050, 101000, 32, 48, 80, 4, 3, 23,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x29, HDMI_DVI },
+	},
+	{
+		{ 1680, 1050, 119000, 32, 48, 80, 6, 3, 21,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x39, HDMI_DVI },
+	},
+	{
+		{ 1280, 800, 79500, 32, 48, 80, 6, 3, 14,
+			OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x1B, HDMI_DVI },
+	},
+	{
+		{ 1280, 720, 74250, 40, 110, 220, 5, 5, 20,
+			OMAPDSS_SIG_ACTIVE_HIGH, OMAPDSS_SIG_ACTIVE_HIGH,
+			false, },
+		{ 0x55, HDMI_DVI },
+	},
 };
 
 static int hdmi_runtime_get(void)
@@ -179,7 +350,7 @@ static const struct hdmi_config *hdmi_get_timings(void)
 }
 
 static bool hdmi_timings_compare(struct omap_video_timings *timing1,
-				const struct hdmi_video_timings *timing2)
+				const struct omap_video_timings *timing2)
 {
 	int timing1_vsync, timing1_hsync, timing2_vsync, timing2_hsync;
 
drivers/video/omap2/dss/ti_hdmi.h +1 -18
index e734cb4..913c4ca 100644
@@ -42,30 +42,13 @@ enum hdmi_clk_refsel {
 	HDMI_REFSEL_SYSCLK = 3
 };
 
-/* HDMI timing structure */
-struct hdmi_video_timings {
-	u16 x_res;
-	u16 y_res;
-	/* Unit: KHz */
-	u32 pixel_clock;
-	u16 hsw;
-	u16 hfp;
-	u16 hbp;
-	u16 vsw;
-	u16 vfp;
-	u16 vbp;
-	bool vsync_pol;
-	bool hsync_pol;
-	bool interlace;
-};
-
 struct hdmi_cm {
 	int	code;
 	int	mode;
 };
 
 struct hdmi_config {
-	struct hdmi_video_timings timings;
+	struct omap_video_timings timings;
 	struct hdmi_cm cm;
 };
 
drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +6 -2
index 4dae1b2..92944ac 100644
@@ -747,11 +747,15 @@ static void hdmi_wp_video_config_format(struct hdmi_ip_data *ip_data,
 static void hdmi_wp_video_config_interface(struct hdmi_ip_data *ip_data)
 {
 	u32 r;
+	bool vsync_pol, hsync_pol;
 	pr_debug("Enter hdmi_wp_video_config_interface\n");
 
+	vsync_pol = ip_data->cfg.timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
+	hsync_pol = ip_data->cfg.timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH;
+
 	r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG);
-	r = FLD_MOD(r, ip_data->cfg.timings.vsync_pol, 7, 7);
-	r = FLD_MOD(r, ip_data->cfg.timings.hsync_pol, 6, 6);
+	r = FLD_MOD(r, vsync_pol, 7, 7);
+	r = FLD_MOD(r, hsync_pol, 6, 6);
 	r = FLD_MOD(r, ip_data->cfg.timings.interlace, 3, 3);
 	r = FLD_MOD(r, 1, 1, 0); /* HDMI_TIMING_MASTER_24BIT */
 	hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, r);
Signature · 1 line
1.7.9.5
#23 lore raw

PATCH 17/17 OMAPDSS: DSI: Remove redundant fields in omap_dss_dsi_videomode_data

In reply to Archit Taneja

The struct omap_dss_dsi_videomode_data holds polaritiy/logic level information of the DISPC video port signals DE, HSYNC and VSYNC. This information already exists in the omap_video_timings struct.

Use the fields in omap_video_timings to program VP_DE_POL, VP_HSYNC_POL and VP_VSYNC_POL in DSI_CTRL. Remove the redundant fields in omap_dss_dsi_videomode_data.

---
 drivers/video/omap2/dss/dsi.c |   11 ++++++++---
 include/video/omapdss.h       |    3 ---
 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/video/omap2/dss/dsi.c +8 -3
index 061bf53..3844430 100644
@@ -3628,13 +3628,18 @@ static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev)
 static void dsi_config_vp_sync_events(struct omap_dss_device *dssdev)
 {
 	struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
-	int de_pol = dssdev->panel.dsi_vm_data.vp_de_pol;
-	int hsync_pol = dssdev->panel.dsi_vm_data.vp_hsync_pol;
-	int vsync_pol = dssdev->panel.dsi_vm_data.vp_vsync_pol;
+	int de_pol, hsync_pol, vsync_pol;
+	int de_level = dssdev->panel.timings.de_level;
+	int hsync_level = dssdev->panel.timings.hsync_level;
+	int vsync_level = dssdev->panel.timings.vsync_level;
 	bool vsync_end = dssdev->panel.dsi_vm_data.vp_vsync_end;
 	bool hsync_end = dssdev->panel.dsi_vm_data.vp_hsync_end;
 	u32 r;
 
+	de_pol = de_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+	hsync_pol = hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+	vsync_pol = vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+
 	r = dsi_read_reg(dsidev, DSI_CTRL);
 	r = FLD_MOD(r, de_pol, 9, 9);		/* VP_DE_POL */
 	r = FLD_MOD(r, hsync_pol, 10, 10);	/* VP_HSYNC_POL */
include/video/omapdss.h +0 -3
index 1498bb3..f627ad9 100644
@@ -255,9 +255,6 @@ struct omap_dss_dsi_videomode_data {
 	int hfp_blanking_mode;
 
 	/* Video port sync events */
-	int vp_de_pol;
-	int vp_hsync_pol;
-	int vp_vsync_pol;
 	bool vp_vsync_end;
 	bool vp_hsync_end;
 
Signature · 1 line
1.7.9.5
#24 lore raw

Re: [PATCH 17/17] OMAPDSS: DSI: Remove redundant fields in omap_dss_dsi_videomode_data

Quoted 30 lines · Archit Taneja

The struct omap_dss_dsi_videomode_data holds polaritiy/logic level information of the DISPC video port signals DE, HSYNC and VSYNC. This information already exists in the omap_video_timings struct.

Use the fields in omap_video_timings to program VP_DE_POL, VP_HSYNC_POL and VP_VSYNC_POL in DSI_CTRL. Remove the redundant fields in omap_dss_dsi_videomode_data.

---
 drivers/video/omap2/dss/dsi.c |   11 ++++++++---
 include/video/omapdss.h       |    3 ---
 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/video/omap2/dss/dsi.c +4 -3
index 061bf53..3844430 100644
@@ -3628,13 +3628,18 @@ static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev)
 static void dsi_config_vp_sync_events(struct omap_dss_device *dssdev)
 {
 	struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
-	int de_pol = dssdev->panel.dsi_vm_data.vp_de_pol;
-	int hsync_pol = dssdev->panel.dsi_vm_data.vp_hsync_pol;
-	int vsync_pol = dssdev->panel.dsi_vm_data.vp_vsync_pol;
+	int de_pol, hsync_pol, vsync_pol;
+	int de_level = dssdev->panel.timings.de_level;
+	int hsync_level = dssdev->panel.timings.hsync_level;
+	int vsync_level = dssdev->panel.timings.vsync_level;
 	bool vsync_end = dssdev->panel.dsi_vm_data.vp_vsync_end;

drivers/video/omap2/dss/dsi.c static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev) · line 3645

Quoted 10 lines
drivers/video/omap2/dss/dsi.c +4 -0
 	bool hsync_end = dssdev->panel.dsi_vm_data.vp_hsync_end;
 	u32 r;
 
+	de_pol = de_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+	hsync_pol = hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+	vsync_pol = vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+
 	r = dsi_read_reg(dsidev, DSI_CTRL);
 	r = FLD_MOD(r, de_pol, 9, 9);		/* VP_DE_POL */
 	r = FLD_MOD(r, hsync_pol, 10, 10);	/* VP_HSYNC_POL */

This patch makes the code cleaner, but I find this DSI sync code a bit strange.

The sync polarities between DISPC and DSI do not matter elsewhere, they do not affect the DSI output, so why do we have them in the panel data? Why doesn't dsi.c just use some hardcoded values for these.

Tomi

#25 lore raw

Re: [PATCH 17/17] OMAPDSS: DSI: Remove redundant fields in omap_dss_dsi_videomode_data

Quoted 45 lines · Tomi Valkeinen
Quoted 30 lines · Archit Taneja

The struct omap_dss_dsi_videomode_data holds polaritiy/logic level information of the DISPC video port signals DE, HSYNC and VSYNC. This information already exists in the omap_video_timings struct.

Use the fields in omap_video_timings to program VP_DE_POL, VP_HSYNC_POL and VP_VSYNC_POL in DSI_CTRL. Remove the redundant fields in omap_dss_dsi_videomode_data.

---
  drivers/video/omap2/dss/dsi.c |   11 ++++++++---
  include/video/omapdss.h       |    3 ---
  2 files changed, 8 insertions(+), 6 deletions(-)
drivers/video/omap2/dss/dsi.c +4 -3
index 061bf53..3844430 100644
@@ -3628,13 +3628,18 @@ static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev)
  static void dsi_config_vp_sync_events(struct omap_dss_device *dssdev)
  {
  	struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
-	int de_pol = dssdev->panel.dsi_vm_data.vp_de_pol;
-	int hsync_pol = dssdev->panel.dsi_vm_data.vp_hsync_pol;
-	int vsync_pol = dssdev->panel.dsi_vm_data.vp_vsync_pol;
+	int de_pol, hsync_pol, vsync_pol;
+	int de_level = dssdev->panel.timings.de_level;
+	int hsync_level = dssdev->panel.timings.hsync_level;
+	int vsync_level = dssdev->panel.timings.vsync_level;
  	bool vsync_end = dssdev->panel.dsi_vm_data.vp_vsync_end;

drivers/video/omap2/dss/dsi.c static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev) · line 3645

Quoted 10 lines
drivers/video/omap2/dss/dsi.c +4 -0
  	bool hsync_end = dssdev->panel.dsi_vm_data.vp_hsync_end;
  	u32 r;
 
+	de_pol = de_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+	hsync_pol = hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+	vsync_pol = vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? 1 : 0;
+
  	r = dsi_read_reg(dsidev, DSI_CTRL);
  	r = FLD_MOD(r, de_pol, 9, 9);		/* VP_DE_POL */
  	r = FLD_MOD(r, hsync_pol, 10, 10);	/* VP_HSYNC_POL */

This patch makes the code cleaner, but I find this DSI sync code a bit strange.

Quoted 3 lines

The sync polarities between DISPC and DSI do not matter elsewhere, they do not affect the DSI output, so why do we have them in the panel data? Why doesn't dsi.c just use some hardcoded values for these.

Ok, are you saying that unlike DPI, where a panel may request for some different polarities. There is no such need for DSI panels, and we can set the polarities of DISPC and DSI always to active high(or any other combination)?

Well, we are doing that indirectly in a way, a DSI panel driver would populate a omap_video_timings struct, and would leave hsync_level, vsync_level and de_level empty(i.e, the default values). This would be passed to the DSI driver, and the timings would be applied to DISPC. The function above would just pick up the same default values and program to the DSI registers.

What we could do is ignore these fields in the omap_video_timings when passed from the panel driver to DSI driver, and always use a fixed value for them, and this way we can use the same fixed values for DSI too. Do you think that is better?

Archit

#26 lore raw

Re: [PATCH 17/17] OMAPDSS: DSI: Remove redundant fields in omap_dss_dsi_videomode_data

Quoted 10 lines · Archit Taneja
Quoted 3 lines · Tomi Valkeinen

The sync polarities between DISPC and DSI do not matter elsewhere, they do not affect the DSI output, so why do we have them in the panel data? Why doesn't dsi.c just use some hardcoded values for these.

Ok, are you saying that unlike DPI, where a panel may request for some different polarities. There is no such need for DSI panels, and we can set the polarities of DISPC and DSI always to active high(or any other combination)?

Yes. There are no sync polarities in DSI bus, there are only sync packets. So afaik, the polarities used here matter only for DISPC and DSI communication. And there the only thing that matters is that both DISPC and DSI have the same configuration for the polarities, so that the communication works.

Quoted 11 lines

Well, we are doing that indirectly in a way, a DSI panel driver would populate a omap_video_timings struct, and would leave hsync_level, vsync_level and de_level empty(i.e, the default values). This would be passed to the DSI driver, and the timings would be applied to DISPC. The function above would just pick up the same default values and program to the DSI registers.

What we could do is ignore these fields in the omap_video_timings when passed from the panel driver to DSI driver, and always use a fixed value for them, and this way we can use the same fixed values for DSI too. Do you think that is better?

I think that is clearer. Optimally we wouldn't even have a video timings struct for DSI panels, the kind that contains sync polarities and such, but a separate timings struct that contains stuff relevant for DSI. But for now I think we should just ignore the "extra" values in video timings.

Tomi