aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dsi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-11-03 10:34:20 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:23 -0500
commit5476e74a03f4be972708162050c8ac7fe150449f (patch)
tree99a047d31d579b2d514c32963da55ce972268cfa /drivers/video/omap2/dss/dsi.c
parent8760db5406fb7b92f900d6c98eea198695476467 (diff)
OMAPDSS: remove partial update from DSI
Partial update for manual update displays has never worked quite well: * The HW has limitations on the update area, and the x and width need to be even. * Showing a part of a scaled overlay causes artifacts. * Makes the management of dispc very complex Considering the above points and the fact that partial update is not used anywhere, this and the following patches remove the partial update support. This will greatly simplify the following re-write of the apply mechanism to get proper locking and additional features like fifo-merge. This patch removes the partial update from the dsi.c. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r--drivers/video/omap2/dss/dsi.c79
1 files changed, 20 insertions, 59 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 773a496a2d31..6fc82a4a14c0 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -238,11 +238,6 @@ enum dsi_vc_source {
238 DSI_VC_SOURCE_VP, 238 DSI_VC_SOURCE_VP,
239}; 239};
240 240
241struct dsi_update_region {
242 u16 x, y, w, h;
243 struct omap_dss_device *device;
244};
245
246struct dsi_irq_stats { 241struct dsi_irq_stats {
247 unsigned long last_reset; 242 unsigned long last_reset;
248 unsigned irq_count; 243 unsigned irq_count;
@@ -292,7 +287,9 @@ struct dsi_data {
292 struct dsi_isr_tables isr_tables_copy; 287 struct dsi_isr_tables isr_tables_copy;
293 288
294 int update_channel; 289 int update_channel;
295 struct dsi_update_region update_region; 290#ifdef DEBUG
291 unsigned update_bytes;
292#endif
296 293
297 bool te_enabled; 294 bool te_enabled;
298 bool ulps_enabled; 295 bool ulps_enabled;
@@ -474,7 +471,6 @@ static void dsi_perf_mark_start(struct platform_device *dsidev)
474static void dsi_perf_show(struct platform_device *dsidev, const char *name) 471static void dsi_perf_show(struct platform_device *dsidev, const char *name)
475{ 472{
476 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 473 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
477 struct omap_dss_device *dssdev = dsi->update_region.device;
478 ktime_t t, setup_time, trans_time; 474 ktime_t t, setup_time, trans_time;
479 u32 total_bytes; 475 u32 total_bytes;
480 u32 setup_us, trans_us, total_us; 476 u32 setup_us, trans_us, total_us;
@@ -496,9 +492,7 @@ static void dsi_perf_show(struct platform_device *dsidev, const char *name)
496 492
497 total_us = setup_us + trans_us; 493 total_us = setup_us + trans_us;
498 494
499 total_bytes = dsi->update_region.w * 495 total_bytes = dsi->update_bytes;
500 dsi->update_region.h *
501 dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) / 8;
502 496
503 printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), " 497 printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), "
504 "%u bytes, %u kbytes/sec\n", 498 "%u bytes, %u kbytes/sec\n",
@@ -4040,7 +4034,7 @@ void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel)
4040EXPORT_SYMBOL(dsi_video_mode_disable); 4034EXPORT_SYMBOL(dsi_video_mode_disable);
4041 4035
4042static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, 4036static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
4043 u16 x, u16 y, u16 w, u16 h) 4037 u16 w, u16 h)
4044{ 4038{
4045 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4039 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4046 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4040 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -4055,8 +4049,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
4055 const unsigned channel = dsi->update_channel; 4049 const unsigned channel = dsi->update_channel;
4056 const unsigned line_buf_size = dsi_get_line_buf_size(dsidev); 4050 const unsigned line_buf_size = dsi_get_line_buf_size(dsidev);
4057 4051
4058 DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", 4052 DSSDBG("dsi_update_screen_dispc(%dx%d)\n", w, h);
4059 x, y, w, h);
4060 4053
4061 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP); 4054 dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP);
4062 4055
@@ -4180,64 +4173,27 @@ static void dsi_framedone_irq_callback(void *data, u32 mask)
4180#endif 4173#endif
4181} 4174}
4182 4175
4183int omap_dsi_prepare_update(struct omap_dss_device *dssdev, 4176int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
4184 u16 *x, u16 *y, u16 *w, u16 *h, 4177 void (*callback)(int, void *), void *data)
4185 bool enlarge_update_area)
4186{ 4178{
4187 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 4179 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4180 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4188 u16 dw, dh; 4181 u16 dw, dh;
4189 4182
4190 dssdev->driver->get_resolution(dssdev, &dw, &dh);
4191
4192 if (*x > dw || *y > dh)
4193 return -EINVAL;
4194
4195 if (*x + *w > dw)
4196 return -EINVAL;
4197
4198 if (*y + *h > dh)
4199 return -EINVAL;
4200
4201 if (*w == 1)
4202 return -EINVAL;
4203
4204 if (*w == 0 || *h == 0)
4205 return -EINVAL;
4206
4207 dsi_perf_mark_setup(dsidev); 4183 dsi_perf_mark_setup(dsidev);
4208 4184
4209 dispc_mgr_set_lcd_size(dssdev->manager->id, *w, *h);
4210
4211 return 0;
4212}
4213EXPORT_SYMBOL(omap_dsi_prepare_update);
4214
4215int omap_dsi_update(struct omap_dss_device *dssdev,
4216 int channel,
4217 u16 x, u16 y, u16 w, u16 h,
4218 void (*callback)(int, void *), void *data)
4219{
4220 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
4221 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4222
4223 dsi->update_channel = channel; 4185 dsi->update_channel = channel;
4224 4186
4225 /* OMAP DSS cannot send updates of odd widths.
4226 * omap_dsi_prepare_update() makes the widths even, but add a BUG_ON
4227 * here to make sure we catch erroneous updates. Otherwise we'll only
4228 * see rather obscure HW error happening, as DSS halts. */
4229 BUG_ON(x % 2 == 1);
4230
4231 dsi->framedone_callback = callback; 4187 dsi->framedone_callback = callback;
4232 dsi->framedone_data = data; 4188 dsi->framedone_data = data;
4233 4189
4234 dsi->update_region.x = x; 4190 dssdev->driver->get_resolution(dssdev, &dw, &dh);
4235 dsi->update_region.y = y;
4236 dsi->update_region.w = w;
4237 dsi->update_region.h = h;
4238 dsi->update_region.device = dssdev;
4239 4191
4240 dsi_update_screen_dispc(dssdev, x, y, w, h); 4192#ifdef DEBUG
4193 dsi->update_bytes = dw * dh *
4194 dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) / 8;
4195#endif
4196 dsi_update_screen_dispc(dssdev, dw, dh);
4241 4197
4242 return 0; 4198 return 0;
4243} 4199}
@@ -4250,6 +4206,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
4250 int r; 4206 int r;
4251 4207
4252 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) { 4208 if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) {
4209 u16 dw, dh;
4253 u32 irq; 4210 u32 irq;
4254 struct omap_video_timings timings = { 4211 struct omap_video_timings timings = {
4255 .hsw = 1, 4212 .hsw = 1,
@@ -4260,6 +4217,10 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
4260 .vbp = 0, 4217 .vbp = 0,
4261 }; 4218 };
4262 4219
4220 dssdev->driver->get_resolution(dssdev, &dw, &dh);
4221 timings.x_res = dw;
4222 timings.y_res = dh;
4223
4263 irq = dssdev->manager->id == OMAP_DSS_CHANNEL_LCD ? 4224 irq = dssdev->manager->id == OMAP_DSS_CHANNEL_LCD ?
4264 DISPC_IRQ_FRAMEDONE : DISPC_IRQ_FRAMEDONE2; 4225 DISPC_IRQ_FRAMEDONE : DISPC_IRQ_FRAMEDONE2;
4265 4226