OMAPDSS: HDMI4: Accept non-standard timings
authorArchit Taneja <archit@ti.com>
Mon, 9 Dec 2013 14:09:08 +0000 (19:39 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 13 Jan 2014 10:19:51 +0000 (12:19 +0200)
The hdmi4 driver currently rejects any timing which is not from the CEA or VESA
standards. This leads hdmi rejecting any non-standard mode. A non standard
timing may not have a valid code corresponding to it. In such cases, the HDMI
spec suggests to set the code to 0.

Modify the driver to check if the timings fall within the range of the DISPC
TV overlay manager, and remove the check for an invalid code. Add a debug print
specifying the mode and code in hdmi_display_set_timing.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/hdmi4.c

index e14009614338fd718451a838c8c3ad2c0957f916..347e455370e806949d89a4028b1d0afa4d443f84 100644 (file)
@@ -218,14 +218,12 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev)
 static int hdmi_display_check_timing(struct omap_dss_device *dssdev,
                                        struct omap_video_timings *timings)
 {
-       struct hdmi_cm cm;
+       struct omap_dss_device *out = &hdmi.output;
 
-       cm = hdmi_get_code(timings);
-       if (cm.code == -1)
+       if (!dispc_mgr_timings_ok(out->dispc_channel, timings))
                return -EINVAL;
 
        return 0;
-
 }
 
 static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
@@ -244,8 +242,17 @@ static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
                hdmi.cfg = *t;
 
                dispc_set_tv_pclk(t->timings.pixel_clock * 1000);
+       } else {
+               hdmi.cfg.timings = *timings;
+               hdmi.cfg.cm.code = 0;
+               hdmi.cfg.cm.mode = HDMI_DVI;
+
+               dispc_set_tv_pclk(timings->pixel_clock * 1000);
        }
 
+       DSSDBG("using mode: %s, code %d\n", hdmi.cfg.cm.mode == HDMI_DVI ?
+                       "DVI" : "HDMI", hdmi.cfg.cm.code);
+
        mutex_unlock(&hdmi.lock);
 }