linux/drivers/media/test-drivers/vivid/vivid-core.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * vivid-core.h - core datastructures
 *
 * Copyright 2014 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
 */

#ifndef _VIVID_CORE_H_
#define _VIVID_CORE_H_

#include <linux/fb.h>
#include <linux/workqueue.h>
#include <media/cec.h>
#include <media/videobuf2-v4l2.h>
#include <media/v4l2-device.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-ctrls.h>
#include <media/tpg/v4l2-tpg.h>
#include "vivid-rds-gen.h"
#include "vivid-vbi-gen.h"

#define dprintk(dev, level, fmt, arg...)

/* The maximum number of inputs */
#define MAX_INPUTS
/* The maximum number of outputs */
#define MAX_OUTPUTS
/* The maximum up or down scaling factor is 4 */
#define MAX_ZOOM
/* The maximum image width/height are set to 4K DMT */
#define MAX_WIDTH
#define MAX_HEIGHT
/* The minimum image width/height */
#define MIN_WIDTH
#define MIN_HEIGHT
/* Pixel Array control divider */
#define PIXEL_ARRAY_DIV
/* The data_offset of plane 0 for the multiplanar formats */
#define PLANE0_DATA_OFFSET

/* The supported TV frequency range in MHz */
#define MIN_TV_FREQ
#define MAX_TV_FREQ

/* The number of samples returned in every SDR buffer */
#define SDR_CAP_SAMPLES_PER_BUF

/* used by the threads to know when to resync internal counters */
#define JIFFIES_PER_DAY
#define JIFFIES_RESYNC

/*
 * Maximum number of HDMI inputs allowed by vivid, due to limitations
 * of the Physical Address in the EDID and used by CEC we stop at 15
 * inputs and outputs.
 */
#define MAX_HDMI_INPUTS
#define MAX_HDMI_OUTPUTS

/* Maximum number of S-Video inputs allowed by vivid */
#define MAX_SVID_INPUTS

/* The maximum number of items in a menu control */
#define MAX_MENU_ITEMS

/* Number of fixed menu items in the 'Connected To' menu controls */
#define FIXED_MENU_ITEMS

/* The maximum number of vivid devices */
#define VIVID_MAX_DEVS

extern const struct v4l2_rect vivid_min_rect;
extern const struct v4l2_rect vivid_max_rect;
extern unsigned vivid_debug;

/*
 * NULL-terminated string array for the HDMI 'Connected To' menu controls
 * with the list of possible HDMI outputs.
 *
 * The first two items are fixed ("TPG" and "None").
 */
extern char *vivid_ctrl_hdmi_to_output_strings[1 + MAX_MENU_ITEMS];
/* Menu control skip mask of all HDMI outputs that are in use */
extern u64 hdmi_to_output_menu_skip_mask;
/*
 * Bitmask of which vivid instances need to update any connected
 * HDMI outputs.
 */
extern u64 hdmi_input_update_outputs_mask;
/*
 * Spinlock for access to hdmi_to_output_menu_skip_mask and
 * hdmi_input_update_outputs_mask.
 */
extern spinlock_t hdmi_output_skip_mask_lock;
/*
 * Workqueue that updates the menu controls whenever the HDMI menu skip mask
 * changes.
 */
extern struct workqueue_struct *update_hdmi_ctrls_workqueue;

/*
 * The HDMI menu control value (index in the menu list) maps to an HDMI
 * output that is part of the given vivid_dev instance and has the given
 * output index (as returned by VIDIOC_G_OUTPUT).
 *
 * NULL/0 if not available.
 */
extern struct vivid_dev *vivid_ctrl_hdmi_to_output_instance[MAX_MENU_ITEMS];
extern unsigned int vivid_ctrl_hdmi_to_output_index[MAX_MENU_ITEMS];

/*
 * NULL-terminated string array for the S-Video 'Connected To' menu controls
 * with the list of possible S-Video outputs.
 *
 * The first two items are fixed ("TPG" and "None").
 */
extern char *vivid_ctrl_svid_to_output_strings[1 + MAX_MENU_ITEMS];
/* Menu control skip mask of all S-Video outputs that are in use */
extern u64 svid_to_output_menu_skip_mask;
/* Spinlock for access to svid_to_output_menu_skip_mask */
extern spinlock_t svid_output_skip_mask_lock;
/*
 * Workqueue that updates the menu controls whenever the S-Video menu skip mask
 * changes.
 */
extern struct workqueue_struct *update_svid_ctrls_workqueue;

/*
 * The S-Video menu control value (index in the menu list) maps to an S-Video
 * output that is part of the given vivid_dev instance and has the given
 * output index (as returned by VIDIOC_G_OUTPUT).
 *
 * NULL/0 if not available.
 */
extern struct vivid_dev *vivid_ctrl_svid_to_output_instance[MAX_MENU_ITEMS];
extern unsigned int vivid_ctrl_svid_to_output_index[MAX_MENU_ITEMS];

extern struct vivid_dev *vivid_devs[VIVID_MAX_DEVS];
extern unsigned int n_devs;

struct vivid_fmt {};

extern struct vivid_fmt vivid_formats[];

/* buffer for one video frame */
struct vivid_buffer {};

enum vivid_input {};

enum vivid_signal_mode {};

enum vivid_colorspace {};

#define VIVID_INVALID_SIGNAL(mode)

struct vivid_cec_xfer {};

struct vivid_dev {};

static inline bool vivid_is_webcam(const struct vivid_dev *dev)
{}

static inline bool vivid_is_tv_cap(const struct vivid_dev *dev)
{}

static inline bool vivid_is_svid_cap(const struct vivid_dev *dev)
{}

static inline bool vivid_is_hdmi_cap(const struct vivid_dev *dev)
{}

static inline bool vivid_is_sdtv_cap(const struct vivid_dev *dev)
{}

static inline bool vivid_is_svid_out(const struct vivid_dev *dev)
{}

static inline bool vivid_is_hdmi_out(const struct vivid_dev *dev)
{}

#endif