diff options
author | Steve Longerbeam <slongerbeam@gmail.com> | 2016-09-17 22:33:58 +0300 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-09-19 09:30:27 +0300 |
commit | cd98e85a6b786da83e0b120b53a182d100c19c9b (patch) | |
tree | 7da1962a7b18ce2b444553cd721de0724bbb51ae /drivers/gpu/ipu-v3/ipu-prv.h | |
parent | 8b9c3d5099b265892ab3578bc757d9b81e5655a6 (diff) | |
download | linux-cd98e85a6b786da83e0b120b53a182d100c19c9b.tar.xz |
gpu: ipu-v3: Add queued image conversion support
This patch implements image conversion support using the IC tasks, with
tiling to support scaling to and from images up to 4096x4096. Image
rotation is also supported. Image conversion requests are added to
a run queue under the IC tasks.
The internal API is subsystem agnostic (no V4L2 dependency except
for the use of V4L2 fourcc pixel formats).
Callers prepare for image conversion by calling
ipu_image_convert_prepare(), which initializes the parameters of
the conversion. The caller passes in the ipu and IC task to use for
the conversion, the input and output image formats, a rotation mode,
and a completion callback and completion context pointer:
struct ipu_image_converter_ctx *
ipu_image_convert_prepare(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
struct ipu_image *in, struct ipu_image *out,
enum ipu_rotate_mode rot_mode,
ipu_image_converter_cb_t complete,
void *complete_context);
A new conversion context is created that is added to an IC task
context queue. The caller is given the new conversion context,
which can then be passed to the further APIs:
int ipu_image_convert_queue(struct ipu_image_converter_run *run);
This queues the given image conversion request run to a run queue,
and starts the conversion immediately if the run queue is empty. Only
the physaddr's of the input and output image buffers are needed,
since the conversion context was created previously with
ipu_image_convert_prepare(). When the conversion completes, the run
pointer is returned to the completion callback.
void ipu_image_convert_abort(struct ipu_image_converter_ctx *ctx);
This will abort any active or pending conversions for this context.
Any currently active or pending runs belonging to this context are
returned via the completion callback with an error status.
void ipu_image_convert_unprepare(struct ipu_image_converter_ctx *ctx);
Unprepares the conversion context. Any active or pending runs will
be aborted by calling ipu_image_convert_abort().
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/ipu-v3/ipu-prv.h')
-rw-r--r-- | drivers/gpu/ipu-v3/ipu-prv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h index dca2c3af1b8a..22e47b68b14a 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -166,6 +166,7 @@ struct ipu_dmfc_priv; struct ipu_di; struct ipu_ic_priv; struct ipu_vdi; +struct ipu_image_convert_priv; struct ipu_smfc_priv; struct ipu_devtype; @@ -199,6 +200,7 @@ struct ipu_soc { struct ipu_csi *csi_priv[2]; struct ipu_ic_priv *ic_priv; struct ipu_vdi *vdi_priv; + struct ipu_image_convert_priv *image_convert_priv; struct ipu_smfc_priv *smfc_priv; }; @@ -233,6 +235,9 @@ int ipu_vdi_init(struct ipu_soc *ipu, struct device *dev, unsigned long base, u32 module); void ipu_vdi_exit(struct ipu_soc *ipu); +int ipu_image_convert_init(struct ipu_soc *ipu, struct device *dev); +void ipu_image_convert_exit(struct ipu_soc *ipu); + int ipu_di_init(struct ipu_soc *ipu, struct device *dev, int id, unsigned long base, u32 module, struct clk *ipu_clk); void ipu_di_exit(struct ipu_soc *ipu, int id); |