aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-03-05 03:37:02 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-03 08:19:17 -0400
commit99322577e80da240cebc087da9ea328bb0960be1 (patch)
tree18d59d5d949e026c89b082b2a1e9924389afe9d5 /drivers/video
parent777f05cc79892c1a5c25a72cfb3cc24554378a45 (diff)
OMAPDSS: DSI: get line buffer size at probe
To find out the DSI line buffer size we need to read HW registers. To make it possible to do DSI configuration calculations without HW powered up, store the line buffer size at DSI driver's probe. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dsi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 8cb43af60fe1..590da06e6a82 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -336,6 +336,7 @@ struct dsi_data {
336 unsigned long lpdiv_max; 336 unsigned long lpdiv_max;
337 337
338 unsigned num_lanes_supported; 338 unsigned num_lanes_supported;
339 unsigned line_buffer_size;
339 340
340 struct dsi_lane_config lanes[DSI_MAX_NR_LANES]; 341 struct dsi_lane_config lanes[DSI_MAX_NR_LANES];
341 unsigned num_lanes_used; 342 unsigned num_lanes_used;
@@ -3791,13 +3792,12 @@ static void dsi_config_vp_num_line_buffers(struct platform_device *dsidev)
3791 3792
3792 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) { 3793 if (dsi->mode == OMAP_DSS_DSI_VIDEO_MODE) {
3793 int bpp = dsi_get_pixel_size(dsi->pix_fmt); 3794 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
3794 unsigned line_buf_size = dsi_get_line_buf_size(dsidev);
3795 struct omap_video_timings *timings = &dsi->timings; 3795 struct omap_video_timings *timings = &dsi->timings;
3796 /* 3796 /*
3797 * Don't use line buffers if width is greater than the video 3797 * Don't use line buffers if width is greater than the video
3798 * port's line buffer size 3798 * port's line buffer size
3799 */ 3799 */
3800 if (line_buf_size <= timings->x_res * bpp / 8) 3800 if (dsi->line_buffer_size <= timings->x_res * bpp / 8)
3801 num_line_buffers = 0; 3801 num_line_buffers = 0;
3802 else 3802 else
3803 num_line_buffers = 2; 3803 num_line_buffers = 2;
@@ -4447,7 +4447,7 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev)
4447 u32 l; 4447 u32 l;
4448 int r; 4448 int r;
4449 const unsigned channel = dsi->update_channel; 4449 const unsigned channel = dsi->update_channel;
4450 const unsigned line_buf_size = dsi_get_line_buf_size(dsidev); 4450 const unsigned line_buf_size = dsi->line_buffer_size;
4451 u16 w = dsi->timings.x_res; 4451 u16 w = dsi->timings.x_res;
4452 u16 h = dsi->timings.y_res; 4452 u16 h = dsi->timings.y_res;
4453 4453
@@ -5293,6 +5293,8 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
5293 else 5293 else
5294 dsi->num_lanes_supported = 3; 5294 dsi->num_lanes_supported = 3;
5295 5295
5296 dsi->line_buffer_size = dsi_get_line_buf_size(dsidev);
5297
5296 dsi_init_output(dsidev); 5298 dsi_init_output(dsidev);
5297 5299
5298 dsi_probe_pdata(dsidev); 5300 dsi_probe_pdata(dsidev);