#ifndef _V4L2_TPG_H_
#define _V4L2_TPG_H_
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/random.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/videodev2.h>
struct tpg_rbg_color8 { … };
struct tpg_rbg_color16 { … };
enum tpg_color { … };
extern const struct tpg_rbg_color8 tpg_colors[TPG_COLOR_MAX];
extern const unsigned short tpg_rec709_to_linear[255 * 16 + 1];
extern const unsigned short tpg_linear_to_rec709[255 * 16 + 1];
extern const struct tpg_rbg_color16 tpg_csc_colors[V4L2_COLORSPACE_DCI_P3 + 1]
[V4L2_XFER_FUNC_SMPTE2084 + 1]
[TPG_COLOR_CSC_BLACK + 1];
enum tpg_pattern { … };
extern const char * const tpg_pattern_strings[];
enum tpg_quality { … };
enum tpg_video_aspect { … };
enum tpg_pixel_aspect { … };
enum tpg_move_mode { … };
enum tgp_color_enc { … };
extern const char * const tpg_aspect_strings[];
#define TPG_MAX_PLANES …
#define TPG_MAX_PAT_LINES …
struct tpg_data { … };
void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h);
int tpg_alloc(struct tpg_data *tpg, unsigned max_w);
void tpg_free(struct tpg_data *tpg);
void tpg_reset_source(struct tpg_data *tpg, unsigned width, unsigned height,
u32 field);
void tpg_log_status(struct tpg_data *tpg);
void tpg_set_font(const u8 *f);
void tpg_gen_text(const struct tpg_data *tpg,
u8 *basep[TPG_MAX_PLANES][2], int y, int x, const char *text);
void tpg_calc_text_basep(struct tpg_data *tpg,
u8 *basep[TPG_MAX_PLANES][2], unsigned p, u8 *vbuf);
unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line);
void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std,
unsigned p, u8 *vbuf);
void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std,
unsigned p, u8 *vbuf);
bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc);
void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop,
const struct v4l2_rect *compose);
const char *tpg_g_color_order(const struct tpg_data *tpg);
static inline void tpg_s_pattern(struct tpg_data *tpg, enum tpg_pattern pattern)
{ … }
static inline void tpg_s_quality(struct tpg_data *tpg,
enum tpg_quality qual, unsigned qual_offset)
{ … }
static inline enum tpg_quality tpg_g_quality(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_alpha_component(struct tpg_data *tpg,
u8 alpha_component)
{ … }
static inline void tpg_s_alpha_mode(struct tpg_data *tpg,
bool red_only)
{ … }
static inline void tpg_s_brightness(struct tpg_data *tpg,
u8 brightness)
{ … }
static inline void tpg_s_contrast(struct tpg_data *tpg,
u8 contrast)
{ … }
static inline void tpg_s_saturation(struct tpg_data *tpg,
u8 saturation)
{ … }
static inline void tpg_s_hue(struct tpg_data *tpg,
s16 hue)
{ … }
static inline void tpg_s_rgb_range(struct tpg_data *tpg,
unsigned rgb_range)
{ … }
static inline void tpg_s_real_rgb_range(struct tpg_data *tpg,
unsigned rgb_range)
{ … }
static inline void tpg_s_colorspace(struct tpg_data *tpg, u32 colorspace)
{ … }
static inline u32 tpg_g_colorspace(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_ycbcr_enc(struct tpg_data *tpg, u32 ycbcr_enc)
{ … }
static inline u32 tpg_g_ycbcr_enc(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_hsv_enc(struct tpg_data *tpg, u32 hsv_enc)
{ … }
static inline u32 tpg_g_hsv_enc(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_xfer_func(struct tpg_data *tpg, u32 xfer_func)
{ … }
static inline u32 tpg_g_xfer_func(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_quantization(struct tpg_data *tpg, u32 quantization)
{ … }
static inline u32 tpg_g_quantization(const struct tpg_data *tpg)
{ … }
static inline unsigned tpg_g_buffers(const struct tpg_data *tpg)
{ … }
static inline unsigned tpg_g_planes(const struct tpg_data *tpg)
{ … }
static inline bool tpg_g_interleaved(const struct tpg_data *tpg)
{ … }
static inline unsigned tpg_g_twopixelsize(const struct tpg_data *tpg, unsigned plane)
{ … }
static inline unsigned tpg_hdiv(const struct tpg_data *tpg,
unsigned plane, unsigned x)
{ … }
static inline unsigned tpg_hscale(const struct tpg_data *tpg, unsigned x)
{ … }
static inline unsigned tpg_hscale_div(const struct tpg_data *tpg,
unsigned plane, unsigned x)
{ … }
static inline unsigned tpg_g_bytesperline(const struct tpg_data *tpg, unsigned plane)
{ … }
static inline void tpg_s_bytesperline(struct tpg_data *tpg, unsigned plane, unsigned bpl)
{ … }
static inline unsigned tpg_g_line_width(const struct tpg_data *tpg, unsigned plane)
{ … }
static inline unsigned tpg_calc_line_width(const struct tpg_data *tpg,
unsigned plane, unsigned bpl)
{ … }
static inline unsigned tpg_calc_plane_size(const struct tpg_data *tpg, unsigned plane)
{ … }
static inline void tpg_s_buf_height(struct tpg_data *tpg, unsigned h)
{ … }
static inline void tpg_s_field(struct tpg_data *tpg, unsigned field, bool alternate)
{ … }
static inline void tpg_s_perc_fill(struct tpg_data *tpg,
unsigned perc_fill)
{ … }
static inline unsigned tpg_g_perc_fill(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_perc_fill_blank(struct tpg_data *tpg,
bool perc_fill_blank)
{ … }
static inline void tpg_s_video_aspect(struct tpg_data *tpg,
enum tpg_video_aspect vid_aspect)
{ … }
static inline enum tpg_video_aspect tpg_g_video_aspect(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_pixel_aspect(struct tpg_data *tpg,
enum tpg_pixel_aspect pix_aspect)
{ … }
static inline void tpg_s_show_border(struct tpg_data *tpg,
bool show_border)
{ … }
static inline void tpg_s_show_square(struct tpg_data *tpg,
bool show_square)
{ … }
static inline void tpg_s_insert_sav(struct tpg_data *tpg, bool insert_sav)
{ … }
static inline void tpg_s_insert_eav(struct tpg_data *tpg, bool insert_eav)
{ … }
static inline void tpg_s_insert_hdmi_video_guard_band(struct tpg_data *tpg,
bool insert_hdmi_video_guard_band)
{ … }
void tpg_update_mv_step(struct tpg_data *tpg);
static inline void tpg_s_mv_hor_mode(struct tpg_data *tpg,
enum tpg_move_mode mv_hor_mode)
{ … }
static inline void tpg_s_mv_vert_mode(struct tpg_data *tpg,
enum tpg_move_mode mv_vert_mode)
{ … }
static inline void tpg_init_mv_count(struct tpg_data *tpg)
{ … }
static inline void tpg_update_mv_count(struct tpg_data *tpg, bool frame_is_field)
{ … }
static inline void tpg_s_hflip(struct tpg_data *tpg, bool hflip)
{ … }
static inline bool tpg_g_hflip(const struct tpg_data *tpg)
{ … }
static inline void tpg_s_vflip(struct tpg_data *tpg, bool vflip)
{ … }
static inline bool tpg_g_vflip(const struct tpg_data *tpg)
{ … }
static inline bool tpg_pattern_is_static(const struct tpg_data *tpg)
{ … }
#endif