License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __SAA7146_VV__
|
|
|
|
#define __SAA7146_VV__
|
|
|
|
|
2006-06-05 21:26:32 +08:00
|
|
|
#include <media/v4l2-common.h>
|
2008-07-20 19:12:02 +08:00
|
|
|
#include <media/v4l2-ioctl.h>
|
2012-05-01 23:04:52 +08:00
|
|
|
#include <media/v4l2-fh.h>
|
2015-11-14 05:40:07 +08:00
|
|
|
#include <media/drv-intf/saa7146.h>
|
2007-08-24 03:37:49 +08:00
|
|
|
#include <media/videobuf-dma-sg.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#define MAX_SAA7146_CAPTURE_BUFFERS 32 /* arbitrary */
|
|
|
|
#define BUFFER_TIMEOUT (HZ/2) /* 0.5 seconds */
|
|
|
|
|
|
|
|
#define WRITE_RPS0(x) do { \
|
|
|
|
dev->d_rps0.cpu_addr[ count++ ] = cpu_to_le32(x); \
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
#define WRITE_RPS1(x) do { \
|
|
|
|
dev->d_rps1.cpu_addr[ count++ ] = cpu_to_le32(x); \
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
struct saa7146_video_dma {
|
|
|
|
u32 base_odd;
|
|
|
|
u32 base_even;
|
|
|
|
u32 prot_addr;
|
|
|
|
u32 pitch;
|
|
|
|
u32 base_page;
|
|
|
|
u32 num_line_byte;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define FORMAT_BYTE_SWAP 0x1
|
|
|
|
#define FORMAT_IS_PLANAR 0x2
|
|
|
|
|
|
|
|
struct saa7146_format {
|
|
|
|
char *name;
|
|
|
|
u32 pixelformat;
|
|
|
|
u32 trans;
|
|
|
|
u8 depth;
|
|
|
|
u8 flags;
|
|
|
|
u8 swap;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct saa7146_standard
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
v4l2_std_id id;
|
|
|
|
|
|
|
|
int v_offset; /* number of lines of vertical offset before processing */
|
|
|
|
int v_field; /* number of lines in a field for HPS to process */
|
|
|
|
|
|
|
|
int h_offset; /* horizontal offset of processing window */
|
|
|
|
int h_pixels; /* number of horizontal pixels to process */
|
|
|
|
|
|
|
|
int v_max_out;
|
|
|
|
int h_max_out;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* buffer for one video/vbi frame */
|
|
|
|
struct saa7146_buf {
|
|
|
|
/* common v4l buffer stuff -- must be first */
|
|
|
|
struct videobuf_buffer vb;
|
|
|
|
|
|
|
|
/* saa7146 specific */
|
|
|
|
struct v4l2_pix_format *fmt;
|
|
|
|
int (*activate)(struct saa7146_dev *dev,
|
|
|
|
struct saa7146_buf *buf,
|
|
|
|
struct saa7146_buf *next);
|
|
|
|
|
|
|
|
/* page tables */
|
|
|
|
struct saa7146_pgtable pt[3];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct saa7146_dmaqueue {
|
|
|
|
struct saa7146_dev *dev;
|
|
|
|
struct saa7146_buf *curr;
|
|
|
|
struct list_head queue;
|
|
|
|
struct timer_list timeout;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct saa7146_overlay {
|
|
|
|
struct saa7146_fh *fh;
|
|
|
|
struct v4l2_window win;
|
|
|
|
struct v4l2_clip clips[16];
|
|
|
|
int nclips;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* per open data */
|
|
|
|
struct saa7146_fh {
|
2012-05-01 23:04:52 +08:00
|
|
|
/* Must be the first field! */
|
|
|
|
struct v4l2_fh fh;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct saa7146_dev *dev;
|
|
|
|
|
|
|
|
/* video capture */
|
|
|
|
struct videobuf_queue video_q;
|
|
|
|
|
|
|
|
/* vbi capture */
|
|
|
|
struct videobuf_queue vbi_q;
|
|
|
|
|
|
|
|
unsigned int resources; /* resource management for device open */
|
|
|
|
};
|
|
|
|
|
|
|
|
#define STATUS_OVERLAY 0x01
|
|
|
|
#define STATUS_CAPTURE 0x02
|
|
|
|
|
|
|
|
struct saa7146_vv
|
|
|
|
{
|
|
|
|
/* vbi capture */
|
2012-05-01 22:45:27 +08:00
|
|
|
struct saa7146_dmaqueue vbi_dmaq;
|
2012-05-01 22:28:20 +08:00
|
|
|
struct v4l2_vbi_format vbi_fmt;
|
|
|
|
struct timer_list vbi_read_timeout;
|
2017-10-17 07:10:12 +08:00
|
|
|
struct file *vbi_read_timeout_file;
|
2005-04-17 06:20:36 +08:00
|
|
|
/* vbi workaround interrupt queue */
|
2005-12-12 16:37:27 +08:00
|
|
|
wait_queue_head_t vbi_wq;
|
2005-04-17 06:20:36 +08:00
|
|
|
int vbi_fieldcount;
|
|
|
|
struct saa7146_fh *vbi_streaming;
|
|
|
|
|
|
|
|
int video_status;
|
|
|
|
struct saa7146_fh *video_fh;
|
|
|
|
|
|
|
|
/* video overlay */
|
2012-05-01 22:06:44 +08:00
|
|
|
struct saa7146_overlay ov;
|
2005-04-17 06:20:36 +08:00
|
|
|
struct v4l2_framebuffer ov_fb;
|
|
|
|
struct saa7146_format *ov_fmt;
|
|
|
|
struct saa7146_fh *ov_suspend;
|
|
|
|
|
|
|
|
/* video capture */
|
2012-05-01 22:45:27 +08:00
|
|
|
struct saa7146_dmaqueue video_dmaq;
|
2012-05-01 22:17:35 +08:00
|
|
|
struct v4l2_pix_format video_fmt;
|
2005-04-17 06:20:36 +08:00
|
|
|
enum v4l2_field last_field;
|
|
|
|
|
|
|
|
/* common: fixme? shouldn't this be in saa7146_fh?
|
|
|
|
(this leads to a more complicated question: shall the driver
|
|
|
|
store the different settings (for example S_INPUT) for every open
|
|
|
|
and restore it appropriately, or should all settings be common for
|
|
|
|
all opens? currently, we do the latter, like all other
|
|
|
|
drivers do... */
|
|
|
|
struct saa7146_standard *standard;
|
|
|
|
|
|
|
|
int vflip;
|
|
|
|
int hflip;
|
|
|
|
int current_hps_source;
|
|
|
|
int current_hps_sync;
|
|
|
|
|
|
|
|
struct saa7146_dma d_clipping; /* pointer to clipping memory */
|
|
|
|
|
|
|
|
unsigned int resources; /* resource management for device */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
#define SAA7146_USE_PORT_B_FOR_VBI 0x2 /* use input port b for vbi hardware bug workaround */
|
|
|
|
|
|
|
|
struct saa7146_ext_vv
|
|
|
|
{
|
|
|
|
/* informations about the video capabilities of the device */
|
|
|
|
int inputs;
|
|
|
|
int audios;
|
|
|
|
u32 capabilities;
|
|
|
|
int flags;
|
|
|
|
|
|
|
|
/* additionally supported transmission standards */
|
|
|
|
struct saa7146_standard *stds;
|
|
|
|
int num_stds;
|
|
|
|
int (*std_callback)(struct saa7146_dev*, struct saa7146_standard *);
|
|
|
|
|
2009-01-19 06:59:11 +08:00
|
|
|
/* the extension can override this */
|
2012-05-01 23:57:57 +08:00
|
|
|
struct v4l2_ioctl_ops vid_ops;
|
|
|
|
struct v4l2_ioctl_ops vbi_ops;
|
2009-01-19 06:59:11 +08:00
|
|
|
/* pointer to the saa7146 core ops */
|
|
|
|
const struct v4l2_ioctl_ops *core_ops;
|
2006-01-10 04:21:37 +08:00
|
|
|
|
2008-12-30 17:58:20 +08:00
|
|
|
struct v4l2_file_operations vbi_fops;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct saa7146_use_ops {
|
2005-12-12 16:37:27 +08:00
|
|
|
void (*init)(struct saa7146_dev *, struct saa7146_vv *);
|
|
|
|
int(*open)(struct saa7146_dev *, struct file *);
|
|
|
|
void (*release)(struct saa7146_dev *, struct file *);
|
|
|
|
void (*irq_done)(struct saa7146_dev *, unsigned long status);
|
2005-04-17 06:20:36 +08:00
|
|
|
ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
|
|
|
|
};
|
|
|
|
|
|
|
|
/* from saa7146_fops.c */
|
2015-03-10 00:33:57 +08:00
|
|
|
int saa7146_register_device(struct video_device *vid, struct saa7146_dev *dev, char *name, int type);
|
|
|
|
int saa7146_unregister_device(struct video_device *vid, struct saa7146_dev *dev);
|
2005-04-17 06:20:36 +08:00
|
|
|
void saa7146_buffer_finish(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, int state);
|
|
|
|
void saa7146_buffer_next(struct saa7146_dev *dev, struct saa7146_dmaqueue *q,int vbi);
|
|
|
|
int saa7146_buffer_queue(struct saa7146_dev *dev, struct saa7146_dmaqueue *q, struct saa7146_buf *buf);
|
2017-10-17 07:10:42 +08:00
|
|
|
void saa7146_buffer_timeout(struct timer_list *t);
|
2006-03-10 23:29:15 +08:00
|
|
|
void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q,
|
|
|
|
struct saa7146_buf *buf);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv);
|
|
|
|
int saa7146_vv_release(struct saa7146_dev* dev);
|
|
|
|
|
|
|
|
/* from saa7146_hlp.c */
|
|
|
|
int saa7146_enable_overlay(struct saa7146_fh *fh);
|
|
|
|
void saa7146_disable_overlay(struct saa7146_fh *fh);
|
|
|
|
|
|
|
|
void saa7146_set_capture(struct saa7146_dev *dev, struct saa7146_buf *buf, struct saa7146_buf *next);
|
|
|
|
void saa7146_write_out_dma(struct saa7146_dev* dev, int which, struct saa7146_video_dma* vdma) ;
|
|
|
|
void saa7146_set_hps_source_and_sync(struct saa7146_dev *saa, int source, int sync);
|
|
|
|
void saa7146_set_gpio(struct saa7146_dev *saa, u8 pin, u8 data);
|
|
|
|
|
|
|
|
/* from saa7146_video.c */
|
2009-01-19 06:59:11 +08:00
|
|
|
extern const struct v4l2_ioctl_ops saa7146_video_ioctl_ops;
|
2012-05-01 23:57:57 +08:00
|
|
|
extern const struct v4l2_ioctl_ops saa7146_vbi_ioctl_ops;
|
2017-09-14 03:37:50 +08:00
|
|
|
extern const struct saa7146_use_ops saa7146_video_uops;
|
2005-04-17 06:20:36 +08:00
|
|
|
int saa7146_start_preview(struct saa7146_fh *fh);
|
|
|
|
int saa7146_stop_preview(struct saa7146_fh *fh);
|
2008-12-30 18:04:34 +08:00
|
|
|
long saa7146_video_do_ioctl(struct file *file, unsigned int cmd, void *arg);
|
2012-04-30 03:47:47 +08:00
|
|
|
int saa7146_s_ctrl(struct v4l2_ctrl *ctrl);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* from saa7146_vbi.c */
|
2017-09-14 03:37:50 +08:00
|
|
|
extern const struct saa7146_use_ops saa7146_vbi_uops;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* resource management functions */
|
|
|
|
int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit);
|
|
|
|
void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits);
|
|
|
|
|
|
|
|
#define RESOURCE_DMA1_HPS 0x1
|
|
|
|
#define RESOURCE_DMA2_CLP 0x2
|
|
|
|
#define RESOURCE_DMA3_BRS 0x4
|
|
|
|
|
|
|
|
/* saa7146 source inputs */
|
|
|
|
#define SAA7146_HPS_SOURCE_PORT_A 0x00
|
|
|
|
#define SAA7146_HPS_SOURCE_PORT_B 0x01
|
|
|
|
#define SAA7146_HPS_SOURCE_YPB_CPA 0x02
|
|
|
|
#define SAA7146_HPS_SOURCE_YPA_CPB 0x03
|
|
|
|
|
|
|
|
/* sync inputs */
|
|
|
|
#define SAA7146_HPS_SYNC_PORT_A 0x00
|
|
|
|
#define SAA7146_HPS_SYNC_PORT_B 0x01
|
|
|
|
|
|
|
|
/* some memory sizes */
|
2007-03-14 10:44:57 +08:00
|
|
|
/* max. 16 clipping rectangles */
|
|
|
|
#define SAA7146_CLIPPING_MEM (16 * 4 * sizeof(u32))
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/* some defines for the various clipping-modes */
|
|
|
|
#define SAA7146_CLIPPING_RECT 0x4
|
|
|
|
#define SAA7146_CLIPPING_RECT_INVERTED 0x5
|
|
|
|
#define SAA7146_CLIPPING_MASK 0x6
|
|
|
|
#define SAA7146_CLIPPING_MASK_INVERTED 0x7
|
|
|
|
|
|
|
|
/* output formats: each entry holds four informations */
|
|
|
|
#define RGB08_COMPOSED 0x0217 /* composed is used in the sense of "not-planar" */
|
|
|
|
/* this means: planar?=0, yuv2rgb-conversation-mode=2, dither=yes(=1), format-mode = 7 */
|
|
|
|
#define RGB15_COMPOSED 0x0213
|
|
|
|
#define RGB16_COMPOSED 0x0210
|
|
|
|
#define RGB24_COMPOSED 0x0201
|
|
|
|
#define RGB32_COMPOSED 0x0202
|
|
|
|
|
|
|
|
#define Y8 0x0006
|
|
|
|
#define YUV411_COMPOSED 0x0003
|
|
|
|
#define YUV422_COMPOSED 0x0000
|
|
|
|
/* this means: planar?=1, yuv2rgb-conversion-mode=0, dither=no(=0), format-mode = b */
|
|
|
|
#define YUV411_DECOMPOSED 0x100b
|
|
|
|
#define YUV422_DECOMPOSED 0x1009
|
|
|
|
#define YUV420_DECOMPOSED 0x100a
|
|
|
|
|
|
|
|
#define IS_PLANAR(x) (x & 0xf000)
|
|
|
|
|
|
|
|
/* misc defines */
|
|
|
|
#define SAA7146_NO_SWAP (0x0)
|
|
|
|
#define SAA7146_TWO_BYTE_SWAP (0x1)
|
|
|
|
#define SAA7146_FOUR_BYTE_SWAP (0x2)
|
|
|
|
|
|
|
|
#endif
|