* [PATCH 0/4] OMAPDSS: HDMI: Improve the timings logic in HDMI @ 2011-11-11 13:09 mythripk 2011-11-11 13:09 ` [PATCH 1/4] OMAPDSS: HDMI: remove duplicate video interface code mythripk 0 siblings, 1 reply; 12+ messages in thread From: mythripk @ 2011-11-11 13:09 UTC (permalink / raw) To: tomi.valkeinen, linux-omap; +Cc: Mythri P K From: Mythri P K <mythripk@ti.com> There are some duplicate timing structure which are not needed thus removing them to clean the code. Also the static mapped timing structure is quite complicated to add new timings, so simplify it by using array indexed method. Mythri P K (4): OMAPDSS: HDMI: remove duplicate video interface code OMAPDSS: HDMI: update static timing table OMAPDSS: HDMI: change the timing match logic OMAPDSS: HDMI: remove duplicate code and mode parameter drivers/video/omap2/dss/hdmi.c | 246 +++++++++++++---------------- drivers/video/omap2/dss/ti_hdmi.h | 14 +- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 47 ++---- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 7 - 4 files changed, 128 insertions(+), 186 deletions(-) -- 1.7.5.4 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/4] OMAPDSS: HDMI: remove duplicate video interface code 2011-11-11 13:09 [PATCH 0/4] OMAPDSS: HDMI: Improve the timings logic in HDMI mythripk @ 2011-11-11 13:09 ` mythripk 2011-11-11 13:09 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table mythripk 0 siblings, 1 reply; 12+ messages in thread From: mythripk @ 2011-11-11 13:09 UTC (permalink / raw) To: tomi.valkeinen, linux-omap; +Cc: Mythri P K From: Mythri P K <mythripk@ti.com> video interface structure is a duplicate structure with parameters which are already present in ip_data config structure, Thus removing the structure and modifying corresponding code. Signed-off-by: Mythri P K <mythripk@ti.com> --- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 31 +++++++--------------------- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 7 ------ 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index e1a6ce5..403d6fc 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c @@ -629,8 +629,7 @@ static void hdmi_core_av_packet_config(struct hdmi_ip_data *ip_data, } static void hdmi_wp_init(struct omap_video_timings *timings, - struct hdmi_video_format *video_fmt, - struct hdmi_video_interface *video_int) + struct hdmi_video_format *video_fmt) { pr_debug("Enter hdmi_wp_init\n"); @@ -645,12 +644,6 @@ static void hdmi_wp_init(struct omap_video_timings *timings, video_fmt->y_res = 0; video_fmt->x_res = 0; - video_int->vsp = 0; - video_int->hsp = 0; - - video_int->interlacing = 0; - video_int->tm = 0; /* HDMI_TIMING_SLAVE */ - } void ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data, bool start) @@ -687,17 +680,16 @@ static void hdmi_wp_video_config_format(struct hdmi_ip_data *ip_data, hdmi_write_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_SIZE, l); } -static void hdmi_wp_video_config_interface(struct hdmi_ip_data *ip_data, - struct hdmi_video_interface *video_int) +static void hdmi_wp_video_config_interface(struct hdmi_ip_data *ip_data) { u32 r; pr_debug("Enter hdmi_wp_video_config_interface\n"); r = hdmi_read_reg(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG); - r = FLD_MOD(r, video_int->vsp, 7, 7); - r = FLD_MOD(r, video_int->hsp, 6, 6); - r = FLD_MOD(r, video_int->interlacing, 3, 3); - r = FLD_MOD(r, video_int->tm, 1, 0); + 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, ip_data->cfg.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); } @@ -725,15 +717,13 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) /* HDMI */ struct omap_video_timings video_timing; struct hdmi_video_format video_format; - struct hdmi_video_interface video_interface; /* HDMI core */ struct hdmi_core_infoframe_avi avi_cfg; struct hdmi_core_video_config v_core_cfg; struct hdmi_core_packet_enable_repeat repeat_cfg; struct hdmi_config *cfg = &ip_data->cfg; - hdmi_wp_init(&video_timing, &video_format, - &video_interface); + hdmi_wp_init(&video_timing, &video_format); hdmi_core_init(&v_core_cfg, &avi_cfg, @@ -748,12 +738,7 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) hdmi_wp_video_config_format(ip_data, &video_format); - video_interface.vsp = cfg->timings.vsync_pol; - video_interface.hsp = cfg->timings.hsync_pol; - video_interface.interlacing = cfg->interlace; - video_interface.tm = 1 ; /* HDMI_TIMING_MASTER_24BIT */ - - hdmi_wp_video_config_interface(ip_data, &video_interface); + hdmi_wp_video_config_interface(ip_data); /* * configure core video part diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h index 2040956..914bec6 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h @@ -517,13 +517,6 @@ struct hdmi_video_format { u32 x_res; /* pixel per line */ }; -struct hdmi_video_interface { - int vsp; /* Vsync polarity */ - int hsp; /* Hsync polarity */ - int interlacing; - int tm; /* Timing mode */ -}; - struct hdmi_audio_format { enum hdmi_stereo_channels stereo_channels; u8 active_chnnls_msk; -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/4] OMAPDSS: HDMI: update static timing table 2011-11-11 13:09 ` [PATCH 1/4] OMAPDSS: HDMI: remove duplicate video interface code mythripk @ 2011-11-11 13:09 ` mythripk 2011-11-11 13:09 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic mythripk 2011-11-14 7:20 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table Tomi Valkeinen 0 siblings, 2 replies; 12+ messages in thread From: mythripk @ 2011-11-11 13:09 UTC (permalink / raw) To: tomi.valkeinen, linux-omap; +Cc: Mythri P K From: Mythri P K <mythripk@ti.com> Add the vsync polarity, hsync polarity, interlace to hdmi_video_timings. Remove the now duplicate structure hdmi_timings. update the static table structure in HDMI with CEA/VESA code and mode. Signed-off-by: Mythri P K <mythripk@ti.com> --- drivers/video/omap2/dss/hdmi.c | 96 ++++++++++++++-------------- drivers/video/omap2/dss/ti_hdmi.h | 14 ++--- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 20 +++--- 3 files changed, 63 insertions(+), 67 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index c56378c..f76ae47 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -88,42 +88,42 @@ static struct { * map it to corresponding CEA or VESA index. */ -static const struct hdmi_timings cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { - { {640, 480, 25200, 96, 16, 48, 2, 10, 33} , 0 , 0}, - { {1280, 720, 74250, 40, 440, 220, 5, 5, 20}, 1, 1}, - { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1}, - { {720, 480, 27027, 62, 16, 60, 6, 9, 30}, 0, 0}, - { {2880, 576, 108000, 256, 48, 272, 5, 5, 39}, 0, 0}, - { {1440, 240, 27027, 124, 38, 114, 3, 4, 15}, 0, 0}, - { {1440, 288, 27000, 126, 24, 138, 3, 2, 19}, 0, 0}, - { {1920, 540, 74250, 44, 528, 148, 5, 2, 15}, 1, 1}, - { {1920, 540, 74250, 44, 88, 148, 5, 2, 15}, 1, 1}, - { {1920, 1080, 148500, 44, 88, 148, 5, 4, 36}, 1, 1}, - { {720, 576, 27000, 64, 12, 68, 5, 5, 39}, 0, 0}, - { {1440, 576, 54000, 128, 24, 136, 5, 5, 39}, 0, 0}, - { {1920, 1080, 148500, 44, 528, 148, 5, 4, 36}, 1, 1}, - { {2880, 480, 108108, 248, 64, 240, 6, 9, 30}, 0, 0}, - { {1920, 1080, 74250, 44, 638, 148, 5, 4, 36}, 1, 1}, - /* VESA From Here */ - { {640, 480, 25175, 96, 16, 48, 2 , 11, 31}, 0, 0}, - { {800, 600, 40000, 128, 40, 88, 4 , 1, 23}, 1, 1}, - { {848, 480, 33750, 112, 16, 112, 8 , 6, 23}, 1, 1}, - { {1280, 768, 79500, 128, 64, 192, 7 , 3, 20}, 1, 0}, - { {1280, 800, 83500, 128, 72, 200, 6 , 3, 22}, 1, 0}, - { {1360, 768, 85500, 112, 64, 256, 6 , 3, 18}, 1, 1}, - { {1280, 960, 108000, 112, 96, 312, 3 , 1, 36}, 1, 1}, - { {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38}, 1, 1}, - { {1024, 768, 65000, 136, 24, 160, 6, 3, 29}, 0, 0}, - { {1400, 1050, 121750, 144, 88, 232, 4, 3, 32}, 1, 0}, - { {1440, 900, 106500, 152, 80, 232, 6, 3, 25}, 1, 0}, - { {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30}, 1, 0}, - { {1366, 768, 85500, 143, 70, 213, 3, 3, 24}, 1, 1}, - { {1920, 1080, 148500, 44, 148, 80, 5, 4, 36}, 1, 1}, - { {1280, 768, 68250, 32, 48, 80, 7, 3, 12}, 0, 1}, - { {1400, 1050, 101000, 32, 48, 80, 4, 3, 23}, 0, 1}, - { {1680, 1050, 119000, 32, 48, 80, 6, 3, 21}, 0, 1}, - { {1280, 800, 79500, 32, 48, 80, 6, 3, 14}, 0, 1}, - { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1} +static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { +{ {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} }, +/* 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} } }; /* @@ -253,23 +253,23 @@ static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing) static void update_hdmi_timings(struct hdmi_config *cfg, struct omap_video_timings *timings, int code) { - cfg->timings.timings.x_res = timings->x_res; - cfg->timings.timings.y_res = timings->y_res; - cfg->timings.timings.hbp = timings->hbp; - cfg->timings.timings.hfp = timings->hfp; - cfg->timings.timings.hsw = timings->hsw; - cfg->timings.timings.vbp = timings->vbp; - cfg->timings.timings.vfp = timings->vfp; - cfg->timings.timings.vsw = timings->vsw; - cfg->timings.timings.pixel_clock = timings->pixel_clock; - cfg->timings.vsync_pol = cea_vesa_timings[code].vsync_pol; - cfg->timings.hsync_pol = cea_vesa_timings[code].hsync_pol; + cfg->timings.x_res = timings->x_res; + cfg->timings.y_res = timings->y_res; + cfg->timings.hbp = timings->hbp; + cfg->timings.hfp = timings->hfp; + cfg->timings.hsw = timings->hsw; + cfg->timings.vbp = timings->vbp; + cfg->timings.vfp = timings->vfp; + cfg->timings.vsw = timings->vsw; + cfg->timings.pixel_clock = timings->pixel_clock; + cfg->timings.vsync_pol = cea_vesa_timings[code].timings.vsync_pol; + cfg->timings.hsync_pol = cea_vesa_timings[code].timings.hsync_pol; } unsigned long hdmi_get_pixel_clock(void) { /* HDMI Pixel Clock in Mhz */ - return hdmi.ip_data.cfg.timings.timings.pixel_clock * 1000; + return hdmi.ip_data.cfg.timings.pixel_clock * 1000; } static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h index 2c3443d..3cf5198 100644 --- a/drivers/video/omap2/dss/ti_hdmi.h +++ b/drivers/video/omap2/dss/ti_hdmi.h @@ -42,6 +42,7 @@ enum hdmi_clk_refsel { HDMI_REFSEL_SYSCLK = 3 }; +/* HDMI timing structure */ struct hdmi_video_timings { u16 x_res; u16 y_res; @@ -53,13 +54,9 @@ struct hdmi_video_timings { u16 vsw; u16 vfp; u16 vbp; -}; - -/* HDMI timing structure */ -struct hdmi_timings { - struct hdmi_video_timings timings; - int vsync_pol; - int hsync_pol; + bool vsync_pol; + bool hsync_pol; + bool interlace; }; struct hdmi_cm { @@ -68,8 +65,7 @@ struct hdmi_cm { }; struct hdmi_config { - struct hdmi_timings timings; - u16 interlace; + struct hdmi_video_timings timings; struct hdmi_cm cm; }; diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index 403d6fc..ccc6254 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c @@ -656,15 +656,15 @@ static void hdmi_wp_video_init_format(struct hdmi_video_format *video_fmt, { pr_debug("Enter hdmi_wp_video_init_format\n"); - video_fmt->y_res = param->timings.timings.y_res; - video_fmt->x_res = param->timings.timings.x_res; - - timings->hbp = param->timings.timings.hbp; - timings->hfp = param->timings.timings.hfp; - timings->hsw = param->timings.timings.hsw; - timings->vbp = param->timings.timings.vbp; - timings->vfp = param->timings.timings.vfp; - timings->vsw = param->timings.timings.vsw; + video_fmt->y_res = param->timings.y_res; + video_fmt->x_res = param->timings.x_res; + + timings->hbp = param->timings.hbp; + timings->hfp = param->timings.hfp; + timings->hsw = param->timings.hsw; + timings->vbp = param->timings.vbp; + timings->vfp = param->timings.vfp; + timings->vsw = param->timings.vsw; } static void hdmi_wp_video_config_format(struct hdmi_ip_data *ip_data, @@ -688,7 +688,7 @@ static void hdmi_wp_video_config_interface(struct hdmi_ip_data *ip_data) 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, ip_data->cfg.interlace, 3, 3); + 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); } -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic 2011-11-11 13:09 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table mythripk @ 2011-11-11 13:09 ` mythripk 2011-11-11 13:09 ` [PATCH 4/4] OMAPDSS: HDMI: remove duplicate code and mode parameter mythripk 2011-11-14 7:33 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic Tomi Valkeinen 2011-11-14 7:20 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table Tomi Valkeinen 1 sibling, 2 replies; 12+ messages in thread From: mythripk @ 2011-11-11 13:09 UTC (permalink / raw) To: tomi.valkeinen, linux-omap; +Cc: Mythri P K From: Mythri P K <mythripk@ti.com> Change the timing match logic, Instead of the statically mapped method to get the corresponding timings for a given code and mode, move to a simpler array indexed method. It will help to scale up to add more timings when needed. Signed-off-by: Mythri P K <mythripk@ti.com> --- drivers/video/omap2/dss/hdmi.c | 162 ++++++++++++++++----------------------- 1 files changed, 67 insertions(+), 95 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index f76ae47..b859350 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -58,8 +58,6 @@ #define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4 #define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4 -#define OMAP_HDMI_TIMINGS_NB 34 - #define HDMI_DEFAULT_REGN 16 #define HDMI_DEFAULT_REGM2 1 @@ -88,7 +86,7 @@ static struct { * map it to corresponding CEA or VESA index. */ -static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { +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} }, @@ -104,6 +102,8 @@ static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { { {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} }, +}; +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} }, @@ -126,39 +126,6 @@ static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { { {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {0x55, HDMI_DVI} } }; -/* - * This is a static mapping array which maps the timing values - * with corresponding CEA / VESA code - */ -static const int code_index[OMAP_HDMI_TIMINGS_NB] = { - 1, 19, 4, 2, 37, 6, 21, 20, 5, 16, 17, 29, 31, 35, 32, - /* <--15 CEA 17--> vesa*/ - 4, 9, 0xE, 0x17, 0x1C, 0x27, 0x20, 0x23, 0x10, 0x2A, - 0X2F, 0x3A, 0X51, 0X52, 0x16, 0x29, 0x39, 0x1B -}; - -/* - * This is reverse static mapping which maps the CEA / VESA code - * to the corresponding timing values - */ -static const int code_cea[39] = { - -1, 0, 3, 3, 2, 8, 5, 5, -1, -1, - -1, -1, -1, -1, -1, -1, 9, 10, 10, 1, - 7, 6, 6, -1, -1, -1, -1, -1, -1, 11, - 11, 12, 14, -1, -1, 13, 13, 4, 4 -}; - -static const int code_vesa[85] = { - -1, -1, -1, -1, 15, -1, -1, -1, -1, 16, - -1, -1, -1, -1, 17, -1, 23, -1, -1, -1, - -1, -1, 29, 18, -1, -1, -1, 32, 19, -1, - -1, -1, 21, -1, -1, 22, -1, -1, -1, 20, - -1, 30, 24, -1, -1, -1, -1, 25, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 31, 26, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 27, 28, -1, 33}; - static int hdmi_runtime_get(void) { int r; @@ -188,82 +155,88 @@ int hdmi_init_display(struct omap_dss_device *dssdev) return 0; } -static int get_timings_index(void) +static bool hdmi_find_code(const struct hdmi_config *timings_arr, + int len, struct hdmi_config *timing) { - int code; + int i; - if (hdmi.mode == 0) - code = code_vesa[hdmi.code]; - else - code = code_cea[hdmi.code]; + for (i = 0; i < len; i++) { + if (timings_arr[i].cm.code == hdmi.code) { + *timing = timings_arr[i]; + return true; + } + } + + return false; +} - if (code == -1) { +static void hdmi_get_timings(struct hdmi_config *timing) +{ + int r; + + if (hdmi.mode == 0) { + r = hdmi_find_code(vesa_timings, + ARRAY_SIZE(vesa_timings), timing); + } else { + r = hdmi_find_code(cea_timings, + ARRAY_SIZE(cea_timings), timing); + } + if (!r) { /* HDMI code 4 corresponds to 640 * 480 VGA */ hdmi.code = 4; /* DVI mode 1 corresponds to HDMI 0 to DVI */ hdmi.mode = HDMI_DVI; + *timing = vesa_timings[0]; + } +} + +static bool hdmi_timings_compare(struct omap_video_timings *timing, + const struct hdmi_video_timings *temp) +{ + int timing_vsync, timing_hsync, temp_vsync, temp_hsync; + + if ((temp->pixel_clock == timing->pixel_clock) && + (temp->x_res == timing->x_res) && + (temp->y_res == timing->y_res)) { - code = code_vesa[hdmi.code]; + temp_hsync = temp->hfp + temp->hsw + temp->hbp; + timing_hsync = timing->hfp + timing->hsw + timing->hbp; + temp_vsync = temp->vfp + temp->vsw + temp->vbp; + timing_vsync = timing->vfp + timing->vsw + timing->vbp; + + DSSDBG("temp_hsync = %d temp_vsync = %d timing_hsync = %d"\ + "timing_vsync = %d\n", temp_hsync, temp_hsync, + timing_hsync, timing_vsync); + + if ((temp_hsync == timing_hsync) && + (temp_vsync == timing_vsync)) { + return true; + } } - return code; + return false; } static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing) { - int i = 0, code = -1, temp_vsync = 0, temp_hsync = 0; - int timing_vsync = 0, timing_hsync = 0; - struct hdmi_video_timings temp; + int i; struct hdmi_cm cm = {-1}; DSSDBG("hdmi_get_code\n"); - for (i = 0; i < OMAP_HDMI_TIMINGS_NB; i++) { - temp = cea_vesa_timings[i].timings; - if ((temp.pixel_clock == timing->pixel_clock) && - (temp.x_res == timing->x_res) && - (temp.y_res == timing->y_res)) { - - temp_hsync = temp.hfp + temp.hsw + temp.hbp; - timing_hsync = timing->hfp + timing->hsw + timing->hbp; - temp_vsync = temp.vfp + temp.vsw + temp.vbp; - timing_vsync = timing->vfp + timing->vsw + timing->vbp; - - DSSDBG("temp_hsync = %d , temp_vsync = %d" - "timing_hsync = %d, timing_vsync = %d\n", - temp_hsync, temp_hsync, - timing_hsync, timing_vsync); - - if ((temp_hsync == timing_hsync) && - (temp_vsync == timing_vsync)) { - code = i; - cm.code = code_index[i]; - if (code < 14) - cm.mode = HDMI_HDMI; - else - cm.mode = HDMI_DVI; - DSSDBG("Hdmi_code = %d mode = %d\n", - cm.code, cm.mode); - break; - } + for (i = 0; i < ARRAY_SIZE(cea_timings); i++) { + if (hdmi_timings_compare(timing, &cea_timings[i].timings)) { + cm = cea_timings[i].cm; + goto end; + } + } + for (i = 0; i < ARRAY_SIZE(vesa_timings); i++) { + if (hdmi_timings_compare(timing, &vesa_timings[i].timings)) { + cm = vesa_timings[i].cm; + goto end; } } - return cm; -} +end: return cm; -static void update_hdmi_timings(struct hdmi_config *cfg, - struct omap_video_timings *timings, int code) -{ - cfg->timings.x_res = timings->x_res; - cfg->timings.y_res = timings->y_res; - cfg->timings.hbp = timings->hbp; - cfg->timings.hfp = timings->hfp; - cfg->timings.hsw = timings->hsw; - cfg->timings.vbp = timings->vbp; - cfg->timings.vfp = timings->vfp; - cfg->timings.vsw = timings->vsw; - cfg->timings.pixel_clock = timings->pixel_clock; - cfg->timings.vsync_pol = cea_vesa_timings[code].timings.vsync_pol; - cfg->timings.hsync_pol = cea_vesa_timings[code].timings.hsync_pol; } unsigned long hdmi_get_pixel_clock(void) @@ -325,7 +298,7 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, static int hdmi_power_on(struct omap_dss_device *dssdev) { - int r, code = 0; + int r; struct omap_video_timings *p; unsigned long phy; @@ -341,8 +314,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) dssdev->panel.timings.x_res, dssdev->panel.timings.y_res); - code = get_timings_index(); - update_hdmi_timings(&hdmi.ip_data.cfg, p, code); + hdmi_get_timings(&hdmi.ip_data.cfg); phy = p->pixel_clock; -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/4] OMAPDSS: HDMI: remove duplicate code and mode parameter 2011-11-11 13:09 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic mythripk @ 2011-11-11 13:09 ` mythripk 2011-11-14 7:33 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic Tomi Valkeinen 1 sibling, 0 replies; 12+ messages in thread From: mythripk @ 2011-11-11 13:09 UTC (permalink / raw) To: tomi.valkeinen, linux-omap; +Cc: Mythri P K From: Mythri P K <mythripk@ti.com> code and mode parameters are already a part of the ip_data structure so no need to keep the same parameters again in hdmi global structure. Signed-off-by: Mythri P K <mythripk@ti.com> --- drivers/video/omap2/dss/hdmi.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index b859350..8d06ce6 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -66,8 +66,6 @@ static struct { struct omap_display_platform_data *pdata; struct platform_device *pdev; struct hdmi_ip_data ip_data; - int code; - int mode; struct clk *sys_clk; } hdmi; @@ -161,7 +159,7 @@ static bool hdmi_find_code(const struct hdmi_config *timings_arr, int i; for (i = 0; i < len; i++) { - if (timings_arr[i].cm.code == hdmi.code) { + if (timings_arr[i].cm.code == hdmi.ip_data.cfg.cm.code) { *timing = timings_arr[i]; return true; } @@ -174,7 +172,7 @@ static void hdmi_get_timings(struct hdmi_config *timing) { int r; - if (hdmi.mode == 0) { + if (hdmi.ip_data.cfg.cm.mode == 0) { r = hdmi_find_code(vesa_timings, ARRAY_SIZE(vesa_timings), timing); } else { @@ -183,9 +181,9 @@ static void hdmi_get_timings(struct hdmi_config *timing) } if (!r) { /* HDMI code 4 corresponds to 640 * 480 VGA */ - hdmi.code = 4; + hdmi.ip_data.cfg.cm.code = 4; /* DVI mode 1 corresponds to HDMI 0 to DVI */ - hdmi.mode = HDMI_DVI; + hdmi.ip_data.cfg.cm.mode = HDMI_DVI; *timing = vesa_timings[0]; } } @@ -335,8 +333,6 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) goto err; } - hdmi.ip_data.cfg.cm.mode = hdmi.mode; - hdmi.ip_data.cfg.cm.code = hdmi.code; hdmi.ip_data.ops->video_configure(&hdmi.ip_data); /* Make selection of HDMI in DSS */ @@ -396,8 +392,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev) struct hdmi_cm cm; cm = hdmi_get_code(&dssdev->panel.timings); - hdmi.code = cm.code; - hdmi.mode = cm.mode; + hdmi.ip_data.cfg.cm.code = cm.code; + hdmi.ip_data.cfg.cm.mode = cm.mode; if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { int r; @@ -663,7 +659,7 @@ static int hdmi_audio_hw_params(struct hdmi_ip_data *ip_data, static int hdmi_audio_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - if (!hdmi.mode) { + if (!hdmi.ip_data.cfg.cm.mode) { pr_err("Current video settings do not support audio.\n"); return -EIO; } -- 1.7.5.4 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic 2011-11-11 13:09 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic mythripk 2011-11-11 13:09 ` [PATCH 4/4] OMAPDSS: HDMI: remove duplicate code and mode parameter mythripk @ 2011-11-14 7:33 ` Tomi Valkeinen 2011-11-16 5:31 ` K, Mythri P 1 sibling, 1 reply; 12+ messages in thread From: Tomi Valkeinen @ 2011-11-14 7:33 UTC (permalink / raw) To: mythripk; +Cc: linux-omap [-- Attachment #1: Type: text/plain, Size: 5380 bytes --] On Fri, 2011-11-11 at 18:39 +0530, mythripk@ti.com wrote: > From: Mythri P K <mythripk@ti.com> > > Change the timing match logic, Instead of the statically mapped method > to get the corresponding timings for a given code and mode, move to a > simpler array indexed method. It will help to scale up to add more > timings when needed. > > Signed-off-by: Mythri P K <mythripk@ti.com> > --- > drivers/video/omap2/dss/hdmi.c | 162 ++++++++++++++++----------------------- > 1 files changed, 67 insertions(+), 95 deletions(-) > > diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c > index f76ae47..b859350 100644 > --- a/drivers/video/omap2/dss/hdmi.c > +++ b/drivers/video/omap2/dss/hdmi.c > @@ -58,8 +58,6 @@ > #define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4 > #define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4 > > -#define OMAP_HDMI_TIMINGS_NB 34 > - > #define HDMI_DEFAULT_REGN 16 > #define HDMI_DEFAULT_REGM2 1 > > @@ -88,7 +86,7 @@ static struct { > * map it to corresponding CEA or VESA index. > */ > > -static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { > +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} }, > @@ -104,6 +102,8 @@ static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { > { {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} }, > +}; > +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} }, > @@ -126,39 +126,6 @@ static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { > { {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {0x55, HDMI_DVI} } > }; > > -/* > - * This is a static mapping array which maps the timing values > - * with corresponding CEA / VESA code > - */ > -static const int code_index[OMAP_HDMI_TIMINGS_NB] = { > - 1, 19, 4, 2, 37, 6, 21, 20, 5, 16, 17, 29, 31, 35, 32, > - /* <--15 CEA 17--> vesa*/ > - 4, 9, 0xE, 0x17, 0x1C, 0x27, 0x20, 0x23, 0x10, 0x2A, > - 0X2F, 0x3A, 0X51, 0X52, 0x16, 0x29, 0x39, 0x1B > -}; > - > -/* > - * This is reverse static mapping which maps the CEA / VESA code > - * to the corresponding timing values > - */ > -static const int code_cea[39] = { > - -1, 0, 3, 3, 2, 8, 5, 5, -1, -1, > - -1, -1, -1, -1, -1, -1, 9, 10, 10, 1, > - 7, 6, 6, -1, -1, -1, -1, -1, -1, 11, > - 11, 12, 14, -1, -1, 13, 13, 4, 4 > -}; > - > -static const int code_vesa[85] = { > - -1, -1, -1, -1, 15, -1, -1, -1, -1, 16, > - -1, -1, -1, -1, 17, -1, 23, -1, -1, -1, > - -1, -1, 29, 18, -1, -1, -1, 32, 19, -1, > - -1, -1, 21, -1, -1, 22, -1, -1, -1, 20, > - -1, 30, 24, -1, -1, -1, -1, 25, -1, -1, > - -1, -1, -1, -1, -1, -1, -1, 31, 26, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, > - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, > - -1, 27, 28, -1, 33}; > - > static int hdmi_runtime_get(void) > { > int r; > @@ -188,82 +155,88 @@ int hdmi_init_display(struct omap_dss_device *dssdev) > return 0; > } > > -static int get_timings_index(void) > +static bool hdmi_find_code(const struct hdmi_config *timings_arr, > + int len, struct hdmi_config *timing) > { > - int code; > + int i; > > - if (hdmi.mode == 0) > - code = code_vesa[hdmi.code]; > - else > - code = code_cea[hdmi.code]; > + for (i = 0; i < len; i++) { > + if (timings_arr[i].cm.code == hdmi.code) { > + *timing = timings_arr[i]; > + return true; > + } > + } > + > + return false; > +} You could return the hdmi_config pointer instead of making a copy and returning a bool. You shouldn't use hdmi.code in this function, but get the code as a parameter. > > - if (code == -1) { > +static void hdmi_get_timings(struct hdmi_config *timing) > +{ > + int r; > + > + if (hdmi.mode == 0) { > + r = hdmi_find_code(vesa_timings, > + ARRAY_SIZE(vesa_timings), timing); > + } else { > + r = hdmi_find_code(cea_timings, > + ARRAY_SIZE(cea_timings), timing); > + } > + if (!r) { > /* HDMI code 4 corresponds to 640 * 480 VGA */ > hdmi.code = 4; > /* DVI mode 1 corresponds to HDMI 0 to DVI */ > hdmi.mode = HDMI_DVI; > + *timing = vesa_timings[0]; > + } > +} Same thing here, you could just return the pointer to hdmi_config. And also for this function you shouldn't use hdmi.mode and hdmi.code, but they should be parameters to this function. And the code in the error path shouldn't modify hdmi.code or hdmi.mode, it should just return NULL, and the caller would then do what it wants, in this case use VGA as a fallback. > + > +static bool hdmi_timings_compare(struct omap_video_timings *timing, > + const struct hdmi_video_timings *temp) Don't call the second argument "temp". It's not a temporary variable. Naming the parameters timing1 and timing2 would make much more sense. Tomi [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic 2011-11-14 7:33 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic Tomi Valkeinen @ 2011-11-16 5:31 ` K, Mythri P 2011-11-18 7:16 ` Tomi Valkeinen 0 siblings, 1 reply; 12+ messages in thread From: K, Mythri P @ 2011-11-16 5:31 UTC (permalink / raw) To: Tomi Valkeinen; +Cc: linux-omap On Mon, Nov 14, 2011 at 1:03 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote: > On Fri, 2011-11-11 at 18:39 +0530, mythripk@ti.com wrote: >> From: Mythri P K <mythripk@ti.com> >> >> Change the timing match logic, Instead of the statically mapped method >> to get the corresponding timings for a given code and mode, move to a >> simpler array indexed method. It will help to scale up to add more >> timings when needed. >> >> Signed-off-by: Mythri P K <mythripk@ti.com> >> --- >> drivers/video/omap2/dss/hdmi.c | 162 ++++++++++++++++----------------------- >> 1 files changed, 67 insertions(+), 95 deletions(-) >> >> diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c >> index f76ae47..b859350 100644 >> --- a/drivers/video/omap2/dss/hdmi.c >> +++ b/drivers/video/omap2/dss/hdmi.c >> @@ -58,8 +58,6 @@ >> #define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4 >> #define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4 >> >> -#define OMAP_HDMI_TIMINGS_NB 34 >> - >> #define HDMI_DEFAULT_REGN 16 >> #define HDMI_DEFAULT_REGM2 1 >> >> @@ -88,7 +86,7 @@ static struct { >> * map it to corresponding CEA or VESA index. >> */ >> >> -static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { >> +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} }, >> @@ -104,6 +102,8 @@ static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { >> { {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} }, >> +}; >> +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} }, >> @@ -126,39 +126,6 @@ static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { >> { {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {0x55, HDMI_DVI} } >> }; >> >> -/* >> - * This is a static mapping array which maps the timing values >> - * with corresponding CEA / VESA code >> - */ >> -static const int code_index[OMAP_HDMI_TIMINGS_NB] = { >> - 1, 19, 4, 2, 37, 6, 21, 20, 5, 16, 17, 29, 31, 35, 32, >> - /* <--15 CEA 17--> vesa*/ >> - 4, 9, 0xE, 0x17, 0x1C, 0x27, 0x20, 0x23, 0x10, 0x2A, >> - 0X2F, 0x3A, 0X51, 0X52, 0x16, 0x29, 0x39, 0x1B >> -}; >> - >> -/* >> - * This is reverse static mapping which maps the CEA / VESA code >> - * to the corresponding timing values >> - */ >> -static const int code_cea[39] = { >> - -1, 0, 3, 3, 2, 8, 5, 5, -1, -1, >> - -1, -1, -1, -1, -1, -1, 9, 10, 10, 1, >> - 7, 6, 6, -1, -1, -1, -1, -1, -1, 11, >> - 11, 12, 14, -1, -1, 13, 13, 4, 4 >> -}; >> - >> -static const int code_vesa[85] = { >> - -1, -1, -1, -1, 15, -1, -1, -1, -1, 16, >> - -1, -1, -1, -1, 17, -1, 23, -1, -1, -1, >> - -1, -1, 29, 18, -1, -1, -1, 32, 19, -1, >> - -1, -1, 21, -1, -1, 22, -1, -1, -1, 20, >> - -1, 30, 24, -1, -1, -1, -1, 25, -1, -1, >> - -1, -1, -1, -1, -1, -1, -1, 31, 26, -1, >> - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, >> - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, >> - -1, 27, 28, -1, 33}; >> - >> static int hdmi_runtime_get(void) >> { >> int r; >> @@ -188,82 +155,88 @@ int hdmi_init_display(struct omap_dss_device *dssdev) >> return 0; >> } >> >> -static int get_timings_index(void) >> +static bool hdmi_find_code(const struct hdmi_config *timings_arr, >> + int len, struct hdmi_config *timing) >> { >> - int code; >> + int i; >> >> - if (hdmi.mode == 0) >> - code = code_vesa[hdmi.code]; >> - else >> - code = code_cea[hdmi.code]; >> + for (i = 0; i < len; i++) { >> + if (timings_arr[i].cm.code == hdmi.code) { >> + *timing = timings_arr[i]; >> + return true; >> + } >> + } >> + >> + return false; >> +} > > You could return the hdmi_config pointer instead of making a copy and > returning a bool. In this function i'm passing the timing value and finally there needs to be one copy whether it is in this function or after the return, because the timings array is a const and dssdev->paneltimings and config timings are not, so do you see any benefit of doing that later or suggest any other method? > > You shouldn't use hdmi.code in this function, but get the code as a > parameter. > >> >> - if (code == -1) { >> +static void hdmi_get_timings(struct hdmi_config *timing) >> +{ >> + int r; >> + >> + if (hdmi.mode == 0) { >> + r = hdmi_find_code(vesa_timings, >> + ARRAY_SIZE(vesa_timings), timing); >> + } else { >> + r = hdmi_find_code(cea_timings, >> + ARRAY_SIZE(cea_timings), timing); >> + } >> + if (!r) { >> /* HDMI code 4 corresponds to 640 * 480 VGA */ >> hdmi.code = 4; >> /* DVI mode 1 corresponds to HDMI 0 to DVI */ >> hdmi.mode = HDMI_DVI; >> + *timing = vesa_timings[0]; >> + } >> +} > > Same thing here, you could just return the pointer to hdmi_config. > > And also for this function you shouldn't use hdmi.mode and hdmi.code, > but they should be parameters to this function. > In the next patch i remove the hdmi.code and mode and use the config instead. > And the code in the error path shouldn't modify hdmi.code or hdmi.mode, > it should just return NULL, and the caller would then do what it wants, > in this case use VGA as a fallback. ok. > >> + >> +static bool hdmi_timings_compare(struct omap_video_timings *timing, >> + const struct hdmi_video_timings *temp) > > Don't call the second argument "temp". It's not a temporary variable. > Naming the parameters timing1 and timing2 would make much more sense. > ok. Thanks and regards, Mythri. > Tomi > > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic 2011-11-16 5:31 ` K, Mythri P @ 2011-11-18 7:16 ` Tomi Valkeinen 2011-11-22 13:08 ` K, Mythri P 0 siblings, 1 reply; 12+ messages in thread From: Tomi Valkeinen @ 2011-11-18 7:16 UTC (permalink / raw) To: K, Mythri P; +Cc: linux-omap [-- Attachment #1: Type: text/plain, Size: 2036 bytes --] On Wed, 2011-11-16 at 11:01 +0530, K, Mythri P wrote: > On Mon, Nov 14, 2011 at 1:03 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote: > > On Fri, 2011-11-11 at 18:39 +0530, mythripk@ti.com wrote: > >> -static int get_timings_index(void) > >> +static bool hdmi_find_code(const struct hdmi_config *timings_arr, > >> + int len, struct hdmi_config *timing) > >> { > >> - int code; > >> + int i; > >> > >> - if (hdmi.mode == 0) > >> - code = code_vesa[hdmi.code]; > >> - else > >> - code = code_cea[hdmi.code]; > >> + for (i = 0; i < len; i++) { > >> + if (timings_arr[i].cm.code == hdmi.code) { > >> + *timing = timings_arr[i]; > >> + return true; > >> + } > >> + } > >> + > >> + return false; > >> +} > > > > You could return the hdmi_config pointer instead of making a copy and > > returning a bool. > In this function i'm passing the timing value and finally there needs > to be one copy whether it is in this function or after the return, > because the timings array is a const and dssdev->paneltimings and > config timings are not, so do you see any benefit of doing that later > or suggest any other method? Well, I think it's just good design, even if it wouldn't help in this particular case. hdmi_find_code is a small utility function, and functions like that should be designed to be usable in any situation. In this particular situation you will anyway make a copy, and it doesn't matter if it's the utility function that does the copy. But in some other case you could perhaps be interested in only one value in the hdmi_config that is found. In that case doing a copy is extra, and it'd be better to return the const struct pointer. Also, it is a standard design pattern that a "find" function returns pointer to the found item, whereas your version returning a bool and making a copy of the found item is not very standard. Tomi [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic 2011-11-18 7:16 ` Tomi Valkeinen @ 2011-11-22 13:08 ` K, Mythri P 0 siblings, 0 replies; 12+ messages in thread From: K, Mythri P @ 2011-11-22 13:08 UTC (permalink / raw) To: Tomi Valkeinen; +Cc: linux-omap Hi Tomi, On Fri, Nov 18, 2011 at 12:46 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote: > On Wed, 2011-11-16 at 11:01 +0530, K, Mythri P wrote: >> On Mon, Nov 14, 2011 at 1:03 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote: >> > On Fri, 2011-11-11 at 18:39 +0530, mythripk@ti.com wrote: > >> >> -static int get_timings_index(void) >> >> +static bool hdmi_find_code(const struct hdmi_config *timings_arr, >> >> + int len, struct hdmi_config *timing) >> >> { >> >> - int code; >> >> + int i; >> >> >> >> - if (hdmi.mode == 0) >> >> - code = code_vesa[hdmi.code]; >> >> - else >> >> - code = code_cea[hdmi.code]; >> >> + for (i = 0; i < len; i++) { >> >> + if (timings_arr[i].cm.code == hdmi.code) { >> >> + *timing = timings_arr[i]; >> >> + return true; >> >> + } >> >> + } >> >> + >> >> + return false; >> >> +} >> > >> > You could return the hdmi_config pointer instead of making a copy and >> > returning a bool. >> In this function i'm passing the timing value and finally there needs >> to be one copy whether it is in this function or after the return, >> because the timings array is a const and dssdev->paneltimings and >> config timings are not, so do you see any benefit of doing that later >> or suggest any other method? > > Well, I think it's just good design, even if it wouldn't help in this > particular case. > > hdmi_find_code is a small utility function, and functions like that > should be designed to be usable in any situation. In this particular > situation you will anyway make a copy, and it doesn't matter if it's the > utility function that does the copy. > > But in some other case you could perhaps be interested in only one value > in the hdmi_config that is found. In that case doing a copy is extra, > and it'd be better to return the const struct pointer. > > Also, it is a standard design pattern that a "find" function returns > pointer to the found item, whereas your version returning a bool and > making a copy of the found item is not very standard. > Well i shall update the change to the standard way then :-). Thanks and regards, Mythri. > Tomi > > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4] OMAPDSS: HDMI: update static timing table 2011-11-11 13:09 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table mythripk 2011-11-11 13:09 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic mythripk @ 2011-11-14 7:20 ` Tomi Valkeinen 2011-11-16 5:13 ` K, Mythri P 1 sibling, 1 reply; 12+ messages in thread From: Tomi Valkeinen @ 2011-11-14 7:20 UTC (permalink / raw) To: mythripk; +Cc: linux-omap [-- Attachment #1: Type: text/plain, Size: 5910 bytes --] On Fri, 2011-11-11 at 18:39 +0530, mythripk@ti.com wrote: > From: Mythri P K <mythripk@ti.com> > > Add the vsync polarity, hsync polarity, interlace to hdmi_video_timings. > Remove the now duplicate structure hdmi_timings. > update the static table structure in HDMI with CEA/VESA code and mode. > > Signed-off-by: Mythri P K <mythripk@ti.com> > --- > drivers/video/omap2/dss/hdmi.c | 96 ++++++++++++++-------------- > drivers/video/omap2/dss/ti_hdmi.h | 14 ++--- > drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 20 +++--- > 3 files changed, 63 insertions(+), 67 deletions(-) > > diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c > index c56378c..f76ae47 100644 > --- a/drivers/video/omap2/dss/hdmi.c > +++ b/drivers/video/omap2/dss/hdmi.c > @@ -88,42 +88,42 @@ static struct { > * map it to corresponding CEA or VESA index. > */ > > -static const struct hdmi_timings cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { > - { {640, 480, 25200, 96, 16, 48, 2, 10, 33} , 0 , 0}, > - { {1280, 720, 74250, 40, 440, 220, 5, 5, 20}, 1, 1}, > - { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1}, > - { {720, 480, 27027, 62, 16, 60, 6, 9, 30}, 0, 0}, > - { {2880, 576, 108000, 256, 48, 272, 5, 5, 39}, 0, 0}, > - { {1440, 240, 27027, 124, 38, 114, 3, 4, 15}, 0, 0}, > - { {1440, 288, 27000, 126, 24, 138, 3, 2, 19}, 0, 0}, > - { {1920, 540, 74250, 44, 528, 148, 5, 2, 15}, 1, 1}, > - { {1920, 540, 74250, 44, 88, 148, 5, 2, 15}, 1, 1}, > - { {1920, 1080, 148500, 44, 88, 148, 5, 4, 36}, 1, 1}, > - { {720, 576, 27000, 64, 12, 68, 5, 5, 39}, 0, 0}, > - { {1440, 576, 54000, 128, 24, 136, 5, 5, 39}, 0, 0}, > - { {1920, 1080, 148500, 44, 528, 148, 5, 4, 36}, 1, 1}, > - { {2880, 480, 108108, 248, 64, 240, 6, 9, 30}, 0, 0}, > - { {1920, 1080, 74250, 44, 638, 148, 5, 4, 36}, 1, 1}, > - /* VESA From Here */ > - { {640, 480, 25175, 96, 16, 48, 2 , 11, 31}, 0, 0}, > - { {800, 600, 40000, 128, 40, 88, 4 , 1, 23}, 1, 1}, > - { {848, 480, 33750, 112, 16, 112, 8 , 6, 23}, 1, 1}, > - { {1280, 768, 79500, 128, 64, 192, 7 , 3, 20}, 1, 0}, > - { {1280, 800, 83500, 128, 72, 200, 6 , 3, 22}, 1, 0}, > - { {1360, 768, 85500, 112, 64, 256, 6 , 3, 18}, 1, 1}, > - { {1280, 960, 108000, 112, 96, 312, 3 , 1, 36}, 1, 1}, > - { {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38}, 1, 1}, > - { {1024, 768, 65000, 136, 24, 160, 6, 3, 29}, 0, 0}, > - { {1400, 1050, 121750, 144, 88, 232, 4, 3, 32}, 1, 0}, > - { {1440, 900, 106500, 152, 80, 232, 6, 3, 25}, 1, 0}, > - { {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30}, 1, 0}, > - { {1366, 768, 85500, 143, 70, 213, 3, 3, 24}, 1, 1}, > - { {1920, 1080, 148500, 44, 148, 80, 5, 4, 36}, 1, 1}, > - { {1280, 768, 68250, 32, 48, 80, 7, 3, 12}, 0, 1}, > - { {1400, 1050, 101000, 32, 48, 80, 4, 3, 23}, 0, 1}, > - { {1680, 1050, 119000, 32, 48, 80, 6, 3, 21}, 0, 1}, > - { {1280, 800, 79500, 32, 48, 80, 6, 3, 14}, 0, 1}, > - { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1} > +static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { > +{ {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} }, > +/* 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} } If you don't have any particular reason to use both decimal and hexadecimal numbers for code, just use one type of numbers. Tomi [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4] OMAPDSS: HDMI: update static timing table 2011-11-14 7:20 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table Tomi Valkeinen @ 2011-11-16 5:13 ` K, Mythri P 0 siblings, 0 replies; 12+ messages in thread From: K, Mythri P @ 2011-11-16 5:13 UTC (permalink / raw) To: Tomi Valkeinen; +Cc: linux-omap Hi Tomi, On Mon, Nov 14, 2011 at 12:50 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote: > On Fri, 2011-11-11 at 18:39 +0530, mythripk@ti.com wrote: >> From: Mythri P K <mythripk@ti.com> >> >> Add the vsync polarity, hsync polarity, interlace to hdmi_video_timings. >> Remove the now duplicate structure hdmi_timings. >> update the static table structure in HDMI with CEA/VESA code and mode. >> >> Signed-off-by: Mythri P K <mythripk@ti.com> >> --- >> drivers/video/omap2/dss/hdmi.c | 96 ++++++++++++++-------------- >> drivers/video/omap2/dss/ti_hdmi.h | 14 ++--- >> drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 20 +++--- >> 3 files changed, 63 insertions(+), 67 deletions(-) >> >> diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c >> index c56378c..f76ae47 100644 >> --- a/drivers/video/omap2/dss/hdmi.c >> +++ b/drivers/video/omap2/dss/hdmi.c >> @@ -88,42 +88,42 @@ static struct { >> * map it to corresponding CEA or VESA index. >> */ >> >> -static const struct hdmi_timings cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { >> - { {640, 480, 25200, 96, 16, 48, 2, 10, 33} , 0 , 0}, >> - { {1280, 720, 74250, 40, 440, 220, 5, 5, 20}, 1, 1}, >> - { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1}, >> - { {720, 480, 27027, 62, 16, 60, 6, 9, 30}, 0, 0}, >> - { {2880, 576, 108000, 256, 48, 272, 5, 5, 39}, 0, 0}, >> - { {1440, 240, 27027, 124, 38, 114, 3, 4, 15}, 0, 0}, >> - { {1440, 288, 27000, 126, 24, 138, 3, 2, 19}, 0, 0}, >> - { {1920, 540, 74250, 44, 528, 148, 5, 2, 15}, 1, 1}, >> - { {1920, 540, 74250, 44, 88, 148, 5, 2, 15}, 1, 1}, >> - { {1920, 1080, 148500, 44, 88, 148, 5, 4, 36}, 1, 1}, >> - { {720, 576, 27000, 64, 12, 68, 5, 5, 39}, 0, 0}, >> - { {1440, 576, 54000, 128, 24, 136, 5, 5, 39}, 0, 0}, >> - { {1920, 1080, 148500, 44, 528, 148, 5, 4, 36}, 1, 1}, >> - { {2880, 480, 108108, 248, 64, 240, 6, 9, 30}, 0, 0}, >> - { {1920, 1080, 74250, 44, 638, 148, 5, 4, 36}, 1, 1}, >> - /* VESA From Here */ >> - { {640, 480, 25175, 96, 16, 48, 2 , 11, 31}, 0, 0}, >> - { {800, 600, 40000, 128, 40, 88, 4 , 1, 23}, 1, 1}, >> - { {848, 480, 33750, 112, 16, 112, 8 , 6, 23}, 1, 1}, >> - { {1280, 768, 79500, 128, 64, 192, 7 , 3, 20}, 1, 0}, >> - { {1280, 800, 83500, 128, 72, 200, 6 , 3, 22}, 1, 0}, >> - { {1360, 768, 85500, 112, 64, 256, 6 , 3, 18}, 1, 1}, >> - { {1280, 960, 108000, 112, 96, 312, 3 , 1, 36}, 1, 1}, >> - { {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38}, 1, 1}, >> - { {1024, 768, 65000, 136, 24, 160, 6, 3, 29}, 0, 0}, >> - { {1400, 1050, 121750, 144, 88, 232, 4, 3, 32}, 1, 0}, >> - { {1440, 900, 106500, 152, 80, 232, 6, 3, 25}, 1, 0}, >> - { {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30}, 1, 0}, >> - { {1366, 768, 85500, 143, 70, 213, 3, 3, 24}, 1, 1}, >> - { {1920, 1080, 148500, 44, 148, 80, 5, 4, 36}, 1, 1}, >> - { {1280, 768, 68250, 32, 48, 80, 7, 3, 12}, 0, 1}, >> - { {1400, 1050, 101000, 32, 48, 80, 4, 3, 23}, 0, 1}, >> - { {1680, 1050, 119000, 32, 48, 80, 6, 3, 21}, 0, 1}, >> - { {1280, 800, 79500, 32, 48, 80, 6, 3, 14}, 0, 1}, >> - { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1} >> +static const struct hdmi_config cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { >> +{ {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} }, >> +/* 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} } > > If you don't have any particular reason to use both decimal and > hexadecimal numbers for code, just use one type of numbers. > The reason being this is coding convention in CEA and VESA spec, so wanted to keep it uniform with the spec. Thanks and regards, Mythri. > Tomi > > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 0/4] OMAPDSS: HDMI: Improve the timings logic in HDMI @ 2012-01-02 8:44 mythripk 0 siblings, 0 replies; 12+ messages in thread From: mythripk @ 2012-01-02 8:44 UTC (permalink / raw) To: tomi.valkeinen, linux-omap; +Cc: Mythri P K From: Mythri P K <mythripk@ti.com> There are some duplicate timing structure which are not needed thus removing them to clean the code. Also the static mapped timing structure is quite complicated to add new timings, so simplify it by using array indexed method. changes since V1: change of hdmi_find_timing function to return pointer to the timing struct rather than deep copy to timing structure passed as parameter variable name change from temp to timing2 in comparator function. Mythri P K (4): OMAPDSS: HDMI: remove duplicate video interface code OMAPDSS: HDMI: update static timing table OMAPDSS: HDMI: change the timing match logic OMAPDSS: HDMI: remove duplicate code and mode parameter drivers/video/omap2/dss/hdmi.c | 254 +++++++++++++---------------- drivers/video/omap2/dss/ti_hdmi.h | 14 +- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 47 ++---- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.h | 7 - 4 files changed, 134 insertions(+), 188 deletions(-) -- 1.7.5.4 ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2012-01-02 8:52 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-11 13:09 [PATCH 0/4] OMAPDSS: HDMI: Improve the timings logic in HDMI mythripk 2011-11-11 13:09 ` [PATCH 1/4] OMAPDSS: HDMI: remove duplicate video interface code mythripk 2011-11-11 13:09 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table mythripk 2011-11-11 13:09 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic mythripk 2011-11-11 13:09 ` [PATCH 4/4] OMAPDSS: HDMI: remove duplicate code and mode parameter mythripk 2011-11-14 7:33 ` [PATCH 3/4] OMAPDSS: HDMI: change the timing match logic Tomi Valkeinen 2011-11-16 5:31 ` K, Mythri P 2011-11-18 7:16 ` Tomi Valkeinen 2011-11-22 13:08 ` K, Mythri P 2011-11-14 7:20 ` [PATCH 2/4] OMAPDSS: HDMI: update static timing table Tomi Valkeinen 2011-11-16 5:13 ` K, Mythri P -- strict thread matches above, loose matches on Subject: below -- 2012-01-02 8:44 [PATCH 0/4] OMAPDSS: HDMI: Improve the timings logic in HDMI mythripk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).