linux/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * v4l2-tpg-core.c - Test Pattern Generator
 *
 * Note: gen_twopix and tpg_gen_text are based on code from vivi.c. See the
 * vivi.c source for the copyright information of those functions.
 *
 * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 */

#include <linux/module.h>
#include <media/tpg/v4l2-tpg.h>

/* Must remain in sync with enum tpg_pattern */
const char * const tpg_pattern_strings[] =;
EXPORT_SYMBOL_GPL();

/* Must remain in sync with enum tpg_aspect */
const char * const tpg_aspect_strings[] =;
EXPORT_SYMBOL_GPL();

/*
 * Sine table: sin[0] = 127 * sin(-180 degrees)
 *             sin[128] = 127 * sin(0 degrees)
 *             sin[256] = 127 * sin(180 degrees)
 */
static const s8 sin[257] =;

#define cos(idx)

/* Global font descriptor */
static const u8 *font8x16;

void tpg_set_font(const u8 *f)
{}
EXPORT_SYMBOL_GPL();

void tpg_init(struct tpg_data *tpg, unsigned w, unsigned h)
{}
EXPORT_SYMBOL_GPL();

int tpg_alloc(struct tpg_data *tpg, unsigned max_w)
{}
EXPORT_SYMBOL_GPL();

void tpg_free(struct tpg_data *tpg)
{}
EXPORT_SYMBOL_GPL();

bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
{}
EXPORT_SYMBOL_GPL();

void tpg_s_crop_compose(struct tpg_data *tpg, const struct v4l2_rect *crop,
		const struct v4l2_rect *compose)
{}
EXPORT_SYMBOL_GPL();

void tpg_reset_source(struct tpg_data *tpg, unsigned width, unsigned height,
		       u32 field)
{}
EXPORT_SYMBOL_GPL();

static enum tpg_color tpg_get_textbg_color(struct tpg_data *tpg)
{}

static enum tpg_color tpg_get_textfg_color(struct tpg_data *tpg)
{}

static inline int rec709_to_linear(int v)
{}

static inline int linear_to_rec709(int v)
{}

static void color_to_hsv(struct tpg_data *tpg, int r, int g, int b,
			   int *h, int *s, int *v)
{}

static void rgb2ycbcr(const int m[3][3], int r, int g, int b,
			int y_offset, int *y, int *cb, int *cr)
{}

static void color_to_ycbcr(struct tpg_data *tpg, int r, int g, int b,
			   int *y, int *cb, int *cr)
{}

static void ycbcr2rgb(const int m[3][3], int y, int cb, int cr,
			int y_offset, int *r, int *g, int *b)
{}

static void ycbcr_to_color(struct tpg_data *tpg, int y, int cb, int cr,
			   int *r, int *g, int *b)
{}

/* precalculate color bar values to speed up rendering */
static void precalculate_color(struct tpg_data *tpg, int k)
{}

static void tpg_precalculate_colors(struct tpg_data *tpg)
{}

/* 'odd' is true for pixels 1, 3, 5, etc. and false for pixels 0, 2, 4, etc. */
static void gen_twopix(struct tpg_data *tpg,
		u8 buf[TPG_MAX_PLANES][8], int color, bool odd)
{}

unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line)
{}
EXPORT_SYMBOL_GPL();

/* Return how many pattern lines are used by the current pattern. */
static unsigned tpg_get_pat_lines(const struct tpg_data *tpg)
{}

/* Which pattern line should be used for the given frame line. */
static unsigned tpg_get_pat_line(const struct tpg_data *tpg, unsigned line)
{}

/*
 * Which color should be used for the given pattern line and X coordinate.
 * Note: x is in the range 0 to 2 * tpg->src_width.
 */
static enum tpg_color tpg_get_color(const struct tpg_data *tpg,
				    unsigned pat_line, unsigned x)
{}

/*
 * Given the pixel aspect ratio and video aspect ratio calculate the
 * coordinates of a centered square and the coordinates of the border of
 * the active video area. The coordinates are relative to the source
 * frame rectangle.
 */
static void tpg_calculate_square_border(struct tpg_data *tpg)
{}

static void tpg_precalculate_line(struct tpg_data *tpg)
{}

/* need this to do rgb24 rendering */
x24;

#define PRINTSTR(PIXTYPE)

static noinline void tpg_print_str_2(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
			unsigned p, unsigned first, unsigned div, unsigned step,
			int y, int x, const char *text, unsigned len)
{}

static noinline void tpg_print_str_4(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
			unsigned p, unsigned first, unsigned div, unsigned step,
			int y, int x, const char *text, unsigned len)
{}

static noinline void tpg_print_str_6(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
			unsigned p, unsigned first, unsigned div, unsigned step,
			int y, int x, const char *text, unsigned len)
{}

static noinline void tpg_print_str_8(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
			unsigned p, unsigned first, unsigned div, unsigned step,
			int y, int x, const char *text, unsigned len)
{}

void tpg_gen_text(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
		  int y, int x, const char *text)
{}
EXPORT_SYMBOL_GPL();

const char *tpg_g_color_order(const struct tpg_data *tpg)
{}
EXPORT_SYMBOL_GPL();

void tpg_update_mv_step(struct tpg_data *tpg)
{}
EXPORT_SYMBOL_GPL();

/* Map the line number relative to the crop rectangle to a frame line number */
static unsigned tpg_calc_frameline(const struct tpg_data *tpg, unsigned src_y,
				    unsigned field)
{}

/*
 * Map the line number relative to the compose rectangle to a destination
 * buffer line number.
 */
static unsigned tpg_calc_buffer_line(const struct tpg_data *tpg, unsigned y,
				    unsigned field)
{}

static void tpg_recalc(struct tpg_data *tpg)
{}

void tpg_calc_text_basep(struct tpg_data *tpg,
		u8 *basep[TPG_MAX_PLANES][2], unsigned p, u8 *vbuf)
{}
EXPORT_SYMBOL_GPL();

static int tpg_pattern_avg(const struct tpg_data *tpg,
			   unsigned pat1, unsigned pat2)
{}

static const char *tpg_color_enc_str(enum tgp_color_enc
						 color_enc)
{}

void tpg_log_status(struct tpg_data *tpg)
{}
EXPORT_SYMBOL_GPL();

/*
 * This struct contains common parameters used by both the drawing of the
 * test pattern and the drawing of the extras (borders, square, etc.)
 */
struct tpg_draw_params {};

static void tpg_fill_params_pattern(const struct tpg_data *tpg, unsigned p,
				    struct tpg_draw_params *params)
{}

static void tpg_fill_params_extras(const struct tpg_data *tpg,
				   unsigned p,
				   struct tpg_draw_params *params)
{}

static void tpg_fill_plane_extras(const struct tpg_data *tpg,
				  const struct tpg_draw_params *params,
				  unsigned p, unsigned h, u8 *vbuf)
{}

static void tpg_fill_plane_pattern(const struct tpg_data *tpg,
				   const struct tpg_draw_params *params,
				   unsigned p, unsigned h, u8 *vbuf)
{}

void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std,
			   unsigned p, u8 *vbuf)
{}
EXPORT_SYMBOL_GPL();

void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std, unsigned p, u8 *vbuf)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();