diff options
author | Archit Taneja <archit@ti.com> | 2012-08-10 05:31:33 -0400 |
---|---|---|
committer | Archit Taneja <archit@ti.com> | 2012-08-16 08:30:47 -0400 |
commit | 02c3960b1eeafd5ed30323e1bb86bfa099b46921 (patch) | |
tree | f9c33b9952e6dcef535767fe840031b36b4bd2bc /drivers/video/omap2/dss/dsi.c | |
parent | 6ff9dd5a6fe624726f7004ddf995bb2b3409e1d5 (diff) |
OMAPDSS: DSI: Maintain copy of pixel format in driver data
The DSI driver currently relies on the omap_dss_device struct to receive the
desired pixel format of the panel. This makes the DSI interface driver dependent
on the omap_dss_device struct.
Make the DSI driver data maintain it's own pixel format field. The panel driver
is expected to call omapdss_dsi_set_pixel_format() to configure the pixel format
before the interface is enabled.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 36e2aa79bca6..8f94cb806145 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -334,6 +334,7 @@ struct dsi_data { | |||
334 | 334 | ||
335 | struct dss_lcd_mgr_config mgr_config; | 335 | struct dss_lcd_mgr_config mgr_config; |
336 | struct omap_video_timings timings; | 336 | struct omap_video_timings timings; |
337 | enum omap_dss_dsi_pixel_format pix_fmt; | ||
337 | }; | 338 | }; |
338 | 339 | ||
339 | struct dsi_packet_sent_handler_data { | 340 | struct dsi_packet_sent_handler_data { |
@@ -3612,7 +3613,7 @@ static void dsi_config_vp_num_line_buffers(struct omap_dss_device *dssdev) | |||
3612 | 3613 | ||
3613 | if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { | 3614 | if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { |
3614 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 3615 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
3615 | int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt); | 3616 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
3616 | unsigned line_buf_size = dsi_get_line_buf_size(dsidev); | 3617 | unsigned line_buf_size = dsi_get_line_buf_size(dsidev); |
3617 | struct omap_video_timings *timings = &dsi->timings; | 3618 | struct omap_video_timings *timings = &dsi->timings; |
3618 | /* | 3619 | /* |
@@ -3744,7 +3745,7 @@ static void dsi_config_cmd_mode_interleaving(struct omap_dss_device *dssdev) | |||
3744 | int tclk_trail, ths_exit, exiths_clk; | 3745 | int tclk_trail, ths_exit, exiths_clk; |
3745 | bool ddr_alwon; | 3746 | bool ddr_alwon; |
3746 | struct omap_video_timings *timings = &dsi->timings; | 3747 | struct omap_video_timings *timings = &dsi->timings; |
3747 | int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt); | 3748 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
3748 | int ndl = dsi->num_lanes_used - 1; | 3749 | int ndl = dsi->num_lanes_used - 1; |
3749 | int dsi_fclk_hsdiv = dssdev->clocks.dsi.regm_dsi + 1; | 3750 | int dsi_fclk_hsdiv = dssdev->clocks.dsi.regm_dsi + 1; |
3750 | int hsa_interleave_hs = 0, hsa_interleave_lp = 0; | 3751 | int hsa_interleave_hs = 0, hsa_interleave_lp = 0; |
@@ -3854,6 +3855,7 @@ static void dsi_config_cmd_mode_interleaving(struct omap_dss_device *dssdev) | |||
3854 | static int dsi_proto_config(struct omap_dss_device *dssdev) | 3855 | static int dsi_proto_config(struct omap_dss_device *dssdev) |
3855 | { | 3856 | { |
3856 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 3857 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
3858 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | ||
3857 | u32 r; | 3859 | u32 r; |
3858 | int buswidth = 0; | 3860 | int buswidth = 0; |
3859 | 3861 | ||
@@ -3873,7 +3875,7 @@ static int dsi_proto_config(struct omap_dss_device *dssdev) | |||
3873 | dsi_set_lp_rx_timeout(dsidev, 0x1fff, true, true); | 3875 | dsi_set_lp_rx_timeout(dsidev, 0x1fff, true, true); |
3874 | dsi_set_hs_tx_timeout(dsidev, 0x1fff, true, true); | 3876 | dsi_set_hs_tx_timeout(dsidev, 0x1fff, true, true); |
3875 | 3877 | ||
3876 | switch (dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt)) { | 3878 | switch (dsi_get_pixel_size(dsi->pix_fmt)) { |
3877 | case 16: | 3879 | case 16: |
3878 | buswidth = 0; | 3880 | buswidth = 0; |
3879 | break; | 3881 | break; |
@@ -3997,7 +3999,7 @@ static void dsi_proto_timings(struct omap_dss_device *dssdev) | |||
3997 | int window_sync = dssdev->panel.dsi_vm_data.window_sync; | 3999 | int window_sync = dssdev->panel.dsi_vm_data.window_sync; |
3998 | bool hsync_end = dssdev->panel.dsi_vm_data.vp_hsync_end; | 4000 | bool hsync_end = dssdev->panel.dsi_vm_data.vp_hsync_end; |
3999 | struct omap_video_timings *timings = &dsi->timings; | 4001 | struct omap_video_timings *timings = &dsi->timings; |
4000 | int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt); | 4002 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
4001 | int tl, t_he, width_bytes; | 4003 | int tl, t_he, width_bytes; |
4002 | 4004 | ||
4003 | t_he = hsync_end ? | 4005 | t_he = hsync_end ? |
@@ -4106,13 +4108,13 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) | |||
4106 | { | 4108 | { |
4107 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4109 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |
4108 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | 4110 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); |
4109 | int bpp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt); | 4111 | int bpp = dsi_get_pixel_size(dsi->pix_fmt); |
4110 | u8 data_type; | 4112 | u8 data_type; |
4111 | u16 word_count; | 4113 | u16 word_count; |
4112 | int r; | 4114 | int r; |
4113 | 4115 | ||
4114 | if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { | 4116 | if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_VIDEO_MODE) { |
4115 | switch (dssdev->panel.dsi_pix_fmt) { | 4117 | switch (dsi->pix_fmt) { |
4116 | case OMAP_DSS_DSI_FMT_RGB888: | 4118 | case OMAP_DSS_DSI_FMT_RGB888: |
4117 | data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24; | 4119 | data_type = MIPI_DSI_PACKED_PIXEL_STREAM_24; |
4118 | break; | 4120 | break; |
@@ -4199,7 +4201,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev) | |||
4199 | 4201 | ||
4200 | dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP); | 4202 | dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP); |
4201 | 4203 | ||
4202 | bytespp = dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) / 8; | 4204 | bytespp = dsi_get_pixel_size(dsi->pix_fmt) / 8; |
4203 | bytespl = w * bytespp; | 4205 | bytespl = w * bytespp; |
4204 | bytespf = bytespl * h; | 4206 | bytespf = bytespl * h; |
4205 | 4207 | ||
@@ -4336,7 +4338,7 @@ int omap_dsi_update(struct omap_dss_device *dssdev, int channel, | |||
4336 | 4338 | ||
4337 | #ifdef DEBUG | 4339 | #ifdef DEBUG |
4338 | dsi->update_bytes = dw * dh * | 4340 | dsi->update_bytes = dw * dh * |
4339 | dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) / 8; | 4341 | dsi_get_pixel_size(dsi->pix_fmt) / 8; |
4340 | #endif | 4342 | #endif |
4341 | dsi_update_screen_dispc(dssdev); | 4343 | dsi_update_screen_dispc(dssdev); |
4342 | 4344 | ||
@@ -4420,7 +4422,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) | |||
4420 | 4422 | ||
4421 | dsi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS; | 4423 | dsi->mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS; |
4422 | dsi->mgr_config.video_port_width = | 4424 | dsi->mgr_config.video_port_width = |
4423 | dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt); | 4425 | dsi_get_pixel_size(dsi->pix_fmt); |
4424 | dsi->mgr_config.lcden_sig_polarity = 0; | 4426 | dsi->mgr_config.lcden_sig_polarity = 0; |
4425 | 4427 | ||
4426 | dss_mgr_set_lcd_config(dssdev->manager, &dsi->mgr_config); | 4428 | dss_mgr_set_lcd_config(dssdev->manager, &dsi->mgr_config); |
@@ -4679,6 +4681,20 @@ void omapdss_dsi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h) | |||
4679 | } | 4681 | } |
4680 | EXPORT_SYMBOL(omapdss_dsi_set_size); | 4682 | EXPORT_SYMBOL(omapdss_dsi_set_size); |
4681 | 4683 | ||
4684 | void omapdss_dsi_set_pixel_format(struct omap_dss_device *dssdev, | ||
4685 | enum omap_dss_dsi_pixel_format fmt) | ||
4686 | { | ||
4687 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | ||
4688 | struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); | ||
4689 | |||
4690 | mutex_lock(&dsi->lock); | ||
4691 | |||
4692 | dsi->pix_fmt = fmt; | ||
4693 | |||
4694 | mutex_unlock(&dsi->lock); | ||
4695 | } | ||
4696 | EXPORT_SYMBOL(omapdss_dsi_set_pixel_format); | ||
4697 | |||
4682 | static int __init dsi_init_display(struct omap_dss_device *dssdev) | 4698 | static int __init dsi_init_display(struct omap_dss_device *dssdev) |
4683 | { | 4699 | { |
4684 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); | 4700 | struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); |