OMAPDSS: Apply LCD manager related parameters
cover OMAPDSS: Apply LCD manager related parameters
The LCD interface drivers(DPI, DSI, RFBI, SDI) do some direct DISPC register writes to configure LCD manager related fields. This series groups these fields into a single struct, and let's the interface driver apply these parameters.
This allows us to:
- Check the LCD manager related parameters before applying them.
- Remove some omap_dss_device references as APPLY holds the applied parameters.
Pushed onto the branch:
git://gitorious.org/~boddob/linux-omap-dss2/archit-dss2-clone.git apply_lcd_mgr_params
Tested on 3430SDP, 4430SDP ans Pandaboard ES.
Archit Taneja (12):
OMAPDSS: DISPC: Change return type of dispc_mgr_set_clock_div()
OMAPDSS: Add struct to hold LCD overlay manager configuration
OMAPDSS: DPI: Configure dss_lcd_mgr_config struct with lcd manager
parameters
OMAPDSS: RFBI: Configure dss_lcd_mgr_config struct with lcd manager
parameters
OMAPDSS: DSI: Configure dss_lcd_mgr_config struct with lcd manager
parameters
OMAPDSS: SDI: Configure dss_lcd_mgr_config struct with lcd manager
parameters
OMAPDSS: APPLY: Remove DISPC writes to manager's lcd parameters in
interface drivers
OMAPDSS: MANAGER: Check LCD related overlay manager parameters
OMAPDSS: APPLY: Remove usage of omap_dss_device from manual/auto
update checks
OMAPDSS: DISPC: Remove a redundant function
OMAPDSS: RFBI: Use dss_mgr_enable to enable the overlay manager
OMAPDSS: OVERLAY: Clean up replication checking
drivers/video/omap2/dss/apply.c | 82 ++++++++++++++++++++++++++-- drivers/video/omap2/dss/dispc.c | 31 ++++------- drivers/video/omap2/dss/display.c | 34 ------------ drivers/video/omap2/dss/dpi.c | 31 ++++++----- drivers/video/omap2/dss/dsi.c | 108 ++++++++++++++++++++++--------------- drivers/video/omap2/dss/dss.h | 30 +++++++++-- drivers/video/omap2/dss/manager.c | 35 ++++++++++++ drivers/video/omap2/dss/overlay.c | 13 +++++ drivers/video/omap2/dss/rfbi.c | 39 ++++++++++---- drivers/video/omap2/dss/sdi.c | 32 +++++------ 10 files changed, 286 insertions(+), 149 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/12 MAPDSS: DISPC: Change return type of dispc_mgr_set_clock_div()
dipsc_mgr_set_clock div has an int return type to report errors or success. The function doesn't really check for errors and always returns 0. Change the return type to void.
Checking for the correct DISPC clock divider ranges will be done when a DSS2 user does a manager apply. This support will be added later.
--- drivers/video/omap2/dss/dispc.c | 4 +--- drivers/video/omap2/dss/dpi.c | 10 ++-------- drivers/video/omap2/dss/dsi.c | 6 +----- drivers/video/omap2/dss/dss.h | 2 +- drivers/video/omap2/dss/sdi.c | 5 +---- 5 files changed, 6 insertions(+), 21 deletions(-)
drivers/video/omap2/dss/dispc.c +1 -3
@@ -3184,15 +3184,13 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,return 0 ; } -int dispc_mgr_set_clock_div (enum omap_channel channel, +void dispc_mgr_set_clock_div (enum omap_channel channel,struct dispc_clock_info *cinfo) {DSSDBG ("lck = %lu (%u)\n" , cinfo->lck, cinfo->lck_div);DSSDBG ("pck = %lu (%u)\n" , cinfo->pck, cinfo->pck_div);dispc_mgr_set_lcd_divisor (channel, cinfo->lck_div, cinfo->pck_div); - -return 0 ; } int dispc_mgr_get_clock_div(enum omap_channel channel,
drivers/video/omap2/dss/dpi.c +2 -8
@@ -100,11 +100,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev,dss_select_dispc_clk_source (clks->dispc.fclk_src); - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) { -dss_select_dispc_clk_source (OMAP_DSS_CLK_SRC_FCK ); -return r; - } +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); *fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk; *lck_div = dispc_cinfo.lck_div;
@@ -129,9 +125,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,if (r)return r; - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) -return r; +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); *fck = dss_cinfo.fck; *lck_div = dispc_cinfo.lck_div;
drivers/video/omap2/dss/dsi.c +1 -5
@@ -4456,11 +4456,7 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev,return r; } - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) { -DSSERR ("Failed to set dispc clocks\n" ); -return r; - } +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo);return 0 ; }
drivers/video/omap2/dss/dss.h +1 -1
@@ -416,7 +416,7 @@ void dispc_mgr_set_timings(enum omap_channel channel,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 ); -int dispc_mgr_set_clock_div (enum omap_channel channel, +void dispc_mgr_set_clock_div (enum omap_channel channel,struct dispc_clock_info *cinfo);int dispc_mgr_get_clock_div (enum omap_channel channel,struct dispc_clock_info *cinfo);
drivers/video/omap2/dss/sdi.c +1 -4
@@ -106,9 +106,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_set_dss_clock_div; - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) - goto err_set_dispc_clock_div; +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo);dss_sdi_init (dssdev->phy.sdi.datapairs); r =dss_sdi_enable ();
@@ -125,7 +123,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) err_mgr_enable:dss_sdi_disable (); err_sdi_enable: -err_set_dispc_clock_div: err_set_dss_clock_div: err_calc_clock_div:dispc_runtime_put ();
Signature · 1 line
1.7.9.5
PATCH 1/12 OMAPDSS: DISPC: Change return type of dispc_mgr_set_clock_div()
In reply to Archit Tanejadipsc_mgr_set_clock div has an int return type to report errors or success. The function doesn't really check for errors and always returns 0. Change the return type to void.
Checking for the correct DISPC clock divider ranges will be done when a DSS2 user does a manager apply. This support will be added later.
--- drivers/video/omap2/dss/dispc.c | 4 +--- drivers/video/omap2/dss/dpi.c | 10 ++-------- drivers/video/omap2/dss/dsi.c | 6 +----- drivers/video/omap2/dss/dss.h | 2 +- drivers/video/omap2/dss/sdi.c | 5 +---- 5 files changed, 6 insertions(+), 21 deletions(-)
drivers/video/omap2/dss/dispc.c +1 -3
@@ -3184,15 +3184,13 @@ int dispc_calc_clock_rates(unsigned long dispc_fclk_rate,return 0 ; } -int dispc_mgr_set_clock_div (enum omap_channel channel, +void dispc_mgr_set_clock_div (enum omap_channel channel,struct dispc_clock_info *cinfo) {DSSDBG ("lck = %lu (%u)\n" , cinfo->lck, cinfo->lck_div);DSSDBG ("pck = %lu (%u)\n" , cinfo->pck, cinfo->pck_div);dispc_mgr_set_lcd_divisor (channel, cinfo->lck_div, cinfo->pck_div); - -return 0 ; } int dispc_mgr_get_clock_div(enum omap_channel channel,
drivers/video/omap2/dss/dpi.c +2 -8
@@ -100,11 +100,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev,dss_select_dispc_clk_source (clks->dispc.fclk_src); - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) { -dss_select_dispc_clk_source (OMAP_DSS_CLK_SRC_FCK ); -return r; - } +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); *fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk; *lck_div = dispc_cinfo.lck_div;
@@ -129,9 +125,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,if (r)return r; - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) -return r; +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); *fck = dss_cinfo.fck; *lck_div = dispc_cinfo.lck_div;
drivers/video/omap2/dss/dsi.c +1 -5
@@ -4456,11 +4456,7 @@ static int dsi_configure_dispc_clocks(struct omap_dss_device *dssdev,return r; } - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) { -DSSERR ("Failed to set dispc clocks\n" ); -return r; - } +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo);return 0 ; }
drivers/video/omap2/dss/dss.h +1 -1
@@ -416,7 +416,7 @@ void dispc_mgr_set_timings(enum omap_channel channel,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 ); -int dispc_mgr_set_clock_div (enum omap_channel channel, +void dispc_mgr_set_clock_div (enum omap_channel channel,struct dispc_clock_info *cinfo);int dispc_mgr_get_clock_div (enum omap_channel channel,struct dispc_clock_info *cinfo);
drivers/video/omap2/dss/sdi.c +1 -4
@@ -106,9 +106,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_set_dss_clock_div; - r =dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); -if (r) - goto err_set_dispc_clock_div; +dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo);dss_sdi_init (dssdev->phy.sdi.datapairs); r =dss_sdi_enable ();
@@ -125,7 +123,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) err_mgr_enable:dss_sdi_disable (); err_sdi_enable: -err_set_dispc_clock_div: err_set_dss_clock_div: err_calc_clock_div:dispc_runtime_put ();
Signature · 1 line
1.7.9.5
PATCH 2/12 OMAPDSS: Add struct to hold LCD overlay manager configuration
In reply to Archit TanejaCreate a struct dss_lcd_mgr_config which holds LCD overlay manager related parameters. These are currently partially contained in the omap_dss_device connected to the manager, and the rest are in the interface driver.
The parameters are directly written to the DISPC registers in the interface drivers. These should eventually be applied at the correct time using the shadow register programming model. This struct would help in grouping these parameters so that they can be applied together.
--- drivers/video/omap2/dss/dss.h | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/video/omap2/dss/dss.h +13 -0
@@ -152,6 +152,19 @@ struct dsi_clock_info {u16 lp_clk_div; }; +struct dss_lcd_mgr_config { +enum dss_io_pad_mode io_pad_mode; + +bool stallmode; +bool fifohandcheck; + +struct dispc_clock_info clock_info; + +int video_port_width; + +int lcden_sig_polarity; +}; +struct seq_file ;struct platform_device ;
Signature · 1 line
1.7.9.5
PATCH 3/12 OMAPDSS: DPI: Configure dss_lcd_mgr_config struct with lcd manager parameters
In reply to Archit TanejaCreate a dss_lcd_mgr_config struct instance in DPI. Fill up all the parameters of the struct with configurations held by the panel, and the configurations required by DPI.
Use these to write to the DISPC registers. These direct register writes would be later replaced by a function which applies the configuration using the shadow register programming model.
The DISPC_DIVISORo registers were written in the functions dpi_set_dispc_clk() and dpi_set_dsi_clk(), now they just fill up the dispc_clock_info parameter in mgr_config. They are written later in dpi_config_lcd_manager.
--- drivers/video/omap2/dss/dpi.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-)
drivers/video/omap2/dss/dpi.c +28 -9
@@ -38,6 +38,8 @@static struct {struct regulator *vdds_dsi_reg;struct platform_device *dsidev; + +struct dss_lcd_mgr_config mgr_config; } dpi;static struct platform_device *dpi_get_dsidev (enum omap_dss_clk_source clk)
@@ -100,7 +102,7 @@ static int dpi_set_dsi_clk(struct omap_dss_device *dssdev,dss_select_dispc_clk_source (clks->dispc.fclk_src); -dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); + dpi.mgr_config.clock_info = dispc_cinfo; *fck = dsi_cinfo.dsi_pll_hsdiv_dispc_clk; *lck_div = dispc_cinfo.lck_div;
@@ -125,7 +127,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,if (r)return r; -dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); + dpi.mgr_config.clock_info = dispc_cinfo; *fck = dss_cinfo.fck; *lck_div = dispc_cinfo.lck_div;
@@ -166,15 +168,32 @@ static int dpi_set_mode(struct omap_dss_device *dssdev)return 0 ; } -static void dpi_basic_init (struct omap_dss_device *dssdev) +static void dpi_config_lcd_manager (struct omap_dss_device *dssdev) { -dispc_mgr_set_io_pad_mode (DSS_IO_PAD_MODE_BYPASS ); -dispc_mgr_enable_stallmode (dssdev->manager->id, false); + dpi.mgr_config.io_pad_mode =DSS_IO_PAD_MODE_BYPASS ; -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); + dpi.mgr_config.stallmode = false; + dpi.mgr_config.fifohandcheck = false; + + dpi.mgr_config.video_port_width = dssdev->phy.dpi.data_lines; + + dpi.mgr_config.lcden_sig_polarity = false; + +dispc_mgr_set_io_pad_mode (dpi.mgr_config.io_pad_mode); +dispc_mgr_enable_stallmode (dssdev->manager->id, + dpi.mgr_config.stallmode); +dispc_mgr_enable_fifohandcheck (dssdev->manager->id, + dpi.mgr_config.fifohandcheck);dispc_mgr_set_tft_data_lines (dssdev->manager->id, - dssdev->phy.dpi.data_lines); + dpi.mgr_config.video_port_width); + +dispc_mgr_set_clock_div (dssdev->manager->id, + &dpi.mgr_config.clock_info); + +dispc_lcd_enable_signal_polarity (dpi.mgr_config.lcden_sig_polarity); + +dispc_mgr_set_lcd_type_tft (dssdev->manager->id); }int omapdss_dpi_display_enable (struct omap_dss_device *dssdev)
@@ -213,8 +232,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_get_dispc; -dpi_basic_init (dssdev); -if (dpi_use_dsi_pll (dssdev)) { r =dsi_runtime_get (dpi.dsidev);if (r)
@@ -229,6 +246,8 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_set_mode; +dpi_config_lcd_manager (dssdev); +mdelay (2 ); r =dss_mgr_enable (dssdev->manager);
Signature · 1 line
1.7.9.5
PATCH 4/12 OMAPDSS: RFBI: Configure dss_lcd_mgr_config struct with lcd manager parameters
In reply to Archit TanejaCreate a dss_lcd_mgr_config struct instance in RFBI. Fill up all the parameters of the struct with configurations held by the panel, and the configurations required by RFBI.
Use these to write to the DISPC registers. These direct register writes would be later replaced by a function which applies the configuration using the shadow register programming model.
Create function rfbi_config_lcd_manager() which fills up the mgr_config parameters and writes to the DISPC regs.
--- drivers/video/omap2/dss/rfbi.c | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-)
drivers/video/omap2/dss/rfbi.c +28 -6
@@ -859,6 +859,33 @@ static void rfbi_dump_regs(struct seq_file *s)#undef DUMPREG } +static void rfbi_config_lcd_manager (struct omap_dss_device *dssdev) +{ +struct dss_lcd_mgr_config mgr_config; + + mgr_config.io_pad_mode =DSS_IO_PAD_MODE_RFBI ; + + mgr_config.stallmode = true; +/* Do we need fifohandcheck for RFBI? */ + mgr_config.fifohandcheck = false; + + mgr_config.video_port_width = dssdev->ctrl.pixel_size; + mgr_config.lcden_sig_polarity =0 ; + +dispc_mgr_set_io_pad_mode (mgr_config.io_pad_mode); + +dispc_mgr_enable_stallmode (dssdev->manager->id, mgr_config.stallmode); +dispc_mgr_enable_fifohandcheck (dssdev->manager->id, + mgr_config.fifohandcheck); + +dispc_mgr_set_tft_data_lines (dssdev->manager->id, + mgr_config.video_port_width); + +dispc_lcd_enable_signal_polarity (mgr_config.lcden_sig_polarity); + +dispc_mgr_set_lcd_type_tft (dssdev->manager->id); +} +int omapdss_rfbi_display_enable (struct omap_dss_device *dssdev) {int r;
@@ -885,12 +912,7 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) goto err1; } -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); - -dispc_mgr_set_tft_data_lines (dssdev->manager->id, dssdev->ctrl.pixel_size); +rfbi_config_lcd_manager (dssdev); rfbi_configure(dssdev->phy.rfbi.channel, dssdev->ctrl.pixel_size,
Signature · 1 line
1.7.9.5
PATCH 5/12 OMAPDSS: DSI: Configure dss_lcd_mgr_config struct with lcd manager parameters
In reply to Archit TanejaCreate a dss_lcd_mgr_config struct instance in DSI. Fill up all the parameters of the struct with configurations held by the panel, and the configurations required by DSI.
Use these to write to the DISPC registers. These direct register writes would be later replaced by a function which applies the configuration using the shadow register programming model.
The function dsi_configure_dispc_clocks() is now called in dsi_display_init_dispc(), this lets all the lcd manager related configurations happen in the same place. The DISPC_DIVISORo register was written in dsi_configure_dispc_clock(), now it just fills up the dispc_clock_info parameter in mgr_config. The clock_info is written later in dsi_display_init_dispc().
--- drivers/video/omap2/dss/dsi.c | 117 ++++++++++++++++++++++++++++------------- 1 file changed, 80 insertions(+), 37 deletions(-)
drivers/video/omap2/dss/dsi.c +80 -37
@@ -331,6 +331,8 @@ struct dsi_data {unsigned num_lanes_used;unsigned scp_clk_refcount; + +struct dss_lcd_mgr_config mgr_config; };struct dsi_packet_sent_handler_data {
@@ -4339,14 +4341,42 @@ EXPORT_SYMBOL(omap_dsi_update);/* Display funcs */ -static int dsi_display_init_dispc (struct omap_dss_device *dssdev) +static int dsi_configure_dispc_clocks (struct omap_dss_device *dssdev, +const struct omapdss_lcd_clock_config *lcd_clks) { +struct platform_device *dsidev =dsi_get_dsidev_from_dssdev (dssdev); +struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); +struct dispc_clock_info dispc_cinfo;int r; +unsigned long long fck; + + fck =dsi_get_pll_hsdiv_dispc_rate (dsidev); + + dispc_cinfo.lck_div = lcd_clks->lck_div; + dispc_cinfo.pck_div = lcd_clks->pck_div; + + r =dispc_calc_clock_rates (fck, &dispc_cinfo); +if (r) { +DSSERR ("Failed to calc dispc clocks\n" ); +return r; + } + + dsi->mgr_config.clock_info = dispc_cinfo; + +return 0 ; +} + +static int dsi_display_init_dispc (struct omap_dss_device *dssdev) +{ +struct platform_device *dsidev =dsi_get_dsidev_from_dssdev (dssdev); +struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);struct omap_video_timings timings; +const struct omapdss_clock_config *clks; +int r, lcd_id; +u32 irq;if (dssdev->panel.dsi_mode ==OMAP_DSS_DSI_CMD_MODE ) {u16 dw, dh; -u32 irq; dssdev->driver->get_resolution (dssdev, &dw, &dh);
@@ -4366,16 +4396,16 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) (void *) dssdev, irq);if (r) {DSSERR ("can't get FRAMEDONE irq\n" ); -return r; + goto err; } -dispc_mgr_enable_stallmode (dssdev->manager->id, true); -dispc_mgr_enable_fifohandcheck (dssdev->manager->id,1 ); + dsi->mgr_config.stallmode = true; + dsi->mgr_config.fifohandcheck = true; }else { timings = dssdev->panel.timings; -dispc_mgr_enable_stallmode (dssdev->manager->id, false); -dispc_mgr_enable_fifohandcheck (dssdev->manager->id,0 ); + dsi->mgr_config.stallmode = false; + dsi->mgr_config.fifohandcheck = false; }/*
@@ -4391,12 +4421,53 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)dss_mgr_set_timings (dssdev->manager, &timings); -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); + clks =dss_get_platform_clock_config (); + +switch (dssdev->manager->id) { +case OMAP_DSS_CHANNEL_LCD : + lcd_id =0 ; +break ; +case OMAP_DSS_CHANNEL_LCD2 : + lcd_id =1 ; +break ; +default : + r = -EINVAL ; + goto err1; + } + + r =dsi_configure_dispc_clocks (dssdev, &clks->lcd[lcd_id]); +if (r) + goto err1; + + dsi->mgr_config.io_pad_mode =DSS_IO_PAD_MODE_BYPASS ; + dsi->mgr_config.video_port_width = +dsi_get_pixel_size (dssdev->panel.dsi_pix_fmt); + dsi->mgr_config.lcden_sig_polarity =0 ; + +dispc_mgr_set_io_pad_mode (dsi->mgr_config.io_pad_mode); + +dispc_mgr_enable_stallmode (dssdev->manager->id, + dsi->mgr_config.stallmode); +dispc_mgr_enable_fifohandcheck (dssdev->manager->id, + dsi->mgr_config.fifohandcheck); + +dispc_mgr_set_clock_div (dssdev->manager->id, + &dsi->mgr_config.clock_info);dispc_mgr_set_tft_data_lines (dssdev->manager->id, -dsi_get_pixel_size (dssdev->panel.dsi_pix_fmt)); + dsi->mgr_config.video_port_width); + +dispc_lcd_enable_signal_polarity (dsi->mgr_config.lcden_sig_polarity); + +dispc_mgr_set_lcd_type_tft (dssdev->manager->id);return 0 ; +err1: +if (dssdev->panel.dsi_mode ==OMAP_DSS_DSI_CMD_MODE ) +omap_dispc_unregister_isr (dsi_framedone_irq_callback, + (void *) dssdev, irq); +err: +return r; }static void dsi_display_uninit_dispc (struct omap_dss_device *dssdev)
@@ -4437,30 +4508,6 @@ static int dsi_configure_dsi_clocks(struct platform_device *dsidev,return 0 ; } -static int dsi_configure_dispc_clocks (struct omap_dss_device *dssdev, -const struct omapdss_lcd_clock_config *lcd_clks) -{ -struct platform_device *dsidev =dsi_get_dsidev_from_dssdev (dssdev); -struct dispc_clock_info dispc_cinfo; -int r; -unsigned long long fck; - - fck =dsi_get_pll_hsdiv_dispc_rate (dsidev); - - dispc_cinfo.lck_div = lcd_clks->lck_div; - dispc_cinfo.pck_div = lcd_clks->pck_div; - - r =dispc_calc_clock_rates (fck, &dispc_cinfo); -if (r) { -DSSERR ("Failed to calc dispc clocks\n" ); -return r; - } - -dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); - -return 0 ; -} -static int dsi_display_init_dsi (struct omap_dss_device *dssdev) {struct platform_device *dsidev =dsi_get_dsidev_from_dssdev (dssdev);
@@ -4499,10 +4546,6 @@ static int dsi_display_init_dsi(struct omap_dss_device *dssdev)DSSDBG ("PLL OK\n" ); - r =dsi_configure_dispc_clocks (dssdev, &clks->lcd[lcd_id]); -if (r) - goto err2; - r =dsi_cio_init (dssdev);if (r) goto err2;
Signature · 1 line
1.7.9.5
PATCH 6/12 OMAPDSS: SDI: Configure dss_lcd_mgr_config struct with lcd manager parameters
In reply to Archit TanejaCreate a dss_lcd_mgr_config struct instance in SDI. Fill up all the parameters of the struct with configurations held by the panel, and the configurations required by SDI.
Use these to write to the DISPC registers. These direct register writes would be later replaced by a function which applies the configuration using the shadow register programming model.
Create function sdi_config_lcd_manager() which fills the mgr_config parameters and writes to the DISPC registers
--- drivers/video/omap2/dss/sdi.c | 42 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-)
drivers/video/omap2/dss/sdi.c +26 -16
@@ -32,18 +32,34 @@static struct {bool update_enabled;struct regulator *vdds_sdi_reg; -} sdi; -static void sdi_basic_init (struct omap_dss_device *dssdev) +struct dss_lcd_mgr_config mgr_config; +} sdi; +static void sdi_config_lcd_manager (struct omap_dss_device *dssdev) { -dispc_mgr_set_io_pad_mode (DSS_IO_PAD_MODE_BYPASS ); -dispc_mgr_enable_stallmode (dssdev->manager->id, false); + sdi.mgr_config.io_pad_mode =DSS_IO_PAD_MODE_BYPASS ; -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); + sdi.mgr_config.stallmode = false; + sdi.mgr_config.fifohandcheck = false; + + sdi.mgr_config.video_port_width =24 ; + sdi.mgr_config.lcden_sig_polarity =1 ; + +dispc_mgr_set_io_pad_mode (sdi.mgr_config.io_pad_mode); +dispc_mgr_enable_stallmode (dssdev->manager->id, + sdi.mgr_config.stallmode); +dispc_mgr_enable_fifohandcheck (dssdev->manager->id, + sdi.mgr_config.fifohandcheck); -dispc_mgr_set_tft_data_lines (dssdev->manager->id,24 ); -dispc_lcd_enable_signal_polarity (1 ); +dispc_mgr_set_clock_div (dssdev->manager->id, + &sdi.mgr_config.clock_info); + +dispc_mgr_set_tft_data_lines (dssdev->manager->id, + sdi.mgr_config.video_port_width); +dispc_lcd_enable_signal_polarity (sdi.mgr_config.lcden_sig_polarity); + +dispc_mgr_set_lcd_type_tft (dssdev->manager->id); }int omapdss_sdi_display_enable (struct omap_dss_device *dssdev)
@@ -51,8 +67,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)struct omap_video_timings *t = &dssdev->panel.timings;struct dss_clock_info dss_cinfo;struct dispc_clock_info dispc_cinfo; -u16 lck_div, pck_div; -unsigned long fck;unsigned long pck;int r;
@@ -75,8 +89,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_get_dispc; -sdi_basic_init (dssdev); -/* 15.5.9.1.2 */ dssdev->panel.timings.pclk_edge =OMAPDSS_DRIVE_SIG_RISING_EDGE ; dssdev->panel.timings.hsync_vsync_edge =OMAPDSS_DRIVE_SIG_RISING_EDGE ;
@@ -85,11 +97,9 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_calc_clock_div; - fck = dss_cinfo.fck; - lck_div = dispc_cinfo.lck_div; - pck_div = dispc_cinfo.pck_div; + sdi.mgr_config.clock_info = dispc_cinfo; - pck = fck / lck_div / pck_div /1000 ; + pck = dss_cinfo.fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div /1000 ;if (pck != t->pixel_clock) { DSSWARN("Could not find exact pixel clock. Requested %d kHz, "
@@ -106,7 +116,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_set_dss_clock_div; -dispc_mgr_set_clock_div (dssdev->manager->id, &dispc_cinfo); +sdi_config_lcd_manager (dssdev);dss_sdi_init (dssdev->phy.sdi.datapairs); r =dss_sdi_enable ();
Signature · 1 line
1.7.9.5
PATCH 7/12 OMAPDSS: APPLY: Remove DISPC writes to manager's lcd parameters in interface drivers
In reply to Archit TanejaReplace the DISPC fuctions used to configure LCD channel related manager parameters with dss_mgr_set_lcd_config() in APPLY. This function ensures that the DISPC registers are written at the right time by using the shadow register programming model.
The LCD manager configurations is stored as a private data of manager in APPLY. It is treated as an extra info as it's the panel drivers which trigger this apply via interface drivers, and not a DSS2 user like omapfb or omapdrm.
Storing LCD manager related properties in APPLY also prevents the need to refer to the panel connected to the manager for information. This helps in making the DSS driver less dependent on panel.
A helper function is added to check whether the manager is LCD or TV. The direct DISPC register writes are removed from the interface drivers.
--- drivers/video/omap2/dss/apply.c | 65 +++++++++++++++++++++++++++++++++++++++ drivers/video/omap2/dss/dpi.c | 16 +--------- drivers/video/omap2/dss/dsi.c | 17 +--------- drivers/video/omap2/dss/dss.h | 10 ++++++ drivers/video/omap2/dss/rfbi.c | 13 +------- drivers/video/omap2/dss/sdi.c | 15 +-------- 6 files changed, 79 insertions(+), 57 deletions(-)
drivers/video/omap2/dss/apply.c +65 -0
@@ -104,6 +104,7 @@ struct mgr_priv_data {bool shadow_extra_info_dirty;struct omap_video_timings timings; +struct dss_lcd_mgr_config lcd_config; }; static struct {
@@ -137,6 +138,7 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)void dss_apply_init (void ) {const int num_ovls =dss_feat_get_num_ovls (); +struct mgr_priv_data *mp;int i;spin_lock_init (&data_lock);
@@ -168,6 +170,16 @@ void dss_apply_init(void) op->user_info = op->info; } + +/* +* Initialize some of the lcd_config fields for TV manager, this lets +* us prevent checking if the manager is LCD or TV at some places +*/ + mp = &dss_data.mgr_priv_data_array[OMAP_DSS_CHANNEL_DIGIT ]; + + mp->lcd_config.video_port_width =24 ; + mp->lcd_config.clock_info.lck_div =1 ; + mp->lcd_config.clock_info.pck_div =1 ; }static bool ovl_manual_update (struct omap_overlay *ovl)
@@ -633,6 +645,24 @@ static void dss_mgr_write_regs_extra(struct omap_overlay_manager *mgr)dispc_mgr_set_timings (mgr->id, &mp->timings); +/* lcd_config parameters */ +if (dss_mgr_is_lcd (mgr->id)) { +dispc_mgr_set_io_pad_mode (mp->lcd_config.io_pad_mode); + +dispc_mgr_enable_stallmode (mgr->id, mp->lcd_config.stallmode); +dispc_mgr_enable_fifohandcheck (mgr->id, + mp->lcd_config.fifohandcheck); + +dispc_mgr_set_clock_div (mgr->id, &mp->lcd_config.clock_info); + +dispc_mgr_set_tft_data_lines (mgr->id, + mp->lcd_config.video_port_width); + +dispc_lcd_enable_signal_polarity (mp->lcd_config.lcden_sig_polarity); + +dispc_mgr_set_lcd_type_tft (mgr->id); + } + mp->extra_info_dirty = false;if (mp->updating) mp->shadow_extra_info_dirty = true;
@@ -1292,6 +1322,41 @@ void dss_mgr_set_timings(struct omap_overlay_manager *mgr,mutex_unlock (&apply_lock); } +static void dss_apply_mgr_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config) +{ +struct mgr_priv_data *mp =get_mgr_priv (mgr); + + mp->lcd_config = config; + mp->extra_info_dirty = true; +} + +void dss_mgr_set_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config) +{ +unsigned long flags; +struct mgr_priv_data *mp =get_mgr_priv (mgr); + +mutex_lock (&apply_lock); + +if (mp->enabled) + goto out; + +spin_lock_irqsave (&data_lock, flags); + +dss_apply_mgr_lcd_config (mgr, config); + +dss_write_regs (); +dss_set_go_bits (); + +spin_unlock_irqrestore (&data_lock, flags); + +wait_pending_extra_info_updates (); + +out: +mutex_unlock (&apply_lock); +} +int dss_ovl_set_info (struct omap_overlay *ovl,struct omap_overlay_info *info) {
drivers/video/omap2/dss/dpi.c +1 -15
@@ -179,21 +179,7 @@ static void dpi_config_lcd_manager(struct omap_dss_device *dssdev) dpi.mgr_config.lcden_sig_polarity = false; -dispc_mgr_set_io_pad_mode (dpi.mgr_config.io_pad_mode); -dispc_mgr_enable_stallmode (dssdev->manager->id, - dpi.mgr_config.stallmode); -dispc_mgr_enable_fifohandcheck (dssdev->manager->id, - dpi.mgr_config.fifohandcheck); - -dispc_mgr_set_tft_data_lines (dssdev->manager->id, - dpi.mgr_config.video_port_width); - -dispc_mgr_set_clock_div (dssdev->manager->id, - &dpi.mgr_config.clock_info); - -dispc_lcd_enable_signal_polarity (dpi.mgr_config.lcden_sig_polarity); - -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); +dss_mgr_set_lcd_config (dssdev->manager, dpi.mgr_config); }int omapdss_dpi_display_enable (struct omap_dss_device *dssdev)
drivers/video/omap2/dss/dsi.c +1 -16
@@ -4444,22 +4444,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)dsi_get_pixel_size (dssdev->panel.dsi_pix_fmt); dsi->mgr_config.lcden_sig_polarity =0 ; -dispc_mgr_set_io_pad_mode (dsi->mgr_config.io_pad_mode); - -dispc_mgr_enable_stallmode (dssdev->manager->id, - dsi->mgr_config.stallmode); -dispc_mgr_enable_fifohandcheck (dssdev->manager->id, - dsi->mgr_config.fifohandcheck); - -dispc_mgr_set_clock_div (dssdev->manager->id, - &dsi->mgr_config.clock_info); - -dispc_mgr_set_tft_data_lines (dssdev->manager->id, - dsi->mgr_config.video_port_width); - -dispc_lcd_enable_signal_polarity (dsi->mgr_config.lcden_sig_polarity); - -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); +dss_mgr_set_lcd_config (dssdev->manager, dsi->mgr_config);return 0 ; err1:
drivers/video/omap2/dss/dss.h +10 -0
@@ -202,6 +202,8 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,int dss_mgr_unset_device (struct omap_overlay_manager *mgr);void dss_mgr_set_timings (struct omap_overlay_manager *mgr,struct omap_video_timings *timings); +void dss_mgr_set_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config);const struct omap_video_timings *dss_mgr_get_timings (struct omap_overlay_manager *mgr);bool dss_ovl_is_enabled (struct omap_overlay *ovl);
@@ -235,6 +237,14 @@ int dss_mgr_check(struct omap_overlay_manager *mgr,const struct omap_video_timings *mgr_timings, struct omap_overlay_info **overlay_infos); +static inline bool dss_mgr_is_lcd (enum omap_channel id) +{ +if (id ==OMAP_DSS_CHANNEL_LCD || id ==OMAP_DSS_CHANNEL_LCD2 ) +return true; +else +return false; +} +/* overlay */ void dss_init_overlays (struct platform_device *pdev);void dss_uninit_overlays (struct platform_device *pdev);
drivers/video/omap2/dss/rfbi.c +1 -12
@@ -872,18 +872,7 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) mgr_config.video_port_width = dssdev->ctrl.pixel_size; mgr_config.lcden_sig_polarity =0 ; -dispc_mgr_set_io_pad_mode (mgr_config.io_pad_mode); - -dispc_mgr_enable_stallmode (dssdev->manager->id, mgr_config.stallmode); -dispc_mgr_enable_fifohandcheck (dssdev->manager->id, - mgr_config.fifohandcheck); - -dispc_mgr_set_tft_data_lines (dssdev->manager->id, - mgr_config.video_port_width); - -dispc_lcd_enable_signal_polarity (mgr_config.lcden_sig_polarity); - -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); +dss_mgr_set_lcd_config (dssdev->manager, mgr_config); }int omapdss_rfbi_display_enable (struct omap_dss_device *dssdev)
drivers/video/omap2/dss/sdi.c +1 -14
@@ -46,20 +46,7 @@ static void sdi_config_lcd_manager(struct omap_dss_device *dssdev) sdi.mgr_config.video_port_width =24 ; sdi.mgr_config.lcden_sig_polarity =1 ; -dispc_mgr_set_io_pad_mode (sdi.mgr_config.io_pad_mode); -dispc_mgr_enable_stallmode (dssdev->manager->id, - sdi.mgr_config.stallmode); -dispc_mgr_enable_fifohandcheck (dssdev->manager->id, - sdi.mgr_config.fifohandcheck); - -dispc_mgr_set_clock_div (dssdev->manager->id, - &sdi.mgr_config.clock_info); - -dispc_mgr_set_tft_data_lines (dssdev->manager->id, - sdi.mgr_config.video_port_width); -dispc_lcd_enable_signal_polarity (sdi.mgr_config.lcden_sig_polarity); - -dispc_mgr_set_lcd_type_tft (dssdev->manager->id); +dss_mgr_set_lcd_config (dssdev->manager, sdi.mgr_config); }int omapdss_sdi_display_enable (struct omap_dss_device *dssdev)
Signature · 1 line
1.7.9.5
Re: [PATCH 07/12] OMAPDSS: APPLY: Remove DISPC writes to manager's lcd parameters in interface drive
Quoted 18 lines · Archit Taneja
Replace the DISPC fuctions used to configure LCD channel related manager parameters with
dss_mgr_set_lcd_config()in APPLY. This function ensures that the DISPC registers are written at the right time by using the shadow register programming model.The LCD manager configurations is stored as a private data of manager in APPLY. It is treated as an extra info as it's the panel drivers which trigger this apply via interface drivers, and not a DSS2 user like omapfb or omapdrm.
Storing LCD manager related properties in APPLY also prevents the need to refer to the panel connected to the manager for information. This helps in making the DSS driver less dependent on panel.
A helper function is added to check whether the manager is LCD or TV. The direct DISPC register writes are removed from the interface drivers.
drivers/video/omap2/dss/apply.c void dss_mgr_set_timings(struct omap_overlay_manager *mgr, · line 1327
Quoted 3 lines
drivers/video/omap2/dss/apply.c +3
-0+static void dss_apply_mgr_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config) +{
This one should take a pointer to the config, not a copy (and const).
drivers/video/omap2/dss/apply.c void dss_mgr_set_timings(struct omap_overlay_manager *mgr, · line 1335
Quoted 8 lines
drivers/video/omap2/dss/apply.c +8
-0+struct mgr_priv_data *mp =get_mgr_priv (mgr); + + mp->lcd_config = config; + mp->extra_info_dirty = true; +} + +void dss_mgr_set_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config)
And this.
drivers/video/omap2/dss/apply.c void dss_mgr_set_timings(struct omap_overlay_manager *mgr, · line 1343
Quoted 8 lines
drivers/video/omap2/dss/apply.c +8
-0+{ +unsigned long flags; +struct mgr_priv_data *mp =get_mgr_priv (mgr); + +mutex_lock (&apply_lock); + +if (mp->enabled) + goto out;
Hmm. Should we print a warning or such here? Isn't it a bug in the interface driver, if it tries to set the lcd config when the output is enabled?
Tomi
Re: [PATCH 07/12] OMAPDSS: APPLY: Remove DISPC writes to manager's lcd parameters in interface drive
Quoted 25 lines · Tomi Valkeinen
Quoted 18 lines · Archit Taneja
Replace the DISPC fuctions used to configure LCD channel related manager parameters with
dss_mgr_set_lcd_config()in APPLY. This function ensures that the DISPC registers are written at the right time by using the shadow register programming model.The LCD manager configurations is stored as a private data of manager in APPLY. It is treated as an extra info as it's the panel drivers which trigger this apply via interface drivers, and not a DSS2 user like omapfb or omapdrm.
Storing LCD manager related properties in APPLY also prevents the need to refer to the panel connected to the manager for information. This helps in making the DSS driver less dependent on panel.
A helper function is added to check whether the manager is LCD or TV. The direct DISPC register writes are removed from the interface drivers.
drivers/video/omap2/dss/apply.c void dss_mgr_set_timings(struct omap_overlay_manager *mgr, · line 1327
Quoted 3 lines
drivers/video/omap2/dss/apply.c +3
-0+static void dss_apply_mgr_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config) +{This one should take a pointer to the config, not a copy (and const).
Quoted 10 lines
drivers/video/omap2/dss/apply.c void dss_mgr_set_timings(struct omap_overlay_manager *mgr, · line 1335
Quoted 8 lines
drivers/video/omap2/dss/apply.c +8
-0+struct mgr_priv_data *mp =get_mgr_priv (mgr); + + mp->lcd_config = config; + mp->extra_info_dirty = true; +} + +void dss_mgr_set_lcd_config (struct omap_overlay_manager *mgr, +struct dss_lcd_mgr_config config)And this.
Will fix these.
Quoted 13 lines
drivers/video/omap2/dss/apply.c void dss_mgr_set_timings(struct omap_overlay_manager *mgr, · line 1343
Quoted 9 lines
drivers/video/omap2/dss/apply.c +8
-0+{ +unsigned long flags; +struct mgr_priv_data *mp =get_mgr_priv (mgr); + +mutex_lock (&apply_lock); + +if (mp->enabled) + goto out;Hmm. Should we print a warning or such here? Isn't it a bug in the interface driver, if it tries to set the lcd config when the output is enabled?
Yes, we should add an error here. Will add it.
Archit
PATCH 8/12 OMAPDSS: MANAGER: Check LCD related overlay manager parameters
In reply to Archit TanejaThe LCD related manager configurations are a part of the manager's private data in APPLY. Pass this to dss_lcd_mgr_config to dss_mgr_check and create a function to check the validity of some of the configurations.
To check some of the configurations, we require information of interface to which the manager output is connected. These can be added once interfaces are represented as an entity.
--- drivers/video/omap2/dss/apply.c | 2 +- drivers/video/omap2/dss/dss.h | 1 + drivers/video/omap2/dss/manager.c | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-)
drivers/video/omap2/dss/apply.c +1 -1
@@ -226,7 +226,7 @@ static int dss_check_settings_low(struct omap_overlay_manager *mgr, ois[ovl->id] = oi; } -return dss_mgr_check (mgr, mi, &mp->timings, ois); +return dss_mgr_check (mgr, mi, &mp->timings, &mp->lcd_config, ois); }/*
drivers/video/omap2/dss/dss.h +1 -0
@@ -235,6 +235,7 @@ int dss_mgr_check_timings(struct omap_overlay_manager *mgr,int dss_mgr_check (struct omap_overlay_manager *mgr,struct omap_overlay_manager_info *info,const struct omap_video_timings *mgr_timings, +const struct dss_lcd_mgr_config *config,struct omap_overlay_info **overlay_infos);static inline bool dss_mgr_is_lcd (enum omap_channel id)
drivers/video/omap2/dss/manager.c +35 -0
@@ -665,9 +665,40 @@ int dss_mgr_check_timings(struct omap_overlay_manager *mgr,return 0 ; } +static int dss_mgr_check_lcd_config (struct omap_overlay_manager *mgr, +const struct dss_lcd_mgr_config *config) +{ +struct dispc_clock_info cinfo = config->clock_info; +int dl = config->video_port_width; +bool stallmode = config->stallmode; +bool fifohandcheck = config->fifohandcheck; + +if (cinfo.lck_div <1 || cinfo.lck_div >255 ) +return -EINVAL ; + +if (cinfo.pck_div <1 || cinfo.pck_div >255 ) +return -EINVAL ; + +if (dl !=12 && dl !=16 && dl !=18 && dl !=24 ) +return -EINVAL ; + +/* fifohandcheck should be used only with stallmode */ +if (stallmode == false && fifohandcheck == true) +return -EINVAL ; + +/* +* io pad mode can be only checked by using dssdev connected to the +* manager. Ignore checking these for now, add checks when manager +* is capable of holding information related to the connected interface +*/ + +return 0 ; +} +int dss_mgr_check (struct omap_overlay_manager *mgr,struct omap_overlay_manager_info *info,const struct omap_video_timings *mgr_timings, +const struct dss_lcd_mgr_config *lcd_config,struct omap_overlay_info **overlay_infos) {struct omap_overlay *ovl;
@@ -683,6 +714,10 @@ int dss_mgr_check(struct omap_overlay_manager *mgr,if (r)return r; + r =dss_mgr_check_lcd_config (mgr, lcd_config); +if (r) +return r; +list_for_each_entry (ovl, &mgr->overlays, list) {struct omap_overlay_info *oi;int r;
Signature · 1 line
1.7.9.5
PATCH 9/12 OMAPDSS: APPLY: Remove usage of omap_dss_device from manual/auto update checks
In reply to Archit TanejaAPPLY needs to know at certain places whether an overlay manager is in manual or auto update mode. The caps of the connected omap_dss_device were used to check that.
A LCD manager is in manual update if stallmode is enabled for that manager. TV managers for now always auto update.
Return the value of stallmode parameter in the private data 'lcd_confg' in mgr_manual_update() and ovl_manual_update(), for TV managers stallmode field will be false by default.
--- drivers/video/omap2/dss/apply.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/video/omap2/dss/apply.c +11 -2
@@ -182,14 +182,23 @@ void dss_apply_init(void) mp->lcd_config.clock_info.pck_div =1 ; } +/* +* A LCD manager's stallmode decides whether it is in manual or auto update. TV +* manager is always auto update, stallmode field for TV manager is false by +* default +*/ static bool ovl_manual_update (struct omap_overlay *ovl) { -return ovl->manager->device->caps &OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE ; +struct mgr_priv_data *mp =get_mgr_priv (ovl->manager); + +return mp->lcd_config.stallmode; }static bool mgr_manual_update (struct omap_overlay_manager *mgr) { -return mgr->device->caps &OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE ; +struct mgr_priv_data *mp =get_mgr_priv (mgr); + +return mp->lcd_config.stallmode; } static int dss_check_settings_low(struct omap_overlay_manager *mgr,
Signature · 1 line
1.7.9.5
PATCH 10/12 OMAPDSS: DISPC: Remove a redundant function
In reply to Archit Tanejadss_mgr_is_lcd() available in dss.h does the same thing as dispc_mgr_is_lcd() in dispc.c. Remove the function from dispc.c and replace it with the one in dss.h.
--- drivers/video/omap2/dss/dispc.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-)
drivers/video/omap2/dss/dispc.c +9 -18
@@ -387,15 +387,6 @@ void dispc_runtime_put(void)WARN_ON (r <0 ); } -static inline bool dispc_mgr_is_lcd (enum omap_channel channel) -{ -if (channel ==OMAP_DSS_CHANNEL_LCD || - channel ==OMAP_DSS_CHANNEL_LCD2 ) -return true; -else -return false; -} -u32 dispc_mgr_get_vsync_irq (enum omap_channel channel) {switch (channel) {
@@ -430,7 +421,7 @@ bool dispc_mgr_go_busy(enum omap_channel channel) {int bit; -if (dispc_mgr_is_lcd (channel)) +if (dss_mgr_is_lcd (channel)) bit =5 ;/* GOLCD */ else bit =6 ;/* GODIGIT */
@@ -446,7 +437,7 @@ void dispc_mgr_go(enum omap_channel channel)int bit;bool enable_bit, go_bit; -if (dispc_mgr_is_lcd (channel)) +if (dss_mgr_is_lcd (channel)) bit =0 ;/* LCDENABLE */ else bit =1 ;/* DIGITALENABLE */
@@ -460,7 +451,7 @@ void dispc_mgr_go(enum omap_channel channel)if (!enable_bit)return ; -if (dispc_mgr_is_lcd (channel)) +if (dss_mgr_is_lcd (channel)) bit =5 ;/* GOLCD */ else bit =6 ;/* GODIGIT */
@@ -939,7 +930,7 @@ static void dispc_mgr_set_cpr_coef(enum omap_channel channel, {u32 coef_r, coef_g, coef_b; -if (!dispc_mgr_is_lcd (channel)) +if (!dss_mgr_is_lcd (channel))return ; coef_r = FLD_VAL(coefs->rr, 31, 22) | FLD_VAL(coefs->rg, 20, 11) |
@@ -1798,7 +1789,7 @@ static int check_horiz_timing_omap3(enum omap_channel channel, nonactive = t->x_res + t->hfp + t->hsw + t->hbp - out_width; pclk =dispc_mgr_pclk_rate (channel); -if (dispc_mgr_is_lcd (channel)) +if (dss_mgr_is_lcd (channel)) lclk =dispc_mgr_lclk_rate (channel);else lclk =dispc_fclk_rate ();
@@ -2398,7 +2389,7 @@ bool dispc_mgr_is_enabled(enum omap_channel channel)void dispc_mgr_enable (enum omap_channel channel,bool enable) { -if (dispc_mgr_is_lcd (channel)) +if (dss_mgr_is_lcd (channel))dispc_mgr_enable_lcd_out (channel, enable);else if (channel ==OMAP_DSS_CHANNEL_DIGIT )dispc_mgr_enable_digit_out (enable);
@@ -2610,7 +2601,7 @@ bool dispc_mgr_timings_ok(enum omap_channel channel, timings_ok =_dispc_mgr_size_ok (timings->x_res, timings->y_res); -if (dispc_mgr_is_lcd (channel)) +if (dss_mgr_is_lcd (channel)) timings_ok = timings_ok && _dispc_lcd_timings_ok(timings->hsw, timings->hfp, timings->hbp, timings->vsw, timings->vfp,
@@ -2702,7 +2693,7 @@ void dispc_mgr_set_timings(enum omap_channel channel,return ; } -if (dispc_mgr_is_lcd (channel)) { +if (dss_mgr_is_lcd (channel)) {_dispc_mgr_set_lcd_timings (channel, t.hsw, t.hfp, t.hbp, t.vsw, t.vfp, t.vbp, t.vsync_level, t.hsync_level, t.pclk_edge, t.de_level, t.hsync_vsync_edge);
@@ -2808,7 +2799,7 @@ unsigned long dispc_mgr_pclk_rate(enum omap_channel channel) {unsigned long r; -if (dispc_mgr_is_lcd (channel)) { +if (dss_mgr_is_lcd (channel)) {int pcd;u32 l;
Signature · 1 line
1.7.9.5
PATCH 11/12 OMAPDSS: RFBI: Use dss_mgr_enable to enable the overlay manager
In reply to Archit TanejaThe RFBI driver uses a direct DISPC register write to enable the overlay manager. Replace this with dss_mgr_enable() which checks if the connected overlay and managers are correctly configured, and configure DSS for fifomerge.
--- drivers/video/omap2/dss/rfbi.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/video/omap2/dss/rfbi.c +12 -4
@@ -300,10 +300,11 @@ void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width, }EXPORT_SYMBOL (omap_rfbi_write_pixels); -static void rfbi_transfer_area (struct omap_dss_device *dssdev,u16 width, +static int rfbi_transfer_area (struct omap_dss_device *dssdev,u16 width,u16 height,void (*callback)(void *data),void *data) {u32 l; +int r;struct omap_video_timings timings = { .hsw =1 , .hfp =1 ,
@@ -322,7 +323,9 @@ static void rfbi_transfer_area(struct omap_dss_device *dssdev, u16 width,dss_mgr_set_timings (dssdev->manager, &timings); -dispc_mgr_enable (dssdev->manager->id, true); + r =dss_mgr_enable (dssdev->manager); +if (r) +return r; rfbi.framedone_callback = callback; rfbi.framedone_callback_data = data;
@@ -335,6 +338,8 @@ static void rfbi_transfer_area(struct omap_dss_device *dssdev, u16 width, l =FLD_MOD (l,1 ,4 ,4 );/* ITE */ rfbi_write_reg (RFBI_CONTROL , l); + +return 0 ; }static void framedone_callback (void *data,u32 mask)
@@ -814,8 +819,11 @@ int omap_rfbi_update(struct omap_dss_device *dssdev, u16 x, u16 y, u16 w, u16 h, void (*callback)(void *), void *data) { -rfbi_transfer_area (dssdev ,w ,h ,callback ,data ); -return 0 ; + int r; + + r =rfbi_transfer_area (dssdev, w, h, callback, data); + +return r; }EXPORT_SYMBOL (omap_rfbi_update);
Signature · 1 line
1.7.9.5
PATCH 12/12 OMAPDSS: OVERLAY: Clean up replication checking
In reply to Archit TanejaReplication logic for an overlay depends on the color mode in which it is configured and the video port width of the manager it is connected to.
video port width now held in dss_lcd_mgr_config in the manager's private data in APPLY. Use this instead of referring to the omap_dss_device connected to the manager.
Replication is enabled in the case of TV manager, the video_port_width is set to a default value of 24 for TV manager.
Make the replication checking an overlay function since it's more of an overlay characteristic than a display characteristic.
--- drivers/video/omap2/dss/apply.c | 2 +- drivers/video/omap2/dss/display.c | 34 ---------------------------------- drivers/video/omap2/dss/dss.h | 4 ++-- drivers/video/omap2/dss/overlay.c | 13 +++++++++++++ 4 files changed, 16 insertions(+), 37 deletions(-)
drivers/video/omap2/dss/apply.c +1 -1
@@ -571,7 +571,7 @@ static void dss_ovl_write_regs(struct omap_overlay *ovl) mp =get_mgr_priv (ovl->manager); - replication =dss_use_replication (ovl->manager->device, oi->color_mode); + replication =dss_ovl_use_replication (mp->lcd_config, oi->color_mode); r =dispc_ovl_setup (ovl->id, oi, replication, &mp->timings);if (r) {
drivers/video/omap2/dss/display.c +0 -34
@@ -316,40 +316,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev, }EXPORT_SYMBOL (omapdss_default_get_timings); -/* Checks if replication logic should be used. Only use for active matrix, -* when overlay is in RGB12U or RGB16 mode, and LCD interface is -* 18bpp or 24bpp */ -bool dss_use_replication (struct omap_dss_device *dssdev, -enum omap_color_mode mode) -{ -int bpp; - -if (mode !=OMAP_DSS_COLOR_RGB12U && mode !=OMAP_DSS_COLOR_RGB16 ) -return false; - -switch (dssdev->type) { -case OMAP_DISPLAY_TYPE_DPI : - bpp = dssdev->phy.dpi.data_lines; -break ; -case OMAP_DISPLAY_TYPE_HDMI : -case OMAP_DISPLAY_TYPE_VENC : -case OMAP_DISPLAY_TYPE_SDI : - bpp =24 ; -break ; -case OMAP_DISPLAY_TYPE_DBI : - bpp = dssdev->ctrl.pixel_size; -break ; -case OMAP_DISPLAY_TYPE_DSI : - bpp =dsi_get_pixel_size (dssdev->panel.dsi_pix_fmt); -break ; -default : -BUG (); -return false; - } - -return bpp >16 ; -} -void dss_init_device (struct platform_device *pdev,struct omap_dss_device *dssdev) {
drivers/video/omap2/dss/dss.h +2 -2
@@ -222,8 +222,6 @@ void dss_init_device(struct platform_device *pdev, struct omap_dss_device *dssdev);void dss_uninit_device (struct platform_device *pdev,struct omap_dss_device *dssdev); -bool dss_use_replication (struct omap_dss_device *dssdev, -enum omap_color_mode mode);/* manager */ int dss_init_overlay_managers (struct platform_device *pdev);
@@ -255,6 +253,8 @@ int dss_ovl_simple_check(struct omap_overlay *ovl, const struct omap_overlay_info *info);int dss_ovl_check (struct omap_overlay *ovl,struct omap_overlay_info *info,const struct omap_video_timings *mgr_timings); +bool dss_ovl_use_replication (struct dss_lcd_mgr_config config, +enum omap_color_mode mode);/* DSS */ int dss_init_platform_driver (void )__init ;
drivers/video/omap2/dss/overlay.c +13 -0
@@ -677,3 +677,16 @@ int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,return 0 ; } + +/* +* Checks if replication logic should be used. Only use when overlay is in +* RGB12U or RGB16 mode, and video port width interface is 18bpp or 24bpp +*/ +bool dss_ovl_use_replication (struct dss_lcd_mgr_config config, +enum omap_color_mode mode) +{ +if (mode !=OMAP_DSS_COLOR_RGB12U && mode !=OMAP_DSS_COLOR_RGB16 ) +return false; + +return config.video_port_width >16 ; +}
Signature · 1 line
1.7.9.5