mirror of
https://github.com/torvalds/linux.git
synced 2024-12-23 11:21:33 +00:00
b24413180f
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>
383 lines
7.9 KiB
C
383 lines
7.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _INTELFB_H
|
|
#define _INTELFB_H
|
|
|
|
/* $DHD: intelfb/intelfb.h,v 1.40 2003/06/27 15:06:25 dawes Exp $ */
|
|
|
|
#include <linux/agp_backend.h>
|
|
#include <linux/fb.h>
|
|
|
|
#ifdef CONFIG_FB_INTEL_I2C
|
|
#include <linux/i2c.h>
|
|
#include <linux/i2c-algo-bit.h>
|
|
#endif
|
|
|
|
/*** Version/name ***/
|
|
#define INTELFB_VERSION "0.9.6"
|
|
#define INTELFB_MODULE_NAME "intelfb"
|
|
#define SUPPORTED_CHIPSETS "830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/945GME/965G/965GM"
|
|
|
|
|
|
/*** Debug/feature defines ***/
|
|
|
|
#ifndef DEBUG
|
|
#define DEBUG 0
|
|
#endif
|
|
|
|
#ifndef VERBOSE
|
|
#define VERBOSE 0
|
|
#endif
|
|
|
|
#ifndef REGDUMP
|
|
#define REGDUMP 0
|
|
#endif
|
|
|
|
#ifndef DETECT_VGA_CLASS_ONLY
|
|
#define DETECT_VGA_CLASS_ONLY 1
|
|
#endif
|
|
|
|
#ifndef ALLOCATE_FOR_PANNING
|
|
#define ALLOCATE_FOR_PANNING 1
|
|
#endif
|
|
|
|
#ifndef PREFERRED_MODE
|
|
#define PREFERRED_MODE "1024x768-32@70"
|
|
#endif
|
|
|
|
/*** hw-related values ***/
|
|
|
|
/* Resource Allocation */
|
|
#define INTELFB_FB_ACQUIRED 1
|
|
#define INTELFB_MMIO_ACQUIRED 2
|
|
|
|
/* PCI ids for supported devices */
|
|
#define PCI_DEVICE_ID_INTEL_830M 0x3577
|
|
#define PCI_DEVICE_ID_INTEL_845G 0x2562
|
|
#define PCI_DEVICE_ID_INTEL_85XGM 0x3582
|
|
#define PCI_DEVICE_ID_INTEL_854 0x358E
|
|
#define PCI_DEVICE_ID_INTEL_865G 0x2572
|
|
#define PCI_DEVICE_ID_INTEL_915G 0x2582
|
|
#define PCI_DEVICE_ID_INTEL_915GM 0x2592
|
|
#define PCI_DEVICE_ID_INTEL_945G 0x2772
|
|
#define PCI_DEVICE_ID_INTEL_945GM 0x27A2
|
|
#define PCI_DEVICE_ID_INTEL_945GME 0x27AE
|
|
#define PCI_DEVICE_ID_INTEL_965G 0x29A2
|
|
#define PCI_DEVICE_ID_INTEL_965GM 0x2A02
|
|
|
|
/* Size of MMIO region */
|
|
#define INTEL_REG_SIZE 0x80000
|
|
|
|
#define STRIDE_ALIGNMENT 16
|
|
#define STRIDE_ALIGNMENT_I9XX 64
|
|
|
|
#define PALETTE_8_ENTRIES 256
|
|
|
|
|
|
/*** Macros ***/
|
|
|
|
/* basic arithmetic */
|
|
#define KB(x) ((x) * 1024)
|
|
#define MB(x) ((x) * 1024 * 1024)
|
|
#define BtoKB(x) ((x) / 1024)
|
|
#define BtoMB(x) ((x) / 1024 / 1024)
|
|
|
|
#define GTT_PAGE_SIZE KB(4)
|
|
|
|
#define ROUND_UP_TO(x, y) (((x) + (y) - 1) / (y) * (y))
|
|
#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y))
|
|
#define ROUND_UP_TO_PAGE(x) ROUND_UP_TO((x), GTT_PAGE_SIZE)
|
|
#define ROUND_DOWN_TO_PAGE(x) ROUND_DOWN_TO((x), GTT_PAGE_SIZE)
|
|
|
|
/* messages */
|
|
#define PFX INTELFB_MODULE_NAME ": "
|
|
|
|
#define ERR_MSG(fmt, args...) printk(KERN_ERR PFX fmt, ## args)
|
|
#define WRN_MSG(fmt, args...) printk(KERN_WARNING PFX fmt, ## args)
|
|
#define NOT_MSG(fmt, args...) printk(KERN_NOTICE PFX fmt, ## args)
|
|
#define INF_MSG(fmt, args...) printk(KERN_INFO PFX fmt, ## args)
|
|
#if DEBUG
|
|
#define DBG_MSG(fmt, args...) printk(KERN_DEBUG PFX fmt, ## args)
|
|
#else
|
|
#define DBG_MSG(fmt, args...) while (0) printk(fmt, ## args)
|
|
#endif
|
|
|
|
/* get commonly used pointers */
|
|
#define GET_DINFO(info) (info)->par
|
|
|
|
/* misc macros */
|
|
#define ACCEL(d, i) \
|
|
((d)->accel && !(d)->ring_lockup && \
|
|
((i)->var.accel_flags & FB_ACCELF_TEXT))
|
|
|
|
/*#define NOACCEL_CHIPSET(d) \
|
|
((d)->chipset != INTEL_865G)*/
|
|
#define NOACCEL_CHIPSET(d) \
|
|
(0)
|
|
|
|
#define FIXED_MODE(d) ((d)->fixed_mode)
|
|
|
|
/*** Driver parameters ***/
|
|
|
|
#define RINGBUFFER_SIZE KB(64)
|
|
#define HW_CURSOR_SIZE KB(4)
|
|
|
|
/* Intel agpgart driver */
|
|
#define AGP_PHYSICAL_MEMORY 2
|
|
|
|
/* store information about an Ixxx DVO */
|
|
/* The i830->i865 use multiple DVOs with multiple i2cs */
|
|
/* the i915, i945 have a single sDVO i2c bus - which is different */
|
|
#define MAX_OUTPUTS 6
|
|
|
|
/* these are outputs from the chip - integrated only
|
|
external chips are via DVO or SDVO output */
|
|
#define INTELFB_OUTPUT_UNUSED 0
|
|
#define INTELFB_OUTPUT_ANALOG 1
|
|
#define INTELFB_OUTPUT_DVO 2
|
|
#define INTELFB_OUTPUT_SDVO 3
|
|
#define INTELFB_OUTPUT_LVDS 4
|
|
#define INTELFB_OUTPUT_TVOUT 5
|
|
|
|
#define INTELFB_DVO_CHIP_NONE 0
|
|
#define INTELFB_DVO_CHIP_LVDS 1
|
|
#define INTELFB_DVO_CHIP_TMDS 2
|
|
#define INTELFB_DVO_CHIP_TVOUT 4
|
|
|
|
#define INTELFB_OUTPUT_PIPE_NC 0
|
|
#define INTELFB_OUTPUT_PIPE_A 1
|
|
#define INTELFB_OUTPUT_PIPE_B 2
|
|
|
|
/*** Data Types ***/
|
|
|
|
/* supported chipsets */
|
|
enum intel_chips {
|
|
INTEL_830M,
|
|
INTEL_845G,
|
|
INTEL_85XGM,
|
|
INTEL_852GM,
|
|
INTEL_852GME,
|
|
INTEL_854,
|
|
INTEL_855GM,
|
|
INTEL_855GME,
|
|
INTEL_865G,
|
|
INTEL_915G,
|
|
INTEL_915GM,
|
|
INTEL_945G,
|
|
INTEL_945GM,
|
|
INTEL_945GME,
|
|
INTEL_965G,
|
|
INTEL_965GM,
|
|
};
|
|
|
|
struct intelfb_hwstate {
|
|
u32 vga0_divisor;
|
|
u32 vga1_divisor;
|
|
u32 vga_pd;
|
|
u32 dpll_a;
|
|
u32 dpll_b;
|
|
u32 fpa0;
|
|
u32 fpa1;
|
|
u32 fpb0;
|
|
u32 fpb1;
|
|
u32 palette_a[PALETTE_8_ENTRIES];
|
|
u32 palette_b[PALETTE_8_ENTRIES];
|
|
u32 htotal_a;
|
|
u32 hblank_a;
|
|
u32 hsync_a;
|
|
u32 vtotal_a;
|
|
u32 vblank_a;
|
|
u32 vsync_a;
|
|
u32 src_size_a;
|
|
u32 bclrpat_a;
|
|
u32 htotal_b;
|
|
u32 hblank_b;
|
|
u32 hsync_b;
|
|
u32 vtotal_b;
|
|
u32 vblank_b;
|
|
u32 vsync_b;
|
|
u32 src_size_b;
|
|
u32 bclrpat_b;
|
|
u32 adpa;
|
|
u32 dvoa;
|
|
u32 dvob;
|
|
u32 dvoc;
|
|
u32 dvoa_srcdim;
|
|
u32 dvob_srcdim;
|
|
u32 dvoc_srcdim;
|
|
u32 lvds;
|
|
u32 pipe_a_conf;
|
|
u32 pipe_b_conf;
|
|
u32 disp_arb;
|
|
u32 cursor_a_control;
|
|
u32 cursor_b_control;
|
|
u32 cursor_a_base;
|
|
u32 cursor_b_base;
|
|
u32 cursor_size;
|
|
u32 disp_a_ctrl;
|
|
u32 disp_b_ctrl;
|
|
u32 disp_a_base;
|
|
u32 disp_b_base;
|
|
u32 cursor_a_palette[4];
|
|
u32 cursor_b_palette[4];
|
|
u32 disp_a_stride;
|
|
u32 disp_b_stride;
|
|
u32 vgacntrl;
|
|
u32 add_id;
|
|
u32 swf0x[7];
|
|
u32 swf1x[7];
|
|
u32 swf3x[3];
|
|
u32 fence[8];
|
|
u32 instpm;
|
|
u32 mem_mode;
|
|
u32 fw_blc_0;
|
|
u32 fw_blc_1;
|
|
u16 hwstam;
|
|
u16 ier;
|
|
u16 iir;
|
|
u16 imr;
|
|
};
|
|
|
|
struct intelfb_heap_data {
|
|
u32 physical;
|
|
u8 __iomem *virtual;
|
|
u32 offset; /* in GATT pages */
|
|
u32 size; /* in bytes */
|
|
};
|
|
|
|
#ifdef CONFIG_FB_INTEL_I2C
|
|
struct intelfb_i2c_chan {
|
|
struct intelfb_info *dinfo;
|
|
u32 reg;
|
|
struct i2c_adapter adapter;
|
|
struct i2c_algo_bit_data algo;
|
|
};
|
|
#endif
|
|
|
|
struct intelfb_output_rec {
|
|
int type;
|
|
int pipe;
|
|
int flags;
|
|
|
|
#ifdef CONFIG_FB_INTEL_I2C
|
|
struct intelfb_i2c_chan i2c_bus;
|
|
struct intelfb_i2c_chan ddc_bus;
|
|
#endif
|
|
};
|
|
|
|
struct intelfb_vsync {
|
|
wait_queue_head_t wait;
|
|
unsigned int count;
|
|
int pan_display;
|
|
u32 pan_offset;
|
|
};
|
|
|
|
struct intelfb_info {
|
|
struct fb_info *info;
|
|
struct fb_ops *fbops;
|
|
struct pci_dev *pdev;
|
|
|
|
struct intelfb_hwstate save_state;
|
|
|
|
/* agpgart structs */
|
|
struct agp_memory *gtt_fb_mem; /* use all stolen memory or vram */
|
|
struct agp_memory *gtt_ring_mem; /* ring buffer */
|
|
struct agp_memory *gtt_cursor_mem; /* hw cursor */
|
|
|
|
/* use a gart reserved fb mem */
|
|
u8 fbmem_gart;
|
|
|
|
int wc_cookie;
|
|
|
|
/* heap data */
|
|
struct intelfb_heap_data aperture;
|
|
struct intelfb_heap_data fb;
|
|
struct intelfb_heap_data ring;
|
|
struct intelfb_heap_data cursor;
|
|
|
|
/* mmio regs */
|
|
u32 mmio_base_phys;
|
|
u8 __iomem *mmio_base;
|
|
|
|
/* fb start offset (in bytes) */
|
|
u32 fb_start;
|
|
|
|
/* ring buffer */
|
|
u32 ring_head;
|
|
u32 ring_tail;
|
|
u32 ring_tail_mask;
|
|
u32 ring_space;
|
|
u32 ring_lockup;
|
|
|
|
/* palette */
|
|
u32 pseudo_palette[16];
|
|
|
|
/* chip info */
|
|
int pci_chipset;
|
|
int chipset;
|
|
const char *name;
|
|
int mobile;
|
|
|
|
/* current mode */
|
|
int bpp, depth;
|
|
u32 visual;
|
|
int xres, yres, pitch;
|
|
int pixclock;
|
|
|
|
/* current pipe */
|
|
int pipe;
|
|
|
|
/* some flags */
|
|
int accel;
|
|
int hwcursor;
|
|
int fixed_mode;
|
|
int ring_active;
|
|
int flag;
|
|
unsigned long irq_flags;
|
|
int open;
|
|
|
|
/* vsync */
|
|
struct intelfb_vsync vsync;
|
|
spinlock_t int_lock;
|
|
|
|
/* hw cursor */
|
|
int cursor_on;
|
|
int cursor_blanked;
|
|
u8 cursor_src[64];
|
|
|
|
/* initial parameters */
|
|
int initial_vga;
|
|
struct fb_var_screeninfo initial_var;
|
|
u32 initial_fb_base;
|
|
u32 initial_video_ram;
|
|
u32 initial_pitch;
|
|
|
|
/* driver registered */
|
|
int registered;
|
|
|
|
/* index into plls */
|
|
int pll_index;
|
|
|
|
/* outputs */
|
|
int num_outputs;
|
|
struct intelfb_output_rec output[MAX_OUTPUTS];
|
|
};
|
|
|
|
#define IS_I9XX(dinfo) (((dinfo)->chipset == INTEL_915G) || \
|
|
((dinfo)->chipset == INTEL_915GM) || \
|
|
((dinfo)->chipset == INTEL_945G) || \
|
|
((dinfo)->chipset == INTEL_945GM) || \
|
|
((dinfo)->chipset == INTEL_945GME) || \
|
|
((dinfo)->chipset == INTEL_965G) || \
|
|
((dinfo)->chipset == INTEL_965GM))
|
|
|
|
/*** function prototypes ***/
|
|
|
|
extern int intelfb_var_to_depth(const struct fb_var_screeninfo *var);
|
|
|
|
#ifdef CONFIG_FB_INTEL_I2C
|
|
extern void intelfb_create_i2c_busses(struct intelfb_info *dinfo);
|
|
extern void intelfb_delete_i2c_busses(struct intelfb_info *dinfo);
|
|
#endif
|
|
|
|
#endif /* _INTELFB_H */
|