提交 5476e74a 编写于 作者: T Tomi Valkeinen

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: NTomi Valkeinen <tomi.valkeinen@ti.com>
上级 8760db54
...@@ -1394,12 +1394,8 @@ static irqreturn_t taal_te_isr(int irq, void *data) ...@@ -1394,12 +1394,8 @@ static irqreturn_t taal_te_isr(int irq, void *data)
if (old) { if (old) {
cancel_delayed_work(&td->te_timeout_work); cancel_delayed_work(&td->te_timeout_work);
r = omap_dsi_update(dssdev, td->channel, r = omap_dsi_update(dssdev, td->channel, taal_framedone_cb,
td->update_region.x, dssdev);
td->update_region.y,
td->update_region.w,
td->update_region.h,
taal_framedone_cb, dssdev);
if (r) if (r)
goto err; goto err;
} }
...@@ -1444,10 +1440,6 @@ static int taal_update(struct omap_dss_device *dssdev, ...@@ -1444,10 +1440,6 @@ static int taal_update(struct omap_dss_device *dssdev,
goto err; goto err;
} }
r = omap_dsi_prepare_update(dssdev, &x, &y, &w, &h, true);
if (r)
goto err;
r = taal_set_update_window(td, x, y, w, h); r = taal_set_update_window(td, x, y, w, h);
if (r) if (r)
goto err; goto err;
...@@ -1462,8 +1454,8 @@ static int taal_update(struct omap_dss_device *dssdev, ...@@ -1462,8 +1454,8 @@ static int taal_update(struct omap_dss_device *dssdev,
msecs_to_jiffies(250)); msecs_to_jiffies(250));
atomic_set(&td->do_update, 1); atomic_set(&td->do_update, 1);
} else { } else {
r = omap_dsi_update(dssdev, td->channel, x, y, w, h, r = omap_dsi_update(dssdev, td->channel, taal_framedone_cb,
taal_framedone_cb, dssdev); dssdev);
if (r) if (r)
goto err; goto err;
} }
......
...@@ -238,11 +238,6 @@ enum dsi_vc_source { ...@@ -238,11 +238,6 @@ enum dsi_vc_source {
DSI_VC_SOURCE_VP, DSI_VC_SOURCE_VP,
}; };
struct dsi_update_region {
u16 x, y, w, h;
struct omap_dss_device *device;
};
struct dsi_irq_stats { struct dsi_irq_stats {
unsigned long last_reset; unsigned long last_reset;
unsigned irq_count; unsigned irq_count;
...@@ -292,7 +287,9 @@ struct dsi_data { ...@@ -292,7 +287,9 @@ struct dsi_data {
struct dsi_isr_tables isr_tables_copy; struct dsi_isr_tables isr_tables_copy;
int update_channel; int update_channel;
struct dsi_update_region update_region; #ifdef DEBUG
unsigned update_bytes;
#endif
bool te_enabled; bool te_enabled;
bool ulps_enabled; bool ulps_enabled;
...@@ -474,7 +471,6 @@ static void dsi_perf_mark_start(struct platform_device *dsidev) ...@@ -474,7 +471,6 @@ static void dsi_perf_mark_start(struct platform_device *dsidev)
static void dsi_perf_show(struct platform_device *dsidev, const char *name) static void dsi_perf_show(struct platform_device *dsidev, const char *name)
{ {
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
struct omap_dss_device *dssdev = dsi->update_region.device;
ktime_t t, setup_time, trans_time; ktime_t t, setup_time, trans_time;
u32 total_bytes; u32 total_bytes;
u32 setup_us, trans_us, total_us; u32 setup_us, trans_us, total_us;
...@@ -496,9 +492,7 @@ static void dsi_perf_show(struct platform_device *dsidev, const char *name) ...@@ -496,9 +492,7 @@ static void dsi_perf_show(struct platform_device *dsidev, const char *name)
total_us = setup_us + trans_us; total_us = setup_us + trans_us;
total_bytes = dsi->update_region.w * total_bytes = dsi->update_bytes;
dsi->update_region.h *
dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) / 8;
printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), " printk(KERN_INFO "DSI(%s): %u us + %u us = %u us (%uHz), "
"%u bytes, %u kbytes/sec\n", "%u bytes, %u kbytes/sec\n",
...@@ -4040,7 +4034,7 @@ void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel) ...@@ -4040,7 +4034,7 @@ void dsi_video_mode_disable(struct omap_dss_device *dssdev, int channel)
EXPORT_SYMBOL(dsi_video_mode_disable); EXPORT_SYMBOL(dsi_video_mode_disable);
static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
u16 x, u16 y, u16 w, u16 h) u16 w, u16 h)
{ {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 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,8 +4049,7 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
const unsigned channel = dsi->update_channel; const unsigned channel = dsi->update_channel;
const unsigned line_buf_size = dsi_get_line_buf_size(dsidev); const unsigned line_buf_size = dsi_get_line_buf_size(dsidev);
DSSDBG("dsi_update_screen_dispc(%d,%d %dx%d)\n", DSSDBG("dsi_update_screen_dispc(%dx%d)\n", w, h);
x, y, w, h);
dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP); dsi_vc_config_source(dsidev, channel, DSI_VC_SOURCE_VP);
...@@ -4180,64 +4173,27 @@ static void dsi_framedone_irq_callback(void *data, u32 mask) ...@@ -4180,64 +4173,27 @@ static void dsi_framedone_irq_callback(void *data, u32 mask)
#endif #endif
} }
int omap_dsi_prepare_update(struct omap_dss_device *dssdev, int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
u16 *x, u16 *y, u16 *w, u16 *h, void (*callback)(int, void *), void *data)
bool enlarge_update_area)
{ {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
u16 dw, dh; u16 dw, dh;
dssdev->driver->get_resolution(dssdev, &dw, &dh);
if (*x > dw || *y > dh)
return -EINVAL;
if (*x + *w > dw)
return -EINVAL;
if (*y + *h > dh)
return -EINVAL;
if (*w == 1)
return -EINVAL;
if (*w == 0 || *h == 0)
return -EINVAL;
dsi_perf_mark_setup(dsidev); dsi_perf_mark_setup(dsidev);
dispc_mgr_set_lcd_size(dssdev->manager->id, *w, *h);
return 0;
}
EXPORT_SYMBOL(omap_dsi_prepare_update);
int omap_dsi_update(struct omap_dss_device *dssdev,
int channel,
u16 x, u16 y, u16 w, u16 h,
void (*callback)(int, void *), void *data)
{
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
dsi->update_channel = channel; dsi->update_channel = channel;
/* OMAP DSS cannot send updates of odd widths.
* omap_dsi_prepare_update() makes the widths even, but add a BUG_ON
* here to make sure we catch erroneous updates. Otherwise we'll only
* see rather obscure HW error happening, as DSS halts. */
BUG_ON(x % 2 == 1);
dsi->framedone_callback = callback; dsi->framedone_callback = callback;
dsi->framedone_data = data; dsi->framedone_data = data;
dsi->update_region.x = x; dssdev->driver->get_resolution(dssdev, &dw, &dh);
dsi->update_region.y = y;
dsi->update_region.w = w;
dsi->update_region.h = h;
dsi->update_region.device = dssdev;
dsi_update_screen_dispc(dssdev, x, y, w, h); #ifdef DEBUG
dsi->update_bytes = dw * dh *
dsi_get_pixel_size(dssdev->panel.dsi_pix_fmt) / 8;
#endif
dsi_update_screen_dispc(dssdev, dw, dh);
return 0; return 0;
} }
...@@ -4250,6 +4206,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) ...@@ -4250,6 +4206,7 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
int r; int r;
if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) { if (dssdev->panel.dsi_mode == OMAP_DSS_DSI_CMD_MODE) {
u16 dw, dh;
u32 irq; u32 irq;
struct omap_video_timings timings = { struct omap_video_timings timings = {
.hsw = 1, .hsw = 1,
...@@ -4260,6 +4217,10 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev) ...@@ -4260,6 +4217,10 @@ static int dsi_display_init_dispc(struct omap_dss_device *dssdev)
.vbp = 0, .vbp = 0,
}; };
dssdev->driver->get_resolution(dssdev, &dw, &dh);
timings.x_res = dw;
timings.y_res = dh;
irq = dssdev->manager->id == OMAP_DSS_CHANNEL_LCD ? irq = dssdev->manager->id == OMAP_DSS_CHANNEL_LCD ?
DISPC_IRQ_FRAMEDONE : DISPC_IRQ_FRAMEDONE2; DISPC_IRQ_FRAMEDONE : DISPC_IRQ_FRAMEDONE2;
......
...@@ -662,12 +662,7 @@ void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, ...@@ -662,12 +662,7 @@ void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
bool enable); bool enable);
int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable); int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
int omap_dsi_prepare_update(struct omap_dss_device *dssdev, int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
u16 *x, u16 *y, u16 *w, u16 *h,
bool enlarge_update_area);
int omap_dsi_update(struct omap_dss_device *dssdev,
int channel,
u16 x, u16 y, u16 w, u16 h,
void (*callback)(int, void *), void *data); void (*callback)(int, void *), void *data);
int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel); int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id); int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册