gpu: ipu-v3: pre: add double buffer status readback
authorLucas Stach <l.stach@pengutronix.de>
Tue, 11 Sep 2018 13:20:34 +0000 (15:20 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 22 Feb 2019 10:58:45 +0000 (11:58 +0100)
This allows the upper layers to check if a double buffer update has
been applied by the PRE or is still pending.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[p.zabel@pengutronix.de: inverted logic: done -> pending]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/ipu-v3/ipu-pre.c
drivers/gpu/ipu-v3/ipu-prv.h

index 4a28f3fbb0a28c55630be20edbb8c2df4de74645..6cacfd61d984207084f04f579cf2fda38811a3ce 100644 (file)
@@ -265,6 +265,12 @@ void ipu_pre_update(struct ipu_pre *pre, unsigned int bufaddr)
        writel(IPU_PRE_CTRL_SDW_UPDATE, pre->regs + IPU_PRE_CTRL_SET);
 }
 
+bool ipu_pre_update_pending(struct ipu_pre *pre)
+{
+       return !!(readl_relaxed(pre->regs + IPU_PRE_CTRL) &
+                 IPU_PRE_CTRL_SDW_UPDATE);
+}
+
 u32 ipu_pre_get_baddr(struct ipu_pre *pre)
 {
        return (u32)pre->buffer_paddr;
index d6beee99b6b8c14a8bc31062656a62c2dd86354b..38622e835e95d4eaabd48dd501725237ba28e39a 100644 (file)
@@ -272,6 +272,7 @@ void ipu_pre_configure(struct ipu_pre *pre, unsigned int width,
                       unsigned int height, unsigned int stride, u32 format,
                       uint64_t modifier, unsigned int bufaddr);
 void ipu_pre_update(struct ipu_pre *pre, unsigned int bufaddr);
+bool ipu_pre_update_pending(struct ipu_pre *pre);
 
 struct ipu_prg *ipu_prg_lookup_by_phandle(struct device *dev, const char *name,
                                          int ipu_id);