#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/math.h>
#include <video/imx-ipu-image-convert.h>
#include "ipu-prv.h"
#define MAX_STRIPES_W …
#define MAX_STRIPES_H …
#define MAX_TILES …
#define MIN_W …
#define MIN_H …
#define MAX_W …
#define MAX_H …
enum ipu_image_convert_type { … };
struct ipu_image_convert_dma_buf { … };
struct ipu_image_convert_dma_chan { … };
struct ipu_image_tile { … };
struct ipu_image_convert_image { … };
struct ipu_image_pixfmt { … };
struct ipu_image_convert_ctx;
struct ipu_image_convert_chan;
struct ipu_image_convert_priv;
enum eof_irq_mask { … };
#define EOF_IRQ_COMPLETE …
#define EOF_IRQ_ROT_COMPLETE …
struct ipu_image_convert_ctx { … };
struct ipu_image_convert_chan { … };
struct ipu_image_convert_priv { … };
static const struct ipu_image_convert_dma_chan
image_convert_dma_chan[IC_NUM_TASKS] = …;
static const struct ipu_image_pixfmt image_convert_formats[] = …;
static const struct ipu_image_pixfmt *get_format(u32 fourcc)
{ … }
static void dump_format(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *ic_image)
{ … }
int ipu_image_convert_enum_format(int index, u32 *fourcc)
{ … }
EXPORT_SYMBOL_GPL(…);
static void free_dma_buf(struct ipu_image_convert_priv *priv,
struct ipu_image_convert_dma_buf *buf)
{ … }
static int alloc_dma_buf(struct ipu_image_convert_priv *priv,
struct ipu_image_convert_dma_buf *buf,
int size)
{ … }
static inline int num_stripes(int dim)
{ … }
static int calc_image_resize_coefficients(struct ipu_image_convert_ctx *ctx,
struct ipu_image *in,
struct ipu_image *out)
{ … }
#define round_closest(x, y) …
static void find_best_seam(struct ipu_image_convert_ctx *ctx,
unsigned int index,
unsigned int in_edge,
unsigned int out_edge,
unsigned int in_align,
unsigned int out_align,
unsigned int in_burst,
unsigned int out_burst,
unsigned int downsize_coeff,
unsigned int resize_coeff,
u32 *_in_seam,
u32 *_out_seam)
{ … }
static inline u32 tile_left_align(const struct ipu_image_pixfmt *fmt)
{ … }
static inline u32 tile_top_align(const struct ipu_image_pixfmt *fmt)
{ … }
static inline u32 tile_width_align(enum ipu_image_convert_type type,
const struct ipu_image_pixfmt *fmt,
enum ipu_rotate_mode rot_mode)
{ … }
static inline u32 tile_height_align(enum ipu_image_convert_type type,
const struct ipu_image_pixfmt *fmt,
enum ipu_rotate_mode rot_mode)
{ … }
static void fill_tile_column(struct ipu_image_convert_ctx *ctx,
unsigned int col,
struct ipu_image_convert_image *in,
unsigned int in_left, unsigned int in_width,
struct ipu_image_convert_image *out,
unsigned int out_left, unsigned int out_width)
{ … }
static void fill_tile_row(struct ipu_image_convert_ctx *ctx, unsigned int row,
struct ipu_image_convert_image *in,
unsigned int in_top, unsigned int in_height,
struct ipu_image_convert_image *out,
unsigned int out_top, unsigned int out_height)
{ … }
static void find_seams(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *in,
struct ipu_image_convert_image *out)
{ … }
static int calc_tile_dimensions(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *image)
{ … }
static int transform_tile_index(struct ipu_image_convert_ctx *ctx,
int src_row, int src_col)
{ … }
static void calc_out_tile_map(struct ipu_image_convert_ctx *ctx)
{ … }
static int calc_tile_offsets_planar(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *image)
{ … }
static int calc_tile_offsets_packed(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *image)
{ … }
static int calc_tile_offsets(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *image)
{ … }
static u32 calc_resize_coeff(u32 input_size, u32 downsize_coeff,
u32 output_size, bool allow_overshoot)
{ … }
static void calc_tile_resize_coefficients(struct ipu_image_convert_ctx *ctx)
{ … }
static int get_run_count(struct ipu_image_convert_ctx *ctx,
struct list_head *q)
{ … }
static void convert_stop(struct ipu_image_convert_run *run)
{ … }
static void init_idmac_channel(struct ipu_image_convert_ctx *ctx,
struct ipuv3_channel *channel,
struct ipu_image_convert_image *image,
enum ipu_rotate_mode rot_mode,
bool rot_swap_width_height,
unsigned int tile)
{ … }
static int convert_start(struct ipu_image_convert_run *run, unsigned int tile)
{ … }
static int do_run(struct ipu_image_convert_run *run)
{ … }
static void run_next(struct ipu_image_convert_chan *chan)
{ … }
static void empty_done_q(struct ipu_image_convert_chan *chan)
{ … }
static irqreturn_t do_bh(int irq, void *dev_id)
{ … }
static bool ic_settings_changed(struct ipu_image_convert_ctx *ctx)
{ … }
static irqreturn_t do_tile_complete(struct ipu_image_convert_run *run)
{ … }
static irqreturn_t eof_irq(int irq, void *data)
{ … }
static void force_abort(struct ipu_image_convert_ctx *ctx)
{ … }
static void release_ipu_resources(struct ipu_image_convert_chan *chan)
{ … }
static int get_eof_irq(struct ipu_image_convert_chan *chan,
struct ipuv3_channel *channel)
{ … }
static int get_ipu_resources(struct ipu_image_convert_chan *chan)
{ … }
static int fill_image(struct ipu_image_convert_ctx *ctx,
struct ipu_image_convert_image *ic_image,
struct ipu_image *image,
enum ipu_image_convert_type type)
{ … }
static unsigned int clamp_align(unsigned int x, unsigned int min,
unsigned int max, unsigned int align)
{ … }
void ipu_image_convert_adjust(struct ipu_image *in, struct ipu_image *out,
enum ipu_rotate_mode rot_mode)
{ … }
EXPORT_SYMBOL_GPL(…);
int ipu_image_convert_verify(struct ipu_image *in, struct ipu_image *out,
enum ipu_rotate_mode rot_mode)
{ … }
EXPORT_SYMBOL_GPL(…);
struct ipu_image_convert_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_convert_cb_t complete,
void *complete_context)
{ … }
EXPORT_SYMBOL_GPL(…);
int ipu_image_convert_queue(struct ipu_image_convert_run *run)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __ipu_image_convert_abort(struct ipu_image_convert_ctx *ctx)
{ … }
void ipu_image_convert_abort(struct ipu_image_convert_ctx *ctx)
{ … }
EXPORT_SYMBOL_GPL(…);
void ipu_image_convert_unprepare(struct ipu_image_convert_ctx *ctx)
{ … }
EXPORT_SYMBOL_GPL(…);
struct ipu_image_convert_run *
ipu_image_convert(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_convert_cb_t complete,
void *complete_context)
{ … }
EXPORT_SYMBOL_GPL(…);
static void image_convert_sync_complete(struct ipu_image_convert_run *run,
void *data)
{ … }
int ipu_image_convert_sync(struct ipu_soc *ipu, enum ipu_ic_task ic_task,
struct ipu_image *in, struct ipu_image *out,
enum ipu_rotate_mode rot_mode)
{ … }
EXPORT_SYMBOL_GPL(…);
int ipu_image_convert_init(struct ipu_soc *ipu, struct device *dev)
{ … }
void ipu_image_convert_exit(struct ipu_soc *ipu)
{ … }