diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-06-21 02:35:36 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-07-01 05:07:14 -0400 |
commit | 5ed8cf5b8e053832a3d0552e0a9681a3ff0325ee (patch) | |
tree | 7b344de5b36f8720cc03a762c28931b6126b212f /drivers/video/omap2/dss/dsi.c | |
parent | 15ffa1dac53820bb712851d329ba465f74b00f76 (diff) |
OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4
The DMA FIFO threshold registers and burst size registers have changed
for OMAP4. The current code only handles OMAP2/3 case, and so the
values are a bit off for OMAP4. A summary of the differences between
OMAP2/3 and OMAP4:
Burst size:
OMAP2/3: 4 x 32 bits / 8 x 32 bits / 16 x 32 bits
OMAP4: 2 x 128 bits / 4 x 128 bits / 8 x 128 bits
Threshold size:
OMAP2/3: in bytes (8 bit units)
OMAP4: in 128bit units
This patch fixes the issue by creating two new helper functions in
dss_features: dss_feat_get_buffer_size_unit() and
dss_feat_get_burst_size_unit(). These return (in bytes) the unit size
for threshold registers and unit size for burst size register,
respectively, and are used to calculate correct values.
For the threshold size the usage is straightforward. However, the burst
size register has different multipliers for OMAP2/3 and OMAP4. This
patch solves the problem by defining the multipliers for the burst size
as 2x, 4x and 8x, which fit fine for the OMAP4 burst size definition
(i.e. burst size unit for OMAP4 is 128bits), but requires a slight twist
on OMAP2/3 by defining the burst size unit as 64bit.
As the driver in practice always uses the maximum burst size, and no use
case currently exists where we would want to use a smaller burst size,
this patch changes the driver to hardcode the burst size when
initializing DISPC. This makes the threshold configuration code somewhat
simpler.
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.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index 2881399be931..795da7281110 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c | |||
@@ -4320,16 +4320,11 @@ int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable) | |||
4320 | EXPORT_SYMBOL(omapdss_dsi_enable_te); | 4320 | EXPORT_SYMBOL(omapdss_dsi_enable_te); |
4321 | 4321 | ||
4322 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, | 4322 | void dsi_get_overlay_fifo_thresholds(enum omap_plane plane, |
4323 | u32 fifo_size, enum omap_burst_size *burst_size, | 4323 | u32 fifo_size, u32 burst_size, |
4324 | u32 *fifo_low, u32 *fifo_high) | 4324 | u32 *fifo_low, u32 *fifo_high) |
4325 | { | 4325 | { |
4326 | unsigned burst_size_bytes; | 4326 | *fifo_high = fifo_size - burst_size; |
4327 | 4327 | *fifo_low = fifo_size - burst_size * 2; | |
4328 | *burst_size = OMAP_DSS_BURST_16x32; | ||
4329 | burst_size_bytes = 16 * 32 / 8; | ||
4330 | |||
4331 | *fifo_high = fifo_size - burst_size_bytes; | ||
4332 | *fifo_low = fifo_size - burst_size_bytes * 2; | ||
4333 | } | 4328 | } |
4334 | 4329 | ||
4335 | int dsi_init_display(struct omap_dss_device *dssdev) | 4330 | int dsi_init_display(struct omap_dss_device *dssdev) |