aboutsummaryrefslogtreecommitdiffstats
path: root/include/video
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-25 19:46:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-25 19:46:44 -0500
commitfffddfd6c8e0c10c42c6e2cc54ba880fcc36ebbb (patch)
tree71bc5e597124dbaf7550f1e089d675718b3ed5c0 /include/video
parent69086a78bdc973ec0b722be790b146e84ba8a8c4 (diff)
parentbe88298b0a3f771a4802f20c5e66af74bfd1dff1 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm merge from Dave Airlie: "Highlights: - TI LCD controller KMS driver - TI OMAP KMS driver merged from staging - drop gma500 stub driver - the fbcon locking fixes - the vgacon dirty like zebra fix. - open firmware videomode and hdmi common code helpers - major locking rework for kms object handling - pageflip/cursor won't block on polling anymore! - fbcon helper and prime helper cleanups - i915: all over the map, haswell power well enhancements, valleyview macro horrors cleaned up, killing lots of legacy GTT code, - radeon: CS ioctl unification, deprecated UMS support, gpu reset rework, VM fixes - nouveau: reworked thermal code, external dp/tmds encoder support (anx9805), fences sleep instead of polling, - exynos: all over the driver fixes." Lovely conflict in radeon/evergreen_cs.c between commit de0babd60d8d ("drm/radeon: enforce use of radeon_get_ib_value when reading user cmd") and the new changes that modified that evergreen_dma_cs_parse() function. * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (508 commits) drm/tilcdc: only build on arm drm/i915: Revert hdmi HDP pin checks drm/tegra: Add list of framebuffers to debugfs drm/tegra: Fix color expansion drm/tegra: Split DC_CMD_STATE_CONTROL register write drm/tegra: Implement page-flipping support drm/tegra: Implement VBLANK support drm/tegra: Implement .mode_set_base() drm/tegra: Add plane support drm/tegra: Remove bogus tegra_framebuffer structure drm: Add consistency check for page-flipping drm/radeon: Use generic HDMI infoframe helpers drm/tegra: Use generic HDMI infoframe helpers drm: Add EDID helper documentation drm: Add HDMI infoframe helpers video: Add generic HDMI infoframe helpers drm: Add some missing forward declarations drm: Move mode tables to drm_edid.c drm: Remove duplicate drm_mode_cea_vic() gma500: Fix n, m1 and m2 clock limits for sdvo and lvds ...
Diffstat (limited to 'include/video')
-rw-r--r--include/video/display_timing.h124
-rw-r--r--include/video/of_display_timing.h20
-rw-r--r--include/video/of_videomode.h18
-rw-r--r--include/video/videomode.h48
4 files changed, 210 insertions, 0 deletions
diff --git a/include/video/display_timing.h b/include/video/display_timing.h
new file mode 100644
index 000000000000..71e9a383a981
--- /dev/null
+++ b/include/video/display_timing.h
@@ -0,0 +1,124 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * description of display timings
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_DISPLAY_TIMING_H
10#define __LINUX_DISPLAY_TIMING_H
11
12#include <linux/bitops.h>
13#include <linux/types.h>
14
15/* VESA display monitor timing parameters */
16#define VESA_DMT_HSYNC_LOW BIT(0)
17#define VESA_DMT_HSYNC_HIGH BIT(1)
18#define VESA_DMT_VSYNC_LOW BIT(2)
19#define VESA_DMT_VSYNC_HIGH BIT(3)
20
21/* display specific flags */
22#define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */
23#define DISPLAY_FLAGS_DE_HIGH BIT(1)
24#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */
25#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */
26#define DISPLAY_FLAGS_INTERLACED BIT(4)
27#define DISPLAY_FLAGS_DOUBLESCAN BIT(5)
28
29/*
30 * A single signal can be specified via a range of minimal and maximal values
31 * with a typical value, that lies somewhere inbetween.
32 */
33struct timing_entry {
34 u32 min;
35 u32 typ;
36 u32 max;
37};
38
39enum timing_entry_index {
40 TE_MIN = 0,
41 TE_TYP = 1,
42 TE_MAX = 2,
43};
44
45/*
46 * Single "mode" entry. This describes one set of signal timings a display can
47 * have in one setting. This struct can later be converted to struct videomode
48 * (see include/video/videomode.h). As each timing_entry can be defined as a
49 * range, one struct display_timing may become multiple struct videomodes.
50 *
51 * Example: hsync active high, vsync active low
52 *
53 * Active Video
54 * Video ______________________XXXXXXXXXXXXXXXXXXXXXX_____________________
55 * |<- sync ->|<- back ->|<----- active ----->|<- front ->|<- sync..
56 * | | porch | | porch |
57 *
58 * HSync _|¯¯¯¯¯¯¯¯¯¯|___________________________________________|¯¯¯¯¯¯¯¯¯
59 *
60 * VSync ¯|__________|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|_________
61 */
62struct display_timing {
63 struct timing_entry pixelclock;
64
65 struct timing_entry hactive; /* hor. active video */
66 struct timing_entry hfront_porch; /* hor. front porch */
67 struct timing_entry hback_porch; /* hor. back porch */
68 struct timing_entry hsync_len; /* hor. sync len */
69
70 struct timing_entry vactive; /* ver. active video */
71 struct timing_entry vfront_porch; /* ver. front porch */
72 struct timing_entry vback_porch; /* ver. back porch */
73 struct timing_entry vsync_len; /* ver. sync len */
74
75 unsigned int dmt_flags; /* VESA DMT flags */
76 unsigned int data_flags; /* video data flags */
77};
78
79/*
80 * This describes all timing settings a display provides.
81 * The native_mode is the default setting for this display.
82 * Drivers that can handle multiple videomodes should work with this struct and
83 * convert each entry to the desired end result.
84 */
85struct display_timings {
86 unsigned int num_timings;
87 unsigned int native_mode;
88
89 struct display_timing **timings;
90};
91
92/* get value specified by index from struct timing_entry */
93static inline u32 display_timing_get_value(const struct timing_entry *te,
94 enum timing_entry_index index)
95{
96 switch (index) {
97 case TE_MIN:
98 return te->min;
99 break;
100 case TE_TYP:
101 return te->typ;
102 break;
103 case TE_MAX:
104 return te->max;
105 break;
106 default:
107 return te->typ;
108 }
109}
110
111/* get one entry from struct display_timings */
112static inline struct display_timing *display_timings_get(const struct
113 display_timings *disp,
114 unsigned int index)
115{
116 if (disp->num_timings > index)
117 return disp->timings[index];
118 else
119 return NULL;
120}
121
122void display_timings_release(struct display_timings *disp);
123
124#endif
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h
new file mode 100644
index 000000000000..8016eb727cf3
--- /dev/null
+++ b/include/video/of_display_timing.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * display timings of helpers
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_OF_DISPLAY_TIMING_H
10#define __LINUX_OF_DISPLAY_TIMING_H
11
12struct device_node;
13struct display_timings;
14
15#define OF_USE_NATIVE_MODE -1
16
17struct display_timings *of_get_display_timings(struct device_node *np);
18int of_display_timings_exist(struct device_node *np);
19
20#endif
diff --git a/include/video/of_videomode.h b/include/video/of_videomode.h
new file mode 100644
index 000000000000..a07efcc51424
--- /dev/null
+++ b/include/video/of_videomode.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * videomode of-helpers
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_OF_VIDEOMODE_H
10#define __LINUX_OF_VIDEOMODE_H
11
12struct device_node;
13struct videomode;
14
15int of_get_videomode(struct device_node *np, struct videomode *vm,
16 int index);
17
18#endif /* __LINUX_OF_VIDEOMODE_H */
diff --git a/include/video/videomode.h b/include/video/videomode.h
new file mode 100644
index 000000000000..a42156234dd4
--- /dev/null
+++ b/include/video/videomode.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * generic videomode description
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_VIDEOMODE_H
10#define __LINUX_VIDEOMODE_H
11
12#include <linux/types.h>
13#include <video/display_timing.h>
14
15/*
16 * Subsystem independent description of a videomode.
17 * Can be generated from struct display_timing.
18 */
19struct videomode {
20 unsigned long pixelclock; /* pixelclock in Hz */
21
22 u32 hactive;
23 u32 hfront_porch;
24 u32 hback_porch;
25 u32 hsync_len;
26
27 u32 vactive;
28 u32 vfront_porch;
29 u32 vback_porch;
30 u32 vsync_len;
31
32 unsigned int dmt_flags; /* VESA DMT flags */
33 unsigned int data_flags; /* video data flags */
34};
35
36/**
37 * videomode_from_timing - convert display timing to videomode
38 * @disp: structure with all possible timing entries
39 * @vm: return value
40 * @index: index into the list of display timings in devicetree
41 *
42 * DESCRIPTION:
43 * This function converts a struct display_timing to a struct videomode.
44 */
45int videomode_from_timing(const struct display_timings *disp,
46 struct videomode *vm, unsigned int index);
47
48#endif