Commit 1beb623b authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: v4l2-tpg*.h: move headers to include/media/tpg and merge them



The v4l2-tpg*.h headers are meant to be used only internally by
vivid and vimc. There's no sense keeping them together with the
V4L2 kAPI headers. Also, one header includes the other as they're
meant to be used together. So, merge them.

Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 9fbe71b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
 */

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

/* sRGB colors with range [0-255] */
const struct color tpg_colors[TPG_COLOR_MAX] = {
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
 */

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

/* Must remain in sync with enum tpg_pattern */
const char * const tpg_pattern_strings[] = {
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
#include <linux/vmalloc.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#include <media/v4l2-tpg.h>
#include <media/tpg/v4l2-tpg.h>

#include "vimc-common.h"

+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#include <media/v4l2-device.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-tpg.h>
#include <media/tpg/v4l2-tpg.h>
#include "vivid-rds-gen.h"
#include "vivid-vbi-gen.h"

+44 −1
Original line number Diff line number Diff line
@@ -26,8 +26,51 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/videodev2.h>
#include <media/v4l2-tpg-colors.h>

struct color {
	unsigned char r, g, b;
};

struct color16 {
	int r, g, b;
};

enum tpg_color {
	TPG_COLOR_CSC_WHITE,
	TPG_COLOR_CSC_YELLOW,
	TPG_COLOR_CSC_CYAN,
	TPG_COLOR_CSC_GREEN,
	TPG_COLOR_CSC_MAGENTA,
	TPG_COLOR_CSC_RED,
	TPG_COLOR_CSC_BLUE,
	TPG_COLOR_CSC_BLACK,
	TPG_COLOR_75_YELLOW,
	TPG_COLOR_75_CYAN,
	TPG_COLOR_75_GREEN,
	TPG_COLOR_75_MAGENTA,
	TPG_COLOR_75_RED,
	TPG_COLOR_75_BLUE,
	TPG_COLOR_100_WHITE,
	TPG_COLOR_100_YELLOW,
	TPG_COLOR_100_CYAN,
	TPG_COLOR_100_GREEN,
	TPG_COLOR_100_MAGENTA,
	TPG_COLOR_100_RED,
	TPG_COLOR_100_BLUE,
	TPG_COLOR_100_BLACK,
	TPG_COLOR_TEXTFG,
	TPG_COLOR_TEXTBG,
	TPG_COLOR_RANDOM,
	TPG_COLOR_RAMP,
	TPG_COLOR_MAX = TPG_COLOR_RAMP + 256
};

extern const struct color 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 color16 tpg_csc_colors[V4L2_COLORSPACE_DCI_P3 + 1]
					  [V4L2_XFER_FUNC_SMPTE2084 + 1]
					  [TPG_COLOR_CSC_BLACK + 1];
enum tpg_pattern {
	TPG_PAT_75_COLORBAR,
	TPG_PAT_100_COLORBAR,
Loading