Skip to content

Commit 3c2e81e

Browse files
committed
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull DRM updates from Dave Airlie: "This is the one and only next pull for 3.8, we had a regression we found last week, so I was waiting for that to resolve itself, and I ended up with some Intel fixes on top as well. Highlights: - new driver: nvidia tegra 20/30/hdmi support - radeon: add support for previously unused DMA engines, more HDMI regs, eviction speeds ups and fixes - i915: HSW support enable, agp removal on GEN6, seqno wrapping - exynos: IPP subsystem support (image post proc), HDMI - nouveau: display class reworking, nv20->40 z compression - ttm: start of locking fixes, rcu usage for lookups, - core: documentation updates, docbook integration, monotonic clock usage, move from connector to object properties" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (590 commits) drm/exynos: add gsc ipp driver drm/exynos: add rotator ipp driver drm/exynos: add fimc ipp driver drm/exynos: add iommu support for ipp drm/exynos: add ipp subsystem drm/exynos: support device tree for fimd radeon: fix regression with eviction since evict caching changes drm/radeon: add more pedantic checks in the CP DMA checker drm/radeon: bump version for CS ioctl support for async DMA drm/radeon: enable the async DMA rings in the CS ioctl drm/radeon: add VM CS parser support for async DMA on cayman/TN/SI drm/radeon/kms: add evergreen/cayman CS parser for async DMA (v2) drm/radeon/kms: add 6xx/7xx CS parser for async DMA (v2) drm/radeon: fix htile buffer size computation for command stream checker drm/radeon: fix fence locking in the pageflip callback drm/radeon: make indirect register access concurrency-safe drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss drm/exynos: support extended screen coordinate of fimd drm/exynos: fix x, y coordinates for right bottom pixel drm/exynos: fix fb offset calculation for plane ...
2 parents 221392c + 55bde6b commit 3c2e81e

364 files changed

Lines changed: 39036 additions & 14981 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/DMA-attributes.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,12 @@ transferred to 'device' domain. This attribute can be also used for
9191
dma_unmap_{single,page,sg} functions family to force buffer to stay in
9292
device domain after releasing a mapping for it. Use this attribute with
9393
care!
94+
95+
DMA_ATTR_FORCE_CONTIGUOUS
96+
-------------------------
97+
98+
By default DMA-mapping subsystem is allowed to assemble the buffer
99+
allocated by dma_alloc_attrs() function from individual pages if it can
100+
be mapped as contiguous chunk into device dma address space. By
101+
specifing this attribute the allocated buffer is forced to be contiguous
102+
also in physical memory.

‎Documentation/DocBook/drm.tmpl‎

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,23 +1141,13 @@ int max_width, max_height;</synopsis>
11411141
the <methodname>page_flip</methodname> operation will be called with a
11421142
non-NULL <parameter>event</parameter> argument pointing to a
11431143
<structname>drm_pending_vblank_event</structname> instance. Upon page
1144-
flip completion the driver must fill the
1145-
<parameter>event</parameter>::<structfield>event</structfield>
1146-
<structfield>sequence</structfield>, <structfield>tv_sec</structfield>
1147-
and <structfield>tv_usec</structfield> fields with the associated
1148-
vertical blanking count and timestamp, add the event to the
1149-
<parameter>drm_file</parameter> list of events to be signaled, and wake
1150-
up any waiting process. This can be performed with
1144+
flip completion the driver must call <methodname>drm_send_vblank_event</methodname>
1145+
to fill in the event and send to wake up any waiting processes.
1146+
This can be performed with
11511147
<programlisting><![CDATA[
1152-
struct timeval now;
1153-
1154-
event->event.sequence = drm_vblank_count_and_time(..., &now);
1155-
event->event.tv_sec = now.tv_sec;
1156-
event->event.tv_usec = now.tv_usec;
1157-
11581148
spin_lock_irqsave(&dev->event_lock, flags);
1159-
list_add_tail(&event->base.link, &event->base.file_priv->event_list);
1160-
wake_up_interruptible(&event->base.file_priv->event_wait);
1149+
...
1150+
drm_send_vblank_event(dev, pipe, event);
11611151
spin_unlock_irqrestore(&dev->event_lock, flags);
11621152
]]></programlisting>
11631153
</para>
@@ -1621,10 +1611,10 @@ void intel_crt_init(struct drm_device *dev)
16211611
</sect2>
16221612
</sect1>
16231613

1624-
<!-- Internals: mid-layer helper functions -->
1614+
<!-- Internals: kms helper functions -->
16251615

16261616
<sect1>
1627-
<title>Mid-layer Helper Functions</title>
1617+
<title>Mode Setting Helper Functions</title>
16281618
<para>
16291619
The CRTC, encoder and connector functions provided by the drivers
16301620
implement the DRM API. They're called by the DRM core and ioctl handlers
@@ -2106,6 +2096,21 @@ void intel_crt_init(struct drm_device *dev)
21062096
</listitem>
21072097
</itemizedlist>
21082098
</sect2>
2099+
<sect2>
2100+
<title>Modeset Helper Functions Reference</title>
2101+
!Edrivers/gpu/drm/drm_crtc_helper.c
2102+
</sect2>
2103+
<sect2>
2104+
<title>fbdev Helper Functions Reference</title>
2105+
!Pdrivers/gpu/drm/drm_fb_helper.c fbdev helpers
2106+
!Edrivers/gpu/drm/drm_fb_helper.c
2107+
</sect2>
2108+
<sect2>
2109+
<title>Display Port Helper Functions Reference</title>
2110+
!Pdrivers/gpu/drm/drm_dp_helper.c dp helpers
2111+
!Iinclude/drm/drm_dp_helper.h
2112+
!Edrivers/gpu/drm/drm_dp_helper.c
2113+
</sect2>
21092114
</sect1>
21102115

21112116
<!-- Internals: vertical blanking -->
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
NVIDIA Tegra host1x
2+
3+
Required properties:
4+
- compatible: "nvidia,tegra<chip>-host1x"
5+
- reg: Physical base address and length of the controller's registers.
6+
- interrupts: The interrupt outputs from the controller.
7+
- #address-cells: The number of cells used to represent physical base addresses
8+
in the host1x address space. Should be 1.
9+
- #size-cells: The number of cells used to represent the size of an address
10+
range in the host1x address space. Should be 1.
11+
- ranges: The mapping of the host1x address space to the CPU address space.
12+
13+
The host1x top-level node defines a number of children, each representing one
14+
of the following host1x client modules:
15+
16+
- mpe: video encoder
17+
18+
Required properties:
19+
- compatible: "nvidia,tegra<chip>-mpe"
20+
- reg: Physical base address and length of the controller's registers.
21+
- interrupts: The interrupt outputs from the controller.
22+
23+
- vi: video input
24+
25+
Required properties:
26+
- compatible: "nvidia,tegra<chip>-vi"
27+
- reg: Physical base address and length of the controller's registers.
28+
- interrupts: The interrupt outputs from the controller.
29+
30+
- epp: encoder pre-processor
31+
32+
Required properties:
33+
- compatible: "nvidia,tegra<chip>-epp"
34+
- reg: Physical base address and length of the controller's registers.
35+
- interrupts: The interrupt outputs from the controller.
36+
37+
- isp: image signal processor
38+
39+
Required properties:
40+
- compatible: "nvidia,tegra<chip>-isp"
41+
- reg: Physical base address and length of the controller's registers.
42+
- interrupts: The interrupt outputs from the controller.
43+
44+
- gr2d: 2D graphics engine
45+
46+
Required properties:
47+
- compatible: "nvidia,tegra<chip>-gr2d"
48+
- reg: Physical base address and length of the controller's registers.
49+
- interrupts: The interrupt outputs from the controller.
50+
51+
- gr3d: 3D graphics engine
52+
53+
Required properties:
54+
- compatible: "nvidia,tegra<chip>-gr3d"
55+
- reg: Physical base address and length of the controller's registers.
56+
57+
- dc: display controller
58+
59+
Required properties:
60+
- compatible: "nvidia,tegra<chip>-dc"
61+
- reg: Physical base address and length of the controller's registers.
62+
- interrupts: The interrupt outputs from the controller.
63+
64+
Each display controller node has a child node, named "rgb", that represents
65+
the RGB output associated with the controller. It can take the following
66+
optional properties:
67+
- nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
68+
- nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
69+
- nvidia,edid: supplies a binary EDID blob
70+
71+
- hdmi: High Definition Multimedia Interface
72+
73+
Required properties:
74+
- compatible: "nvidia,tegra<chip>-hdmi"
75+
- reg: Physical base address and length of the controller's registers.
76+
- interrupts: The interrupt outputs from the controller.
77+
- vdd-supply: regulator for supply voltage
78+
- pll-supply: regulator for PLL
79+
80+
Optional properties:
81+
- nvidia,ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing
82+
- nvidia,hpd-gpio: specifies a GPIO used for hotplug detection
83+
- nvidia,edid: supplies a binary EDID blob
84+
85+
- tvo: TV encoder output
86+
87+
Required properties:
88+
- compatible: "nvidia,tegra<chip>-tvo"
89+
- reg: Physical base address and length of the controller's registers.
90+
- interrupts: The interrupt outputs from the controller.
91+
92+
- dsi: display serial interface
93+
94+
Required properties:
95+
- compatible: "nvidia,tegra<chip>-dsi"
96+
- reg: Physical base address and length of the controller's registers.
97+
98+
Example:
99+
100+
/ {
101+
...
102+
103+
host1x {
104+
compatible = "nvidia,tegra20-host1x", "simple-bus";
105+
reg = <0x50000000 0x00024000>;
106+
interrupts = <0 65 0x04 /* mpcore syncpt */
107+
0 67 0x04>; /* mpcore general */
108+
109+
#address-cells = <1>;
110+
#size-cells = <1>;
111+
112+
ranges = <0x54000000 0x54000000 0x04000000>;
113+
114+
mpe {
115+
compatible = "nvidia,tegra20-mpe";
116+
reg = <0x54040000 0x00040000>;
117+
interrupts = <0 68 0x04>;
118+
};
119+
120+
vi {
121+
compatible = "nvidia,tegra20-vi";
122+
reg = <0x54080000 0x00040000>;
123+
interrupts = <0 69 0x04>;
124+
};
125+
126+
epp {
127+
compatible = "nvidia,tegra20-epp";
128+
reg = <0x540c0000 0x00040000>;
129+
interrupts = <0 70 0x04>;
130+
};
131+
132+
isp {
133+
compatible = "nvidia,tegra20-isp";
134+
reg = <0x54100000 0x00040000>;
135+
interrupts = <0 71 0x04>;
136+
};
137+
138+
gr2d {
139+
compatible = "nvidia,tegra20-gr2d";
140+
reg = <0x54140000 0x00040000>;
141+
interrupts = <0 72 0x04>;
142+
};
143+
144+
gr3d {
145+
compatible = "nvidia,tegra20-gr3d";
146+
reg = <0x54180000 0x00040000>;
147+
};
148+
149+
dc@54200000 {
150+
compatible = "nvidia,tegra20-dc";
151+
reg = <0x54200000 0x00040000>;
152+
interrupts = <0 73 0x04>;
153+
154+
rgb {
155+
status = "disabled";
156+
};
157+
};
158+
159+
dc@54240000 {
160+
compatible = "nvidia,tegra20-dc";
161+
reg = <0x54240000 0x00040000>;
162+
interrupts = <0 74 0x04>;
163+
164+
rgb {
165+
status = "disabled";
166+
};
167+
};
168+
169+
hdmi {
170+
compatible = "nvidia,tegra20-hdmi";
171+
reg = <0x54280000 0x00040000>;
172+
interrupts = <0 75 0x04>;
173+
status = "disabled";
174+
};
175+
176+
tvo {
177+
compatible = "nvidia,tegra20-tvo";
178+
reg = <0x542c0000 0x00040000>;
179+
interrupts = <0 76 0x04>;
180+
status = "disabled";
181+
};
182+
183+
dsi {
184+
compatible = "nvidia,tegra20-dsi";
185+
reg = <0x54300000 0x00040000>;
186+
status = "disabled";
187+
};
188+
};
189+
190+
...
191+
};

‎Documentation/kref.txt‎

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,91 @@ presentation on krefs, which can be found at:
213213
and:
214214
http://www.kroah.com/linux/talks/ols_2004_kref_talk/
215215

216+
217+
The above example could also be optimized using kref_get_unless_zero() in
218+
the following way:
219+
220+
static struct my_data *get_entry()
221+
{
222+
struct my_data *entry = NULL;
223+
mutex_lock(&mutex);
224+
if (!list_empty(&q)) {
225+
entry = container_of(q.next, struct my_data, link);
226+
if (!kref_get_unless_zero(&entry->refcount))
227+
entry = NULL;
228+
}
229+
mutex_unlock(&mutex);
230+
return entry;
231+
}
232+
233+
static void release_entry(struct kref *ref)
234+
{
235+
struct my_data *entry = container_of(ref, struct my_data, refcount);
236+
237+
mutex_lock(&mutex);
238+
list_del(&entry->link);
239+
mutex_unlock(&mutex);
240+
kfree(entry);
241+
}
242+
243+
static void put_entry(struct my_data *entry)
244+
{
245+
kref_put(&entry->refcount, release_entry);
246+
}
247+
248+
Which is useful to remove the mutex lock around kref_put() in put_entry(), but
249+
it's important that kref_get_unless_zero is enclosed in the same critical
250+
section that finds the entry in the lookup table,
251+
otherwise kref_get_unless_zero may reference already freed memory.
252+
Note that it is illegal to use kref_get_unless_zero without checking its
253+
return value. If you are sure (by already having a valid pointer) that
254+
kref_get_unless_zero() will return true, then use kref_get() instead.
255+
256+
The function kref_get_unless_zero also makes it possible to use rcu
257+
locking for lookups in the above example:
258+
259+
struct my_data
260+
{
261+
struct rcu_head rhead;
262+
.
263+
struct kref refcount;
264+
.
265+
.
266+
};
267+
268+
static struct my_data *get_entry_rcu()
269+
{
270+
struct my_data *entry = NULL;
271+
rcu_read_lock();
272+
if (!list_empty(&q)) {
273+
entry = container_of(q.next, struct my_data, link);
274+
if (!kref_get_unless_zero(&entry->refcount))
275+
entry = NULL;
276+
}
277+
rcu_read_unlock();
278+
return entry;
279+
}
280+
281+
static void release_entry_rcu(struct kref *ref)
282+
{
283+
struct my_data *entry = container_of(ref, struct my_data, refcount);
284+
285+
mutex_lock(&mutex);
286+
list_del_rcu(&entry->link);
287+
mutex_unlock(&mutex);
288+
kfree_rcu(entry, rhead);
289+
}
290+
291+
static void put_entry(struct my_data *entry)
292+
{
293+
kref_put(&entry->refcount, release_entry_rcu);
294+
}
295+
296+
But note that the struct kref member needs to remain in valid memory for a
297+
rcu grace period after release_entry_rcu was called. That can be accomplished
298+
by using kfree_rcu(entry, rhead) as done above, or by calling synchronize_rcu()
299+
before using kfree, but note that synchronize_rcu() may sleep for a
300+
substantial amount of time.
301+
302+
303+
Thomas Hellstrom <thellstrom@vmware.com>

‎MAINTAINERS‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,6 +2549,15 @@ S: Supported
25492549
F: drivers/gpu/drm/exynos
25502550
F: include/drm/exynos*
25512551

2552+
DRM DRIVERS FOR NVIDIA TEGRA
2553+
M: Thierry Reding <thierry.reding@avionic-design.de>
2554+
L: dri-devel@lists.freedesktop.org
2555+
L: linux-tegra@vger.kernel.org
2556+
T: git git://gitorious.org/thierryreding/linux.git
2557+
S: Maintained
2558+
F: drivers/gpu/drm/tegra/
2559+
F: Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
2560+
25522561
DSCC4 DRIVER
25532562
M: Francois Romieu <romieu@fr.zoreil.com>
25542563
L: netdev@vger.kernel.org

0 commit comments

Comments
 (0)