diff options
| author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-01 08:58:51 -0500 |
|---|---|---|
| committer | Vinod Koul <vinod.koul@linux.intel.com> | 2011-12-08 02:29:03 -0500 |
| commit | c99e78435342a65a6a0bf9b86f87fd05831858d2 (patch) | |
| tree | b9aa68bc64326a819e0550c85bb4483a90b81b43 /drivers/dma/ipu | |
| parent | 5cd326fd27da347925019fcc041b79bad8dd55ed (diff) | |
i.MX IPU DMA: Fix wrong burstsize settings
The burstsize (npb in struct chan_param_mem) is set in
ipu_ch_param_set_size() once. The number of allowed
pixels in a burst depend on the pixel format and the
rotation mode. For 16bit formats 16 pixels are allowed
whereas for 32bit formats only 8 pixels are allowed.
Set these values correctly in ipu_ch_param_set_size()
and do not overwrite them afterwards.
We do not support rotation right now, so ignore this
case.
This patch fixes the wrong burstsize setting of 16 pixels
for 32bpp.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/ipu')
| -rw-r--r-- | drivers/dma/ipu/ipu_idmac.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index e16e280b26eb..6212b16e8cf2 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
| @@ -312,7 +312,7 @@ static void ipu_ch_param_set_size(union chan_param_mem *params, | |||
| 312 | case IPU_PIX_FMT_RGB565: | 312 | case IPU_PIX_FMT_RGB565: |
| 313 | params->ip.bpp = 2; | 313 | params->ip.bpp = 2; |
| 314 | params->ip.pfs = 4; | 314 | params->ip.pfs = 4; |
| 315 | params->ip.npb = 7; | 315 | params->ip.npb = 15; |
| 316 | params->ip.sat = 2; /* SAT = 32-bit access */ | 316 | params->ip.sat = 2; /* SAT = 32-bit access */ |
| 317 | params->ip.ofs0 = 0; /* Red bit offset */ | 317 | params->ip.ofs0 = 0; /* Red bit offset */ |
| 318 | params->ip.ofs1 = 5; /* Green bit offset */ | 318 | params->ip.ofs1 = 5; /* Green bit offset */ |
| @@ -422,12 +422,6 @@ static void ipu_ch_param_set_size(union chan_param_mem *params, | |||
| 422 | params->pp.nsb = 1; | 422 | params->pp.nsb = 1; |
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | static void ipu_ch_param_set_burst_size(union chan_param_mem *params, | ||
| 426 | uint16_t burst_pixels) | ||
| 427 | { | ||
| 428 | params->pp.npb = burst_pixels - 1; | ||
| 429 | } | ||
| 430 | |||
| 431 | static void ipu_ch_param_set_buffer(union chan_param_mem *params, | 425 | static void ipu_ch_param_set_buffer(union chan_param_mem *params, |
| 432 | dma_addr_t buf0, dma_addr_t buf1) | 426 | dma_addr_t buf0, dma_addr_t buf1) |
| 433 | { | 427 | { |
| @@ -690,23 +684,6 @@ static int ipu_init_channel_buffer(struct idmac_channel *ichan, | |||
| 690 | ipu_ch_param_set_size(¶ms, pixel_fmt, width, height, stride_bytes); | 684 | ipu_ch_param_set_size(¶ms, pixel_fmt, width, height, stride_bytes); |
| 691 | ipu_ch_param_set_buffer(¶ms, phyaddr_0, phyaddr_1); | 685 | ipu_ch_param_set_buffer(¶ms, phyaddr_0, phyaddr_1); |
| 692 | ipu_ch_param_set_rotation(¶ms, rot_mode); | 686 | ipu_ch_param_set_rotation(¶ms, rot_mode); |
| 693 | /* Some channels (rotation) have restriction on burst length */ | ||
| 694 | switch (channel) { | ||
| 695 | case IDMAC_IC_7: /* Hangs with burst 8, 16, other values | ||
| 696 | invalid - Table 44-30 */ | ||
| 697 | /* | ||
| 698 | ipu_ch_param_set_burst_size(¶ms, 8); | ||
| 699 | */ | ||
| 700 | break; | ||
| 701 | case IDMAC_SDC_0: | ||
| 702 | case IDMAC_SDC_1: | ||
| 703 | /* In original code only IPU_PIX_FMT_RGB565 was setting burst */ | ||
| 704 | ipu_ch_param_set_burst_size(¶ms, 16); | ||
| 705 | break; | ||
| 706 | case IDMAC_IC_0: | ||
| 707 | default: | ||
| 708 | break; | ||
| 709 | } | ||
| 710 | 687 | ||
| 711 | spin_lock_irqsave(&ipu->lock, flags); | 688 | spin_lock_irqsave(&ipu->lock, flags); |
| 712 | 689 | ||
