aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-07-05 18:52:45 -0400
committerDave Airlie <airlied@redhat.com>2018-07-05 20:01:56 -0400
commita1c3b49523aeb89a7f5ffa852c29db9c4e5ac8dd (patch)
tree25119ff623073a26f79608c50cdd78a8e8b50078
parentc5be9b54034339a7983a1167cdc80dc27fea1799 (diff)
parent968d72e6a5105a18fe17c0a8b4ef2951d0eb42dd (diff)
Merge tag 'drm-misc-next-2018-07-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 4.19: UAPI Changes: v3d: add fourcc modicfier for fourcc for the Broadcom UIF format (Eric Anholt) Cross-subsystem Changes: console/fbcon: Add support for deferred console takeover (Hans de Goede) Core Changes: dma-fence clean up, improvements and docs (Daniel Vetter) add mask function for crtc, plane, encoder and connector DRM objects(Ville Syrjälä) Driver Changes: pl111: add Nomadik LCDC variant (Linus Walleij) Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180704234641.GA3981@juma
-rw-r--r--Documentation/driver-api/dma-buf.rst6
-rw-r--r--Documentation/fb/fbcon.txt7
-rw-r--r--Documentation/gpu/drm-kms.rst2
-rw-r--r--drivers/dma-buf/dma-fence-array.c1
-rw-r--r--drivers/dma-buf/dma-fence.c167
-rw-r--r--drivers/dma-buf/sw_sync.c1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c1
-rw-r--r--drivers/gpu/drm/arc/arcpgu_crtc.c2
-rw-r--r--drivers/gpu/drm/arm/hdlcd_crtc.c2
-rw-r--r--drivers/gpu/drm/drm_atomic.c10
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c25
-rw-r--r--drivers/gpu/drm/drm_connector.c4
-rw-r--r--drivers/gpu/drm/drm_crtc.c11
-rw-r--r--drivers/gpu/drm/drm_framebuffer.c2
-rw-r--r--drivers/gpu/drm/drm_global.c2
-rw-r--r--drivers/gpu/drm/drm_plane_helper.c8
-rw-r--r--drivers/gpu/drm/drm_simple_kms_helper.c4
-rw-r--r--drivers/gpu/drm/drm_syncobj.c1
-rw-r--r--drivers/gpu/drm/drm_vma_manager.c1
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_gpu.c7
-rw-r--r--drivers/gpu/drm/i810/i810_dma.c2
-rw-r--r--drivers/gpu/drm/i915/intel_display.c14
-rw-r--r--drivers/gpu/drm/i915/intel_display.h4
-rw-r--r--drivers/gpu/drm/i915/intel_dpll_mgr.c6
-rw-r--r--drivers/gpu/drm/imx/ipuv3-crtc.c2
-rw-r--r--drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c2
-rw-r--r--drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ttm.c3
-rw-r--r--drivers/gpu/drm/pl111/Makefile1
-rw-r--r--drivers/gpu/drm/pl111/pl111_display.c54
-rw-r--r--drivers/gpu/drm/pl111/pl111_drm.h5
-rw-r--r--drivers/gpu/drm/pl111/pl111_drv.c44
-rw-r--r--drivers/gpu/drm/pl111/pl111_nomadik.c36
-rw-r--r--drivers/gpu/drm/pl111/pl111_nomadik.h18
-rw-r--r--drivers/gpu/drm/qxl/qxl_release.c7
-rw-r--r--drivers/gpu/drm/savage/savage_state.c2
-rw-r--r--drivers/gpu/drm/scheduler/sched_fence.c11
-rw-r--r--drivers/gpu/drm/sti/sti_cursor.c2
-rw-r--r--drivers/gpu/drm/sti/sti_gdp.c2
-rw-r--r--drivers/gpu/drm/sti/sti_hqvdp.c2
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_crtc.c2
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_lvds.c2
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_rgb.c2
-rw-r--r--drivers/gpu/drm/vc4/vc4_crtc.c6
-rw-r--r--drivers/gpu/drm/vc4/vc4_dsi.c42
-rw-r--r--drivers/gpu/drm/vc4/vc4_fence.c8
-rw-r--r--drivers/gpu/drm/vc4/vc4_plane.c2
-rw-r--r--drivers/gpu/drm/vgem/vgem_drv.c2
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_fence.c7
-rw-r--r--drivers/gpu/drm/vmwgfx/Kconfig1
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga_escape.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga_reg.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/svga_types.h3
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h25
-rw-r--r--drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h25
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_binding.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_binding.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_blit.c3
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_context.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_drv.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_drv.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fence.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fence.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_irq.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.c8
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_kms.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_marker.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_mob.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_msg.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_msg.h35
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_prime.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_reg.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_shader.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_so.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_so.h4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_surface.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c4
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_va.c4
-rw-r--r--drivers/gpu/drm/zte/zx_plane.c2
-rw-r--r--drivers/video/console/Kconfig11
-rw-r--r--drivers/video/console/dummycon.c69
-rw-r--r--drivers/video/fbdev/core/fbcon.c83
-rw-r--r--include/drm/drm_connector.h8
-rw-r--r--include/drm/drm_encoder.h16
-rw-r--r--include/drm/drm_plane.h14
-rw-r--r--include/drm/drm_plane_helper.h6
-rw-r--r--include/linux/console.h5
-rw-r--r--include/linux/dma-fence.h32
-rw-r--r--include/uapi/drm/drm_fourcc.h21
-rw-r--r--kernel/printk/printk.c1
117 files changed, 727 insertions, 381 deletions
diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst
index dc384f2f7f34..b541e97c7ab1 100644
--- a/Documentation/driver-api/dma-buf.rst
+++ b/Documentation/driver-api/dma-buf.rst
@@ -131,6 +131,12 @@ DMA Fences
131---------- 131----------
132 132
133.. kernel-doc:: drivers/dma-buf/dma-fence.c 133.. kernel-doc:: drivers/dma-buf/dma-fence.c
134 :doc: DMA fences overview
135
136DMA Fences Functions Reference
137~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138
139.. kernel-doc:: drivers/dma-buf/dma-fence.c
134 :export: 140 :export:
135 141
136.. kernel-doc:: include/linux/dma-fence.h 142.. kernel-doc:: include/linux/dma-fence.h
diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt
index 79c22d096bbc..d4d642e1ce9c 100644
--- a/Documentation/fb/fbcon.txt
+++ b/Documentation/fb/fbcon.txt
@@ -155,6 +155,13 @@ C. Boot options
155 used by text. By default, this area will be black. The 'color' value 155 used by text. By default, this area will be black. The 'color' value
156 is an integer number that depends on the framebuffer driver being used. 156 is an integer number that depends on the framebuffer driver being used.
157 157
1586. fbcon=nodefer
159
160 If the kernel is compiled with deferred fbcon takeover support, normally
161 the framebuffer contents, left in place by the firmware/bootloader, will
162 be preserved until there actually is some text is output to the console.
163 This option causes fbcon to bind immediately to the fbdev device.
164
158C. Attaching, Detaching and Unloading 165C. Attaching, Detaching and Unloading
159 166
160Before going on how to attach, detach and unload the framebuffer console, an 167Before going on how to attach, detach and unload the framebuffer console, an
diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
index 4f6f113a7f5d..514939433004 100644
--- a/Documentation/gpu/drm-kms.rst
+++ b/Documentation/gpu/drm-kms.rst
@@ -527,7 +527,7 @@ Standard Connector Properties
527 :doc: standard connector properties 527 :doc: standard connector properties
528 528
529HDMI Specific Connector Properties 529HDMI Specific Connector Properties
530----------------------------- 530----------------------------------
531 531
532.. kernel-doc:: drivers/gpu/drm/drm_connector.c 532.. kernel-doc:: drivers/gpu/drm/drm_connector.c
533 :doc: HDMI connector properties 533 :doc: HDMI connector properties
diff --git a/drivers/dma-buf/dma-fence-array.c b/drivers/dma-buf/dma-fence-array.c
index dd1edfb27b61..a8c254497251 100644
--- a/drivers/dma-buf/dma-fence-array.c
+++ b/drivers/dma-buf/dma-fence-array.c
@@ -104,7 +104,6 @@ const struct dma_fence_ops dma_fence_array_ops = {
104 .get_timeline_name = dma_fence_array_get_timeline_name, 104 .get_timeline_name = dma_fence_array_get_timeline_name,
105 .enable_signaling = dma_fence_array_enable_signaling, 105 .enable_signaling = dma_fence_array_enable_signaling,
106 .signaled = dma_fence_array_signaled, 106 .signaled = dma_fence_array_signaled,
107 .wait = dma_fence_default_wait,
108 .release = dma_fence_array_release, 107 .release = dma_fence_array_release,
109}; 108};
110EXPORT_SYMBOL(dma_fence_array_ops); 109EXPORT_SYMBOL(dma_fence_array_ops);
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 4edb9fd3cf47..1551ca7df394 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -39,11 +39,42 @@ EXPORT_TRACEPOINT_SYMBOL(dma_fence_enable_signal);
39static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(0); 39static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(0);
40 40
41/** 41/**
42 * DOC: DMA fences overview
43 *
44 * DMA fences, represented by &struct dma_fence, are the kernel internal
45 * synchronization primitive for DMA operations like GPU rendering, video
46 * encoding/decoding, or displaying buffers on a screen.
47 *
48 * A fence is initialized using dma_fence_init() and completed using
49 * dma_fence_signal(). Fences are associated with a context, allocated through
50 * dma_fence_context_alloc(), and all fences on the same context are
51 * fully ordered.
52 *
53 * Since the purposes of fences is to facilitate cross-device and
54 * cross-application synchronization, there's multiple ways to use one:
55 *
56 * - Individual fences can be exposed as a &sync_file, accessed as a file
57 * descriptor from userspace, created by calling sync_file_create(). This is
58 * called explicit fencing, since userspace passes around explicit
59 * synchronization points.
60 *
61 * - Some subsystems also have their own explicit fencing primitives, like
62 * &drm_syncobj. Compared to &sync_file, a &drm_syncobj allows the underlying
63 * fence to be updated.
64 *
65 * - Then there's also implicit fencing, where the synchronization points are
66 * implicitly passed around as part of shared &dma_buf instances. Such
67 * implicit fences are stored in &struct reservation_object through the
68 * &dma_buf.resv pointer.
69 */
70
71/**
42 * dma_fence_context_alloc - allocate an array of fence contexts 72 * dma_fence_context_alloc - allocate an array of fence contexts
43 * @num: [in] amount of contexts to allocate 73 * @num: amount of contexts to allocate
44 * 74 *
45 * This function will return the first index of the number of fences allocated. 75 * This function will return the first index of the number of fence contexts
46 * The fence context is used for setting fence->context to a unique number. 76 * allocated. The fence context is used for setting &dma_fence.context to a
77 * unique number by passing the context to dma_fence_init().
47 */ 78 */
48u64 dma_fence_context_alloc(unsigned num) 79u64 dma_fence_context_alloc(unsigned num)
49{ 80{
@@ -59,10 +90,14 @@ EXPORT_SYMBOL(dma_fence_context_alloc);
59 * Signal completion for software callbacks on a fence, this will unblock 90 * Signal completion for software callbacks on a fence, this will unblock
60 * dma_fence_wait() calls and run all the callbacks added with 91 * dma_fence_wait() calls and run all the callbacks added with
61 * dma_fence_add_callback(). Can be called multiple times, but since a fence 92 * dma_fence_add_callback(). Can be called multiple times, but since a fence
62 * can only go from unsignaled to signaled state, it will only be effective 93 * can only go from the unsignaled to the signaled state and not back, it will
63 * the first time. 94 * only be effective the first time.
64 * 95 *
65 * Unlike dma_fence_signal, this function must be called with fence->lock held. 96 * Unlike dma_fence_signal(), this function must be called with &dma_fence.lock
97 * held.
98 *
99 * Returns 0 on success and a negative error value when @fence has been
100 * signalled already.
66 */ 101 */
67int dma_fence_signal_locked(struct dma_fence *fence) 102int dma_fence_signal_locked(struct dma_fence *fence)
68{ 103{
@@ -102,8 +137,11 @@ EXPORT_SYMBOL(dma_fence_signal_locked);
102 * Signal completion for software callbacks on a fence, this will unblock 137 * Signal completion for software callbacks on a fence, this will unblock
103 * dma_fence_wait() calls and run all the callbacks added with 138 * dma_fence_wait() calls and run all the callbacks added with
104 * dma_fence_add_callback(). Can be called multiple times, but since a fence 139 * dma_fence_add_callback(). Can be called multiple times, but since a fence
105 * can only go from unsignaled to signaled state, it will only be effective 140 * can only go from the unsignaled to the signaled state and not back, it will
106 * the first time. 141 * only be effective the first time.
142 *
143 * Returns 0 on success and a negative error value when @fence has been
144 * signalled already.
107 */ 145 */
108int dma_fence_signal(struct dma_fence *fence) 146int dma_fence_signal(struct dma_fence *fence)
109{ 147{
@@ -136,9 +174,9 @@ EXPORT_SYMBOL(dma_fence_signal);
136/** 174/**
137 * dma_fence_wait_timeout - sleep until the fence gets signaled 175 * dma_fence_wait_timeout - sleep until the fence gets signaled
138 * or until timeout elapses 176 * or until timeout elapses
139 * @fence: [in] the fence to wait on 177 * @fence: the fence to wait on
140 * @intr: [in] if true, do an interruptible wait 178 * @intr: if true, do an interruptible wait
141 * @timeout: [in] timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT 179 * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
142 * 180 *
143 * Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or the 181 * Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or the
144 * remaining timeout in jiffies on success. Other error values may be 182 * remaining timeout in jiffies on success. Other error values may be
@@ -148,6 +186,8 @@ EXPORT_SYMBOL(dma_fence_signal);
148 * directly or indirectly (buf-mgr between reservation and committing) 186 * directly or indirectly (buf-mgr between reservation and committing)
149 * holds a reference to the fence, otherwise the fence might be 187 * holds a reference to the fence, otherwise the fence might be
150 * freed before return, resulting in undefined behavior. 188 * freed before return, resulting in undefined behavior.
189 *
190 * See also dma_fence_wait() and dma_fence_wait_any_timeout().
151 */ 191 */
152signed long 192signed long
153dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout) 193dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
@@ -158,12 +198,22 @@ dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout)
158 return -EINVAL; 198 return -EINVAL;
159 199
160 trace_dma_fence_wait_start(fence); 200 trace_dma_fence_wait_start(fence);
161 ret = fence->ops->wait(fence, intr, timeout); 201 if (fence->ops->wait)
202 ret = fence->ops->wait(fence, intr, timeout);
203 else
204 ret = dma_fence_default_wait(fence, intr, timeout);
162 trace_dma_fence_wait_end(fence); 205 trace_dma_fence_wait_end(fence);
163 return ret; 206 return ret;
164} 207}
165EXPORT_SYMBOL(dma_fence_wait_timeout); 208EXPORT_SYMBOL(dma_fence_wait_timeout);
166 209
210/**
211 * dma_fence_release - default relese function for fences
212 * @kref: &dma_fence.recfount
213 *
214 * This is the default release functions for &dma_fence. Drivers shouldn't call
215 * this directly, but instead call dma_fence_put().
216 */
167void dma_fence_release(struct kref *kref) 217void dma_fence_release(struct kref *kref)
168{ 218{
169 struct dma_fence *fence = 219 struct dma_fence *fence =
@@ -181,6 +231,13 @@ void dma_fence_release(struct kref *kref)
181} 231}
182EXPORT_SYMBOL(dma_fence_release); 232EXPORT_SYMBOL(dma_fence_release);
183 233
234/**
235 * dma_fence_free - default release function for &dma_fence.
236 * @fence: fence to release
237 *
238 * This is the default implementation for &dma_fence_ops.release. It calls
239 * kfree_rcu() on @fence.
240 */
184void dma_fence_free(struct dma_fence *fence) 241void dma_fence_free(struct dma_fence *fence)
185{ 242{
186 kfree_rcu(fence, rcu); 243 kfree_rcu(fence, rcu);
@@ -189,10 +246,11 @@ EXPORT_SYMBOL(dma_fence_free);
189 246
190/** 247/**
191 * dma_fence_enable_sw_signaling - enable signaling on fence 248 * dma_fence_enable_sw_signaling - enable signaling on fence
192 * @fence: [in] the fence to enable 249 * @fence: the fence to enable
193 * 250 *
194 * this will request for sw signaling to be enabled, to make the fence 251 * This will request for sw signaling to be enabled, to make the fence
195 * complete as soon as possible 252 * complete as soon as possible. This calls &dma_fence_ops.enable_signaling
253 * internally.
196 */ 254 */
197void dma_fence_enable_sw_signaling(struct dma_fence *fence) 255void dma_fence_enable_sw_signaling(struct dma_fence *fence)
198{ 256{
@@ -200,7 +258,8 @@ void dma_fence_enable_sw_signaling(struct dma_fence *fence)
200 258
201 if (!test_and_set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, 259 if (!test_and_set_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
202 &fence->flags) && 260 &fence->flags) &&
203 !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) { 261 !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) &&
262 fence->ops->enable_signaling) {
204 trace_dma_fence_enable_signal(fence); 263 trace_dma_fence_enable_signal(fence);
205 264
206 spin_lock_irqsave(fence->lock, flags); 265 spin_lock_irqsave(fence->lock, flags);
@@ -216,24 +275,24 @@ EXPORT_SYMBOL(dma_fence_enable_sw_signaling);
216/** 275/**
217 * dma_fence_add_callback - add a callback to be called when the fence 276 * dma_fence_add_callback - add a callback to be called when the fence
218 * is signaled 277 * is signaled
219 * @fence: [in] the fence to wait on 278 * @fence: the fence to wait on
220 * @cb: [in] the callback to register 279 * @cb: the callback to register
221 * @func: [in] the function to call 280 * @func: the function to call
222 * 281 *
223 * cb will be initialized by dma_fence_add_callback, no initialization 282 * @cb will be initialized by dma_fence_add_callback(), no initialization
224 * by the caller is required. Any number of callbacks can be registered 283 * by the caller is required. Any number of callbacks can be registered
225 * to a fence, but a callback can only be registered to one fence at a time. 284 * to a fence, but a callback can only be registered to one fence at a time.
226 * 285 *
227 * Note that the callback can be called from an atomic context. If 286 * Note that the callback can be called from an atomic context. If
228 * fence is already signaled, this function will return -ENOENT (and 287 * fence is already signaled, this function will return -ENOENT (and
229 * *not* call the callback) 288 * *not* call the callback).
230 * 289 *
231 * Add a software callback to the fence. Same restrictions apply to 290 * Add a software callback to the fence. Same restrictions apply to
232 * refcount as it does to dma_fence_wait, however the caller doesn't need to 291 * refcount as it does to dma_fence_wait(), however the caller doesn't need to
233 * keep a refcount to fence afterwards: when software access is enabled, 292 * keep a refcount to fence afterward dma_fence_add_callback() has returned:
234 * the creator of the fence is required to keep the fence alive until 293 * when software access is enabled, the creator of the fence is required to keep
235 * after it signals with dma_fence_signal. The callback itself can be called 294 * the fence alive until after it signals with dma_fence_signal(). The callback
236 * from irq context. 295 * itself can be called from irq context.
237 * 296 *
238 * Returns 0 in case of success, -ENOENT if the fence is already signaled 297 * Returns 0 in case of success, -ENOENT if the fence is already signaled
239 * and -EINVAL in case of error. 298 * and -EINVAL in case of error.
@@ -260,7 +319,7 @@ int dma_fence_add_callback(struct dma_fence *fence, struct dma_fence_cb *cb,
260 319
261 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) 320 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
262 ret = -ENOENT; 321 ret = -ENOENT;
263 else if (!was_set) { 322 else if (!was_set && fence->ops->enable_signaling) {
264 trace_dma_fence_enable_signal(fence); 323 trace_dma_fence_enable_signal(fence);
265 324
266 if (!fence->ops->enable_signaling(fence)) { 325 if (!fence->ops->enable_signaling(fence)) {
@@ -282,7 +341,7 @@ EXPORT_SYMBOL(dma_fence_add_callback);
282 341
283/** 342/**
284 * dma_fence_get_status - returns the status upon completion 343 * dma_fence_get_status - returns the status upon completion
285 * @fence: [in] the dma_fence to query 344 * @fence: the dma_fence to query
286 * 345 *
287 * This wraps dma_fence_get_status_locked() to return the error status 346 * This wraps dma_fence_get_status_locked() to return the error status
288 * condition on a signaled fence. See dma_fence_get_status_locked() for more 347 * condition on a signaled fence. See dma_fence_get_status_locked() for more
@@ -307,8 +366,8 @@ EXPORT_SYMBOL(dma_fence_get_status);
307 366
308/** 367/**
309 * dma_fence_remove_callback - remove a callback from the signaling list 368 * dma_fence_remove_callback - remove a callback from the signaling list
310 * @fence: [in] the fence to wait on 369 * @fence: the fence to wait on
311 * @cb: [in] the callback to remove 370 * @cb: the callback to remove
312 * 371 *
313 * Remove a previously queued callback from the fence. This function returns 372 * Remove a previously queued callback from the fence. This function returns
314 * true if the callback is successfully removed, or false if the fence has 373 * true if the callback is successfully removed, or false if the fence has
@@ -319,6 +378,9 @@ EXPORT_SYMBOL(dma_fence_get_status);
319 * doing, since deadlocks and race conditions could occur all too easily. For 378 * doing, since deadlocks and race conditions could occur all too easily. For
320 * this reason, it should only ever be done on hardware lockup recovery, 379 * this reason, it should only ever be done on hardware lockup recovery,
321 * with a reference held to the fence. 380 * with a reference held to the fence.
381 *
382 * Behaviour is undefined if @cb has not been added to @fence using
383 * dma_fence_add_callback() beforehand.
322 */ 384 */
323bool 385bool
324dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb) 386dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb)
@@ -355,9 +417,9 @@ dma_fence_default_wait_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
355/** 417/**
356 * dma_fence_default_wait - default sleep until the fence gets signaled 418 * dma_fence_default_wait - default sleep until the fence gets signaled
357 * or until timeout elapses 419 * or until timeout elapses
358 * @fence: [in] the fence to wait on 420 * @fence: the fence to wait on
359 * @intr: [in] if true, do an interruptible wait 421 * @intr: if true, do an interruptible wait
360 * @timeout: [in] timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT 422 * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
361 * 423 *
362 * Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or the 424 * Returns -ERESTARTSYS if interrupted, 0 if the wait timed out, or the
363 * remaining timeout in jiffies on success. If timeout is zero the value one is 425 * remaining timeout in jiffies on success. If timeout is zero the value one is
@@ -388,7 +450,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
388 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) 450 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
389 goto out; 451 goto out;
390 452
391 if (!was_set) { 453 if (!was_set && fence->ops->enable_signaling) {
392 trace_dma_fence_enable_signal(fence); 454 trace_dma_fence_enable_signal(fence);
393 455
394 if (!fence->ops->enable_signaling(fence)) { 456 if (!fence->ops->enable_signaling(fence)) {
@@ -450,12 +512,12 @@ dma_fence_test_signaled_any(struct dma_fence **fences, uint32_t count,
450/** 512/**
451 * dma_fence_wait_any_timeout - sleep until any fence gets signaled 513 * dma_fence_wait_any_timeout - sleep until any fence gets signaled
452 * or until timeout elapses 514 * or until timeout elapses
453 * @fences: [in] array of fences to wait on 515 * @fences: array of fences to wait on
454 * @count: [in] number of fences to wait on 516 * @count: number of fences to wait on
455 * @intr: [in] if true, do an interruptible wait 517 * @intr: if true, do an interruptible wait
456 * @timeout: [in] timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT 518 * @timeout: timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT
457 * @idx: [out] the first signaled fence index, meaningful only on 519 * @idx: used to store the first signaled fence index, meaningful only on
458 * positive return 520 * positive return
459 * 521 *
460 * Returns -EINVAL on custom fence wait implementation, -ERESTARTSYS if 522 * Returns -EINVAL on custom fence wait implementation, -ERESTARTSYS if
461 * interrupted, 0 if the wait timed out, or the remaining timeout in jiffies 523 * interrupted, 0 if the wait timed out, or the remaining timeout in jiffies
@@ -464,6 +526,8 @@ dma_fence_test_signaled_any(struct dma_fence **fences, uint32_t count,
464 * Synchronous waits for the first fence in the array to be signaled. The 526 * Synchronous waits for the first fence in the array to be signaled. The
465 * caller needs to hold a reference to all fences in the array, otherwise a 527 * caller needs to hold a reference to all fences in the array, otherwise a
466 * fence might be freed before return, resulting in undefined behavior. 528 * fence might be freed before return, resulting in undefined behavior.
529 *
530 * See also dma_fence_wait() and dma_fence_wait_timeout().
467 */ 531 */
468signed long 532signed long
469dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count, 533dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count,
@@ -496,11 +560,6 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count,
496 for (i = 0; i < count; ++i) { 560 for (i = 0; i < count; ++i) {
497 struct dma_fence *fence = fences[i]; 561 struct dma_fence *fence = fences[i];
498 562
499 if (fence->ops->wait != dma_fence_default_wait) {
500 ret = -EINVAL;
501 goto fence_rm_cb;
502 }
503
504 cb[i].task = current; 563 cb[i].task = current;
505 if (dma_fence_add_callback(fence, &cb[i].base, 564 if (dma_fence_add_callback(fence, &cb[i].base,
506 dma_fence_default_wait_cb)) { 565 dma_fence_default_wait_cb)) {
@@ -541,27 +600,25 @@ EXPORT_SYMBOL(dma_fence_wait_any_timeout);
541 600
542/** 601/**
543 * dma_fence_init - Initialize a custom fence. 602 * dma_fence_init - Initialize a custom fence.
544 * @fence: [in] the fence to initialize 603 * @fence: the fence to initialize
545 * @ops: [in] the dma_fence_ops for operations on this fence 604 * @ops: the dma_fence_ops for operations on this fence
546 * @lock: [in] the irqsafe spinlock to use for locking this fence 605 * @lock: the irqsafe spinlock to use for locking this fence
547 * @context: [in] the execution context this fence is run on 606 * @context: the execution context this fence is run on
548 * @seqno: [in] a linear increasing sequence number for this context 607 * @seqno: a linear increasing sequence number for this context
549 * 608 *
550 * Initializes an allocated fence, the caller doesn't have to keep its 609 * Initializes an allocated fence, the caller doesn't have to keep its
551 * refcount after committing with this fence, but it will need to hold a 610 * refcount after committing with this fence, but it will need to hold a
552 * refcount again if dma_fence_ops.enable_signaling gets called. This can 611 * refcount again if &dma_fence_ops.enable_signaling gets called.
553 * be used for other implementing other types of fence.
554 * 612 *
555 * context and seqno are used for easy comparison between fences, allowing 613 * context and seqno are used for easy comparison between fences, allowing
556 * to check which fence is later by simply using dma_fence_later. 614 * to check which fence is later by simply using dma_fence_later().
557 */ 615 */
558void 616void
559dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops, 617dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
560 spinlock_t *lock, u64 context, unsigned seqno) 618 spinlock_t *lock, u64 context, unsigned seqno)
561{ 619{
562 BUG_ON(!lock); 620 BUG_ON(!lock);
563 BUG_ON(!ops || !ops->wait || !ops->enable_signaling || 621 BUG_ON(!ops || !ops->get_driver_name || !ops->get_timeline_name);
564 !ops->get_driver_name || !ops->get_timeline_name);
565 622
566 kref_init(&fence->refcount); 623 kref_init(&fence->refcount);
567 fence->ops = ops; 624 fence->ops = ops;
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 3d78ca89a605..53c1d6d36a64 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -188,7 +188,6 @@ static const struct dma_fence_ops timeline_fence_ops = {
188 .get_timeline_name = timeline_fence_get_timeline_name, 188 .get_timeline_name = timeline_fence_get_timeline_name,
189 .enable_signaling = timeline_fence_enable_signaling, 189 .enable_signaling = timeline_fence_enable_signaling,
190 .signaled = timeline_fence_signaled, 190 .signaled = timeline_fence_signaled,
191 .wait = dma_fence_default_wait,
192 .release = timeline_fence_release, 191 .release = timeline_fence_release,
193 .fence_value_str = timeline_fence_value_str, 192 .fence_value_str = timeline_fence_value_str,
194 .timeline_value_str = timeline_fence_timeline_value_str, 193 .timeline_value_str = timeline_fence_timeline_value_str,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
index 2c14025e5e76..574c1181ae9a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
@@ -173,7 +173,5 @@ static const struct dma_fence_ops amdkfd_fence_ops = {
173 .get_driver_name = amdkfd_fence_get_driver_name, 173 .get_driver_name = amdkfd_fence_get_driver_name,
174 .get_timeline_name = amdkfd_fence_get_timeline_name, 174 .get_timeline_name = amdkfd_fence_get_timeline_name,
175 .enable_signaling = amdkfd_fence_enable_signaling, 175 .enable_signaling = amdkfd_fence_enable_signaling,
176 .signaled = NULL,
177 .wait = dma_fence_default_wait,
178 .release = amdkfd_fence_release, 176 .release = amdkfd_fence_release,
179}; 177};
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index e74d620d9699..7056925eb386 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -646,7 +646,6 @@ static const struct dma_fence_ops amdgpu_fence_ops = {
646 .get_driver_name = amdgpu_fence_get_driver_name, 646 .get_driver_name = amdgpu_fence_get_driver_name,
647 .get_timeline_name = amdgpu_fence_get_timeline_name, 647 .get_timeline_name = amdgpu_fence_get_timeline_name,
648 .enable_signaling = amdgpu_fence_enable_signaling, 648 .enable_signaling = amdgpu_fence_enable_signaling,
649 .wait = dma_fence_default_wait,
650 .release = amdgpu_fence_release, 649 .release = amdgpu_fence_release,
651}; 650};
652 651
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c
index c3349b8fb58b..965cda48dc13 100644
--- a/drivers/gpu/drm/arc/arcpgu_crtc.c
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -186,7 +186,7 @@ static const struct drm_plane_helper_funcs arc_pgu_plane_helper_funcs = {
186 186
187static void arc_pgu_plane_destroy(struct drm_plane *plane) 187static void arc_pgu_plane_destroy(struct drm_plane *plane)
188{ 188{
189 drm_plane_helper_disable(plane); 189 drm_plane_helper_disable(plane, NULL);
190 drm_plane_cleanup(plane); 190 drm_plane_cleanup(plane);
191} 191}
192 192
diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
index cf5cbd63ecdf..f3f08cd6e9ef 100644
--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
+++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
@@ -282,7 +282,7 @@ static const struct drm_plane_helper_funcs hdlcd_plane_helper_funcs = {
282 282
283static void hdlcd_plane_destroy(struct drm_plane *plane) 283static void hdlcd_plane_destroy(struct drm_plane *plane)
284{ 284{
285 drm_plane_helper_disable(plane); 285 drm_plane_helper_disable(plane, NULL);
286 drm_plane_cleanup(plane); 286 drm_plane_cleanup(plane);
287} 287}
288 288
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 178842380f75..d5cefb1cb2a2 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1581,7 +1581,7 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
1581 if (WARN_ON(IS_ERR(crtc_state))) 1581 if (WARN_ON(IS_ERR(crtc_state)))
1582 return PTR_ERR(crtc_state); 1582 return PTR_ERR(crtc_state);
1583 1583
1584 crtc_state->plane_mask &= ~(1 << drm_plane_index(plane)); 1584 crtc_state->plane_mask &= ~drm_plane_mask(plane);
1585 } 1585 }
1586 1586
1587 plane_state->crtc = crtc; 1587 plane_state->crtc = crtc;
@@ -1591,7 +1591,7 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state,
1591 crtc); 1591 crtc);
1592 if (IS_ERR(crtc_state)) 1592 if (IS_ERR(crtc_state))
1593 return PTR_ERR(crtc_state); 1593 return PTR_ERR(crtc_state);
1594 crtc_state->plane_mask |= (1 << drm_plane_index(plane)); 1594 crtc_state->plane_mask |= drm_plane_mask(plane);
1595 } 1595 }
1596 1596
1597 if (crtc) 1597 if (crtc)
@@ -1700,7 +1700,7 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
1700 conn_state->crtc); 1700 conn_state->crtc);
1701 1701
1702 crtc_state->connector_mask &= 1702 crtc_state->connector_mask &=
1703 ~(1 << drm_connector_index(conn_state->connector)); 1703 ~drm_connector_mask(conn_state->connector);
1704 1704
1705 drm_connector_put(conn_state->connector); 1705 drm_connector_put(conn_state->connector);
1706 conn_state->crtc = NULL; 1706 conn_state->crtc = NULL;
@@ -1712,7 +1712,7 @@ drm_atomic_set_crtc_for_connector(struct drm_connector_state *conn_state,
1712 return PTR_ERR(crtc_state); 1712 return PTR_ERR(crtc_state);
1713 1713
1714 crtc_state->connector_mask |= 1714 crtc_state->connector_mask |=
1715 1 << drm_connector_index(conn_state->connector); 1715 drm_connector_mask(conn_state->connector);
1716 1716
1717 drm_connector_get(conn_state->connector); 1717 drm_connector_get(conn_state->connector);
1718 conn_state->crtc = crtc; 1718 conn_state->crtc = crtc;
@@ -1839,7 +1839,7 @@ drm_atomic_add_affected_connectors(struct drm_atomic_state *state,
1839 */ 1839 */
1840 drm_connector_list_iter_begin(state->dev, &conn_iter); 1840 drm_connector_list_iter_begin(state->dev, &conn_iter);
1841 drm_for_each_connector_iter(connector, &conn_iter) { 1841 drm_for_each_connector_iter(connector, &conn_iter) {
1842 if (!(crtc_state->connector_mask & (1 << drm_connector_index(connector)))) 1842 if (!(crtc_state->connector_mask & drm_connector_mask(connector)))
1843 continue; 1843 continue;
1844 1844
1845 conn_state = drm_atomic_get_connector_state(state, connector); 1845 conn_state = drm_atomic_get_connector_state(state, connector);
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 17baf5057132..8008a7de2e10 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -121,7 +121,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
121 new_encoder = drm_atomic_helper_best_encoder(connector); 121 new_encoder = drm_atomic_helper_best_encoder(connector);
122 122
123 if (new_encoder) { 123 if (new_encoder) {
124 if (encoder_mask & (1 << drm_encoder_index(new_encoder))) { 124 if (encoder_mask & drm_encoder_mask(new_encoder)) {
125 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] on [CONNECTOR:%d:%s] already assigned\n", 125 DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] on [CONNECTOR:%d:%s] already assigned\n",
126 new_encoder->base.id, new_encoder->name, 126 new_encoder->base.id, new_encoder->name,
127 connector->base.id, connector->name); 127 connector->base.id, connector->name);
@@ -129,7 +129,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
129 return -EINVAL; 129 return -EINVAL;
130 } 130 }
131 131
132 encoder_mask |= 1 << drm_encoder_index(new_encoder); 132 encoder_mask |= drm_encoder_mask(new_encoder);
133 } 133 }
134 } 134 }
135 135
@@ -155,7 +155,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
155 continue; 155 continue;
156 156
157 encoder = connector->state->best_encoder; 157 encoder = connector->state->best_encoder;
158 if (!encoder || !(encoder_mask & (1 << drm_encoder_index(encoder)))) 158 if (!encoder || !(encoder_mask & drm_encoder_mask(encoder)))
159 continue; 159 continue;
160 160
161 if (!disable_conflicting_encoders) { 161 if (!disable_conflicting_encoders) {
@@ -223,7 +223,7 @@ set_best_encoder(struct drm_atomic_state *state,
223 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); 223 crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
224 224
225 crtc_state->encoder_mask &= 225 crtc_state->encoder_mask &=
226 ~(1 << drm_encoder_index(conn_state->best_encoder)); 226 ~drm_encoder_mask(conn_state->best_encoder);
227 } 227 }
228 } 228 }
229 229
@@ -234,7 +234,7 @@ set_best_encoder(struct drm_atomic_state *state,
234 crtc_state = drm_atomic_get_new_crtc_state(state, crtc); 234 crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
235 235
236 crtc_state->encoder_mask |= 236 crtc_state->encoder_mask |=
237 1 << drm_encoder_index(encoder); 237 drm_encoder_mask(encoder);
238 } 238 }
239 } 239 }
240 240
@@ -2342,11 +2342,13 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
2342 const struct drm_crtc_helper_funcs *crtc_funcs; 2342 const struct drm_crtc_helper_funcs *crtc_funcs;
2343 struct drm_crtc *crtc = old_crtc_state->crtc; 2343 struct drm_crtc *crtc = old_crtc_state->crtc;
2344 struct drm_atomic_state *old_state = old_crtc_state->state; 2344 struct drm_atomic_state *old_state = old_crtc_state->state;
2345 struct drm_crtc_state *new_crtc_state =
2346 drm_atomic_get_new_crtc_state(old_state, crtc);
2345 struct drm_plane *plane; 2347 struct drm_plane *plane;
2346 unsigned plane_mask; 2348 unsigned plane_mask;
2347 2349
2348 plane_mask = old_crtc_state->plane_mask; 2350 plane_mask = old_crtc_state->plane_mask;
2349 plane_mask |= crtc->state->plane_mask; 2351 plane_mask |= new_crtc_state->plane_mask;
2350 2352
2351 crtc_funcs = crtc->helper_private; 2353 crtc_funcs = crtc->helper_private;
2352 if (crtc_funcs && crtc_funcs->atomic_begin) 2354 if (crtc_funcs && crtc_funcs->atomic_begin)
@@ -2355,6 +2357,8 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
2355 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) { 2357 drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
2356 struct drm_plane_state *old_plane_state = 2358 struct drm_plane_state *old_plane_state =
2357 drm_atomic_get_old_plane_state(old_state, plane); 2359 drm_atomic_get_old_plane_state(old_state, plane);
2360 struct drm_plane_state *new_plane_state =
2361 drm_atomic_get_new_plane_state(old_state, plane);
2358 const struct drm_plane_helper_funcs *plane_funcs; 2362 const struct drm_plane_helper_funcs *plane_funcs;
2359 2363
2360 plane_funcs = plane->helper_private; 2364 plane_funcs = plane->helper_private;
@@ -2362,13 +2366,14 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
2362 if (!old_plane_state || !plane_funcs) 2366 if (!old_plane_state || !plane_funcs)
2363 continue; 2367 continue;
2364 2368
2365 WARN_ON(plane->state->crtc && plane->state->crtc != crtc); 2369 WARN_ON(new_plane_state->crtc &&
2370 new_plane_state->crtc != crtc);
2366 2371
2367 if (drm_atomic_plane_disabling(old_plane_state, plane->state) && 2372 if (drm_atomic_plane_disabling(old_plane_state, new_plane_state) &&
2368 plane_funcs->atomic_disable) 2373 plane_funcs->atomic_disable)
2369 plane_funcs->atomic_disable(plane, old_plane_state); 2374 plane_funcs->atomic_disable(plane, old_plane_state);
2370 else if (plane->state->crtc || 2375 else if (new_plane_state->crtc ||
2371 drm_atomic_plane_disabling(old_plane_state, plane->state)) 2376 drm_atomic_plane_disabling(old_plane_state, new_plane_state))
2372 plane_funcs->atomic_update(plane, old_plane_state); 2377 plane_funcs->atomic_update(plane, old_plane_state);
2373 } 2378 }
2374 2379
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 2f9ebddd178e..b09b3a3e4024 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -1033,9 +1033,7 @@ EXPORT_SYMBOL(drm_mode_create_dvi_i_properties);
1033 * 1033 *
1034 * Drivers can set up this property by calling 1034 * Drivers can set up this property by calling
1035 * drm_connector_attach_content_type_property(). Decoding to 1035 * drm_connector_attach_content_type_property(). Decoding to
1036 * infoframe values is done through 1036 * infoframe values is done through drm_hdmi_avi_infoframe_content_type().
1037 * drm_hdmi_get_content_type_from_property() and
1038 * drm_hdmi_get_itc_bit_from_property().
1039 */ 1037 */
1040 1038
1041/** 1039/**
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index f45e7a8d4acd..a6906c4ab880 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -225,16 +225,9 @@ static const char *drm_crtc_fence_get_timeline_name(struct dma_fence *fence)
225 return crtc->timeline_name; 225 return crtc->timeline_name;
226} 226}
227 227
228static bool drm_crtc_fence_enable_signaling(struct dma_fence *fence)
229{
230 return true;
231}
232
233static const struct dma_fence_ops drm_crtc_fence_ops = { 228static const struct dma_fence_ops drm_crtc_fence_ops = {
234 .get_driver_name = drm_crtc_fence_get_driver_name, 229 .get_driver_name = drm_crtc_fence_get_driver_name,
235 .get_timeline_name = drm_crtc_fence_get_timeline_name, 230 .get_timeline_name = drm_crtc_fence_get_timeline_name,
236 .enable_signaling = drm_crtc_fence_enable_signaling,
237 .wait = dma_fence_default_wait,
238}; 231};
239 232
240struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc) 233struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc)
@@ -329,9 +322,9 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
329 crtc->primary = primary; 322 crtc->primary = primary;
330 crtc->cursor = cursor; 323 crtc->cursor = cursor;
331 if (primary && !primary->possible_crtcs) 324 if (primary && !primary->possible_crtcs)
332 primary->possible_crtcs = 1 << drm_crtc_index(crtc); 325 primary->possible_crtcs = drm_crtc_mask(crtc);
333 if (cursor && !cursor->possible_crtcs) 326 if (cursor && !cursor->possible_crtcs)
334 cursor->possible_crtcs = 1 << drm_crtc_index(crtc); 327 cursor->possible_crtcs = drm_crtc_mask(crtc);
335 328
336 ret = drm_crtc_crc_init(crtc); 329 ret = drm_crtc_crc_init(crtc);
337 if (ret) { 330 if (ret) {
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index ed90974a452a..781af1d42d76 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -847,7 +847,7 @@ retry:
847 if (ret) 847 if (ret)
848 goto unlock; 848 goto unlock;
849 849
850 plane_mask |= BIT(drm_plane_index(plane)); 850 plane_mask |= drm_plane_mask(plane);
851 } 851 }
852 852
853 /* This list is only filled when disable_crtcs is set. */ 853 /* This list is only filled when disable_crtcs is set. */
diff --git a/drivers/gpu/drm/drm_global.c b/drivers/gpu/drm/drm_global.c
index b2dc21e33ae0..5799e2782dd1 100644
--- a/drivers/gpu/drm/drm_global.c
+++ b/drivers/gpu/drm/drm_global.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 2010794943bc..621f17643bb0 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -440,6 +440,7 @@ out:
440 * @src_y: y offset of @fb for panning 440 * @src_y: y offset of @fb for panning
441 * @src_w: width of source rectangle in @fb 441 * @src_w: width of source rectangle in @fb
442 * @src_h: height of source rectangle in @fb 442 * @src_h: height of source rectangle in @fb
443 * @ctx: lock acquire context, not used here
443 * 444 *
444 * Provides a default plane update handler using the atomic plane update 445 * Provides a default plane update handler using the atomic plane update
445 * functions. It is fully left to the driver to check plane constraints and 446 * functions. It is fully left to the driver to check plane constraints and
@@ -455,7 +456,8 @@ int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
455 int crtc_x, int crtc_y, 456 int crtc_x, int crtc_y,
456 unsigned int crtc_w, unsigned int crtc_h, 457 unsigned int crtc_w, unsigned int crtc_h,
457 uint32_t src_x, uint32_t src_y, 458 uint32_t src_x, uint32_t src_y,
458 uint32_t src_w, uint32_t src_h) 459 uint32_t src_w, uint32_t src_h,
460 struct drm_modeset_acquire_ctx *ctx)
459{ 461{
460 struct drm_plane_state *plane_state; 462 struct drm_plane_state *plane_state;
461 463
@@ -489,6 +491,7 @@ EXPORT_SYMBOL(drm_plane_helper_update);
489/** 491/**
490 * drm_plane_helper_disable() - Transitional helper for plane disable 492 * drm_plane_helper_disable() - Transitional helper for plane disable
491 * @plane: plane to disable 493 * @plane: plane to disable
494 * @ctx: lock acquire context, not used here
492 * 495 *
493 * Provides a default plane disable handler using the atomic plane update 496 * Provides a default plane disable handler using the atomic plane update
494 * functions. It is fully left to the driver to check plane constraints and 497 * functions. It is fully left to the driver to check plane constraints and
@@ -499,7 +502,8 @@ EXPORT_SYMBOL(drm_plane_helper_update);
499 * RETURNS: 502 * RETURNS:
500 * Zero on success, error code on failure 503 * Zero on success, error code on failure
501 */ 504 */
502int drm_plane_helper_disable(struct drm_plane *plane) 505int drm_plane_helper_disable(struct drm_plane *plane,
506 struct drm_modeset_acquire_ctx *ctx)
503{ 507{
504 struct drm_plane_state *plane_state; 508 struct drm_plane_state *plane_state;
505 struct drm_framebuffer *old_fb; 509 struct drm_framebuffer *old_fb;
diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
index 7a00455ca568..b72fcf1e9605 100644
--- a/drivers/gpu/drm/drm_simple_kms_helper.c
+++ b/drivers/gpu/drm/drm_simple_kms_helper.c
@@ -52,7 +52,7 @@ static int drm_simple_kms_crtc_check(struct drm_crtc *crtc,
52 struct drm_crtc_state *state) 52 struct drm_crtc_state *state)
53{ 53{
54 bool has_primary = state->plane_mask & 54 bool has_primary = state->plane_mask &
55 BIT(drm_plane_index(crtc->primary)); 55 drm_plane_mask(crtc->primary);
56 56
57 /* We always want to have an active plane with an active CRTC */ 57 /* We always want to have an active plane with an active CRTC */
58 if (has_primary != state->enable) 58 if (has_primary != state->enable)
@@ -281,7 +281,7 @@ int drm_simple_display_pipe_init(struct drm_device *dev,
281 if (ret) 281 if (ret)
282 return ret; 282 return ret;
283 283
284 encoder->possible_crtcs = 1 << drm_crtc_index(crtc); 284 encoder->possible_crtcs = drm_crtc_mask(crtc);
285 ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs, 285 ret = drm_encoder_init(dev, encoder, &drm_simple_kms_encoder_funcs,
286 DRM_MODE_ENCODER_NONE, NULL); 286 DRM_MODE_ENCODER_NONE, NULL);
287 if (ret || !connector) 287 if (ret || !connector)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index d4f4ce484529..adb3cb27d31e 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -207,7 +207,6 @@ static const struct dma_fence_ops drm_syncobj_null_fence_ops = {
207 .get_driver_name = drm_syncobj_null_fence_get_name, 207 .get_driver_name = drm_syncobj_null_fence_get_name,
208 .get_timeline_name = drm_syncobj_null_fence_get_name, 208 .get_timeline_name = drm_syncobj_null_fence_get_name,
209 .enable_signaling = drm_syncobj_null_fence_enable_signaling, 209 .enable_signaling = drm_syncobj_null_fence_enable_signaling,
210 .wait = dma_fence_default_wait,
211 .release = NULL, 210 .release = NULL,
212}; 211};
213 212
diff --git a/drivers/gpu/drm/drm_vma_manager.c b/drivers/gpu/drm/drm_vma_manager.c
index 23c749c05b5a..a6b2fe36b025 100644
--- a/drivers/gpu/drm/drm_vma_manager.c
+++ b/drivers/gpu/drm/drm_vma_manager.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/* 2/*
2 * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA 3 * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
3 * Copyright (c) 2012 David Airlie <airlied@linux.ie> 4 * Copyright (c) 2012 David Airlie <airlied@linux.ie>
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index 686f6552db48..19b09a59e30e 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -1027,11 +1027,6 @@ static const char *etnaviv_fence_get_timeline_name(struct dma_fence *fence)
1027 return dev_name(f->gpu->dev); 1027 return dev_name(f->gpu->dev);
1028} 1028}
1029 1029
1030static bool etnaviv_fence_enable_signaling(struct dma_fence *fence)
1031{
1032 return true;
1033}
1034
1035static bool etnaviv_fence_signaled(struct dma_fence *fence) 1030static bool etnaviv_fence_signaled(struct dma_fence *fence)
1036{ 1031{
1037 struct etnaviv_fence *f = to_etnaviv_fence(fence); 1032 struct etnaviv_fence *f = to_etnaviv_fence(fence);
@@ -1049,9 +1044,7 @@ static void etnaviv_fence_release(struct dma_fence *fence)
1049static const struct dma_fence_ops etnaviv_fence_ops = { 1044static const struct dma_fence_ops etnaviv_fence_ops = {
1050 .get_driver_name = etnaviv_fence_get_driver_name, 1045 .get_driver_name = etnaviv_fence_get_driver_name,
1051 .get_timeline_name = etnaviv_fence_get_timeline_name, 1046 .get_timeline_name = etnaviv_fence_get_timeline_name,
1052 .enable_signaling = etnaviv_fence_enable_signaling,
1053 .signaled = etnaviv_fence_signaled, 1047 .signaled = etnaviv_fence_signaled,
1054 .wait = dma_fence_default_wait,
1055 .release = etnaviv_fence_release, 1048 .release = etnaviv_fence_release,
1056}; 1049};
1057 1050
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index 576a417690d4..3b378936f575 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
+++ b/drivers/gpu/drm/i810/i810_dma.c
@@ -934,7 +934,7 @@ static int i810_dma_vertex(struct drm_device *dev, void *data,
934 DRM_DEBUG("idx %d used %d discard %d\n", 934 DRM_DEBUG("idx %d used %d discard %d\n",
935 vertex->idx, vertex->used, vertex->discard); 935 vertex->idx, vertex->used, vertex->discard);
936 936
937 if (vertex->idx < 0 || vertex->idx > dma->buf_count) 937 if (vertex->idx < 0 || vertex->idx >= dma->buf_count)
938 return -EINVAL; 938 return -EINVAL;
939 939
940 i810_dma_dispatch_vertex(dev, 940 i810_dma_dispatch_vertex(dev,
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2c8fef3ede54..694a4703042f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2756,10 +2756,10 @@ intel_set_plane_visible(struct intel_crtc_state *crtc_state,
2756 2756
2757 /* FIXME pre-g4x don't work like this */ 2757 /* FIXME pre-g4x don't work like this */
2758 if (visible) { 2758 if (visible) {
2759 crtc_state->base.plane_mask |= BIT(drm_plane_index(&plane->base)); 2759 crtc_state->base.plane_mask |= drm_plane_mask(&plane->base);
2760 crtc_state->active_planes |= BIT(plane->id); 2760 crtc_state->active_planes |= BIT(plane->id);
2761 } else { 2761 } else {
2762 crtc_state->base.plane_mask &= ~BIT(drm_plane_index(&plane->base)); 2762 crtc_state->base.plane_mask &= ~drm_plane_mask(&plane->base);
2763 crtc_state->active_planes &= ~BIT(plane->id); 2763 crtc_state->active_planes &= ~BIT(plane->id);
2764 } 2764 }
2765 2765
@@ -11884,7 +11884,7 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv,
11884 struct drm_crtc_state *new_state) 11884 struct drm_crtc_state *new_state)
11885{ 11885{
11886 struct intel_dpll_hw_state dpll_hw_state; 11886 struct intel_dpll_hw_state dpll_hw_state;
11887 unsigned crtc_mask; 11887 unsigned int crtc_mask;
11888 bool active; 11888 bool active;
11889 11889
11890 memset(&dpll_hw_state, 0, sizeof(dpll_hw_state)); 11890 memset(&dpll_hw_state, 0, sizeof(dpll_hw_state));
@@ -11911,7 +11911,7 @@ verify_single_dpll_state(struct drm_i915_private *dev_priv,
11911 return; 11911 return;
11912 } 11912 }
11913 11913
11914 crtc_mask = 1 << drm_crtc_index(crtc); 11914 crtc_mask = drm_crtc_mask(crtc);
11915 11915
11916 if (new_state->active) 11916 if (new_state->active)
11917 I915_STATE_WARN(!(pll->active_mask & crtc_mask), 11917 I915_STATE_WARN(!(pll->active_mask & crtc_mask),
@@ -11946,7 +11946,7 @@ verify_shared_dpll_state(struct drm_device *dev, struct drm_crtc *crtc,
11946 11946
11947 if (old_state->shared_dpll && 11947 if (old_state->shared_dpll &&
11948 old_state->shared_dpll != new_state->shared_dpll) { 11948 old_state->shared_dpll != new_state->shared_dpll) {
11949 unsigned crtc_mask = 1 << drm_crtc_index(crtc); 11949 unsigned int crtc_mask = drm_crtc_mask(crtc);
11950 struct intel_shared_dpll *pll = old_state->shared_dpll; 11950 struct intel_shared_dpll *pll = old_state->shared_dpll;
11951 11951
11952 I915_STATE_WARN(pll->active_mask & crtc_mask, 11952 I915_STATE_WARN(pll->active_mask & crtc_mask,
@@ -15608,9 +15608,9 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
15608 * rely on the connector_mask being accurate. 15608 * rely on the connector_mask being accurate.
15609 */ 15609 */
15610 encoder->base.crtc->state->connector_mask |= 15610 encoder->base.crtc->state->connector_mask |=
15611 1 << drm_connector_index(&connector->base); 15611 drm_connector_mask(&connector->base);
15612 encoder->base.crtc->state->encoder_mask |= 15612 encoder->base.crtc->state->encoder_mask |=
15613 1 << drm_encoder_index(&encoder->base); 15613 drm_encoder_mask(&encoder->base);
15614 } 15614 }
15615 15615
15616 } else { 15616 } else {
diff --git a/drivers/gpu/drm/i915/intel_display.h b/drivers/gpu/drm/i915/intel_display.h
index dfb02da73ac8..dd30cae5eb00 100644
--- a/drivers/gpu/drm/i915/intel_display.h
+++ b/drivers/gpu/drm/i915/intel_display.h
@@ -261,7 +261,7 @@ struct intel_link_m_n {
261 &(dev)->mode_config.plane_list, \ 261 &(dev)->mode_config.plane_list, \
262 base.head) \ 262 base.head) \
263 for_each_if((plane_mask) & \ 263 for_each_if((plane_mask) & \
264 BIT(drm_plane_index(&intel_plane->base))) 264 drm_plane_mask(&intel_plane->base)))
265 265
266#define for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) \ 266#define for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) \
267 list_for_each_entry(intel_plane, \ 267 list_for_each_entry(intel_plane, \
@@ -278,7 +278,7 @@ struct intel_link_m_n {
278 list_for_each_entry(intel_crtc, \ 278 list_for_each_entry(intel_crtc, \
279 &(dev)->mode_config.crtc_list, \ 279 &(dev)->mode_config.crtc_list, \
280 base.head) \ 280 base.head) \
281 for_each_if((crtc_mask) & BIT(drm_crtc_index(&intel_crtc->base))) 281 for_each_if((crtc_mask) & drm_crtc_mask(&intel_crtc->base))
282 282
283#define for_each_intel_encoder(dev, intel_encoder) \ 283#define for_each_intel_encoder(dev, intel_encoder) \
284 list_for_each_entry(intel_encoder, \ 284 list_for_each_entry(intel_encoder, \
diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
index 132fe63e042a..156f8e4cbe4c 100644
--- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
+++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
@@ -163,8 +163,8 @@ void intel_enable_shared_dpll(struct intel_crtc *crtc)
163 struct drm_device *dev = crtc->base.dev; 163 struct drm_device *dev = crtc->base.dev;
164 struct drm_i915_private *dev_priv = to_i915(dev); 164 struct drm_i915_private *dev_priv = to_i915(dev);
165 struct intel_shared_dpll *pll = crtc->config->shared_dpll; 165 struct intel_shared_dpll *pll = crtc->config->shared_dpll;
166 unsigned crtc_mask = 1 << drm_crtc_index(&crtc->base); 166 unsigned int crtc_mask = drm_crtc_mask(&crtc->base);
167 unsigned old_mask; 167 unsigned int old_mask;
168 168
169 if (WARN_ON(pll == NULL)) 169 if (WARN_ON(pll == NULL))
170 return; 170 return;
@@ -207,7 +207,7 @@ void intel_disable_shared_dpll(struct intel_crtc *crtc)
207{ 207{
208 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 208 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
209 struct intel_shared_dpll *pll = crtc->config->shared_dpll; 209 struct intel_shared_dpll *pll = crtc->config->shared_dpll;
210 unsigned crtc_mask = 1 << drm_crtc_index(&crtc->base); 210 unsigned int crtc_mask = drm_crtc_mask(&crtc->base);
211 211
212 /* PCH only available on ILK+ */ 212 /* PCH only available on ILK+ */
213 if (INTEL_GEN(dev_priv) < 5) 213 if (INTEL_GEN(dev_priv) < 5)
diff --git a/drivers/gpu/drm/imx/ipuv3-crtc.c b/drivers/gpu/drm/imx/ipuv3-crtc.c
index e83af0f2be86..21d002859ae0 100644
--- a/drivers/gpu/drm/imx/ipuv3-crtc.c
+++ b/drivers/gpu/drm/imx/ipuv3-crtc.c
@@ -213,7 +213,7 @@ static bool ipu_crtc_mode_fixup(struct drm_crtc *crtc,
213static int ipu_crtc_atomic_check(struct drm_crtc *crtc, 213static int ipu_crtc_atomic_check(struct drm_crtc *crtc,
214 struct drm_crtc_state *state) 214 struct drm_crtc_state *state)
215{ 215{
216 u32 primary_plane_mask = 1 << drm_plane_index(crtc->primary); 216 u32 primary_plane_mask = drm_plane_mask(crtc->primary);
217 217
218 if (state->active && (primary_plane_mask & state->plane_mask) == 0) 218 if (state->active && (primary_plane_mask & state->plane_mask) == 0)
219 return -EINVAL; 219 return -EINVAL;
diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
index 7b641fa6dc4d..79ff653d8081 100644
--- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c
@@ -68,7 +68,7 @@ static void mdp4_plane_destroy(struct drm_plane *plane)
68{ 68{
69 struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane); 69 struct mdp4_plane *mdp4_plane = to_mdp4_plane(plane);
70 70
71 drm_plane_helper_disable(plane); 71 drm_plane_helper_disable(plane, NULL);
72 drm_plane_cleanup(plane); 72 drm_plane_cleanup(plane);
73 73
74 kfree(mdp4_plane); 74 kfree(mdp4_plane);
diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
index c4f115fe96ff..7d306c5acd09 100644
--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
@@ -46,7 +46,7 @@ static void mdp5_plane_destroy(struct drm_plane *plane)
46{ 46{
47 struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane); 47 struct mdp5_plane *mdp5_plane = to_mdp5_plane(plane);
48 48
49 drm_plane_helper_disable(plane); 49 drm_plane_helper_disable(plane, NULL);
50 drm_plane_cleanup(plane); 50 drm_plane_cleanup(plane);
51 51
52 kfree(mdp5_plane); 52 kfree(mdp5_plane);
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index 8c093ca4222e..8edb9f2a4269 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -1,8 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/* 2/*
2 * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA, 3 * Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA,
3 * All Rights Reserved.
4 * Copyright (c) 2009 VMware, Inc., Palo Alto, CA., USA, 4 * Copyright (c) 2009 VMware, Inc., Palo Alto, CA., USA,
5 * All Rights Reserved.
6 * 5 *
7 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
diff --git a/drivers/gpu/drm/pl111/Makefile b/drivers/gpu/drm/pl111/Makefile
index 19a8189dc54f..0c70f0e91d21 100644
--- a/drivers/gpu/drm/pl111/Makefile
+++ b/drivers/gpu/drm/pl111/Makefile
@@ -4,6 +4,7 @@ pl111_drm-y += pl111_display.o \
4 pl111_drv.o 4 pl111_drv.o
5 5
6pl111_drm-$(CONFIG_ARCH_VEXPRESS) += pl111_vexpress.o 6pl111_drm-$(CONFIG_ARCH_VEXPRESS) += pl111_vexpress.o
7pl111_drm-$(CONFIG_ARCH_NOMADIK) += pl111_nomadik.o
7pl111_drm-$(CONFIG_DEBUG_FS) += pl111_debugfs.o 8pl111_drm-$(CONFIG_DEBUG_FS) += pl111_debugfs.o
8 9
9obj-$(CONFIG_DRM_PL111) += pl111_drm.o 10obj-$(CONFIG_DRM_PL111) += pl111_drm.o
diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 19b0d006a54a..a432eb7ad445 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -223,48 +223,84 @@ static void pl111_display_enable(struct drm_simple_display_pipe *pipe,
223 223
224 /* Hard-code TFT panel */ 224 /* Hard-code TFT panel */
225 cntl = CNTL_LCDEN | CNTL_LCDTFT | CNTL_LCDVCOMP(1); 225 cntl = CNTL_LCDEN | CNTL_LCDTFT | CNTL_LCDVCOMP(1);
226 /* On the ST Micro variant, assume all 24 bits are connected */
227 if (priv->variant->st_bitmux_control)
228 cntl |= CNTL_ST_CDWID_24;
226 229
227 /* Note that the the hardware's format reader takes 'r' from 230 /*
231 * Note that the the ARM hardware's format reader takes 'r' from
228 * the low bit, while DRM formats list channels from high bit 232 * the low bit, while DRM formats list channels from high bit
229 * to low bit as you read left to right. 233 * to low bit as you read left to right. The ST Micro version of
234 * the PL110 (LCDC) however uses the standard DRM format.
230 */ 235 */
231 switch (fb->format->format) { 236 switch (fb->format->format) {
237 case DRM_FORMAT_BGR888:
238 /* Only supported on the ST Micro variant */
239 if (priv->variant->st_bitmux_control)
240 cntl |= CNTL_ST_LCDBPP24_PACKED | CNTL_BGR;
241 break;
242 case DRM_FORMAT_RGB888:
243 /* Only supported on the ST Micro variant */
244 if (priv->variant->st_bitmux_control)
245 cntl |= CNTL_ST_LCDBPP24_PACKED;
246 break;
232 case DRM_FORMAT_ABGR8888: 247 case DRM_FORMAT_ABGR8888:
233 case DRM_FORMAT_XBGR8888: 248 case DRM_FORMAT_XBGR8888:
234 cntl |= CNTL_LCDBPP24; 249 if (priv->variant->st_bitmux_control)
250 cntl |= CNTL_LCDBPP24 | CNTL_BGR;
251 else
252 cntl |= CNTL_LCDBPP24;
235 break; 253 break;
236 case DRM_FORMAT_ARGB8888: 254 case DRM_FORMAT_ARGB8888:
237 case DRM_FORMAT_XRGB8888: 255 case DRM_FORMAT_XRGB8888:
238 cntl |= CNTL_LCDBPP24 | CNTL_BGR; 256 if (priv->variant->st_bitmux_control)
257 cntl |= CNTL_LCDBPP24;
258 else
259 cntl |= CNTL_LCDBPP24 | CNTL_BGR;
239 break; 260 break;
240 case DRM_FORMAT_BGR565: 261 case DRM_FORMAT_BGR565:
241 if (priv->variant->is_pl110) 262 if (priv->variant->is_pl110)
242 cntl |= CNTL_LCDBPP16; 263 cntl |= CNTL_LCDBPP16;
264 else if (priv->variant->st_bitmux_control)
265 cntl |= CNTL_LCDBPP16 | CNTL_ST_1XBPP_565 | CNTL_BGR;
243 else 266 else
244 cntl |= CNTL_LCDBPP16_565; 267 cntl |= CNTL_LCDBPP16_565;
245 break; 268 break;
246 case DRM_FORMAT_RGB565: 269 case DRM_FORMAT_RGB565:
247 if (priv->variant->is_pl110) 270 if (priv->variant->is_pl110)
248 cntl |= CNTL_LCDBPP16; 271 cntl |= CNTL_LCDBPP16 | CNTL_BGR;
272 else if (priv->variant->st_bitmux_control)
273 cntl |= CNTL_LCDBPP16 | CNTL_ST_1XBPP_565;
249 else 274 else
250 cntl |= CNTL_LCDBPP16_565; 275 cntl |= CNTL_LCDBPP16_565 | CNTL_BGR;
251 cntl |= CNTL_BGR;
252 break; 276 break;
253 case DRM_FORMAT_ABGR1555: 277 case DRM_FORMAT_ABGR1555:
254 case DRM_FORMAT_XBGR1555: 278 case DRM_FORMAT_XBGR1555:
255 cntl |= CNTL_LCDBPP16; 279 cntl |= CNTL_LCDBPP16;
280 if (priv->variant->st_bitmux_control)
281 cntl |= CNTL_ST_1XBPP_5551 | CNTL_BGR;
256 break; 282 break;
257 case DRM_FORMAT_ARGB1555: 283 case DRM_FORMAT_ARGB1555:
258 case DRM_FORMAT_XRGB1555: 284 case DRM_FORMAT_XRGB1555:
259 cntl |= CNTL_LCDBPP16 | CNTL_BGR; 285 cntl |= CNTL_LCDBPP16;
286 if (priv->variant->st_bitmux_control)
287 cntl |= CNTL_ST_1XBPP_5551;
288 else
289 cntl |= CNTL_BGR;
260 break; 290 break;
261 case DRM_FORMAT_ABGR4444: 291 case DRM_FORMAT_ABGR4444:
262 case DRM_FORMAT_XBGR4444: 292 case DRM_FORMAT_XBGR4444:
263 cntl |= CNTL_LCDBPP16_444; 293 cntl |= CNTL_LCDBPP16_444;
294 if (priv->variant->st_bitmux_control)
295 cntl |= CNTL_ST_1XBPP_444 | CNTL_BGR;
264 break; 296 break;
265 case DRM_FORMAT_ARGB4444: 297 case DRM_FORMAT_ARGB4444:
266 case DRM_FORMAT_XRGB4444: 298 case DRM_FORMAT_XRGB4444:
267 cntl |= CNTL_LCDBPP16_444 | CNTL_BGR; 299 cntl |= CNTL_LCDBPP16_444;
300 if (priv->variant->st_bitmux_control)
301 cntl |= CNTL_ST_1XBPP_444;
302 else
303 cntl |= CNTL_BGR;
268 break; 304 break;
269 default: 305 default:
270 WARN_ONCE(true, "Unknown FB format 0x%08x\n", 306 WARN_ONCE(true, "Unknown FB format 0x%08x\n",
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index ce4501d0ab48..1aa015ccacef 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -36,11 +36,14 @@ struct drm_minor;
36 * struct pl111_variant_data - encodes IP differences 36 * struct pl111_variant_data - encodes IP differences
37 * @name: the name of this variant 37 * @name: the name of this variant
38 * @is_pl110: this is the early PL110 variant 38 * @is_pl110: this is the early PL110 variant
39 * @is_lcdc: this is the ST Microelectronics Nomadik LCDC variant
39 * @external_bgr: this is the Versatile Pl110 variant with external 40 * @external_bgr: this is the Versatile Pl110 variant with external
40 * BGR/RGB routing 41 * BGR/RGB routing
41 * @broken_clockdivider: the clock divider is broken and we need to 42 * @broken_clockdivider: the clock divider is broken and we need to
42 * use the supplied clock directly 43 * use the supplied clock directly
43 * @broken_vblank: the vblank IRQ is broken on this variant 44 * @broken_vblank: the vblank IRQ is broken on this variant
45 * @st_bitmux_control: this variant is using the ST Micro bitmux
46 * extensions to the control register
44 * @formats: array of supported pixel formats on this variant 47 * @formats: array of supported pixel formats on this variant
45 * @nformats: the length of the array of supported pixel formats 48 * @nformats: the length of the array of supported pixel formats
46 * @fb_bpp: desired bits per pixel on the default framebuffer 49 * @fb_bpp: desired bits per pixel on the default framebuffer
@@ -48,9 +51,11 @@ struct drm_minor;
48struct pl111_variant_data { 51struct pl111_variant_data {
49 const char *name; 52 const char *name;
50 bool is_pl110; 53 bool is_pl110;
54 bool is_lcdc;
51 bool external_bgr; 55 bool external_bgr;
52 bool broken_clockdivider; 56 bool broken_clockdivider;
53 bool broken_vblank; 57 bool broken_vblank;
58 bool st_bitmux_control;
54 const u32 *formats; 59 const u32 *formats;
55 unsigned int nformats; 60 unsigned int nformats;
56 unsigned int fb_bpp; 61 unsigned int fb_bpp;
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 454ff0804642..054b93689d94 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -75,6 +75,7 @@
75 75
76#include "pl111_drm.h" 76#include "pl111_drm.h"
77#include "pl111_versatile.h" 77#include "pl111_versatile.h"
78#include "pl111_nomadik.h"
78 79
79#define DRIVER_DESC "DRM module for PL111" 80#define DRIVER_DESC "DRM module for PL111"
80 81
@@ -288,8 +289,8 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
288 priv->memory_bw = 0; 289 priv->memory_bw = 0;
289 } 290 }
290 291
291 /* The two variants swap this register */ 292 /* The two main variants swap this register */
292 if (variant->is_pl110) { 293 if (variant->is_pl110 || variant->is_lcdc) {
293 priv->ienb = CLCD_PL110_IENB; 294 priv->ienb = CLCD_PL110_IENB;
294 priv->ctrl = CLCD_PL110_CNTL; 295 priv->ctrl = CLCD_PL110_CNTL;
295 } else { 296 } else {
@@ -308,6 +309,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
308 ret = pl111_versatile_init(dev, priv); 309 ret = pl111_versatile_init(dev, priv);
309 if (ret) 310 if (ret)
310 goto dev_unref; 311 goto dev_unref;
312 pl111_nomadik_init(dev);
311 313
312 /* turn off interrupts before requesting the irq */ 314 /* turn off interrupts before requesting the irq */
313 writel(0, priv->regs + priv->ienb); 315 writel(0, priv->regs + priv->ienb);
@@ -400,16 +402,50 @@ static const struct pl111_variant_data pl111_variant = {
400 .fb_bpp = 32, 402 .fb_bpp = 32,
401}; 403};
402 404
405static const u32 pl110_nomadik_pixel_formats[] = {
406 DRM_FORMAT_RGB888,
407 DRM_FORMAT_BGR888,
408 DRM_FORMAT_ABGR8888,
409 DRM_FORMAT_XBGR8888,
410 DRM_FORMAT_ARGB8888,
411 DRM_FORMAT_XRGB8888,
412 DRM_FORMAT_BGR565,
413 DRM_FORMAT_RGB565,
414 DRM_FORMAT_ABGR1555,
415 DRM_FORMAT_XBGR1555,
416 DRM_FORMAT_ARGB1555,
417 DRM_FORMAT_XRGB1555,
418 DRM_FORMAT_ABGR4444,
419 DRM_FORMAT_XBGR4444,
420 DRM_FORMAT_ARGB4444,
421 DRM_FORMAT_XRGB4444,
422};
423
424static const struct pl111_variant_data pl110_nomadik_variant = {
425 .name = "LCDC (PL110 Nomadik)",
426 .formats = pl110_nomadik_pixel_formats,
427 .nformats = ARRAY_SIZE(pl110_nomadik_pixel_formats),
428 .is_lcdc = true,
429 .st_bitmux_control = true,
430 .broken_vblank = true,
431 .fb_bpp = 16,
432};
433
403static const struct amba_id pl111_id_table[] = { 434static const struct amba_id pl111_id_table[] = {
404 { 435 {
405 .id = 0x00041110, 436 .id = 0x00041110,
406 .mask = 0x000fffff, 437 .mask = 0x000fffff,
407 .data = (void*)&pl110_variant, 438 .data = (void *)&pl110_variant,
439 },
440 {
441 .id = 0x00180110,
442 .mask = 0x00fffffe,
443 .data = (void *)&pl110_nomadik_variant,
408 }, 444 },
409 { 445 {
410 .id = 0x00041111, 446 .id = 0x00041111,
411 .mask = 0x000fffff, 447 .mask = 0x000fffff,
412 .data = (void*)&pl111_variant, 448 .data = (void *)&pl111_variant,
413 }, 449 },
414 {0, 0}, 450 {0, 0},
415}; 451};
diff --git a/drivers/gpu/drm/pl111/pl111_nomadik.c b/drivers/gpu/drm/pl111/pl111_nomadik.c
new file mode 100644
index 000000000000..6f385e59be22
--- /dev/null
+++ b/drivers/gpu/drm/pl111/pl111_nomadik.c
@@ -0,0 +1,36 @@
1// SPDX-License-Identifier: GPL-2.0+
2#include <linux/device.h>
3#include <linux/regmap.h>
4#include <linux/mfd/syscon.h>
5#include <linux/bitops.h>
6#include <linux/module.h>
7#include "pl111_nomadik.h"
8
9#define PMU_CTRL_OFFSET 0x0000
10#define PMU_CTRL_LCDNDIF BIT(26)
11
12void pl111_nomadik_init(struct device *dev)
13{
14 struct regmap *pmu_regmap;
15
16 /*
17 * Just bail out of this is not found, we could be running
18 * multiplatform on something else than Nomadik.
19 */
20 pmu_regmap =
21 syscon_regmap_lookup_by_compatible("stericsson,nomadik-pmu");
22 if (IS_ERR(pmu_regmap))
23 return;
24
25 /*
26 * This bit in the PMU controller multiplexes the two graphics
27 * blocks found in the Nomadik STn8815. The other one is called
28 * MDIF (Master Display Interface) and gets muxed out here.
29 */
30 regmap_update_bits(pmu_regmap,
31 PMU_CTRL_OFFSET,
32 PMU_CTRL_LCDNDIF,
33 0);
34 dev_info(dev, "set Nomadik PMU mux to CLCD mode\n");
35}
36EXPORT_SYMBOL_GPL(pl111_nomadik_init);
diff --git a/drivers/gpu/drm/pl111/pl111_nomadik.h b/drivers/gpu/drm/pl111/pl111_nomadik.h
new file mode 100644
index 000000000000..19d663d46353
--- /dev/null
+++ b/drivers/gpu/drm/pl111/pl111_nomadik.h
@@ -0,0 +1,18 @@
1// SPDX-License-Identifier: GPL-2.0+
2#include <linux/device.h>
3
4#ifndef PL111_NOMADIK_H
5#define PL111_NOMADIK_H
6#endif
7
8#ifdef CONFIG_ARCH_NOMADIK
9
10void pl111_nomadik_init(struct device *dev);
11
12#else
13
14static inline void pl111_nomadik_init(struct device *dev)
15{
16}
17
18#endif
diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c
index 7cb214577275..e37f0097f744 100644
--- a/drivers/gpu/drm/qxl/qxl_release.c
+++ b/drivers/gpu/drm/qxl/qxl_release.c
@@ -50,12 +50,6 @@ static const char *qxl_get_timeline_name(struct dma_fence *fence)
50 return "release"; 50 return "release";
51} 51}
52 52
53static bool qxl_nop_signaling(struct dma_fence *fence)
54{
55 /* fences are always automatically signaled, so just pretend we did this.. */
56 return true;
57}
58
59static long qxl_fence_wait(struct dma_fence *fence, bool intr, 53static long qxl_fence_wait(struct dma_fence *fence, bool intr,
60 signed long timeout) 54 signed long timeout)
61{ 55{
@@ -119,7 +113,6 @@ signaled:
119static const struct dma_fence_ops qxl_fence_ops = { 113static const struct dma_fence_ops qxl_fence_ops = {
120 .get_driver_name = qxl_get_driver_name, 114 .get_driver_name = qxl_get_driver_name,
121 .get_timeline_name = qxl_get_timeline_name, 115 .get_timeline_name = qxl_get_timeline_name,
122 .enable_signaling = qxl_nop_signaling,
123 .wait = qxl_fence_wait, 116 .wait = qxl_fence_wait,
124}; 117};
125 118
diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c
index 2db89bed52e8..7559a820bd43 100644
--- a/drivers/gpu/drm/savage/savage_state.c
+++ b/drivers/gpu/drm/savage/savage_state.c
@@ -971,7 +971,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
971 LOCK_TEST_WITH_RETURN(dev, file_priv); 971 LOCK_TEST_WITH_RETURN(dev, file_priv);
972 972
973 if (dma && dma->buflist) { 973 if (dma && dma->buflist) {
974 if (cmdbuf->dma_idx > dma->buf_count) { 974 if (cmdbuf->dma_idx >= dma->buf_count) {
975 DRM_ERROR 975 DRM_ERROR
976 ("vertex buffer index %u out of range (0-%u)\n", 976 ("vertex buffer index %u out of range (0-%u)\n",
977 cmdbuf->dma_idx, dma->buf_count - 1); 977 cmdbuf->dma_idx, dma->buf_count - 1);
diff --git a/drivers/gpu/drm/scheduler/sched_fence.c b/drivers/gpu/drm/scheduler/sched_fence.c
index df4461648e3f..45d9c3affbea 100644
--- a/drivers/gpu/drm/scheduler/sched_fence.c
+++ b/drivers/gpu/drm/scheduler/sched_fence.c
@@ -81,11 +81,6 @@ static const char *drm_sched_fence_get_timeline_name(struct dma_fence *f)
81 return (const char *)fence->sched->name; 81 return (const char *)fence->sched->name;
82} 82}
83 83
84static bool drm_sched_fence_enable_signaling(struct dma_fence *f)
85{
86 return true;
87}
88
89/** 84/**
90 * drm_sched_fence_free - free up the fence memory 85 * drm_sched_fence_free - free up the fence memory
91 * 86 *
@@ -134,18 +129,12 @@ static void drm_sched_fence_release_finished(struct dma_fence *f)
134const struct dma_fence_ops drm_sched_fence_ops_scheduled = { 129const struct dma_fence_ops drm_sched_fence_ops_scheduled = {
135 .get_driver_name = drm_sched_fence_get_driver_name, 130 .get_driver_name = drm_sched_fence_get_driver_name,
136 .get_timeline_name = drm_sched_fence_get_timeline_name, 131 .get_timeline_name = drm_sched_fence_get_timeline_name,
137 .enable_signaling = drm_sched_fence_enable_signaling,
138 .signaled = NULL,
139 .wait = dma_fence_default_wait,
140 .release = drm_sched_fence_release_scheduled, 132 .release = drm_sched_fence_release_scheduled,
141}; 133};
142 134
143const struct dma_fence_ops drm_sched_fence_ops_finished = { 135const struct dma_fence_ops drm_sched_fence_ops_finished = {
144 .get_driver_name = drm_sched_fence_get_driver_name, 136 .get_driver_name = drm_sched_fence_get_driver_name,
145 .get_timeline_name = drm_sched_fence_get_timeline_name, 137 .get_timeline_name = drm_sched_fence_get_timeline_name,
146 .enable_signaling = drm_sched_fence_enable_signaling,
147 .signaled = NULL,
148 .wait = dma_fence_default_wait,
149 .release = drm_sched_fence_release_finished, 138 .release = drm_sched_fence_release_finished,
150}; 139};
151 140
diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c
index df0a282b9615..57b870e1e696 100644
--- a/drivers/gpu/drm/sti/sti_cursor.c
+++ b/drivers/gpu/drm/sti/sti_cursor.c
@@ -332,7 +332,7 @@ static void sti_cursor_destroy(struct drm_plane *drm_plane)
332{ 332{
333 DRM_DEBUG_DRIVER("\n"); 333 DRM_DEBUG_DRIVER("\n");
334 334
335 drm_plane_helper_disable(drm_plane); 335 drm_plane_helper_disable(drm_plane, NULL);
336 drm_plane_cleanup(drm_plane); 336 drm_plane_cleanup(drm_plane);
337} 337}
338 338
diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 49813d34bdf0..c32de6cbf061 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -883,7 +883,7 @@ static void sti_gdp_destroy(struct drm_plane *drm_plane)
883{ 883{
884 DRM_DEBUG_DRIVER("\n"); 884 DRM_DEBUG_DRIVER("\n");
885 885
886 drm_plane_helper_disable(drm_plane); 886 drm_plane_helper_disable(drm_plane, NULL);
887 drm_plane_cleanup(drm_plane); 887 drm_plane_cleanup(drm_plane);
888} 888}
889 889
diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c
index 106be8c4e58b..03ac3b4a4469 100644
--- a/drivers/gpu/drm/sti/sti_hqvdp.c
+++ b/drivers/gpu/drm/sti/sti_hqvdp.c
@@ -1260,7 +1260,7 @@ static void sti_hqvdp_destroy(struct drm_plane *drm_plane)
1260{ 1260{
1261 DRM_DEBUG_DRIVER("\n"); 1261 DRM_DEBUG_DRIVER("\n");
1262 1262
1263 drm_plane_helper_disable(drm_plane); 1263 drm_plane_helper_disable(drm_plane, NULL);
1264 drm_plane_cleanup(drm_plane); 1264 drm_plane_cleanup(drm_plane);
1265} 1265}
1266 1266
diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c
index 2d7c57406715..3eedf335a935 100644
--- a/drivers/gpu/drm/sun4i/sun4i_crtc.c
+++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c
@@ -242,7 +242,7 @@ struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
242 242
243 /* Set possible_crtcs to this crtc for overlay planes */ 243 /* Set possible_crtcs to this crtc for overlay planes */
244 for (i = 0; planes[i]; i++) { 244 for (i = 0; planes[i]; i++) {
245 uint32_t possible_crtcs = BIT(drm_crtc_index(&scrtc->crtc)); 245 uint32_t possible_crtcs = drm_crtc_mask(&scrtc->crtc);
246 struct drm_plane *plane = planes[i]; 246 struct drm_plane *plane = planes[i];
247 247
248 if (plane->type == DRM_PLANE_TYPE_OVERLAY) 248 if (plane->type == DRM_PLANE_TYPE_OVERLAY)
diff --git a/drivers/gpu/drm/sun4i/sun4i_lvds.c b/drivers/gpu/drm/sun4i/sun4i_lvds.c
index be3f14d7746d..a69fe2e1f9d1 100644
--- a/drivers/gpu/drm/sun4i/sun4i_lvds.c
+++ b/drivers/gpu/drm/sun4i/sun4i_lvds.c
@@ -136,7 +136,7 @@ int sun4i_lvds_init(struct drm_device *drm, struct sun4i_tcon *tcon)
136 } 136 }
137 137
138 /* The LVDS encoder can only work with the TCON channel 0 */ 138 /* The LVDS encoder can only work with the TCON channel 0 */
139 lvds->encoder.possible_crtcs = BIT(drm_crtc_index(&tcon->crtc->crtc)); 139 lvds->encoder.possible_crtcs = drm_crtc_mask(&tcon->crtc->crtc);
140 140
141 if (tcon->panel) { 141 if (tcon->panel) {
142 drm_connector_helper_add(&lvds->connector, 142 drm_connector_helper_add(&lvds->connector,
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c
index f2fa1f210509..96d21b07f8fc 100644
--- a/drivers/gpu/drm/sun4i/sun4i_rgb.c
+++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c
@@ -202,7 +202,7 @@ int sun4i_rgb_init(struct drm_device *drm, struct sun4i_tcon *tcon)
202 } 202 }
203 203
204 /* The RGB encoder can only work with the TCON channel 0 */ 204 /* The RGB encoder can only work with the TCON channel 0 */
205 rgb->encoder.possible_crtcs = BIT(drm_crtc_index(&tcon->crtc->crtc)); 205 rgb->encoder.possible_crtcs = drm_crtc_mask(&tcon->crtc->crtc);
206 206
207 if (tcon->panel) { 207 if (tcon->panel) {
208 drm_connector_helper_add(&rgb->connector, 208 drm_connector_helper_add(&rgb->connector,
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c
index dcadf793ee80..d222358fa8a7 100644
--- a/drivers/gpu/drm/vc4/vc4_crtc.c
+++ b/drivers/gpu/drm/vc4/vc4_crtc.c
@@ -1081,7 +1081,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
1081 if (IS_ERR(plane)) 1081 if (IS_ERR(plane))
1082 continue; 1082 continue;
1083 1083
1084 plane->possible_crtcs = 1 << drm_crtc_index(crtc); 1084 plane->possible_crtcs = drm_crtc_mask(crtc);
1085 } 1085 }
1086 1086
1087 /* Set up the legacy cursor after overlay initialization, 1087 /* Set up the legacy cursor after overlay initialization,
@@ -1090,7 +1090,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
1090 */ 1090 */
1091 cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR); 1091 cursor_plane = vc4_plane_init(drm, DRM_PLANE_TYPE_CURSOR);
1092 if (!IS_ERR(cursor_plane)) { 1092 if (!IS_ERR(cursor_plane)) {
1093 cursor_plane->possible_crtcs = 1 << drm_crtc_index(crtc); 1093 cursor_plane->possible_crtcs = drm_crtc_mask(crtc);
1094 crtc->cursor = cursor_plane; 1094 crtc->cursor = cursor_plane;
1095 } 1095 }
1096 1096
@@ -1118,7 +1118,7 @@ static int vc4_crtc_bind(struct device *dev, struct device *master, void *data)
1118err_destroy_planes: 1118err_destroy_planes:
1119 list_for_each_entry_safe(destroy_plane, temp, 1119 list_for_each_entry_safe(destroy_plane, temp,
1120 &drm->mode_config.plane_list, head) { 1120 &drm->mode_config.plane_list, head) {
1121 if (destroy_plane->possible_crtcs == 1 << drm_crtc_index(crtc)) 1121 if (destroy_plane->possible_crtcs == drm_crtc_mask(crtc))
1122 destroy_plane->funcs->destroy(destroy_plane); 1122 destroy_plane->funcs->destroy(destroy_plane);
1123 } 1123 }
1124err: 1124err:
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c
index 8aa897835118..9c8e89372d1c 100644
--- a/drivers/gpu/drm/vc4/vc4_dsi.c
+++ b/drivers/gpu/drm/vc4/vc4_dsi.c
@@ -814,7 +814,9 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)
814 struct vc4_dsi *dsi = vc4_encoder->dsi; 814 struct vc4_dsi *dsi = vc4_encoder->dsi;
815 struct device *dev = &dsi->pdev->dev; 815 struct device *dev = &dsi->pdev->dev;
816 816
817 drm_bridge_disable(dsi->bridge);
817 vc4_dsi_ulps(dsi, true); 818 vc4_dsi_ulps(dsi, true);
819 drm_bridge_post_disable(dsi->bridge);
818 820
819 clk_disable_unprepare(dsi->pll_phy_clock); 821 clk_disable_unprepare(dsi->pll_phy_clock);
820 clk_disable_unprepare(dsi->escape_clock); 822 clk_disable_unprepare(dsi->escape_clock);
@@ -1089,21 +1091,6 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
1089 /* Display reset sequence timeout */ 1091 /* Display reset sequence timeout */
1090 DSI_PORT_WRITE(PR_TO_CNT, 100000); 1092 DSI_PORT_WRITE(PR_TO_CNT, 100000);
1091 1093
1092 if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
1093 DSI_PORT_WRITE(DISP0_CTRL,
1094 VC4_SET_FIELD(dsi->divider,
1095 DSI_DISP0_PIX_CLK_DIV) |
1096 VC4_SET_FIELD(dsi->format, DSI_DISP0_PFORMAT) |
1097 VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME,
1098 DSI_DISP0_LP_STOP_CTRL) |
1099 DSI_DISP0_ST_END |
1100 DSI_DISP0_ENABLE);
1101 } else {
1102 DSI_PORT_WRITE(DISP0_CTRL,
1103 DSI_DISP0_COMMAND_MODE |
1104 DSI_DISP0_ENABLE);
1105 }
1106
1107 /* Set up DISP1 for transferring long command payloads through 1094 /* Set up DISP1 for transferring long command payloads through
1108 * the pixfifo. 1095 * the pixfifo.
1109 */ 1096 */
@@ -1128,6 +1115,25 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)
1128 1115
1129 vc4_dsi_ulps(dsi, false); 1116 vc4_dsi_ulps(dsi, false);
1130 1117
1118 drm_bridge_pre_enable(dsi->bridge);
1119
1120 if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
1121 DSI_PORT_WRITE(DISP0_CTRL,
1122 VC4_SET_FIELD(dsi->divider,
1123 DSI_DISP0_PIX_CLK_DIV) |
1124 VC4_SET_FIELD(dsi->format, DSI_DISP0_PFORMAT) |
1125 VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME,
1126 DSI_DISP0_LP_STOP_CTRL) |
1127 DSI_DISP0_ST_END |
1128 DSI_DISP0_ENABLE);
1129 } else {
1130 DSI_PORT_WRITE(DISP0_CTRL,
1131 DSI_DISP0_COMMAND_MODE |
1132 DSI_DISP0_ENABLE);
1133 }
1134
1135 drm_bridge_enable(dsi->bridge);
1136
1131 if (debug_dump_regs) { 1137 if (debug_dump_regs) {
1132 DRM_INFO("DSI regs after:\n"); 1138 DRM_INFO("DSI regs after:\n");
1133 vc4_dsi_dump_regs(dsi); 1139 vc4_dsi_dump_regs(dsi);
@@ -1639,6 +1645,12 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
1639 dev_err(dev, "bridge attach failed: %d\n", ret); 1645 dev_err(dev, "bridge attach failed: %d\n", ret);
1640 return ret; 1646 return ret;
1641 } 1647 }
1648 /* Disable the atomic helper calls into the bridge. We
1649 * manually call the bridge pre_enable / enable / etc. calls
1650 * from our driver, since we need to sequence them within the
1651 * encoder's enable/disable paths.
1652 */
1653 dsi->encoder->bridge = NULL;
1642 1654
1643 pm_runtime_enable(dev); 1655 pm_runtime_enable(dev);
1644 1656
diff --git a/drivers/gpu/drm/vc4/vc4_fence.c b/drivers/gpu/drm/vc4/vc4_fence.c
index dbf5a5a5d5f5..580214e2158c 100644
--- a/drivers/gpu/drm/vc4/vc4_fence.c
+++ b/drivers/gpu/drm/vc4/vc4_fence.c
@@ -33,11 +33,6 @@ static const char *vc4_fence_get_timeline_name(struct dma_fence *fence)
33 return "vc4-v3d"; 33 return "vc4-v3d";
34} 34}
35 35
36static bool vc4_fence_enable_signaling(struct dma_fence *fence)
37{
38 return true;
39}
40
41static bool vc4_fence_signaled(struct dma_fence *fence) 36static bool vc4_fence_signaled(struct dma_fence *fence)
42{ 37{
43 struct vc4_fence *f = to_vc4_fence(fence); 38 struct vc4_fence *f = to_vc4_fence(fence);
@@ -49,8 +44,5 @@ static bool vc4_fence_signaled(struct dma_fence *fence)
49const struct dma_fence_ops vc4_fence_ops = { 44const struct dma_fence_ops vc4_fence_ops = {
50 .get_driver_name = vc4_fence_get_driver_name, 45 .get_driver_name = vc4_fence_get_driver_name,
51 .get_timeline_name = vc4_fence_get_timeline_name, 46 .get_timeline_name = vc4_fence_get_timeline_name,
52 .enable_signaling = vc4_fence_enable_signaling,
53 .signaled = vc4_fence_signaled, 47 .signaled = vc4_fence_signaled,
54 .wait = dma_fence_default_wait,
55 .release = dma_fence_free,
56}; 48};
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 8604fd2e7c5a..9d7a36f148cf 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -902,7 +902,7 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
902 902
903static void vc4_plane_destroy(struct drm_plane *plane) 903static void vc4_plane_destroy(struct drm_plane *plane)
904{ 904{
905 drm_plane_helper_disable(plane); 905 drm_plane_helper_disable(plane, NULL);
906 drm_plane_cleanup(plane); 906 drm_plane_cleanup(plane);
907} 907}
908 908
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index c64a85950c82..0e5620f76ee0 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -74,7 +74,7 @@ static vm_fault_t vgem_gem_fault(struct vm_fault *vmf)
74 74
75 num_pages = DIV_ROUND_UP(obj->base.size, PAGE_SIZE); 75 num_pages = DIV_ROUND_UP(obj->base.size, PAGE_SIZE);
76 76
77 if (page_offset > num_pages) 77 if (page_offset >= num_pages)
78 return VM_FAULT_SIGBUS; 78 return VM_FAULT_SIGBUS;
79 79
80 mutex_lock(&obj->pages_lock); 80 mutex_lock(&obj->pages_lock);
diff --git a/drivers/gpu/drm/virtio/virtgpu_fence.c b/drivers/gpu/drm/virtio/virtgpu_fence.c
index 23353521f903..00c742a441bf 100644
--- a/drivers/gpu/drm/virtio/virtgpu_fence.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fence.c
@@ -36,11 +36,6 @@ static const char *virtio_get_timeline_name(struct dma_fence *f)
36 return "controlq"; 36 return "controlq";
37} 37}
38 38
39static bool virtio_enable_signaling(struct dma_fence *f)
40{
41 return true;
42}
43
44static bool virtio_signaled(struct dma_fence *f) 39static bool virtio_signaled(struct dma_fence *f)
45{ 40{
46 struct virtio_gpu_fence *fence = to_virtio_fence(f); 41 struct virtio_gpu_fence *fence = to_virtio_fence(f);
@@ -67,9 +62,7 @@ static void virtio_timeline_value_str(struct dma_fence *f, char *str, int size)
67static const struct dma_fence_ops virtio_fence_ops = { 62static const struct dma_fence_ops virtio_fence_ops = {
68 .get_driver_name = virtio_get_driver_name, 63 .get_driver_name = virtio_get_driver_name,
69 .get_timeline_name = virtio_get_timeline_name, 64 .get_timeline_name = virtio_get_timeline_name,
70 .enable_signaling = virtio_enable_signaling,
71 .signaled = virtio_signaled, 65 .signaled = virtio_signaled,
72 .wait = dma_fence_default_wait,
73 .fence_value_str = virtio_fence_value_str, 66 .fence_value_str = virtio_fence_value_str,
74 .timeline_value_str = virtio_timeline_value_str, 67 .timeline_value_str = virtio_timeline_value_str,
75}; 68};
diff --git a/drivers/gpu/drm/vmwgfx/Kconfig b/drivers/gpu/drm/vmwgfx/Kconfig
index 8c308dac99c5..6b28a326f8bb 100644
--- a/drivers/gpu/drm/vmwgfx/Kconfig
+++ b/drivers/gpu/drm/vmwgfx/Kconfig
@@ -1,3 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0
1config DRM_VMWGFX 2config DRM_VMWGFX
2 tristate "DRM driver for VMware Virtual GPU" 3 tristate "DRM driver for VMware Virtual GPU"
3 depends on DRM && PCI && X86 && MMU 4 depends on DRM && PCI && X86 && MMU
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h
index 9ce2466a5d00..69c4253fbfbb 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_caps.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2007-2015 VMware, Inc. All rights reserved. 3 * Copyright 2007-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h
index 2dfd57c5f463..3bf75978e155 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 1998-2015 VMware, Inc. All rights reserved. 3 * Copyright 1998-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h
index c18b663f360f..e1c0d94cc1e9 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_devcaps.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 1998-2015 VMware, Inc. All rights reserved. 3 * Copyright 1998-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h
index 8c5ae608cfb4..f4606d04556b 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_dx.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2012-2015 VMware, Inc. All rights reserved. 3 * Copyright 2012-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h
index a1c36877ad55..8732490d45d5 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_limits.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2007-2015 VMware, Inc. All rights reserved. 3 * Copyright 2007-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h
index b44ce648f592..bdfc404c91e3 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_reg.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 1998-2015 VMware, Inc. All rights reserved. 3 * Copyright 1998-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h
index babe7cb84fc2..b45e96309233 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_surfacedefs.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2008-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2008-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h b/drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h
index 27b33ba88430..df63f24c2e10 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga3d_types.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2012-2015 VMware, Inc. All rights reserved. 3 * Copyright 2012-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga_escape.h b/drivers/gpu/drm/vmwgfx/device_include/svga_escape.h
index 884b1d1fb85f..acb41e28e46f 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga_escape.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga_escape.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2007-2015 VMware, Inc. All rights reserved. 3 * Copyright 2007-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h b/drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h
index faf6d9b2b891..e5385146e7fc 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2007-2015 VMware, Inc. All rights reserved. 3 * Copyright 2007-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga_reg.h b/drivers/gpu/drm/vmwgfx/device_include/svga_reg.h
index 88e72bf9a534..847e3301c478 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga_reg.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga_reg.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 1998-2015 VMware, Inc. All rights reserved. 3 * Copyright 1998-2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/svga_types.h b/drivers/gpu/drm/vmwgfx/device_include/svga_types.h
index 2e8ba4df8de9..53602a4e7957 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/svga_types.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/svga_types.h
@@ -1,5 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/********************************************************** 2/**********************************************************
2 * Copyright 2015 VMware, Inc. All rights reserved. 3 * Copyright 2015 VMware, Inc.
3 * 4 *
4 * Permission is hereby granted, free of charge, to any person 5 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation 6 * obtaining a copy of this software and associated documentation
diff --git a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h
index 7e7b0ce34aa2..75308bd0d970 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_begin.h
@@ -1,25 +1,2 @@
1/********************************************************** 1/* SPDX-License-Identifier: GPL-2.0 */
2 * Copyright 2015 VMware, Inc. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 *
24 **********************************************************/
25#include <linux/compiler.h> 2#include <linux/compiler.h>
diff --git a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h
index e2e440ed3d44..e93d6f28b68c 100644
--- a/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h
+++ b/drivers/gpu/drm/vmwgfx/device_include/vmware_pack_end.h
@@ -1,25 +1,2 @@
1/********************************************************** 1/* SPDX-License-Identifier: GPL-2.0 */
2 * Copyright 2015 VMware, Inc. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 *
24 **********************************************************/
25__packed 2__packed
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_binding.c b/drivers/gpu/drm/vmwgfx/vmwgfx_binding.c
index 55d32ae43aa4..0b9ee7fb45d6 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_binding.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_binding.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h b/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h
index bf2e77ad5a20..6a2a9d69043b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
index e8c94b19db7b..fc6673cde289 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
@@ -1,6 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2017 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2017 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved. 5 * All Rights Reserved.
5 * 6 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * Permission is hereby granted, free of charge, to any person obtaining a
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
index 21111fd091f9..02de216d55a1 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
index 9f45d5004cae..e7e4655d3f36 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
index 36c7b6c839c0..3b75af9bf85f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2014-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2014-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
index 3767ac335aca..750319d95458 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
index cbf54ea7b4c0..df55e7d8b4cf 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2014-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2014-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
index d59d9dd16ebc..df7d1c97eb82 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_dmabuf.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2011-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2011-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index 09cc721160c4..af88cb737be3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2016 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2016 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
index 5fcbe1620d50..422eef114b98 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index c9d5cc237124..47bb7e58a368 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009 - 2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009 - 2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
index 9ed544f8958f..c2eeb677cdfc 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2011-2014 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2011-2014 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
index 20224dba9d8e..c9382933c2b9 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2011-2012 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2011-2012 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index a1c68e6a689e..d0fd147ef75f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
index 66ffa1d4759c..007a0cc7f232 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
index f2f9d88131f2..ddb1e9365a3e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright (c) 2007-2010 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2007-2010 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
index c5e8eae0dbe2..78fce406e1d4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
index b9239ba067c4..c3ad4478266b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index ef96ba7432ad..bc5fbd39cf9a 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
@@ -535,9 +535,9 @@ int vmw_du_crtc_atomic_check(struct drm_crtc *crtc,
535 struct drm_crtc_state *new_state) 535 struct drm_crtc_state *new_state)
536{ 536{
537 struct vmw_display_unit *du = vmw_crtc_to_du(new_state->crtc); 537 struct vmw_display_unit *du = vmw_crtc_to_du(new_state->crtc);
538 int connector_mask = 1 << drm_connector_index(&du->connector); 538 int connector_mask = drm_connector_mask(&du->connector);
539 bool has_primary = new_state->plane_mask & 539 bool has_primary = new_state->plane_mask &
540 BIT(drm_plane_index(crtc->primary)); 540 drm_plane_mask(crtc->primary);
541 541
542 /* We always want to have an active plane with an active CRTC */ 542 /* We always want to have an active plane with an active CRTC */
543 if (has_primary != new_state->enable) 543 if (has_primary != new_state->enable)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
index 6b7c012719f1..27c41c227120 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
index 4a5907e3f560..dc0cfda26b1b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
index efd1ffd68185..e53bc639a754 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_marker.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright (C) 2010 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2010 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
index d07c585e3c1d..0963d0438190 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2012-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2012-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index 21d746bdc922..4437c41c585a 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -1,6 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/* 2/*
2 * Copyright © 2016 VMware, Inc., Palo Alto, CA., USA 3 * Copyright 2016 VMware, Inc., Palo Alto, CA., USA
3 * All Rights Reserved.
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a 5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the 6 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h
index 8545488aa0cf..4907e50fb20a 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h
@@ -1,16 +1,29 @@
1/* 1/* SPDX-License-Identifier: GPL-2.0+ OR MIT */
2 * Copyright (C) 2016, VMware, Inc. 2/**************************************************************************
3 *
4 * Copyright 2016 VMware, Inc., Palo Alto, CA., USA
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
3 * 17 *
4 * This program is free software; you can redistribute it and/or modify 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5 * it under the terms of the GNU General Public License as published by 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
6 * the Free Software Foundation; either version 2 of the License, or 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
7 * (at your option) any later version. 21 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
8 * 25 *
9 * This program is distributed in the hope that it will be useful, but 26 **************************************************************************
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12 * NON INFRINGEMENT. See the GNU General Public License for more
13 * details.
14 * 27 *
15 * Based on code from vmware.c and vmmouse.c. 28 * Based on code from vmware.c and vmmouse.c.
16 * Author: 29 * Author:
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
index 222c9c2123a1..3ced89e70a64 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2014 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2014 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c b/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c
index 373bc6da2f84..0861c821a7fe 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_prime.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2013 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2013 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_reg.h b/drivers/gpu/drm/vmwgfx/vmwgfx_reg.h
index dce798053a96..e99f6cdbb091 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_reg.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_reg.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2014 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2014 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index 6b3a942b18df..3063a3e4bd40 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h
index ac05968a832b..a8c1c5ebd71d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h
@@ -1,7 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2012-2014 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2012-2014 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
index 9798640cbfcd..73cf3c6e1591 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2011-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2011-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
index 73b8e9a16368..e3ba63da396d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c
index a0cb310665cc..6ebc5affde14 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_simple_resource.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2016 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2016 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_so.c b/drivers/gpu/drm/vmwgfx/vmwgfx_so.c
index d3573c37c436..e9b6b7baa009 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_so.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_so.c
@@ -1,6 +1,6 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * Copyright © 2014-2015 VMware, Inc., Palo Alto, CA., USA 3 * Copyright 2014-2015 VMware, Inc., Palo Alto, CA., USA
3 * All Rights Reserved.
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a 5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the 6 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_so.h b/drivers/gpu/drm/vmwgfx/vmwgfx_so.h
index 268738387b5e..b80c7252f2fd 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_so.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_so.h
@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */
1/************************************************************************** 2/**************************************************************************
2 * Copyright © 2014-2015 VMware, Inc., Palo Alto, CA., USA 3 * Copyright 2014-2015 VMware, Inc., Palo Alto, CA., USA
3 * All Rights Reserved.
4 * 4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a 5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the 6 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
index 152e96cb1c01..a474d87b1af3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/****************************************************************************** 2/******************************************************************************
2 * 3 *
3 * COPYRIGHT © 2014-2015 VMware, Inc., Palo Alto, CA., USA 4 * COPYRIGHT (C) 2014-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index b236c48bf265..40a439797ae2 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2015 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2015 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
index e771091d2cd3..7b1e5a5cbd2c 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2009-2011 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2009-2011 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_va.c b/drivers/gpu/drm/vmwgfx/vmwgfx_va.c
index b4162fd78600..ebc1d83c34b4 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_va.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_va.c
@@ -1,7 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 OR MIT
1/************************************************************************** 2/**************************************************************************
2 * 3 *
3 * Copyright © 2012-2016 VMware, Inc., Palo Alto, CA., USA 4 * Copyright 2012-2016 VMware, Inc., Palo Alto, CA., USA
4 * All Rights Reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the 7 * copy of this software and associated documentation files (the
diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c
index d1931f5ea0b2..ae8c53b4b261 100644
--- a/drivers/gpu/drm/zte/zx_plane.c
+++ b/drivers/gpu/drm/zte/zx_plane.c
@@ -446,7 +446,7 @@ static const struct drm_plane_helper_funcs zx_gl_plane_helper_funcs = {
446 446
447static void zx_plane_destroy(struct drm_plane *plane) 447static void zx_plane_destroy(struct drm_plane *plane)
448{ 448{
449 drm_plane_helper_disable(plane); 449 drm_plane_helper_disable(plane, NULL);
450 drm_plane_cleanup(plane); 450 drm_plane_cleanup(plane);
451} 451}
452 452
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 4110ba7d7ca9..e91edef98633 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -150,6 +150,17 @@ config FRAMEBUFFER_CONSOLE_ROTATION
150 such that other users of the framebuffer will remain normally 150 such that other users of the framebuffer will remain normally
151 oriented. 151 oriented.
152 152
153config FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
154 bool "Framebuffer Console Deferred Takeover"
155 depends on FRAMEBUFFER_CONSOLE=y && DUMMY_CONSOLE=y
156 help
157 If enabled this defers the framebuffer console taking over the
158 console from the dummy console until the first text is displayed on
159 the console. This is useful in combination with the "quiet" kernel
160 commandline option to keep the framebuffer contents initially put up
161 by the firmware in place, rather then replacing the contents with a
162 black screen as soon as fbcon loads.
163
153config STI_CONSOLE 164config STI_CONSOLE
154 bool "STI text console" 165 bool "STI text console"
155 depends on PARISC && HAS_IOMEM 166 depends on PARISC && HAS_IOMEM
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index f2eafe2ed980..0254251fdd79 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -26,6 +26,67 @@
26#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS 26#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
27#endif 27#endif
28 28
29#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
30/* These are both protected by the console_lock */
31static RAW_NOTIFIER_HEAD(dummycon_output_nh);
32static bool dummycon_putc_called;
33
34void dummycon_register_output_notifier(struct notifier_block *nb)
35{
36 raw_notifier_chain_register(&dummycon_output_nh, nb);
37
38 if (dummycon_putc_called)
39 nb->notifier_call(nb, 0, NULL);
40}
41EXPORT_SYMBOL_GPL(dummycon_register_output_notifier);
42
43void dummycon_unregister_output_notifier(struct notifier_block *nb)
44{
45 raw_notifier_chain_unregister(&dummycon_output_nh, nb);
46}
47EXPORT_SYMBOL_GPL(dummycon_unregister_output_notifier);
48
49static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos)
50{
51 dummycon_putc_called = true;
52 raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
53}
54
55static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
56 int count, int ypos, int xpos)
57{
58 int i;
59
60 if (!dummycon_putc_called) {
61 /* Ignore erases */
62 for (i = 0 ; i < count; i++) {
63 if (s[i] != vc->vc_video_erase_char)
64 break;
65 }
66 if (i == count)
67 return;
68
69 dummycon_putc_called = true;
70 }
71
72 raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
73}
74
75static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
76{
77 /* Redraw, so that we get putc(s) for output done while blanked */
78 return 1;
79}
80#else
81static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { }
82static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
83 int count, int ypos, int xpos) { }
84static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
85{
86 return 0;
87}
88#endif
89
29static const char *dummycon_startup(void) 90static const char *dummycon_startup(void)
30{ 91{
31 return "dummy device"; 92 return "dummy device";
@@ -44,9 +105,6 @@ static void dummycon_init(struct vc_data *vc, int init)
44static void dummycon_deinit(struct vc_data *vc) { } 105static void dummycon_deinit(struct vc_data *vc) { }
45static void dummycon_clear(struct vc_data *vc, int sy, int sx, int height, 106static void dummycon_clear(struct vc_data *vc, int sy, int sx, int height,
46 int width) { } 107 int width) { }
47static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { }
48static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
49 int count, int ypos, int xpos) { }
50static void dummycon_cursor(struct vc_data *vc, int mode) { } 108static void dummycon_cursor(struct vc_data *vc, int mode) { }
51 109
52static bool dummycon_scroll(struct vc_data *vc, unsigned int top, 110static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
@@ -61,11 +119,6 @@ static int dummycon_switch(struct vc_data *vc)
61 return 0; 119 return 0;
62} 120}
63 121
64static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
65{
66 return 0;
67}
68
69static int dummycon_font_set(struct vc_data *vc, struct console_font *font, 122static int dummycon_font_set(struct vc_data *vc, struct console_font *font,
70 unsigned int flags) 123 unsigned int flags)
71{ 124{
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index c910e74d46ff..5fb156bdcf4e 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -129,6 +129,12 @@ static inline void fbcon_map_override(void)
129} 129}
130#endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */ 130#endif /* CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY */
131 131
132#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
133static bool deferred_takeover = true;
134#else
135#define deferred_takeover false
136#endif
137
132/* font data */ 138/* font data */
133static char fontname[40]; 139static char fontname[40];
134 140
@@ -499,6 +505,12 @@ static int __init fb_console_setup(char *this_opt)
499 margin_color = simple_strtoul(options, &options, 0); 505 margin_color = simple_strtoul(options, &options, 0);
500 continue; 506 continue;
501 } 507 }
508#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
509 if (!strcmp(options, "nodefer")) {
510 deferred_takeover = false;
511 continue;
512 }
513#endif
502 } 514 }
503 return 1; 515 return 1;
504} 516}
@@ -828,6 +840,8 @@ static int set_con2fb_map(int unit, int newidx, int user)
828 struct fb_info *oldinfo = NULL; 840 struct fb_info *oldinfo = NULL;
829 int found, err = 0; 841 int found, err = 0;
830 842
843 WARN_CONSOLE_UNLOCKED();
844
831 if (oldidx == newidx) 845 if (oldidx == newidx)
832 return 0; 846 return 0;
833 847
@@ -3044,6 +3058,8 @@ static int fbcon_fb_unbind(int idx)
3044{ 3058{
3045 int i, new_idx = -1, ret = 0; 3059 int i, new_idx = -1, ret = 0;
3046 3060
3061 WARN_CONSOLE_UNLOCKED();
3062
3047 if (!fbcon_has_console_bind) 3063 if (!fbcon_has_console_bind)
3048 return 0; 3064 return 0;
3049 3065
@@ -3094,6 +3110,11 @@ static int fbcon_fb_unregistered(struct fb_info *info)
3094{ 3110{
3095 int i, idx; 3111 int i, idx;
3096 3112
3113 WARN_CONSOLE_UNLOCKED();
3114
3115 if (deferred_takeover)
3116 return 0;
3117
3097 idx = info->node; 3118 idx = info->node;
3098 for (i = first_fb_vc; i <= last_fb_vc; i++) { 3119 for (i = first_fb_vc; i <= last_fb_vc; i++) {
3099 if (con2fb_map[i] == idx) 3120 if (con2fb_map[i] == idx)
@@ -3131,6 +3152,16 @@ static int fbcon_fb_unregistered(struct fb_info *info)
3131static void fbcon_remap_all(int idx) 3152static void fbcon_remap_all(int idx)
3132{ 3153{
3133 int i; 3154 int i;
3155
3156 WARN_CONSOLE_UNLOCKED();
3157
3158 if (deferred_takeover) {
3159 for (i = first_fb_vc; i <= last_fb_vc; i++)
3160 con2fb_map_boot[i] = idx;
3161 fbcon_map_override();
3162 return;
3163 }
3164
3134 for (i = first_fb_vc; i <= last_fb_vc; i++) 3165 for (i = first_fb_vc; i <= last_fb_vc; i++)
3135 set_con2fb_map(i, idx, 0); 3166 set_con2fb_map(i, idx, 0);
3136 3167
@@ -3177,9 +3208,16 @@ static int fbcon_fb_registered(struct fb_info *info)
3177{ 3208{
3178 int ret = 0, i, idx; 3209 int ret = 0, i, idx;
3179 3210
3211 WARN_CONSOLE_UNLOCKED();
3212
3180 idx = info->node; 3213 idx = info->node;
3181 fbcon_select_primary(info); 3214 fbcon_select_primary(info);
3182 3215
3216 if (deferred_takeover) {
3217 pr_info("fbcon: Deferring console take-over\n");
3218 return 0;
3219 }
3220
3183 if (info_idx == -1) { 3221 if (info_idx == -1) {
3184 for (i = first_fb_vc; i <= last_fb_vc; i++) { 3222 for (i = first_fb_vc; i <= last_fb_vc; i++) {
3185 if (con2fb_map_boot[i] == idx) { 3223 if (con2fb_map_boot[i] == idx) {
@@ -3555,8 +3593,46 @@ static int fbcon_init_device(void)
3555 return 0; 3593 return 0;
3556} 3594}
3557 3595
3596#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
3597static struct notifier_block fbcon_output_nb;
3598
3599static int fbcon_output_notifier(struct notifier_block *nb,
3600 unsigned long action, void *data)
3601{
3602 int i;
3603
3604 WARN_CONSOLE_UNLOCKED();
3605
3606 pr_info("fbcon: Taking over console\n");
3607
3608 dummycon_unregister_output_notifier(&fbcon_output_nb);
3609 deferred_takeover = false;
3610 logo_shown = FBCON_LOGO_DONTSHOW;
3611
3612 for (i = 0; i < FB_MAX; i++) {
3613 if (registered_fb[i])
3614 fbcon_fb_registered(registered_fb[i]);
3615 }
3616
3617 return NOTIFY_OK;
3618}
3619
3620static void fbcon_register_output_notifier(void)
3621{
3622 fbcon_output_nb.notifier_call = fbcon_output_notifier;
3623 dummycon_register_output_notifier(&fbcon_output_nb);
3624}
3625#else
3626static inline void fbcon_register_output_notifier(void) {}
3627#endif
3628
3558static void fbcon_start(void) 3629static void fbcon_start(void)
3559{ 3630{
3631 if (deferred_takeover) {
3632 fbcon_register_output_notifier();
3633 return;
3634 }
3635
3560 if (num_registered_fb) { 3636 if (num_registered_fb) {
3561 int i; 3637 int i;
3562 3638
@@ -3583,6 +3659,13 @@ static void fbcon_exit(void)
3583 if (fbcon_has_exited) 3659 if (fbcon_has_exited)
3584 return; 3660 return;
3585 3661
3662#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
3663 if (deferred_takeover) {
3664 dummycon_unregister_output_notifier(&fbcon_output_nb);
3665 deferred_takeover = false;
3666 }
3667#endif
3668
3586 kfree((void *)softback_buf); 3669 kfree((void *)softback_buf);
3587 softback_buf = 0UL; 3670 softback_buf = 0UL;
3588 3671
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 14ab58ade87f..bf0f0f0786d3 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1030,11 +1030,17 @@ int drm_mode_connector_attach_encoder(struct drm_connector *connector,
1030 struct drm_encoder *encoder); 1030 struct drm_encoder *encoder);
1031 1031
1032void drm_connector_cleanup(struct drm_connector *connector); 1032void drm_connector_cleanup(struct drm_connector *connector);
1033static inline unsigned drm_connector_index(struct drm_connector *connector) 1033
1034static inline unsigned int drm_connector_index(const struct drm_connector *connector)
1034{ 1035{
1035 return connector->index; 1036 return connector->index;
1036} 1037}
1037 1038
1039static inline u32 drm_connector_mask(const struct drm_connector *connector)
1040{
1041 return 1 << connector->index;
1042}
1043
1038/** 1044/**
1039 * drm_connector_lookup - lookup connector object 1045 * drm_connector_lookup - lookup connector object
1040 * @dev: DRM device 1046 * @dev: DRM device
diff --git a/include/drm/drm_encoder.h b/include/drm/drm_encoder.h
index fb299696c7c4..4f597c0730b4 100644
--- a/include/drm/drm_encoder.h
+++ b/include/drm/drm_encoder.h
@@ -191,12 +191,24 @@ int drm_encoder_init(struct drm_device *dev,
191 * Given a registered encoder, return the index of that encoder within a DRM 191 * Given a registered encoder, return the index of that encoder within a DRM
192 * device's list of encoders. 192 * device's list of encoders.
193 */ 193 */
194static inline unsigned int drm_encoder_index(struct drm_encoder *encoder) 194static inline unsigned int drm_encoder_index(const struct drm_encoder *encoder)
195{ 195{
196 return encoder->index; 196 return encoder->index;
197} 197}
198 198
199/** 199/**
200 * drm_encoder_mask - find the mask of a registered ENCODER
201 * @encoder: encoder to find mask for
202 *
203 * Given a registered encoder, return the mask bit of that encoder for an
204 * encoder's possible_clones field.
205 */
206static inline u32 drm_encoder_mask(const struct drm_encoder *encoder)
207{
208 return 1 << drm_encoder_index(encoder);
209}
210
211/**
200 * drm_encoder_crtc_ok - can a given crtc drive a given encoder? 212 * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
201 * @encoder: encoder to test 213 * @encoder: encoder to test
202 * @crtc: crtc to test 214 * @crtc: crtc to test
@@ -241,7 +253,7 @@ void drm_encoder_cleanup(struct drm_encoder *encoder);
241 */ 253 */
242#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \ 254#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \
243 list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \ 255 list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \
244 for_each_if ((encoder_mask) & (1 << drm_encoder_index(encoder))) 256 for_each_if ((encoder_mask) & drm_encoder_mask(encoder))
245 257
246/** 258/**
247 * drm_for_each_encoder - iterate over all encoders 259 * drm_for_each_encoder - iterate over all encoders
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 7d4d6c7f0afd..cee9dfaaa740 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -639,10 +639,20 @@ void drm_plane_cleanup(struct drm_plane *plane);
639 * Given a registered plane, return the index of that plane within a DRM 639 * Given a registered plane, return the index of that plane within a DRM
640 * device's list of planes. 640 * device's list of planes.
641 */ 641 */
642static inline unsigned int drm_plane_index(struct drm_plane *plane) 642static inline unsigned int drm_plane_index(const struct drm_plane *plane)
643{ 643{
644 return plane->index; 644 return plane->index;
645} 645}
646
647/**
648 * drm_plane_mask - find the mask of a registered plane
649 * @plane: plane to find mask for
650 */
651static inline u32 drm_plane_mask(const struct drm_plane *plane)
652{
653 return 1 << drm_plane_index(plane);
654}
655
646struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx); 656struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx);
647void drm_plane_force_disable(struct drm_plane *plane); 657void drm_plane_force_disable(struct drm_plane *plane);
648 658
@@ -678,7 +688,7 @@ static inline struct drm_plane *drm_plane_find(struct drm_device *dev,
678 */ 688 */
679#define drm_for_each_plane_mask(plane, dev, plane_mask) \ 689#define drm_for_each_plane_mask(plane, dev, plane_mask) \
680 list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \ 690 list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
681 for_each_if ((plane_mask) & (1 << drm_plane_index(plane))) 691 for_each_if ((plane_mask) & drm_plane_mask(plane))
682 692
683/** 693/**
684 * drm_for_each_legacy_plane - iterate over all planes for legacy userspace 694 * drm_for_each_legacy_plane - iterate over all planes for legacy userspace
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h
index 28d7ce620729..26cee2934781 100644
--- a/include/drm/drm_plane_helper.h
+++ b/include/drm/drm_plane_helper.h
@@ -67,8 +67,10 @@ int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
67 int crtc_x, int crtc_y, 67 int crtc_x, int crtc_y,
68 unsigned int crtc_w, unsigned int crtc_h, 68 unsigned int crtc_w, unsigned int crtc_h,
69 uint32_t src_x, uint32_t src_y, 69 uint32_t src_x, uint32_t src_y,
70 uint32_t src_w, uint32_t src_h); 70 uint32_t src_w, uint32_t src_h,
71int drm_plane_helper_disable(struct drm_plane *plane); 71 struct drm_modeset_acquire_ctx *ctx);
72int drm_plane_helper_disable(struct drm_plane *plane,
73 struct drm_modeset_acquire_ctx *ctx);
72 74
73/* For use by drm_crtc_helper.c */ 75/* For use by drm_crtc_helper.c */
74int drm_plane_helper_commit(struct drm_plane *plane, 76int drm_plane_helper_commit(struct drm_plane *plane,
diff --git a/include/linux/console.h b/include/linux/console.h
index dfd6b0e97855..f59f3dbca65c 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -21,6 +21,7 @@ struct console_font_op;
21struct console_font; 21struct console_font;
22struct module; 22struct module;
23struct tty_struct; 23struct tty_struct;
24struct notifier_block;
24 25
25/* 26/*
26 * this is what the terminal answers to a ESC-Z or csi0c query. 27 * this is what the terminal answers to a ESC-Z or csi0c query.
@@ -220,4 +221,8 @@ static inline bool vgacon_text_force(void) { return false; }
220 221
221extern void console_init(void); 222extern void console_init(void);
222 223
224/* For deferred console takeover */
225void dummycon_register_output_notifier(struct notifier_block *nb);
226void dummycon_unregister_output_notifier(struct notifier_block *nb);
227
223#endif /* _LINUX_CONSOLE_H */ 228#endif /* _LINUX_CONSOLE_H */
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index eb9b05aa5aea..02dba8cd033d 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -166,7 +166,8 @@ struct dma_fence_ops {
166 * released when the fence is signalled (through e.g. the interrupt 166 * released when the fence is signalled (through e.g. the interrupt
167 * handler). 167 * handler).
168 * 168 *
169 * This callback is mandatory. 169 * This callback is optional. If this callback is not present, then the
170 * driver must always have signaling enabled.
170 */ 171 */
171 bool (*enable_signaling)(struct dma_fence *fence); 172 bool (*enable_signaling)(struct dma_fence *fence);
172 173
@@ -190,11 +191,14 @@ struct dma_fence_ops {
190 /** 191 /**
191 * @wait: 192 * @wait:
192 * 193 *
193 * Custom wait implementation, or dma_fence_default_wait. 194 * Custom wait implementation, defaults to dma_fence_default_wait() if
195 * not set.
194 * 196 *
195 * Must not be NULL, set to dma_fence_default_wait for default implementation. 197 * The dma_fence_default_wait implementation should work for any fence, as long
196 * the dma_fence_default_wait implementation should work for any fence, as long 198 * as @enable_signaling works correctly. This hook allows drivers to
197 * as enable_signaling works correctly. 199 * have an optimized version for the case where a process context is
200 * already available, e.g. if @enable_signaling for the general case
201 * needs to set up a worker thread.
198 * 202 *
199 * Must return -ERESTARTSYS if the wait is intr = true and the wait was 203 * Must return -ERESTARTSYS if the wait is intr = true and the wait was
200 * interrupted, and remaining jiffies if fence has signaled, or 0 if wait 204 * interrupted, and remaining jiffies if fence has signaled, or 0 if wait
@@ -202,7 +206,7 @@ struct dma_fence_ops {
202 * which should be treated as if the fence is signaled. For example a hardware 206 * which should be treated as if the fence is signaled. For example a hardware
203 * lockup could be reported like that. 207 * lockup could be reported like that.
204 * 208 *
205 * This callback is mandatory. 209 * This callback is optional.
206 */ 210 */
207 signed long (*wait)(struct dma_fence *fence, 211 signed long (*wait)(struct dma_fence *fence,
208 bool intr, signed long timeout); 212 bool intr, signed long timeout);
@@ -218,17 +222,6 @@ struct dma_fence_ops {
218 void (*release)(struct dma_fence *fence); 222 void (*release)(struct dma_fence *fence);
219 223
220 /** 224 /**
221 * @fill_driver_data:
222 *
223 * Callback to fill in free-form debug info.
224 *
225 * Returns amount of bytes filled, or negative error on failure.
226 *
227 * This callback is optional.
228 */
229 int (*fill_driver_data)(struct dma_fence *fence, void *data, int size);
230
231 /**
232 * @fence_value_str: 225 * @fence_value_str:
233 * 226 *
234 * Callback to fill in free-form debug info specific to this fence, like 227 * Callback to fill in free-form debug info specific to this fence, like
@@ -242,8 +235,9 @@ struct dma_fence_ops {
242 * @timeline_value_str: 235 * @timeline_value_str:
243 * 236 *
244 * Fills in the current value of the timeline as a string, like the 237 * Fills in the current value of the timeline as a string, like the
245 * sequence number. This should match what @fill_driver_data prints for 238 * sequence number. Note that the specific fence passed to this function
246 * the most recently signalled fence (assuming no delayed signalling). 239 * should not matter, drivers should only use it to look up the
240 * corresponding timeline structures.
247 */ 241 */
248 void (*timeline_value_str)(struct dma_fence *fence, 242 void (*timeline_value_str)(struct dma_fence *fence,
249 char *str, int size); 243 char *str, int size);
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index 64bf67abff7e..d5e52350a3aa 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -464,6 +464,27 @@ extern "C" {
464#define DRM_FORMAT_MOD_BROADCOM_SAND256 \ 464#define DRM_FORMAT_MOD_BROADCOM_SAND256 \
465 DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0) 465 DRM_FORMAT_MOD_BROADCOM_SAND256_COL_HEIGHT(0)
466 466
467/* Broadcom UIF format
468 *
469 * This is the common format for the current Broadcom multimedia
470 * blocks, including V3D 3.x and newer, newer video codecs, and
471 * displays.
472 *
473 * The image consists of utiles (64b blocks), UIF blocks (2x2 utiles),
474 * and macroblocks (4x4 UIF blocks). Those 4x4 UIF block groups are
475 * stored in columns, with padding between the columns to ensure that
476 * moving from one column to the next doesn't hit the same SDRAM page
477 * bank.
478 *
479 * To calculate the padding, it is assumed that each hardware block
480 * and the software driving it knows the platform's SDRAM page size,
481 * number of banks, and XOR address, and that it's identical between
482 * all blocks using the format. This tiling modifier will use XOR as
483 * necessary to reduce the padding. If a hardware block can't do XOR,
484 * the assumption is that a no-XOR tiling modifier will be created.
485 */
486#define DRM_FORMAT_MOD_BROADCOM_UIF fourcc_mod_code(BROADCOM, 6)
487
467#if defined(__cplusplus) 488#if defined(__cplusplus)
468} 489}
469#endif 490#endif
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 247808333ba4..3f041e7cbfc9 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2243,6 +2243,7 @@ int is_console_locked(void)
2243{ 2243{
2244 return console_locked; 2244 return console_locked;
2245} 2245}
2246EXPORT_SYMBOL(is_console_locked);
2246 2247
2247/* 2248/*
2248 * Check if we have any console that is capable of printing while cpu is 2249 * Check if we have any console that is capable of printing while cpu is