Message ID | 20180914165917.8464-2-l.stach@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/4] gpu: ipu-v3: pre: add double buffer status readback | expand |
On Fri, 2018-09-14 at 18:59 +0200, Lucas Stach wrote: > This allows channels using the PRG to check if a requested configuration > update has been applied or is still pending. > > Signed-off-by: Lucas Stach <l.stach@pengutronix.de> > --- > drivers/gpu/ipu-v3/ipu-prg.c | 16 ++++++++++++++++ > include/video/imx-ipu-v3.h | 1 + > 2 files changed, 17 insertions(+) > > diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c > index 38a3a9764e49..f78463cf1c15 100644 > --- a/drivers/gpu/ipu-v3/ipu-prg.c > +++ b/drivers/gpu/ipu-v3/ipu-prg.c > @@ -347,6 +347,22 @@ int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, > } > EXPORT_SYMBOL_GPL(ipu_prg_channel_configure); > > +int ipu_prg_channel_configure_done(struct ipuv3_channel *ipu_chan) Same as patch 1, I'd prefer ipu_prg_channel_configure_pending instead. Also the return value is only ever used as a boolean, so just make this return bool. > +{ > + int prg_chan = ipu_prg_ipu_to_prg_chan(ipu_chan->num); > + struct ipu_prg *prg = ipu_chan->ipu->prg_priv; > + struct ipu_prg_channel *chan; > + > + if (prg_chan < 0) > + return -EINVAL; Since nonexisting channels can't have updates pending, let's just return false here. regards Philipp
diff --git a/drivers/gpu/ipu-v3/ipu-prg.c b/drivers/gpu/ipu-v3/ipu-prg.c index 38a3a9764e49..f78463cf1c15 100644 --- a/drivers/gpu/ipu-v3/ipu-prg.c +++ b/drivers/gpu/ipu-v3/ipu-prg.c @@ -347,6 +347,22 @@ int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, } EXPORT_SYMBOL_GPL(ipu_prg_channel_configure); +int ipu_prg_channel_configure_done(struct ipuv3_channel *ipu_chan) +{ + int prg_chan = ipu_prg_ipu_to_prg_chan(ipu_chan->num); + struct ipu_prg *prg = ipu_chan->ipu->prg_priv; + struct ipu_prg_channel *chan; + + if (prg_chan < 0) + return -EINVAL; + + chan = &prg->chan[prg_chan]; + WARN_ON(!chan->enabled); + + return ipu_pre_update_done(prg->pres[chan->used_pre]); +} +EXPORT_SYMBOL_GPL(ipu_prg_channel_configure_done); + static int ipu_prg_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index abbad94e14a1..45802eab1084 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -345,6 +345,7 @@ int ipu_prg_channel_configure(struct ipuv3_channel *ipu_chan, unsigned int axi_id, unsigned int width, unsigned int height, unsigned int stride, u32 format, uint64_t modifier, unsigned long *eba); +int ipu_prg_channel_configure_done(struct ipuv3_channel *ipu_chan); /* * IPU CMOS Sensor Interface (csi) functions
This allows channels using the PRG to check if a requested configuration update has been applied or is still pending. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> --- drivers/gpu/ipu-v3/ipu-prg.c | 16 ++++++++++++++++ include/video/imx-ipu-v3.h | 1 + 2 files changed, 17 insertions(+)