diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2018-06-01 16:13:16 +0300 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2018-07-16 17:56:37 +0300 |
commit | 4e3c5d7e05be6c9c6de4f4da9116511428924997 (patch) | |
tree | b9b9f15ca39a918644880141a85ee125ff18fd2c /drivers/gpu | |
parent | 1e6a1495c66947b289de9ba92b569b62ce68a979 (diff) | |
download | linux-4e3c5d7e05be6c9c6de4f4da9116511428924997.tar.xz |
gpu: ipu-v3: Allow negative offsets for interlaced scanning
The IPU also supports interlaced buffers that start with the bottom field.
To achieve this, the the base address EBA has to be increased by a stride
length and the interlace offset ILO has to be set to the negative stride.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-cpmem.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c index 9f2d9ec42add..125721a7f8b6 100644 --- a/drivers/gpu/ipu-v3/ipu-cpmem.c +++ b/drivers/gpu/ipu-v3/ipu-cpmem.c @@ -269,9 +269,20 @@ EXPORT_SYMBOL_GPL(ipu_cpmem_set_uv_offset); void ipu_cpmem_interlaced_scan(struct ipuv3_channel *ch, int stride) { + u32 ilo, sly; + + if (stride < 0) { + stride = -stride; + ilo = 0x100000 - (stride / 8); + } else { + ilo = stride / 8; + } + + sly = (stride * 2) - 1; + ipu_ch_param_write_field(ch, IPU_FIELD_SO, 1); - ipu_ch_param_write_field(ch, IPU_FIELD_ILO, stride / 8); - ipu_ch_param_write_field(ch, IPU_FIELD_SLY, (stride * 2) - 1); + ipu_ch_param_write_field(ch, IPU_FIELD_ILO, ilo); + ipu_ch_param_write_field(ch, IPU_FIELD_SLY, sly); }; EXPORT_SYMBOL_GPL(ipu_cpmem_interlaced_scan); |