All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: ipu-v3: Allow negative offsets for interlaced scanning
@ 2018-06-01 13:13 Philipp Zabel
  2018-06-11  0:08 ` Steve Longerbeam
  0 siblings, 1 reply; 13+ messages in thread
From: Philipp Zabel @ 2018-06-01 13:13 UTC (permalink / raw)
  To: linux-media
  Cc: Steve Longerbeam, Krzysztof Hałasa, kernel, Philipp Zabel

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>
---
 drivers/gpu/ipu-v3/ipu-cpmem.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c
index 9f2d9ec42add..c1028f38c553 100644
--- a/drivers/gpu/ipu-v3/ipu-cpmem.c
+++ b/drivers/gpu/ipu-v3/ipu-cpmem.c
@@ -269,8 +269,14 @@ EXPORT_SYMBOL_GPL(ipu_cpmem_set_uv_offset);
 
 void ipu_cpmem_interlaced_scan(struct ipuv3_channel *ch, int stride)
 {
+	u32 ilo;
+
 	ipu_ch_param_write_field(ch, IPU_FIELD_SO, 1);
-	ipu_ch_param_write_field(ch, IPU_FIELD_ILO, stride / 8);
+	if (stride >= 0)
+		ilo = stride / 8;
+	else
+		ilo = 0x100000 - (-stride / 8);
+	ipu_ch_param_write_field(ch, IPU_FIELD_ILO, ilo);
 	ipu_ch_param_write_field(ch, IPU_FIELD_SLY, (stride * 2) - 1);
 };
 EXPORT_SYMBOL_GPL(ipu_cpmem_interlaced_scan);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-06-21  4:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-01 13:13 [PATCH] gpu: ipu-v3: Allow negative offsets for interlaced scanning Philipp Zabel
2018-06-11  0:08 ` Steve Longerbeam
2018-06-11  9:19   ` Philipp Zabel
2018-06-11 21:06     ` Steve Longerbeam
2018-06-12 16:43       ` Philipp Zabel
2018-06-12 17:27       ` Javier Martinez Canillas
2018-06-12 17:31         ` Steve Longerbeam
2018-06-14  9:39           ` Krzysztof Hałasa
2018-06-14 16:26             ` Steve Longerbeam
2018-06-15  8:33               ` Krzysztof Hałasa
2018-06-20  1:30                 ` Steve Longerbeam
2018-06-20  8:54                   ` Philipp Zabel
2018-06-21  4:30                     ` Steve Longerbeam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.