Skip to content

Commit a09e9a7

Browse files
committed
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm tree changes from Dave Airlie: "This is the main drm pull request, I have some overlap with sound and arm-soc, the sound patch is acked and may conflict based on -next reports but should be a trivial fixup, which I'll leave to you! Highlights: - new drivers: MSM driver from Rob Clark - non-drm: switcheroo and hdmi audio driver support for secondary GPU poweroff, so drivers can use runtime PM to poweroff the GPUs. This can save 5 or 6W on some optimus laptops. - drm core: combined GEM and TTM VMA manager per-filp mmap permission tracking initial rendernode support (via a runtime enable for now, until we get api stable), remove old proc support, lots of cleanups of legacy code hdmi vendor infoframes and 4k modes lots of gem/prime locking and races fixes async pageflip scaffolding drm bridge objects - i915: Haswell PC8+ support and eLLC support, HDMI 4K support, initial per-process VMA pieces, watermark reworks, convert to generic hdmi infoframes, encoder reworking, fastboot support, - radeon: CIK PM support, remove 3d blit code in favour of DMA engines, Berlin GPU support, HDMI audio fixes - nouveau: secondary GPU power down support for optimus laptops, lots of fixes, use MSI, VP3 engine support - exynos: runtime pm support for g2d, DT support, remove non-DT, - tda998x i2c driver: lots of fixes for sync issues - gma500: lots of cleanups - rcar: add LVDS support, fbdev emulation, - tegra: just minor fixes" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (684 commits) drm/exynos: Fix build error with exynos_drm_connector.c drm/exynos: Remove non-DT support in exynos_drm_fimd drm/exynos: Remove non-DT support in exynos_hdmi drm/exynos: Remove non-DT support in exynos_drm_g2d drm/exynos: Remove non-DT support in exynos_hdmiphy drm/exynos: Remove non-DT support in exynos_ddc drm/exynos: Make Exynos DRM drivers depend on OF drm/exynos: Consider fallback option to allocation fail drm/exynos: fimd: move platform data parsing to separate function drm/exynos: fimd: get signal polarities from device tree drm/exynos: fimd: replace struct fb_videomode with videomode drm/exynos: check a pixel format to a particular window layer drm/exynos: fix fimd pixel format setting drm/exynos: Add NULL pointer check drm/exynos: Remove redundant error messages drm/exynos: Add missing of.h header include drm/exynos: Remove redundant NULL check in exynos_drm_buf drm/exynos: add device tree support for rotator drm/exynos: Add missing includes drm/exynos: add runtime pm interfaces to g2d driver ...
2 parents 9ab073b + 86a7e12 commit a09e9a7

435 files changed

Lines changed: 50558 additions & 17822 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/DocBook/drm.tmpl‎

Lines changed: 97 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,6 @@
155155
will become a fatal error.
156156
</para></listitem>
157157
</varlistentry>
158-
<varlistentry>
159-
<term>DRIVER_USE_MTRR</term>
160-
<listitem><para>
161-
Driver uses MTRR interface for mapping memory, the DRM core will
162-
manage MTRR resources. Deprecated.
163-
</para></listitem>
164-
</varlistentry>
165158
<varlistentry>
166159
<term>DRIVER_PCI_DMA</term>
167160
<listitem><para>
@@ -194,28 +187,6 @@
194187
support shared IRQs (note that this is required of PCI drivers).
195188
</para></listitem>
196189
</varlistentry>
197-
<varlistentry>
198-
<term>DRIVER_IRQ_VBL</term>
199-
<listitem><para>Unused. Deprecated.</para></listitem>
200-
</varlistentry>
201-
<varlistentry>
202-
<term>DRIVER_DMA_QUEUE</term>
203-
<listitem><para>
204-
Should be set if the driver queues DMA requests and completes them
205-
asynchronously. Deprecated.
206-
</para></listitem>
207-
</varlistentry>
208-
<varlistentry>
209-
<term>DRIVER_FB_DMA</term>
210-
<listitem><para>
211-
Driver supports DMA to/from the framebuffer, mapping of frambuffer
212-
DMA buffers to userspace will be supported. Deprecated.
213-
</para></listitem>
214-
</varlistentry>
215-
<varlistentry>
216-
<term>DRIVER_IRQ_VBL2</term>
217-
<listitem><para>Unused. Deprecated.</para></listitem>
218-
</varlistentry>
219190
<varlistentry>
220191
<term>DRIVER_GEM</term>
221192
<listitem><para>
@@ -234,6 +205,12 @@
234205
Driver implements DRM PRIME buffer sharing.
235206
</para></listitem>
236207
</varlistentry>
208+
<varlistentry>
209+
<term>DRIVER_RENDER</term>
210+
<listitem><para>
211+
Driver supports dedicated render nodes.
212+
</para></listitem>
213+
</varlistentry>
237214
</variablelist>
238215
</sect3>
239216
<sect3>
@@ -2212,6 +2189,18 @@ void intel_crt_init(struct drm_device *dev)
22122189
!Iinclude/drm/drm_rect.h
22132190
!Edrivers/gpu/drm/drm_rect.c
22142191
</sect2>
2192+
<sect2>
2193+
<title>Flip-work Helper Reference</title>
2194+
!Pinclude/drm/drm_flip_work.h flip utils
2195+
!Iinclude/drm/drm_flip_work.h
2196+
!Edrivers/gpu/drm/drm_flip_work.c
2197+
</sect2>
2198+
<sect2>
2199+
<title>VMA Offset Manager</title>
2200+
!Pdrivers/gpu/drm/drm_vma_manager.c vma offset manager
2201+
!Edrivers/gpu/drm/drm_vma_manager.c
2202+
!Iinclude/drm/drm_vma_manager.h
2203+
</sect2>
22152204
</sect1>
22162205

22172206
<!-- Internals: kms properties -->
@@ -2422,18 +2411,18 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis>
24222411
</abstract>
24232412
<para>
24242413
The <methodname>firstopen</methodname> method is called by the DRM core
2425-
when an application opens a device that has no other opened file handle.
2426-
Similarly the <methodname>lastclose</methodname> method is called when
2427-
the last application holding a file handle opened on the device closes
2428-
it. Both methods are mostly used for UMS (User Mode Setting) drivers to
2429-
acquire and release device resources which should be done in the
2430-
<methodname>load</methodname> and <methodname>unload</methodname>
2431-
methods for KMS drivers.
2414+
for legacy UMS (User Mode Setting) drivers only when an application
2415+
opens a device that has no other opened file handle. UMS drivers can
2416+
implement it to acquire device resources. KMS drivers can't use the
2417+
method and must acquire resources in the <methodname>load</methodname>
2418+
method instead.
24322419
</para>
24332420
<para>
2434-
Note that the <methodname>lastclose</methodname> method is also called
2435-
at module unload time or, for hot-pluggable devices, when the device is
2436-
unplugged. The <methodname>firstopen</methodname> and
2421+
Similarly the <methodname>lastclose</methodname> method is called when
2422+
the last application holding a file handle opened on the device closes
2423+
it, for both UMS and KMS drivers. Additionally, the method is also
2424+
called at module unload time or, for hot-pluggable devices, when the
2425+
device is unplugged. The <methodname>firstopen</methodname> and
24372426
<methodname>lastclose</methodname> calls can thus be unbalanced.
24382427
</para>
24392428
<para>
@@ -2462,7 +2451,12 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis>
24622451
<para>
24632452
The <methodname>lastclose</methodname> method should restore CRTC and
24642453
plane properties to default value, so that a subsequent open of the
2465-
device will not inherit state from the previous user.
2454+
device will not inherit state from the previous user. It can also be
2455+
used to execute delayed power switching state changes, e.g. in
2456+
conjunction with the vga-switcheroo infrastructure. Beyond that KMS
2457+
drivers should not do any further cleanup. Only legacy UMS drivers might
2458+
need to clean up device state so that the vga console or an independent
2459+
fbdev driver could take over.
24662460
</para>
24672461
</sect2>
24682462
<sect2>
@@ -2498,7 +2492,6 @@ void (*postclose) (struct drm_device *, struct drm_file *);</synopsis>
24982492
<programlisting>
24992493
.poll = drm_poll,
25002494
.read = drm_read,
2501-
.fasync = drm_fasync,
25022495
.llseek = no_llseek,
25032496
</programlisting>
25042497
</para>
@@ -2657,6 +2650,69 @@ int (*resume) (struct drm_device *);</synopsis>
26572650
info, since man pages should cover the rest.
26582651
</para>
26592652

2653+
<!-- External: render nodes -->
2654+
2655+
<sect1>
2656+
<title>Render nodes</title>
2657+
<para>
2658+
DRM core provides multiple character-devices for user-space to use.
2659+
Depending on which device is opened, user-space can perform a different
2660+
set of operations (mainly ioctls). The primary node is always created
2661+
and called <term>card&lt;num&gt;</term>. Additionally, a currently
2662+
unused control node, called <term>controlD&lt;num&gt;</term> is also
2663+
created. The primary node provides all legacy operations and
2664+
historically was the only interface used by userspace. With KMS, the
2665+
control node was introduced. However, the planned KMS control interface
2666+
has never been written and so the control node stays unused to date.
2667+
</para>
2668+
<para>
2669+
With the increased use of offscreen renderers and GPGPU applications,
2670+
clients no longer require running compositors or graphics servers to
2671+
make use of a GPU. But the DRM API required unprivileged clients to
2672+
authenticate to a DRM-Master prior to getting GPU access. To avoid this
2673+
step and to grant clients GPU access without authenticating, render
2674+
nodes were introduced. Render nodes solely serve render clients, that
2675+
is, no modesetting or privileged ioctls can be issued on render nodes.
2676+
Only non-global rendering commands are allowed. If a driver supports
2677+
render nodes, it must advertise it via the <term>DRIVER_RENDER</term>
2678+
DRM driver capability. If not supported, the primary node must be used
2679+
for render clients together with the legacy drmAuth authentication
2680+
procedure.
2681+
</para>
2682+
<para>
2683+
If a driver advertises render node support, DRM core will create a
2684+
separate render node called <term>renderD&lt;num&gt;</term>. There will
2685+
be one render node per device. No ioctls except PRIME-related ioctls
2686+
will be allowed on this node. Especially <term>GEM_OPEN</term> will be
2687+
explicitly prohibited. Render nodes are designed to avoid the
2688+
buffer-leaks, which occur if clients guess the flink names or mmap
2689+
offsets on the legacy interface. Additionally to this basic interface,
2690+
drivers must mark their driver-dependent render-only ioctls as
2691+
<term>DRM_RENDER_ALLOW</term> so render clients can use them. Driver
2692+
authors must be careful not to allow any privileged ioctls on render
2693+
nodes.
2694+
</para>
2695+
<para>
2696+
With render nodes, user-space can now control access to the render node
2697+
via basic file-system access-modes. A running graphics server which
2698+
authenticates clients on the privileged primary/legacy node is no longer
2699+
required. Instead, a client can open the render node and is immediately
2700+
granted GPU access. Communication between clients (or servers) is done
2701+
via PRIME. FLINK from render node to legacy node is not supported. New
2702+
clients must not use the insecure FLINK interface.
2703+
</para>
2704+
<para>
2705+
Besides dropping all modeset/global ioctls, render nodes also drop the
2706+
DRM-Master concept. There is no reason to associate render clients with
2707+
a DRM-Master as they are independent of any graphics server. Besides,
2708+
they must work without any running master, anyway.
2709+
Drivers must be able to run without a master object if they support
2710+
render nodes. If, on the other hand, a driver requires shared state
2711+
between clients which is visible to user-space and accessible beyond
2712+
open-file boundaries, they cannot support render nodes.
2713+
</para>
2714+
</sect1>
2715+
26602716
<!-- External: vblank handling -->
26612717

26622718
<sect1>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
* Samsung Image Rotator
2+
3+
Required properties:
4+
- compatible : value should be one of the following:
5+
(a) "samsung,exynos4210-rotator" for Rotator IP in Exynos4210
6+
(b) "samsung,exynos4212-rotator" for Rotator IP in Exynos4212/4412
7+
(c) "samsung,exynos5250-rotator" for Rotator IP in Exynos5250
8+
9+
- reg : Physical base address of the IP registers and length of memory
10+
mapped region.
11+
12+
- interrupts : Interrupt specifier for rotator interrupt, according to format
13+
specific to interrupt parent.
14+
15+
- clocks : Clock specifier for rotator clock, according to generic clock
16+
bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt)
17+
18+
- clock-names : Names of clocks. For exynos rotator, it should be "rotator".
19+
20+
Example:
21+
rotator@12810000 {
22+
compatible = "samsung,exynos4210-rotator";
23+
reg = <0x12810000 0x1000>;
24+
interrupts = <0 83 0>;
25+
clocks = <&clock 278>;
26+
clock-names = "rotator";
27+
};

‎drivers/gpu/drm/Kconfig‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
menuconfig DRM
88
tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
9-
depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && MMU
9+
depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && MMU && HAS_DMA
1010
select HDMI
1111
select I2C
1212
select I2C_ALGOBIT
@@ -168,6 +168,17 @@ config DRM_I915_KMS
168168
the driver to bind to PCI devices, which precludes loading things
169169
like intelfb.
170170

171+
config DRM_I915_PRELIMINARY_HW_SUPPORT
172+
bool "Enable preliminary support for prerelease Intel hardware by default"
173+
depends on DRM_I915
174+
help
175+
Choose this option if you have prerelease Intel hardware and want the
176+
i915 driver to support it by default. You can enable such support at
177+
runtime with the module option i915.preliminary_hw_support=1; this
178+
option changes the default for that module option.
179+
180+
If in doubt, say "N".
181+
171182
config DRM_MGA
172183
tristate "Matrox g200/g400"
173184
depends on DRM && PCI
@@ -223,3 +234,5 @@ source "drivers/gpu/drm/omapdrm/Kconfig"
223234
source "drivers/gpu/drm/tilcdc/Kconfig"
224235

225236
source "drivers/gpu/drm/qxl/Kconfig"
237+
238+
source "drivers/gpu/drm/msm/Kconfig"

‎drivers/gpu/drm/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ ccflags-y := -Iinclude/drm
77
drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
88
drm_context.o drm_dma.o \
99
drm_drv.o drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
10-
drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \
10+
drm_lock.o drm_memory.o drm_stub.o drm_vm.o \
1111
drm_agpsupport.o drm_scatter.o drm_pci.o \
1212
drm_platform.o drm_sysfs.o drm_hashtab.o drm_mm.o \
1313
drm_crtc.o drm_modes.o drm_edid.o \
1414
drm_info.o drm_debugfs.o drm_encoder_slave.o \
1515
drm_trace_points.o drm_global.o drm_prime.o \
16-
drm_rect.o
16+
drm_rect.o drm_vma_manager.o drm_flip_work.o
1717

1818
drm-$(CONFIG_COMPAT) += drm_ioc32.o
1919
drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
@@ -54,4 +54,5 @@ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
5454
obj-$(CONFIG_DRM_OMAP) += omapdrm/
5555
obj-$(CONFIG_DRM_TILCDC) += tilcdc/
5656
obj-$(CONFIG_DRM_QXL) += qxl/
57+
obj-$(CONFIG_DRM_MSM) += msm/
5758
obj-y += i2c/

‎drivers/gpu/drm/ast/ast_drv.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,14 @@ static const struct file_operations ast_fops = {
190190
.unlocked_ioctl = drm_ioctl,
191191
.mmap = ast_mmap,
192192
.poll = drm_poll,
193-
.fasync = drm_fasync,
194193
#ifdef CONFIG_COMPAT
195194
.compat_ioctl = drm_compat_ioctl,
196195
#endif
197196
.read = drm_read,
198197
};
199198

200199
static struct drm_driver driver = {
201-
.driver_features = DRIVER_USE_MTRR | DRIVER_MODESET | DRIVER_GEM,
200+
.driver_features = DRIVER_MODESET | DRIVER_GEM,
202201
.dev_priv_size = 0,
203202

204203
.load = ast_driver_load,
@@ -216,7 +215,7 @@ static struct drm_driver driver = {
216215
.gem_free_object = ast_gem_free_object,
217216
.dumb_create = ast_dumb_create,
218217
.dumb_map_offset = ast_dumb_mmap_offset,
219-
.dumb_destroy = ast_dumb_destroy,
218+
.dumb_destroy = drm_gem_dumb_destroy,
220219

221220
};
222221

‎drivers/gpu/drm/ast/ast_drv.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@ ast_bo(struct ttm_buffer_object *bo)
322322
extern int ast_dumb_create(struct drm_file *file,
323323
struct drm_device *dev,
324324
struct drm_mode_create_dumb *args);
325-
extern int ast_dumb_destroy(struct drm_file *file,
326-
struct drm_device *dev,
327-
uint32_t handle);
328325

329326
extern int ast_gem_init_object(struct drm_gem_object *obj);
330327
extern void ast_gem_free_object(struct drm_gem_object *obj);

‎drivers/gpu/drm/ast/ast_main.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,6 @@ int ast_dumb_create(struct drm_file *file,
449449
return 0;
450450
}
451451

452-
int ast_dumb_destroy(struct drm_file *file,
453-
struct drm_device *dev,
454-
uint32_t handle)
455-
{
456-
return drm_gem_handle_delete(file, handle);
457-
}
458-
459452
int ast_gem_init_object(struct drm_gem_object *obj)
460453
{
461454
BUG();
@@ -487,7 +480,7 @@ void ast_gem_free_object(struct drm_gem_object *obj)
487480

488481
static inline u64 ast_bo_mmap_offset(struct ast_bo *bo)
489482
{
490-
return bo->bo.addr_space_offset;
483+
return drm_vma_node_offset_addr(&bo->bo.vma_node);
491484
}
492485
int
493486
ast_dumb_mmap_offset(struct drm_file *file,

‎drivers/gpu/drm/ast/ast_ttm.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ ast_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl)
148148

149149
static int ast_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp)
150150
{
151-
return 0;
151+
struct ast_bo *astbo = ast_bo(bo);
152+
153+
return drm_vma_node_verify_access(&astbo->gem.vma_node, filp);
152154
}
153155

154156
static int ast_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
@@ -321,7 +323,6 @@ int ast_bo_create(struct drm_device *dev, int size, int align,
321323
return ret;
322324
}
323325

324-
astbo->gem.driver_private = NULL;
325326
astbo->bo.bdev = &ast->ttm.bdev;
326327
astbo->bo.bdev->dev_mapping = dev->dev_mapping;
327328

‎drivers/gpu/drm/cirrus/cirrus_drv.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@ static const struct file_operations cirrus_driver_fops = {
8585
#ifdef CONFIG_COMPAT
8686
.compat_ioctl = drm_compat_ioctl,
8787
#endif
88-
.fasync = drm_fasync,
8988
};
9089
static struct drm_driver driver = {
91-
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_USE_MTRR,
90+
.driver_features = DRIVER_MODESET | DRIVER_GEM,
9291
.load = cirrus_driver_load,
9392
.unload = cirrus_driver_unload,
9493
.fops = &cirrus_driver_fops,
@@ -102,7 +101,7 @@ static struct drm_driver driver = {
102101
.gem_free_object = cirrus_gem_free_object,
103102
.dumb_create = cirrus_dumb_create,
104103
.dumb_map_offset = cirrus_dumb_mmap_offset,
105-
.dumb_destroy = cirrus_dumb_destroy,
104+
.dumb_destroy = drm_gem_dumb_destroy,
106105
};
107106

108107
static struct pci_driver cirrus_pci_driver = {

‎drivers/gpu/drm/cirrus/cirrus_drv.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ int cirrus_gem_create(struct drm_device *dev,
203203
int cirrus_dumb_create(struct drm_file *file,
204204
struct drm_device *dev,
205205
struct drm_mode_create_dumb *args);
206-
int cirrus_dumb_destroy(struct drm_file *file,
207-
struct drm_device *dev,
208-
uint32_t handle);
209206

210207
int cirrus_framebuffer_init(struct drm_device *dev,
211208
struct cirrus_framebuffer *gfb,

0 commit comments

Comments
 (0)