Eric Yang
d3511fd01c
drm/amd/display: update sr and pstate latencies for Renoir
...
[Why]
DF team has produced more optimized latency numbers.
[How]
Add sr latencies to the wm table, use different latencies
for different wm sets.
Also fix bb override from registery key for these latencies.
Signed-off-by: Eric Yang <Eric.Yang2@amd.com >
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com >
Acked-by: Leo Li <sunpeng.li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:26:30 -05:00
Le Ma
76434f75d4
drm/amdgpu: reduce redundant uvd context lost warning message
...
Move the print out of uvd instance loop in amdgpu_uvd_suspend
v2: drop unnecessary brackets
v3: grab ras_intr state once for multiple times use
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:26:20 -05:00
Le Ma
00eaa57172
drm/amdgpu: clear err_event_athub flag after reset exit
...
Otherwise next err_event_athub error cannot call gpu reset. And following
resume sequence will not be affected by this flag.
v2: create function to clear amdgpu_ras_in_intr for modularity of ras driver
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:26:11 -05:00
Le Ma
b823821f22
drm/amdgpu: support full gpu reset workflow when ras err_event_athub occurs
...
This athub fatal error can be recovered by baco without system-level reboot,
so add a mode to use baco for the recovery. Not affect the default psp reset
situations for now.
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:26:03 -05:00
Le Ma
ce316fa55e
drm/amdgpu: add concurrent baco reset support for XGMI
...
Currently each XGMI node reset wq does not run in parrallel if bound to same
cpu. Make change to bound the xgmi_reset_work item to different cpus.
XGMI requires all nodes enter into baco within very close proximity before
any node exit baco. So schedule the xgmi_reset_work wq twice for enter/exit
baco respectively.
To use baco for XGMI, PMFW supported for baco on XGMI needs to be involved.
The case that PSP reset and baco reset coexist within an XGMI hive never exist
and is not in the consideration.
v2: define use_baco flag to simplify the code for xgmi baco sequence
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:25:53 -05:00
Le Ma
7a22677b95
drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper
...
This operation is needed when baco entry/exit for ras recovery
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:25:45 -05:00
Le Ma
5c39d600e3
drm/amdgpu: clear uncorrectable parity error status bit
...
This should be cleared during every nbif uncorrectable error cleanup work.
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:25:35 -05:00
Le Ma
28f87950d9
drm/amdgpu: clear ras controller status registers when interrupt occurs
...
To fix issue that ras controller interrupt cannot be triggered anymore after
one time nbif uncorrectable error. And error count is stored in nbif ras object
for query.
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:25:27 -05:00
Le Ma
f2a79be1c0
drm/amdgpu: export amdgpu_ras_find_obj to use externally
...
Change it to external interface.
Signed-off-by: Le Ma <le.ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:25:20 -05:00
Le Ma
4a2d93565a
drm/amdgpu: remove ras global recovery handling from ras_controller_int handler
...
v2: add notification when ras controller interrupt generates
Signed-off-by: Le Ma <Le.Ma@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:25:11 -05:00
Pierre-Eric Pelloux-Prayer
b456c93253
drm/amdgpu: add cache flush workaround to gfx8 emit_fence
...
The same workaround is used for gfx7.
Both PAL and Mesa use it for gfx8 too, so port this commit to
gfx_v8_0_ring_emit_fence_gfx.
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:24:58 -05:00
Alex Deucher
80c5a807a5
drm/amdgpu: add header line for power profile on Arcturus
...
So the output is consistent with other asics.
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:24:45 -05:00
Yong Zhao
a5a4d68c93
drm/amdkfd: Eliminate unnecessary kernel queue function pointers
...
Up to this point, those functions are all the same for all ASICs, so
no need to call them by functions pointers. Removing the function
pointers will greatly increase the code readablity. If there is ever
need for those function pointers, we can add it back then.
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:24:36 -05:00
James Zhu
f83f5a1e11
drm/amdgpu/gfx: Improvement on EDC GPR workarounds
...
SPI limits total CS waves in flight per SE to no more than 32 * num_cu and
we need to stuff 40 waves on a CU to completely clean the SGPR. This is
accomplished in the WR by cleaning the SE in two steps, half of the CU per
step.
Signed-off-by: James Zhu <James.Zhu@amd.com >
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:24:28 -05:00
Guchun Chen
79c4c8ea91
drm/amdgpu: add check before enabling/disabling broadcast mode
...
When security violation from new vbios happens, data fabric is
risky to stop working. So prevent the direct access to DF
mmFabricConfigAccessControl from the new vbios and onwards.
Signed-off-by: Guchun Chen <guchun.chen@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2019-12-05 16:24:09 -05:00
Chris Wilson
bbca083de2
drm/i915: Serialise i915_active_acquire() with __active_retire()
...
As __active_retire() does it's final atomic_dec() under the
ref->tree_lock spinlock, in order to prevent ourselves from reusing the
ref->cache and ref->tree as they are being destroyed, we need to
serialise with the retirement during i915_active_acquire().
[ +0.000005] kernel BUG at drivers/gpu/drm/i915/i915_active.c:157!
[ +0.000011] invalid opcode: 0000 [#1 ] SMP
[ +0.000004] CPU: 7 PID: 188 Comm: kworker/u16:4 Not tainted 5.4.0-rc8-03070-gac5e57322614 #89
[ +0.000002] Hardware name: Razer Razer Blade Stealth 13 Late 2019/LY320, BIOS 1.02 09/10/2019
[ +0.000082] Workqueue: events_unbound active_work [i915]
[ +0.000059] RIP: 0010:__active_retire+0x115/0x120 [i915]
[ +0.000003] Code: 75 28 48 8b 3d 8c 6e 1a 00 48 89 ee e8 e4 5f a5 c0 48 8b 44 24 10 65 48 33 04 25 28 00 00 00 75 0f 48 83 c4 18 5b 5d 41 5c c3 <0f> 0b 0f 0b 0f 0b e8 a0 90 87 c0 0f 1f 44 00 00 48 8b 3d 54 6e 1a
[ +0.000002] RSP: 0018:ffffb833003f7e48 EFLAGS: 00010286
[ +0.000003] RAX: ffff8d6e8d726d00 RBX: ffff8d6f9db4e840 RCX: 0000000000000000
[ +0.000001] RDX: ffffffff82605930 RSI: ffff8d6f9adc4908 RDI: ffff8d6e96cefe28
[ +0.000002] RBP: ffff8d6e96cefe00 R08: 0000000000000000 R09: ffff8d6f9ffe9a50
[ +0.000002] R10: 0000000000000048 R11: 0000000000000018 R12: ffff8d6f9adc4930
[ +0.000001] R13: ffff8d6f9e04fb00 R14: 0000000000000000 R15: ffff8d6f9adc4988
[ +0.000002] FS: 0000000000000000(0000) GS:ffff8d6f9ffc0000(0000) knlGS:0000000000000000
[ +0.000002] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ +0.000002] CR2: 000055eb5a34cf10 CR3: 000000018d609002 CR4: 0000000000760ee0
[ +0.000002] PKRU: 55555554
[ +0.000001] Call Trace:
[ +0.000010] process_one_work+0x1aa/0x350
[ +0.000004] worker_thread+0x4d/0x3a0
[ +0.000004] kthread+0xfb/0x130
[ +0.000004] ? process_one_work+0x350/0x350
[ +0.000003] ? kthread_park+0x90/0x90
[ +0.000005] ret_from_fork+0x1f/0x40
Reported-by: Kenneth Graunke <kenneth@whitecape.org >
Fixes: c9ad602fea ("drm/i915: Split i915_active.mutex into an irq-safe spinlock for the rbtree")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Cc: Kenneth Graunke <kenneth@whitecape.org >
Cc: Matthew Auld <matthew.auld@intel.com >
Tested-by: Kenneth Graunke <kenneth@whitecape.org >
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205183332.801237-1-chris@chris-wilson.co.uk
2019-12-05 21:10:48 +00:00
Andi Shyti
92c964ca3e
drm/i915/gt: Replace I915_READ with intel_uncore_read
...
Get rid of the last remaining I915_READ in gt/ and make gt-land
the first I915_READ-free happy island.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Andi Shyti <andi.shyti@intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205164422.727968-1-chris@chris-wilson.co.uk
2019-12-05 18:37:50 +00:00
Sean Paul
f79489074c
drm/dp_mst: Clear all payload id tables downstream when initializing
...
It seems that on certain MST hubs, namely the CableMatters USB-C 2x DP
hub, using the DP_PAYLOAD_ALLOCATE_SET and DP_PAYLOAD_TABLE_UPDATE_STATUS
register ranges to clear any pre-existing payload allocations on the hub isn't
always enough to reset things if the source device has been reset unexpectedly.
Or at least, that's the current running theory. The precise behavior appears to
be that when the source device gets reset unexpectedly, the hub begins reporting
an available_pbn value of 0 for all of its ports. This is a bit inconsistent
with the our theory, since this seems to happen even if previously set PBN
allocations should have resulted in a non-zero available_pbn value. So, it's
possible that something else may be going on here.
Strangely though, sending a CLEAR_PAYLOAD_ID_TABLE broadcast request when
initializing the MST topology seems to bring things into working order and make
available_pbn work again. Since this is a pretty safe solution, let's go ahead
and implement it.
Changes since v1:
* Change indenting on drm_dp_send_clear_payload_id_table() prototype
* Remove some braces in drm_dp_send_clear_payload_id_table()
* Reorganize some variable declarations in drm_dp_send_clear_payload_id_table()
* Don't forget to handle DP_CLEAR_PAYLOAD_ID_TABLE in
drm_dp_sideband_parse_reply()
* Move drm_dp_send_clear_payload_id_table() call into
drm_dp_mst_link_probe_work(), since we can't send sideband messages
while under lock in drm_dp_mst_topology_mgr_set_mst()
* Change commit message
Acked-by: Daniel Vetter <daniel@ffwll.ch >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190829000944.20722-1-lyude@redhat.com
2019-12-05 13:13:46 -05:00
Chris Wilson
6f7ac82853
drm/i915/gt: Save irqstate around virtual_context_destroy
...
As virtual_context_destroy() may be called from a request signal, it may
be called from inside an irq-off section, and so we need to do a full
save/restore of the irq state rather than blindly re-enable irqs upon
unlocking.
<4> [110.024262] WARNING: inconsistent lock state
<4> [110.024277] 5.4.0-rc8-CI-CI_DRM_7489+ #1 Tainted: G U
<4> [110.024292] --------------------------------
<4> [110.024305] inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
<4> [110.024323] kworker/0:0/5 [HC0[0]:SC0[0]:HE1:SE1] takes:
<4> [110.024338] ffff88826a0c7a18 (&(&rq->lock)->rlock){?.-.}, at: i915_request_retire+0x221/0x930 [i915]
<4> [110.024592] {IN-HARDIRQ-W} state was registered at:
<4> [110.024612] lock_acquire+0xa7/0x1c0
<4> [110.024627] _raw_spin_lock_irqsave+0x33/0x50
<4> [110.024788] intel_engine_breadcrumbs_irq+0x38c/0x600 [i915]
<4> [110.024808] irq_work_run_list+0x49/0x70
<4> [110.024824] irq_work_run+0x26/0x50
<4> [110.024839] smp_irq_work_interrupt+0x44/0x1e0
<4> [110.024855] irq_work_interrupt+0xf/0x20
<4> [110.024871] __do_softirq+0xb7/0x47f
<4> [110.024885] irq_exit+0xba/0xc0
<4> [110.024898] do_IRQ+0x83/0x160
<4> [110.024910] ret_from_intr+0x0/0x1d
<4> [110.024922] irq event stamp: 172864
<4> [110.024938] hardirqs last enabled at (172863): [<ffffffff819ea214>] _raw_spin_unlock_irq+0x24/0x50
<4> [110.024963] hardirqs last disabled at (172864): [<ffffffff819e9fba>] _raw_spin_lock_irq+0xa/0x40
<4> [110.024988] softirqs last enabled at (172812): [<ffffffff81c00385>] __do_softirq+0x385/0x47f
<4> [110.025012] softirqs last disabled at (172797): [<ffffffff810b829a>] irq_exit+0xba/0xc0
<4> [110.025031]
other info that might help us debug this:
<4> [110.025049] Possible unsafe locking scenario:
<4> [110.025065] CPU0
<4> [110.025075] ----
<4> [110.025084] lock(&(&rq->lock)->rlock);
<4> [110.025099] <Interrupt>
<4> [110.025109] lock(&(&rq->lock)->rlock);
<4> [110.025124]
*** DEADLOCK ***
<4> [110.025144] 4 locks held by kworker/0:0/5:
<4> [110.025156] #0 : ffff88827588f528 ((wq_completion)events){+.+.}, at: process_one_work+0x1de/0x620
<4> [110.025187] #1 : ffffc9000006fe78 ((work_completion)(&engine->retire_work)){+.+.}, at: process_one_work+0x1de/0x620
<4> [110.025219] #2 : ffff88825605e270 (&kernel#2){+.+.}, at: engine_retire+0x57/0xe0 [i915]
<4> [110.025405] #3 : ffff88826a0c7a18 (&(&rq->lock)->rlock){?.-.}, at: i915_request_retire+0x221/0x930 [i915]
<4> [110.025634]
stack backtrace:
<4> [110.025653] CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G U 5.4.0-rc8-CI-CI_DRM_7489+ #1
<4> [110.025675] Hardware name: /NUC7i5BNB, BIOS BNKBL357.86A.0054.2017.1025.1822 10/25/2017
<4> [110.025856] Workqueue: events engine_retire [i915]
<4> [110.025872] Call Trace:
<4> [110.025891] dump_stack+0x71/0x9b
<4> [110.025907] mark_lock+0x49a/0x500
<4> [110.025926] ? print_shortest_lock_dependencies+0x200/0x200
<4> [110.025946] mark_held_locks+0x49/0x70
<4> [110.025962] ? _raw_spin_unlock_irq+0x24/0x50
<4> [110.025978] lockdep_hardirqs_on+0xa2/0x1c0
<4> [110.025995] _raw_spin_unlock_irq+0x24/0x50
<4> [110.026171] virtual_context_destroy+0xc5/0x2e0 [i915]
<4> [110.026376] __active_retire+0xb4/0x290 [i915]
<4> [110.026396] dma_fence_signal_locked+0x9e/0x1b0
<4> [110.026613] i915_request_retire+0x451/0x930 [i915]
<4> [110.026766] retire_requests+0x4d/0x60 [i915]
<4> [110.026919] engine_retire+0x63/0xe0 [i915]
Fixes: b1e3177bd1 ("drm/i915: Coordinate i915_active with its own mutex")
Fixes: 6d06779e86 ("drm/i915: Load balancing across a virtual engine")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205145934.663183-1-chris@chris-wilson.co.uk
2019-12-05 17:27:55 +00:00
Thomas Zimmermann
c0826f40c2
drm/mgag200: Debug-print unique revisions id on G200 SE
...
The behavior of MGA G200 SE depends on the rev id. Print the id when
debugging is enabled.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Gerd Hoffmann <kraxel@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204133435.17462-1-tzimmermann@suse.de
2019-12-05 16:31:55 +01:00
Thomas Zimmermann
9623ecb07f
drm/mgag200: Call mgag200_driver_{load, unload}() before registering device
...
The load/unload callbacks in struct drm_driver are deprecated. Remove
them and call functions explicitly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205090252.5711-1-tzimmermann@suse.de
2019-12-05 16:31:37 +01:00
Thomas Zimmermann
50cbe0e379
drm/gma500: Call psb_driver_{load, unload}() before registering device
...
The load/unload callbacks in struct drm_driver are deprecated. Remove
them and call functions explicitly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204184617.22201-1-tzimmermann@suse.de
2019-12-05 16:31:19 +01:00
Chris Wilson
5c4fe63aba
drm/i915/gem: Reinitialise the local list before repeating
...
As we may start the loop again, we require our local list of i915_vma
we've processed to be reinitialised.
Fixes: aa5e4453dc ("drm/i915/gem: Try to flush pending unbind events")
Closes: https://gitlab.freedesktop.org/drm/intel/issues/731
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Andi Shyti <andi.shyti@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205132912.606868-1-chris@chris-wilson.co.uk
2019-12-05 14:37:25 +00:00
Chris Wilson
0471a44871
drm/i915/gt: Bump the PP_DIR invalidation for Baytrail
...
Invalidate the ring TLB and increase the delay required for Baytrail.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205113726.413351-3-chris@chris-wilson.co.uk
2019-12-05 13:51:06 +00:00
Chris Wilson
ccd2094559
drm/i915: Try hard to bind the context
...
It is not acceptable for context pinning to fail with -ENOSPC as we
should always be able to make space in the GGTT. The only reason we may
fail is that other "temporary" context pins are reserving their space
and we need to wait for an available slot.
Closes: https://gitlab.freedesktop.org/drm/intel/issues/676
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205113726.413351-2-chris@chris-wilson.co.uk
2019-12-05 13:50:54 +00:00
Chris Wilson
a725d711e8
drm/i915: Ignore most failures during evict-vm
...
Removing all vma from the VM is best effort -- we only remove all those
ready to be removed, so forgive and VMA that becomes pinned. While
forgiving those that become pinned, also take a second look for any that
became unpinned as we waited.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191205113726.413351-1-chris@chris-wilson.co.uk
2019-12-05 13:50:39 +00:00
Chris Wilson
05975cd9eb
drm/i915: Remove vestigal i915_gem_context locals from cmdparser
...
The use GEM context itself was removed in commit cd30a50317
("drm/i915/gem: Excise the per-batch whitelist from the context"), but
the locals were left in place as an oversight. Remove the parameters and
clean up.
References: cd30a50317 ("drm/i915/gem: Excise the per-batch whitelist from the context")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204232616.94397-1-chris@chris-wilson.co.uk
2019-12-05 10:27:29 +00:00
Jani Nikula
b6ff753a0c
drm: constify fb ops across all drivers
...
Now that the fbops member of struct fb_info is const, we can start
making the ops const as well.
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/59b43629ac60031c5bbf961d8c49695019bc9c6f.1575390740.git.jani.nikula@intel.com
2019-12-05 10:57:42 +02:00
Thomas Zimmermann
02c484a894
drm/via: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-13-tzimmermann@suse.de
2019-12-05 08:45:13 +01:00
Thomas Zimmermann
95f02279a7
drm/tdfx: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-12-tzimmermann@suse.de
2019-12-05 08:45:01 +01:00
Thomas Zimmermann
528ea54fb0
drm/sis: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-11-tzimmermann@suse.de
2019-12-05 08:44:55 +01:00
Thomas Zimmermann
fdca3c4905
drm/savage: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-10-tzimmermann@suse.de
2019-12-05 08:44:34 +01:00
Thomas Zimmermann
2ef79416f0
drm/radeon: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-9-tzimmermann@suse.de
2019-12-05 08:44:28 +01:00
Thomas Zimmermann
5613f633f9
drm/r128: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-8-tzimmermann@suse.de
2019-12-05 08:44:23 +01:00
Thomas Zimmermann
09daa2e7f3
drm/mgag200: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-7-tzimmermann@suse.de
2019-12-05 08:44:19 +01:00
Thomas Zimmermann
474863a146
drm/mga: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-6-tzimmermann@suse.de
2019-12-05 08:44:16 +01:00
Thomas Zimmermann
3760999287
drm/i810: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-5-tzimmermann@suse.de
2019-12-05 08:44:12 +01:00
Thomas Zimmermann
5562085806
drm/ast: Don't include <drm/drm_pci.h>
...
Including <drm/drm_pci.h> is unnecessary in most cases. Replace
these instances.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-4-tzimmermann@suse.de
2019-12-05 08:44:09 +01:00
Thomas Zimmermann
1be9d5f069
drm/pci: Hide legacy PCI functions from non-legacy code
...
Declarations of drm_legacy_pci_{init,exit}() are being moved to
drm_legacy.h. CONFIG_DRM_LEGACY protects the implementation.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-3-tzimmermann@suse.de
2019-12-05 08:44:04 +01:00
Thomas Zimmermann
5c7a0bb0cf
drm/pci: Only build drm_pci.c if CONFIG_PCI is set
...
Non-PCI systems should not build PCI helpers. Set up source code, header
file and Makefile accordingly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Emil Velikov <emil.velikov@collabora.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203100406.9674-2-tzimmermann@suse.de
2019-12-05 08:43:14 +01:00
Daniel Vetter
5bf8bec3f4
drm: limit to INT_MAX in create_blob ioctl
...
The hardened usercpy code is too paranoid ever since commit 6a30afa8c1fb
("uaccess: disallow > INT_MAX copy sizes")
Code itself should have been fine as-is.
Link: http://lkml.kernel.org/r/20191106164755.31478-1-daniel.vetter@ffwll.ch
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Reported-by: syzbot+fb77e97ebf0612ee6914@syzkaller.appspotmail.com
Fixes: 6a30afa8c1fb ("uaccess: disallow > INT_MAX copy sizes")
Cc: Kees Cook <keescook@chromium.org >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Stephen Rothwell <sfr@canb.auug.org.au >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:13 -08:00
Dave Airlie
b53bd16fec
Merge tag 'drm-misc-next-fixes-2019-12-04' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
mgag200- Fix hw with broken 'startadd' support (Thomas)
mst- Avoid skipping payloads in payload deletion loop (Wayne)
omap- Fix dma_addr refcounting (Tomi)
Cc: Wayne Lin <Wayne.Lin@amd.com >
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Sean Paul <sean@poorly.run >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204212255.GA256395@art_vandelay
2019-12-05 11:11:11 +10:00
Dave Airlie
b7fa0cde29
Merge tag 'drm/tegra/for-5.5-rc1-fixes' of git://anongit.freedesktop.org/tegra/linux into drm-next
...
drm/tegra: Fixes for v5.5-rc1
This is a set of small fixes, mostly for regressions introduced with the
DMA API and DisplayPort support in the main pull request for v5.5-rc1.
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Thierry Reding <thierry.reding@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204124316.3534855-1-thierry.reding@gmail.com
2019-12-05 10:56:12 +10:00
Wayne Lin
e5a6ca27eb
drm/dp_mst: Correct the bug in drm_dp_update_payload_part1()
...
[Why]
If the payload_state is DP_PAYLOAD_DELETE_LOCAL in series, current
code doesn't delete the payload at current index and just move the
index to next one after shuffling payloads.
[How]
Drop the i++ increasing part in for loop head and decide whether
to increase the index or not according to payload_state of current
payload.
Changes since v1:
* Refine the code to have it easy reading
* Amend the commit message to meet the way code is modified now.
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Fixes: 706246c761 ("drm/dp_mst: Refactor drm_dp_update_payload_part1()")
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Juston Li <juston.li@intel.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Maxime Ripard <mripard@kernel.org >
Cc: Sean Paul <sean@poorly.run >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org > # v5.1+
[Added cc for stable]
Signed-off-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191203042423.5961-1-Wayne.Lin@amd.com
2019-12-04 15:31:16 -05:00
Chris Wilson
126d5de385
drm/i915/gem: Hook user-extensions upto MMAP_OFFSET_IOCTL
...
Call i915_user_extensions() to validate the arg->extensions pointer, and
so return consistent error numbers for the future.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com >
Cc: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204162803.3841140-1-chris@chris-wilson.co.uk
2019-12-04 18:06:28 +00:00
Chris Wilson
780ccb5a5a
drm/i915/gem: Hold the obj->vma.lock while walking the vma.list
...
Remember to take the lock before walking the obj->vma.list so that the
nodes do not change beneath us! E.g.,
i915_gem_object_bump_inactive_ggtt:387 GEM_BUG_ON(vma->vm != &i915->ggtt.vm)
Closes: https://gitlab.freedesktop.org/drm/intel/issues/691
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204164527.3872783-1-chris@chris-wilson.co.uk
2019-12-04 17:30:44 +00:00
Chris Wilson
aa5e4453dc
drm/i915/gem: Try to flush pending unbind events
...
If we cannot handle a vma within the unbind loop, try to flush the
pending events (i915_vma_parked, i915_vm_release) and try again. This
avoids a round trip to userspace that is not guaranteed to make forward
progress, as the events we wait upon require being idle.
References: cb6c3d45f9 ("drm/i915/gem: Avoid parking the vma as we unbind")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204123556.3740002-1-chris@chris-wilson.co.uk
2019-12-04 17:30:31 +00:00
Tomi Valkeinen
d9c148cfaf
drm/omap: fix dma_addr refcounting
...
cec4fa7511 ("drm/omap: use refcount API to
track the number of users of dma_addr") changed omap_gem.c to use
refcounting API to track dma_addr uses. However, the driver only tracks
the refcounts for non-contiguous buffers, and the patch didn't fully
take this in account.
After the patch, the driver always decreased refcount in omap_gem_unpin,
instead of decreasing the refcount only for non-contiguous buffers. This
leads to refcounting mismatch.
As for the contiguous cases the refcount is never increased, fix this
issue by returning from omap_gem_unpin if the buffer being unpinned is
contiguous.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20191114080343.30704-1-tomi.valkeinen@ti.com
Fixes: cec4fa7511 ("drm/omap: use refcount API to track the number of users of dma_addr")
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
2019-12-04 19:11:28 +02:00
Abdiel Janulgue
cc662126b4
drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET
...
This is really just an alias of mmap_gtt. The 'mmap offset' nomenclature
comes from the value returned by this ioctl which is the offset into the
device fd which userpace uses with mmap(2).
mmap_gtt was our initial mmap_offset implementation, this extends
our CPU mmap support to allow additional fault handlers that depends on
the object's backing pages.
Note that we multiplex mmap_gtt and mmap_offset through the same ioctl,
and use the zero extending behaviour of drm to differentiate between
them, when we inspect the flags.
To support multiple mmap types on an object we need to support multiple
mmap_offsets for an object (each offset in the global device address
space corresponding to a unique instance of the object for a file + mmap
type). As we drop the simplified drm core idea of a single mmap_offset,
we need to provide replacement hooks for the dumb mmap interface as
well.
Link: https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1675
Testcase: igt/gem_mmap_offset
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204120032.3682839-1-chris@chris-wilson.co.uk
2019-12-04 15:11:44 +00:00
Mao Wenan
c415ef2a26
drm/i915/perf: drop pointless static qualifier in i915_perf_add_config_ioctl()
...
There is no need to have the 'T *v' variable static
since new value always be assigned before use it.
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Mao Wenan <maowenan@huawei.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20191204010154.152396-1-maowenan@huawei.com
2019-12-04 15:11:44 +00:00