aboutsummaryrefslogtreecommitdiffstats
path: root/include/video
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /include/video
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'include/video')
-rw-r--r--include/video/epson1355.h64
-rw-r--r--include/video/nvhdcp.h91
-rw-r--r--include/video/tegra_dc_ext.h320
-rw-r--r--include/video/tegrafb.h32
4 files changed, 507 insertions, 0 deletions
diff --git a/include/video/epson1355.h b/include/video/epson1355.h
new file mode 100644
index 00000000000..9759f299499
--- /dev/null
+++ b/include/video/epson1355.h
@@ -0,0 +1,64 @@
1/*
2 * include/video/epson13xx.h -- Epson 13xx frame buffer
3 *
4 * Copyright (C) Hewlett-Packard Company. All rights reserved.
5 *
6 * Written by Christopher Hoover <ch@hpl.hp.com>
7 *
8 */
9
10#ifndef _EPSON13XX_H_
11#define _EPSON13XX_H_
12
13#define REG_REVISION_CODE 0x00
14#define REG_MEMORY_CONFIG 0x01
15#define REG_PANEL_TYPE 0x02
16#define REG_MOD_RATE 0x03
17#define REG_HORZ_DISP_WIDTH 0x04
18#define REG_HORZ_NONDISP_PERIOD 0x05
19#define REG_HRTC_START_POSITION 0x06
20#define REG_HRTC_PULSE_WIDTH 0x07
21#define REG_VERT_DISP_HEIGHT0 0x08
22#define REG_VERT_DISP_HEIGHT1 0x09
23#define REG_VERT_NONDISP_PERIOD 0x0A
24#define REG_VRTC_START_POSITION 0x0B
25#define REG_VRTC_PULSE_WIDTH 0x0C
26#define REG_DISPLAY_MODE 0x0D
27#define REG_SCRN1_LINE_COMPARE0 0x0E
28#define REG_SCRN1_LINE_COMPARE1 0x0F
29#define REG_SCRN1_DISP_START_ADDR0 0x10
30#define REG_SCRN1_DISP_START_ADDR1 0x11
31#define REG_SCRN1_DISP_START_ADDR2 0x12
32#define REG_SCRN2_DISP_START_ADDR0 0x13
33#define REG_SCRN2_DISP_START_ADDR1 0x14
34#define REG_SCRN2_DISP_START_ADDR2 0x15
35#define REG_MEM_ADDR_OFFSET0 0x16
36#define REG_MEM_ADDR_OFFSET1 0x17
37#define REG_PIXEL_PANNING 0x18
38#define REG_CLOCK_CONFIG 0x19
39#define REG_POWER_SAVE_CONFIG 0x1A
40#define REG_MISC 0x1B
41#define REG_MD_CONFIG_READBACK0 0x1C
42#define REG_MD_CONFIG_READBACK1 0x1D
43#define REG_GPIO_CONFIG0 0x1E
44#define REG_GPIO_CONFIG1 0x1F
45#define REG_GPIO_CONTROL0 0x20
46#define REG_GPIO_CONTROL1 0x21
47#define REG_PERF_ENHANCEMENT0 0x22
48#define REG_PERF_ENHANCEMENT1 0x23
49#define REG_LUT_ADDR 0x24
50#define REG_RESERVED_1 0x25
51#define REG_LUT_DATA 0x26
52#define REG_INK_CURSOR_CONTROL 0x27
53#define REG_CURSOR_X_POSITION0 0x28
54#define REG_CURSOR_X_POSITION1 0x29
55#define REG_CURSOR_Y_POSITION0 0x2A
56#define REG_CURSOR_Y_POSITION1 0x2B
57#define REG_INK_CURSOR_COLOR0_0 0x2C
58#define REG_INK_CURSOR_COLOR0_1 0x2D
59#define REG_INK_CURSOR_COLOR1_0 0x2E
60#define REG_INK_CURSOR_COLOR1_1 0x2F
61#define REG_INK_CURSOR_START_ADDR 0x30
62#define REG_ALTERNATE_FRM 0x31
63
64#endif
diff --git a/include/video/nvhdcp.h b/include/video/nvhdcp.h
new file mode 100644
index 00000000000..f282ff8caa9
--- /dev/null
+++ b/include/video/nvhdcp.h
@@ -0,0 +1,91 @@
1/*
2 * include/video/nvhdcp.h
3 *
4 * Copyright (c) 2010-2011, NVIDIA Corporation.
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef _LINUX_NVHDCP_H_
18#define _LINUX_NVHDCP_H_
19
20#include <linux/fb.h>
21#include <linux/types.h>
22#include <asm/ioctl.h>
23
24/* maximum receivers and repeaters connected at a time */
25#define TEGRA_NVHDCP_MAX_DEVS 127
26
27/* values for value_flags */
28#define TEGRA_NVHDCP_FLAG_AN 0x0001
29#define TEGRA_NVHDCP_FLAG_AKSV 0x0002
30#define TEGRA_NVHDCP_FLAG_BKSV 0x0004
31#define TEGRA_NVHDCP_FLAG_BSTATUS 0x0008 /* repeater status */
32#define TEGRA_NVHDCP_FLAG_CN 0x0010 /* c_n */
33#define TEGRA_NVHDCP_FLAG_CKSV 0x0020 /* c_ksv */
34#define TEGRA_NVHDCP_FLAG_DKSV 0x0040 /* d_ksv */
35#define TEGRA_NVHDCP_FLAG_KP 0x0080 /* k_prime */
36#define TEGRA_NVHDCP_FLAG_S 0x0100 /* hdcp_status */
37#define TEGRA_NVHDCP_FLAG_CS 0x0200 /* connection state */
38#define TEGRA_NVHDCP_FLAG_V 0x0400
39#define TEGRA_NVHDCP_FLAG_MP 0x0800
40#define TEGRA_NVHDCP_FLAG_BKSVLIST 0x1000
41
42/* values for packet_results */
43#define TEGRA_NVHDCP_RESULT_SUCCESS 0
44#define TEGRA_NVHDCP_RESULT_UNSUCCESSFUL 1
45#define TEGRA_NVHDCP_RESULT_PENDING 0x103
46#define TEGRA_NVHDCP_RESULT_LINK_FAILED 0xc0000013
47/* TODO: replace with -EINVAL */
48#define TEGRA_NVHDCP_RESULT_INVALID_PARAMETER 0xc000000d
49#define TEGRA_NVHDCP_RESULT_INVALID_PARAMETER_MIX 0xc0000030
50/* TODO: replace with -ENOMEM */
51#define TEGRA_NVHDCP_RESULT_NO_MEMORY 0xc0000017
52
53struct tegra_nvhdcp_packet {
54 __u32 value_flags; // (IN/OUT)
55 __u32 packet_results; // (OUT)
56
57 __u64 c_n; // (IN) upstream exchange number
58 __u64 c_ksv; // (IN)
59
60 __u32 b_status; // (OUT) link/repeater status
61 __u64 hdcp_status; // (OUT) READ_S
62 __u64 cs; // (OUT) Connection State
63
64 __u64 k_prime; // (OUT)
65 __u64 a_n; // (OUT)
66 __u64 a_ksv; // (OUT)
67 __u64 b_ksv; // (OUT)
68 __u64 d_ksv; // (OUT)
69 __u8 v_prime[20]; // (OUT) 160-bit
70 __u64 m_prime; // (OUT)
71
72 // (OUT) Valid KSVs in the bKsvList. Maximum is 127 devices
73 __u32 num_bksv_list;
74
75 // (OUT) Up to 127 receivers & repeaters
76 __u64 bksv_list[TEGRA_NVHDCP_MAX_DEVS];
77};
78
79/* parameters to TEGRAIO_NVHDCP_SET_POLICY */
80#define TEGRA_NVHDCP_POLICY_ON_DEMAND 0
81#define TEGRA_NVHDCP_POLICY_ALWAYS_ON 1
82
83/* ioctls */
84#define TEGRAIO_NVHDCP_ON _IO('F', 0x70)
85#define TEGRAIO_NVHDCP_OFF _IO('F', 0x71)
86#define TEGRAIO_NVHDCP_SET_POLICY _IOW('F', 0x72, __u32)
87#define TEGRAIO_NVHDCP_READ_M _IOWR('F', 0x73, struct tegra_nvhdcp_packet)
88#define TEGRAIO_NVHDCP_READ_S _IOWR('F', 0x74, struct tegra_nvhdcp_packet)
89#define TEGRAIO_NVHDCP_RENEGOTIATE _IO('F', 0x75)
90
91#endif
diff --git a/include/video/tegra_dc_ext.h b/include/video/tegra_dc_ext.h
new file mode 100644
index 00000000000..f46074b1e55
--- /dev/null
+++ b/include/video/tegra_dc_ext.h
@@ -0,0 +1,320 @@
1/*
2 * Copyright (C) 2011, NVIDIA Corporation
3 *
4 * Author: Robert Morell <rmorell@nvidia.com>
5 * Some code based on fbdev extensions written by:
6 * Erik Gilling <konkers@android.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 */
18
19#ifndef __TEGRA_DC_EXT_H
20#define __TEGRA_DC_EXT_H
21
22#include <linux/types.h>
23#include <linux/ioctl.h>
24#if defined(__KERNEL__)
25# include <linux/time.h>
26#else
27# include <time.h>
28# include <unistd.h>
29#endif
30
31#define TEGRA_DC_EXT_FMT_P1 0
32#define TEGRA_DC_EXT_FMT_P2 1
33#define TEGRA_DC_EXT_FMT_P4 2
34#define TEGRA_DC_EXT_FMT_P8 3
35#define TEGRA_DC_EXT_FMT_B4G4R4A4 4
36#define TEGRA_DC_EXT_FMT_B5G5R5A 5
37#define TEGRA_DC_EXT_FMT_B5G6R5 6
38#define TEGRA_DC_EXT_FMT_AB5G5R5 7
39#define TEGRA_DC_EXT_FMT_B8G8R8A8 12
40#define TEGRA_DC_EXT_FMT_R8G8B8A8 13
41#define TEGRA_DC_EXT_FMT_B6x2G6x2R6x2A8 14
42#define TEGRA_DC_EXT_FMT_R6x2G6x2B6x2A8 15
43#define TEGRA_DC_EXT_FMT_YCbCr422 16
44#define TEGRA_DC_EXT_FMT_YUV422 17
45#define TEGRA_DC_EXT_FMT_YCbCr420P 18
46#define TEGRA_DC_EXT_FMT_YUV420P 19
47#define TEGRA_DC_EXT_FMT_YCbCr422P 20
48#define TEGRA_DC_EXT_FMT_YUV422P 21
49#define TEGRA_DC_EXT_FMT_YCbCr422R 22
50#define TEGRA_DC_EXT_FMT_YUV422R 23
51#define TEGRA_DC_EXT_FMT_YCbCr422RA 24
52#define TEGRA_DC_EXT_FMT_YUV422RA 25
53
54#define TEGRA_DC_EXT_BLEND_NONE 0
55#define TEGRA_DC_EXT_BLEND_PREMULT 1
56#define TEGRA_DC_EXT_BLEND_COVERAGE 2
57
58#define TEGRA_DC_EXT_FLIP_FLAG_INVERT_H (1 << 0)
59#define TEGRA_DC_EXT_FLIP_FLAG_INVERT_V (1 << 1)
60#define TEGRA_DC_EXT_FLIP_FLAG_TILED (1 << 2)
61#define TEGRA_DC_EXT_FLIP_FLAG_CURSOR (1 << 3)
62
63struct tegra_dc_ext_flip_windowattr {
64 __s32 index;
65 __u32 buff_id;
66 __u32 blend;
67 __u32 offset;
68 __u32 offset_u;
69 __u32 offset_v;
70 __u32 stride;
71 __u32 stride_uv;
72 __u32 pixformat;
73 /*
74 * x, y, w, h are fixed-point: 20 bits of integer (MSB) and 12 bits of
75 * fractional (LSB)
76 */
77 __u32 x;
78 __u32 y;
79 __u32 w;
80 __u32 h;
81 __u32 out_x;
82 __u32 out_y;
83 __u32 out_w;
84 __u32 out_h;
85 __u32 z;
86 __u32 swap_interval;
87 struct timespec timestamp;
88 __u32 pre_syncpt_id;
89 __u32 pre_syncpt_val;
90 /* These two are optional; if zero, U and V are taken from buff_id */
91 __u32 buff_id_u;
92 __u32 buff_id_v;
93 __u32 flags;
94 /* Leave some wiggle room for future expansion */
95 __u32 pad[5];
96};
97
98#define TEGRA_DC_EXT_FLIP_N_WINDOWS 3
99
100struct tegra_dc_ext_flip {
101 struct tegra_dc_ext_flip_windowattr win[TEGRA_DC_EXT_FLIP_N_WINDOWS];
102 __u32 post_syncpt_id;
103 __u32 post_syncpt_val;
104};
105
106/*
107 * Cursor image format:
108 * - Tegra hardware supports two colors: foreground and background, specified
109 * by the client in RGB8.
110 * - The image should be specified as two 1bpp bitmaps immediately following
111 * each other in memory. Each pixel in the final cursor will be constructed
112 * from the bitmaps with the following logic:
113 * bitmap1 bitmap0
114 * (mask) (color)
115 * 1 0 transparent
116 * 1 1 inverted
117 * 0 0 background color
118 * 0 1 foreground color
119 * - Exactly one of the SIZE flags must be specified.
120 */
121#define TEGRA_DC_EXT_CURSOR_IMAGE_FLAGS_SIZE_32x32 1
122#define TEGRA_DC_EXT_CURSOR_IMAGE_FLAGS_SIZE_64x64 2
123struct tegra_dc_ext_cursor_image {
124 struct {
125 __u8 r;
126 __u8 g;
127 __u8 b;
128 } foreground, background;
129 __u32 buff_id;
130 __u32 flags;
131};
132
133/* Possible flags for struct nvdc_cursor's flags field */
134#define TEGRA_DC_EXT_CURSOR_FLAGS_VISIBLE 1
135
136struct tegra_dc_ext_cursor {
137 __s16 x;
138 __s16 y;
139 __u32 flags;
140};
141
142/*
143 * Color conversion is performed as follows:
144 *
145 * r = sat(kyrgb * sat(y + yof) + kur * u + kvr * v)
146 * g = sat(kyrgb * sat(y + yof) + kug * u + kvg * v)
147 * b = sat(kyrgb * sat(y + yof) + kub * u + kvb * v)
148 *
149 * Coefficients should be specified as fixed-point values; the exact format
150 * varies for each coefficient.
151 * The format for each coefficient is listed below with the syntax:
152 * - A "s." prefix means that the coefficient has a sign bit (twos complement).
153 * - The first number is the number of bits in the integer component (not
154 * including the optional sign bit).
155 * - The second number is the number of bits in the fractional component.
156 *
157 * All three fields should be tightly packed, justified to the LSB of the
158 * 16-bit value. For example, the "s.2.8" value should be packed as:
159 * (MSB) 5 bits of 0, 1 bit of sign, 2 bits of integer, 8 bits of frac (LSB)
160 */
161struct tegra_dc_ext_csc {
162 __u32 win_index;
163 __u16 yof; /* s.7.0 */
164 __u16 kyrgb; /* 2.8 */
165 __u16 kur; /* s.2.8 */
166 __u16 kvr; /* s.2.8 */
167 __u16 kug; /* s.1.8 */
168 __u16 kvg; /* s.1.8 */
169 __u16 kub; /* s.2.8 */
170 __u16 kvb; /* s.2.8 */
171};
172
173/*
174 * RGB Lookup table
175 *
176 * In true-color and YUV modes this is used for post-CSC RGB->RGB lookup, i.e.
177 * gamma-correction. In palette-indexed RGB modes, this table designates the
178 * mode's color palette.
179 *
180 * To convert 8-bit per channel RGB values to 16-bit, duplicate the 8 bits
181 * in low and high byte, e.g. r=r|(r<<8)
182 *
183 * To just update flags, set len to 0.
184 *
185 * Current Tegra DC hardware supports 8-bit per channel to 8-bit per channel,
186 * and each hardware window (overlay) uses its own lookup table.
187 *
188 */
189struct tegra_dc_ext_lut {
190 __u32 win_index; /* window index to set lut for */
191 __u32 flags; /* Flag bitmask, see TEGRA_DC_EXT_LUT_FLAGS_* */
192 __u32 start; /* start index to update lut from */
193 __u32 len; /* number of valid lut entries */
194 __u16 *r; /* array of 16-bit red values, 0 to reset */
195 __u16 *g; /* array of 16-bit green values, 0 to reset */
196 __u16 *b; /* array of 16-bit blue values, 0 to reset */
197};
198
199/* tegra_dc_ext_lut.flags - override global fb device lookup table.
200 * Default behaviour is double-lookup.
201 */
202#define TEGRA_DC_EXT_LUT_FLAGS_FBOVERRIDE 0x01
203
204#define TEGRA_DC_EXT_FLAGS_ENABLED 1
205struct tegra_dc_ext_status {
206 __u32 flags;
207 /* Leave some wiggle room for future expansion */
208 __u32 pad[3];
209};
210
211#define TEGRA_DC_EXT_SET_NVMAP_FD \
212 _IOW('D', 0x00, __s32)
213
214#define TEGRA_DC_EXT_GET_WINDOW \
215 _IOW('D', 0x01, __u32)
216#define TEGRA_DC_EXT_PUT_WINDOW \
217 _IOW('D', 0x02, __u32)
218
219#define TEGRA_DC_EXT_FLIP \
220 _IOWR('D', 0x03, struct tegra_dc_ext_flip)
221
222#define TEGRA_DC_EXT_GET_CURSOR \
223 _IO('D', 0x04)
224#define TEGRA_DC_EXT_PUT_CURSOR \
225 _IO('D', 0x05)
226#define TEGRA_DC_EXT_SET_CURSOR_IMAGE \
227 _IOW('D', 0x06, struct tegra_dc_ext_cursor_image)
228#define TEGRA_DC_EXT_SET_CURSOR \
229 _IOW('D', 0x07, struct tegra_dc_ext_cursor)
230
231#define TEGRA_DC_EXT_SET_CSC \
232 _IOW('D', 0x08, struct tegra_dc_ext_csc)
233
234#define TEGRA_DC_EXT_GET_STATUS \
235 _IOR('D', 0x09, struct tegra_dc_ext_status)
236
237/*
238 * Returns the auto-incrementing vblank syncpoint for the head associated with
239 * this device node
240 */
241#define TEGRA_DC_EXT_GET_VBLANK_SYNCPT \
242 _IOR('D', 0x09, __u32)
243
244#define TEGRA_DC_EXT_SET_LUT \
245 _IOW('D', 0x0A, struct tegra_dc_ext_lut)
246
247enum tegra_dc_ext_control_output_type {
248 TEGRA_DC_EXT_DSI,
249 TEGRA_DC_EXT_LVDS,
250 TEGRA_DC_EXT_VGA,
251 TEGRA_DC_EXT_HDMI,
252 TEGRA_DC_EXT_DVI,
253};
254
255/*
256 * Get the properties for a given output.
257 *
258 * handle (in): Which output to query
259 * type (out): Describes the type of the output
260 * connected (out): Non-zero iff the output is currently connected
261 * associated_head (out): The head number that the output is currently
262 * bound to. -1 iff the output is not associated with any head.
263 * head_mask (out): Bitmask of which heads the output may be bound to (some
264 * outputs are permanently bound to a single head).
265 */
266struct tegra_dc_ext_control_output_properties {
267 __u32 handle;
268 enum tegra_dc_ext_control_output_type type;
269 __u32 connected;
270 __s32 associated_head;
271 __u32 head_mask;
272};
273
274/*
275 * This allows userspace to query the raw EDID data for the specified output
276 * handle.
277 *
278 * Here, the size parameter is both an input and an output:
279 * 1. Userspace passes in the size of the buffer allocated for data.
280 * 2. If size is too small, the call fails with the error EFBIG; otherwise, the
281 * raw EDID data is written to the buffer pointed to by data. In both
282 * cases, size will be filled in with the size of the data.
283 */
284struct tegra_dc_ext_control_output_edid {
285 __u32 handle;
286 __u32 size;
287 void *data;
288};
289
290struct tegra_dc_ext_event {
291 __u32 type;
292 ssize_t data_size;
293 char data[0];
294};
295
296#define TEGRA_DC_EXT_EVENT_HOTPLUG 0x1
297struct tegra_dc_ext_control_event_hotplug {
298 __u32 handle;
299};
300
301
302#define TEGRA_DC_EXT_CAPABILITIES_CURSOR_MODE (1 << 0)
303struct tegra_dc_ext_control_capabilities {
304 __u32 caps;
305 /* Leave some wiggle room for future expansion */
306 __u32 pad[3];
307};
308
309#define TEGRA_DC_EXT_CONTROL_GET_NUM_OUTPUTS \
310 _IOR('C', 0x00, __u32)
311#define TEGRA_DC_EXT_CONTROL_GET_OUTPUT_PROPERTIES \
312 _IOWR('C', 0x01, struct tegra_dc_ext_control_output_properties)
313#define TEGRA_DC_EXT_CONTROL_GET_OUTPUT_EDID \
314 _IOWR('C', 0x02, struct tegra_dc_ext_control_output_edid)
315#define TEGRA_DC_EXT_CONTROL_SET_EVENT_MASK \
316 _IOW('C', 0x03, __u32)
317#define TEGRA_DC_EXT_CONTROL_GET_CAPABILITIES \
318 _IOR('C', 0x04, struct tegra_dc_ext_control_capabilities)
319
320#endif /* __TEGRA_DC_EXT_H */
diff --git a/include/video/tegrafb.h b/include/video/tegrafb.h
new file mode 100644
index 00000000000..919661b1a8e
--- /dev/null
+++ b/include/video/tegrafb.h
@@ -0,0 +1,32 @@
1/*
2 * include/video/tegrafb.h
3 *
4 * Copyright (C) 2010 Google, Inc.
5 * Author: Erik Gilling <konkers@android.com>
6 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#ifndef _LINUX_TEGRAFB_H_
19#define _LINUX_TEGRAFB_H_
20
21#include <linux/fb.h>
22#include <linux/types.h>
23#include <linux/ioctl.h>
24
25struct tegra_fb_modedb {
26 struct fb_var_screeninfo *modedb;
27 __u32 modedb_len;
28};
29
30#define FBIO_TEGRA_GET_MODEDB _IOWR('F', 0x42, struct tegra_fb_modedb)
31
32#endif