]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
8 years agodrm/amdgpu: rename smumgr to smum for dpm
Huang Rui [Sun, 19 Jun 2016 13:57:21 +0000 (21:57 +0800)]
drm/amdgpu: rename smumgr to smum for dpm

Rename smumgr.h to smum.h, because smum.h is to align with the dpm of
other chips and we will use "iceland_smumgr" at powerplay in following
patches.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: disable GFX PG on CZ/BR/ST
Alex Deucher [Fri, 15 Jul 2016 16:06:57 +0000 (12:06 -0400)]
drm/amdgpu: disable GFX PG on CZ/BR/ST

Still some stability issues under certain workloads.

Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrivers: gpu: drm: amd: powerplay: hwmgr: Remove unused variable
Matthias Beyer [Thu, 30 Jun 2016 16:38:49 +0000 (18:38 +0200)]
drivers: gpu: drm: amd: powerplay: hwmgr: Remove unused variable

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: return -ENOSPC when running out of UVD handles
Christian König [Wed, 13 Jul 2016 19:24:59 +0000 (21:24 +0200)]
drm/amdgpu: return -ENOSPC when running out of UVD handles

This is a minor interface change, but clearly won't break anything.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: trace need_flush in grab_vm as well
Christian König [Fri, 8 Jul 2016 08:48:24 +0000 (10:48 +0200)]
drm/amdgpu: trace need_flush in grab_vm as well

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: always signal all fences
Christian König [Tue, 12 Jul 2016 11:57:03 +0000 (13:57 +0200)]
drm/amdgpu: always signal all fences

A little fallout from "drm/amdgpu: sanitize fence numbers", we
sometimes need to signal all fences in the ring.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: check flush fence context instead of same ring v2
Christian König [Fri, 8 Jul 2016 08:21:02 +0000 (10:21 +0200)]
drm/amdgpu: check flush fence context instead of same ring v2

Otherwise we can run into the following situation:

1. Process A grabs ID 1 for ring 0.
2. Process B grabs ID 1 for ring 0.
3. Process A grabs ID 1 for ring 1.
4. Process A tries to reuse ID1 for ring 0 but things he doesn't need to flush.

v2: check the context of the flush fence instead of messing with the owner field.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/radeon: support backlight control for UNIPHY3
Alex Deucher [Fri, 8 Jul 2016 21:27:04 +0000 (17:27 -0400)]
drm/radeon: support backlight control for UNIPHY3

Same interface as other UNIPHY blocks

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
8 years agodrm/amdgpu: support backlight control for UNIPHY3
Alex Deucher [Fri, 8 Jul 2016 21:19:59 +0000 (17:19 -0400)]
drm/amdgpu: support backlight control for UNIPHY3

Same interface as other UNIPHY blocks

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
8 years agodrm/amdgpu: remove usec timeout loop from IB tests
Christian König [Tue, 5 Jul 2016 13:53:07 +0000 (15:53 +0200)]
drm/amdgpu: remove usec timeout loop from IB tests

We already waited for the fence, so waiting for the registers
is completely pointless and just copy & pasted from the ring test.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: cleanup hw reference handling in the IB tests
Christian König [Tue, 5 Jul 2016 12:48:17 +0000 (14:48 +0200)]
drm/amdgpu: cleanup hw reference handling in the IB tests

Reference should be taken when we make the assignment, not anywhere else.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: cleanup UVD coding style
Christian König [Fri, 1 Jul 2016 15:45:49 +0000 (17:45 +0200)]
drm/amdgpu: cleanup UVD coding style

Cleanup 80 chars limit.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: allow multiple sessions in the same VCE IB
Christian König [Fri, 1 Jul 2016 20:19:25 +0000 (22:19 +0200)]
drm/amdgpu: allow multiple sessions in the same VCE IB

We always used updated firmware for amdgpu, so this actually should work fine.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: cleanup VCE coding style
Christian König [Fri, 1 Jul 2016 15:43:57 +0000 (17:43 +0200)]
drm/amdgpu: cleanup VCE coding style

Fix 80 chars issues and remove some dead code as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: sanitize fence numbers
Christian König [Fri, 24 Jun 2016 19:11:51 +0000 (21:11 +0200)]
drm/amdgpu: sanitize fence numbers

Looks like the VCE block sometimes still sends nonsense
fence numbers on startup.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/powerplay: endian fixes for ppatomctrl.c
Alex Deucher [Fri, 8 Jul 2016 14:12:10 +0000 (10:12 -0400)]
drm/amdgpu/powerplay: endian fixes for ppatomctrl.c

Atom tables are in LE format.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: don't add invalid voltage.
Rex Zhu [Tue, 5 Jul 2016 11:18:15 +0000 (19:18 +0800)]
drm/amd/powerplay: don't add invalid voltage.

if atomctrl_get_voltage_evv_on_sclk_ai returns
non zero (fail) in the expansion of the
PP_ASSERT_WITH_CODE macro the continue will
actually do nothing, So invalid voltage will be
added to ppbable.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add read/write function for GC CAC programming
Rex Zhu [Wed, 8 Jun 2016 04:47:41 +0000 (12:47 +0800)]
drm/amdgpu: add read/write function for GC CAC programming

Create a GC_CAC_IND_INDEX/DATA pair of funcitons to program
all the CAC registers

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: add definitions related to di/dt feature for fiji and polaris.
Rex Zhu [Tue, 5 Jul 2016 10:24:28 +0000 (18:24 +0800)]
drm/amd/powerplay: add definitions related to di/dt feature for fiji and polaris.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: add shared definitions for di/dt feature.
Rex Zhu [Wed, 8 Jun 2016 04:52:16 +0000 (12:52 +0800)]
drm/amd/powerplay: add shared definitions for di/dt feature.

v1: delete some comflict definitions between polaris and fiji.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove gfx8 registers that vary between asics
Ken Wang [Fri, 1 Jul 2016 05:54:23 +0000 (13:54 +0800)]
drm/amdgpu: remove gfx8 registers that vary between asics

those register mask definitions are different in polaris compare to
former gfx 8 gpus, so remove them from misusing.

Signed-off-by: Ken Wang <Qingqing.Wang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: add mvdd dpm support.
Rex Zhu [Mon, 27 Jun 2016 09:30:24 +0000 (17:30 +0800)]
drm/amd/powerplay: add mvdd dpm support.

SMC requires master switch bit to be set.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: get number of shade engine by cgs interface.
Rex Zhu [Tue, 7 Jun 2016 12:15:24 +0000 (20:15 +0800)]
drm/amdgpu: get number of shade engine by cgs interface.

the num of shade engine was needed to
measure the activity of the graphics core
and to enable di/dt feature.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove more of the ring backup code
Alex Deucher [Wed, 6 Jul 2016 16:40:16 +0000 (12:40 -0400)]
drm/amdgpu: remove more of the ring backup code

Not used anymore.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: Unify family defines
Tom St Denis [Wed, 6 Jul 2016 14:01:39 +0000 (10:01 -0400)]
drm/amd/powerplay:  Unify family defines

s/AMD_FAMILY_/AMDGPU_FAMILY_/

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: clean up ring_backup code, no need more
Chunming Zhou [Wed, 29 Jun 2016 08:01:49 +0000 (16:01 +0800)]
drm/amdgpu: clean up ring_backup code, no need more

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: ib test first after gpu reset
Chunming Zhou [Thu, 30 Jun 2016 07:02:26 +0000 (15:02 +0800)]
drm/amdgpu: ib test first after gpu reset

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: recovery hw jobs when gpu reset V3
Chunming Zhou [Thu, 30 Jun 2016 05:56:02 +0000 (13:56 +0800)]
drm/amdgpu: recovery hw jobs when gpu reset V3

V3: directly use pd_addr.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: abstract amdgpu_vm_is_gpu_reset
Chunming Zhou [Wed, 29 Jun 2016 06:01:15 +0000 (14:01 +0800)]
drm/amdgpu: abstract amdgpu_vm_is_gpu_reset

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add a bool to specify if needing vm flush V2
Chunming Zhou [Fri, 1 Jul 2016 09:59:01 +0000 (17:59 +0800)]
drm/amdgpu: add a bool to specify if needing vm flush V2

which avoids job->vm_pd_addr be changed.

V2: pass job structure to amdgpu_vm_grab_id and amdgpu_vm_flush directly.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add amd_sched_job_recovery
Chunming Zhou [Wed, 29 Jun 2016 07:23:55 +0000 (15:23 +0800)]
drm/amdgpu: add amd_sched_job_recovery

Which is to recover hw jobs when gpu reset.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: force completion for gpu reset
Chunming Zhou [Thu, 30 Jun 2016 08:53:02 +0000 (16:53 +0800)]
drm/amdgpu: force completion for gpu reset

After all hw jobs are reset, hw fence is meaningless, so force_completion

Cc: William Lewis <minutemaidpark@hotmail.com>
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: block ttm first before parking scheduler
Chunming Zhou [Thu, 30 Jun 2016 08:44:41 +0000 (16:44 +0800)]
drm/amdgpu: block ttm first before parking scheduler

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd: add amd_sched_hw_job_reset
Chunming Zhou [Thu, 30 Jun 2016 03:30:37 +0000 (11:30 +0800)]
drm/amd: add amd_sched_hw_job_reset

amd_sched_hw_job_reset will remove callback from hw fence.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd: add parent for sched fence
Chunming Zhou [Thu, 30 Jun 2016 03:23:31 +0000 (11:23 +0800)]
drm/amd: add parent for sched fence

Parent of sched fence is hw fence which is to signal sched fence.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove evict vram
Chunming Zhou [Wed, 29 Jun 2016 05:33:40 +0000 (13:33 +0800)]
drm/amdgpu: remove evict vram

Previous vm fault is since page talbe losts connection with vmid after gpu reset.
Now the issue is fixed by recovery. No need more.

If we want to save vram for some EDC card, we will need to consider a complete solution.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: put old hw fence of job if gpu reset
Chunming Zhou [Thu, 30 Jun 2016 09:30:42 +0000 (17:30 +0800)]
drm/amdgpu: put old hw fence of job if gpu reset

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove fence parameter from amd_sched_job_init
Christian König [Thu, 30 Jun 2016 08:52:03 +0000 (10:52 +0200)]
drm/amdgpu: remove fence parameter from amd_sched_job_init

We return the fence as part of the job structur anyway,
no need to do this twice.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: earlier free SA resources
Christian König [Wed, 29 Jun 2016 13:10:31 +0000 (15:10 +0200)]
drm/amdgpu: earlier free SA resources

Keep the time we don't have a fence associated with the resource smaller.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: shorten amdgpu_job_free_resources
Christian König [Wed, 29 Jun 2016 11:29:57 +0000 (13:29 +0200)]
drm/amdgpu: shorten amdgpu_job_free_resources

The fence and the sync object are not hardware resources.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: fix user fence handling once more
Christian König [Wed, 29 Jun 2016 11:26:41 +0000 (13:26 +0200)]
drm/amdgpu: fix user fence handling once more

Same problem as with the VM page tables. The user fence address must be
determined before the job is scheduled, not when the IB is executed.

This fixes a security problem where user fences could be used to overwrite
any part of VRAM.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/amdgpu: Add bank selection for MMIO debugfs (v3)
Tom St Denis [Mon, 27 Jun 2016 15:55:07 +0000 (11:55 -0400)]
drm/amd/amdgpu: Add bank selection for MMIO debugfs (v3)

(v2) Added INSTANCE selector
(v3) Changed order of bank selectors

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/amdgpu: Add gca config debug entry (v4)
Tom St Denis [Mon, 27 Jun 2016 13:57:18 +0000 (09:57 -0400)]
drm/amd/amdgpu: Add gca config debug entry (v4)

A binary entry that lists GCA configuration data (and can be
read by umr).

(v2) Use kmalloc instead of vmalloc
(v3) Minor indentation correction
(v4) agd: Squash in kmalloc fix

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/gfx: add instance field to select_se_sh (v3)
Tom St Denis [Tue, 28 Jun 2016 14:26:48 +0000 (10:26 -0400)]
drm/amd/gfx: add instance field to select_se_sh (v3)

Add ability to specify instance in select_se_sh callback.
Defaults to 0xffffffff all over the driver.

(v2) Don't enable INSTANCE_BROADCAST by default
(v3) Style changes

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: Poll for both connect/disconnect on analog connectors
Lyude [Fri, 24 Jun 2016 21:54:32 +0000 (17:54 -0400)]
drm/amdgpu: Poll for both connect/disconnect on analog connectors

DRM_CONNECTOR_POLL_CONNECT only enables polling for connections, not
disconnections. Because of this, we end up losing hotplug polling for
analog connectors once they get connected.

Easy way to reproduce:
 - Grab a machine with an AMD GPU and a VGA port
 - Plug a monitor into the VGA port, wait for it to update the connector
   from disconnected to connected
 - Disconnect the monitor on VGA, a hotplug event is never sent for the
   removal of the connector.

Originally, only using DRM_CONNECTOR_POLL_CONNECT might have been a good
idea since doing VGA polling can sometimes result in having to mess with
the DAC voltages to figure out whether or not there's actually something
there since VGA doesn't have HPD. Doing this would have the potential of
showing visible artifacts on the screen every time we ran a poll while a
VGA display was connected. Luckily, amdgpu_vga_detect() only resorts to
this sort of polling if the poll is forced, and DRM's polling helper
doesn't force it's polls.

Additionally, this removes some assignments to connector->polled that
weren't actually doing anything.

Cc: stable@vger.kernel.org
Signed-off-by: Lyude <cpaul@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/radeon: Poll for both connect/disconnect on analog connectors
Lyude [Fri, 24 Jun 2016 21:54:31 +0000 (17:54 -0400)]
drm/radeon: Poll for both connect/disconnect on analog connectors

DRM_CONNECTOR_POLL_CONNECT only enables polling for connections, not
disconnections. Because of this, we end up losing hotplug polling for
analog connectors once they get connected.

Easy way to reproduce:
 - Grab a machine with a radeon GPU and a VGA port
 - Plug a monitor into the VGA port, wait for it to update the connector
   from disconnected to connected
 - Disconnect the monitor on VGA, a hotplug event is never sent for the
   removal of the connector.

Originally, only using DRM_CONNECTOR_POLL_CONNECT might have been a good
idea since doing VGA polling can sometimes result in having to mess with
the DAC voltages to figure out whether or not there's actually something
there since VGA doesn't have HPD. Doing this would have the potential of
showing visible artifacts on the screen every time we ran a poll while a
VGA display was connected. Luckily, radeon_vga_detect() only resorts to
this sort of polling if the poll is forced, and DRM's polling helper
doesn't force it's polls.

Additionally, this removes some assignments to connector->polled that
weren't actually doing anything.

Cc: stable@vger.kernel.org
Signed-off-by: Lyude <cpaul@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: stop/resume fb access when gpu reset V3
Chunming Zhou [Tue, 28 Jun 2016 02:38:50 +0000 (10:38 +0800)]
drm/amdgpu: stop/resume fb access when gpu reset V3

V2: Add wait_for_mc_idle after stopping fb access
V3:
1. Remove resume fb access since there is no need to
    do that for gpu reset.
2. Move stop fb access to amdgpu_gpu_reset function,
since it's the same for all asics.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com> (V1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: change condition judgment as function's return value changed.
Rex Zhu [Wed, 29 Jun 2016 11:48:58 +0000 (19:48 +0800)]
drm/amd/powerplay: change condition judgment as function's return value changed.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: functions's return state was reversed
Rex Zhu [Wed, 29 Jun 2016 11:32:50 +0000 (19:32 +0800)]
drm/amd/powerplay: functions's return state was reversed

In commit 195567e99bdf6491a370b71a1dcf6b4c891495d7,
use true/false instead of 1/0 to fix build warning.
But the original logic: '0' means true and '1' means false.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: stop disabling irqs when it isn't neccessary
Christian König [Mon, 13 Jun 2016 14:12:43 +0000 (16:12 +0200)]
drm/amdgpu: stop disabling irqs when it isn't neccessary

A regular spin_lock/unlock should do here as well.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: must update page table after gpu reset
Chunming Zhou [Mon, 27 Jun 2016 09:04:23 +0000 (17:04 +0800)]
drm/amdgpu: must update page table after gpu reset

Record the gpu reset count in vmid to identify if gpu reset happened.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: save/restore bios scratch when gpu reset
Chunming Zhou [Tue, 21 Jun 2016 06:52:09 +0000 (14:52 +0800)]
drm/amdgpu: save/restore bios scratch when gpu reset

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: must update page table after gpu reset
Chunming Zhou [Mon, 27 Jun 2016 09:06:01 +0000 (17:06 +0800)]
drm/amdgpu: must update page table after gpu reset

Record the gpu reset count in vmid to identify if gpu reset happened.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: fix stupid parameter inversion in the pipeline code
Christian König [Fri, 24 Jun 2016 19:51:03 +0000 (21:51 +0200)]
drm/ttm: fix stupid parameter inversion in the pipeline code

We want to keep the newest fence, not the oldest one.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: fix typos in comment in polaris' hwmgr
Alexandre Demers [Thu, 23 Jun 2016 03:31:29 +0000 (23:31 -0400)]
drm/amd/powerplay: fix typos in comment in polaris' hwmgr

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: fix trivial typo and tidy comment
Alexandre Demers [Thu, 7 Jul 2016 19:05:18 +0000 (15:05 -0400)]
drm/amd/powerplay: fix trivial typo and tidy comment

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/amdgpu: Set DRIVER_MODESET feature flag at build time
Frank Binns [Fri, 24 Jun 2016 17:15:17 +0000 (18:15 +0100)]
drm/amd/amdgpu: Set DRIVER_MODESET feature flag at build time

This flag was being set unconditionally at runtime so just set it at
compile time instead.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: Unpin BO if we can't get fences in amdgpu_crtc_page_flip
Michel Dänzer [Fri, 24 Jun 2016 08:30:08 +0000 (17:30 +0900)]
drm/amdgpu: Unpin BO if we can't get fences in amdgpu_crtc_page_flip

If reservation_object_get_fences_rcu failed, we'd previously go directly
to the cleanup label, so we'd leave the BO pinned.

While we're at it, remove two amdgpu_bo_unreserve calls in favour of two
new labels.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gmc7: remove duplicate wait_for_idle functions
Alex Deucher [Fri, 24 Jun 2016 03:43:36 +0000 (23:43 -0400)]
drm/amdgpu/gmc7: remove duplicate wait_for_idle functions

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gmc8: remove duplicate wait_for_idle functions
Alex Deucher [Fri, 24 Jun 2016 03:41:48 +0000 (23:41 -0400)]
drm/amdgpu/gmc8: remove duplicate wait_for_idle functions

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce8: fix flash with white screen on monitor
Junwei Zhang [Fri, 17 Jun 2016 09:07:56 +0000 (17:07 +0800)]
drm/amdgpu/dce8: fix flash with white screen on monitor

Fixed mc stop and resume hardware programming sequence.

Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: skip invalid ip blocks in ip helpers
Alex Deucher [Thu, 23 Jun 2016 15:53:12 +0000 (11:53 -0400)]
drm/amdgpu: skip invalid ip blocks in ip helpers

Skip IP blocks that are not enabled.

Reviewed-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add missing breaks
Alex Deucher [Thu, 23 Jun 2016 15:48:30 +0000 (11:48 -0400)]
drm/amdgpu: add missing breaks

Saves a few CPU cycles.

Reviewed-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add IP helpers for wait_for_idle and is_idle
Alex Deucher [Thu, 23 Jun 2016 15:41:04 +0000 (11:41 -0400)]
drm/amdgpu: add IP helpers for wait_for_idle and is_idle

Helpers to to call the IP functions for the selected IP.

Reviewed-by: Chunming zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/powerplay/cz: add missing call to powergate VCE
Alex Deucher [Thu, 23 Jun 2016 14:55:40 +0000 (10:55 -0400)]
drm/amdgpu/powerplay/cz: add missing call to powergate VCE

Not enabled yet, but missing the call.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/dce11: update async flip update time
Alex Deucher [Wed, 22 Jun 2016 20:49:22 +0000 (16:49 -0400)]
drm/amdgpu/dce11: update async flip update time

Use UPDATE_IMMEDIATE (update on next data request boundary) rather
than UPDATE_H_RETRACE (update on next line boundary).  The data
request boundary is less than a scanline, so it update will happen
sooner.

Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: wait for eviction in ttm_bo_force_list_clean
Christian König [Wed, 22 Jun 2016 12:16:28 +0000 (14:16 +0200)]
drm/ttm: wait for eviction in ttm_bo_force_list_clean

Now that we can pipeline evictions we need to wait for
them to finish when we cleanup a memory domain.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: don't update page tables for VM emulation
Christian König [Wed, 22 Jun 2016 12:25:55 +0000 (14:25 +0200)]
drm/amdgpu: don't update page tables for VM emulation

It's just overhead to do so and allocating a VMID
when we don't need one is actually a bit dangerous.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: implement HDP functions for UVD v2
Christian König [Wed, 22 Jun 2016 12:25:54 +0000 (14:25 +0200)]
drm/amdgpu: implement HDP functions for UVD v2

Flush and invalidate the HDP caches.

v2: fix typo in comment

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: change pcie_gen_cap magic code to macro
Huang Rui [Wed, 22 Jun 2016 05:49:48 +0000 (13:49 +0800)]
drm/amdgpu: change pcie_gen_cap magic code to macro

This patch changes pcie_gen_cap magic code to macro to make it more
readable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Cc: Eric Huang <JinHuiEric.Huang@amd.com>
Cc: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gfx7: make gfx_v7_0_rlc_stop static
Alex Deucher [Tue, 21 Jun 2016 16:19:43 +0000 (12:19 -0400)]
drm/amdgpu/gfx7: make gfx_v7_0_rlc_stop static

Not used outside of gfx7.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gfx7: switch to using the existing rlc callbacks
Alex Deucher [Tue, 21 Jun 2016 16:16:30 +0000 (12:16 -0400)]
drm/amdgpu/gfx7: switch to using the existing rlc callbacks

gfx8 already uses them.  Remove the direct exports and
use the callbacks fpr gfx7.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: move select_se_sh into the gfx struct
Alex Deucher [Tue, 21 Jun 2016 16:00:55 +0000 (12:00 -0400)]
drm/amdgpu: move select_se_sh into the gfx struct

It's gfx IP specific, not asic specific, so move to a
gfx callback.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: move get_gpu_clock_counter into the gfx struct
Alex Deucher [Thu, 7 Jul 2016 19:01:42 +0000 (15:01 -0400)]
drm/amdgpu: move get_gpu_clock_counter into the gfx struct

It's gfx IP specific, not asic specific, so move to a
gfx callback.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: drop wait_for_mc_idle asic callback
Alex Deucher [Tue, 21 Jun 2016 15:35:36 +0000 (11:35 -0400)]
drm/amdgpu: drop wait_for_mc_idle asic callback

Only used in the gmc IP modules so just call the local
function directly.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gmc: make some functions static
Alex Deucher [Tue, 21 Jun 2016 15:25:51 +0000 (11:25 -0400)]
drm/amdgpu/gmc: make some functions static

These are not used outside of the respective gmc ip modules.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: validate VM PTs only on eviction
Christian König [Tue, 21 Jun 2016 14:28:15 +0000 (16:28 +0200)]
drm/amdgpu: validate VM PTs only on eviction

We don't need to validate them again if the eviction counter didn't changed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add eviction counter
Christian König [Tue, 21 Jun 2016 14:28:14 +0000 (16:28 +0200)]
drm/amdgpu: add eviction counter

Keep track of the number of evictions since boot.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add amdgpu_irq_gpu_reset_resume_helper
Chunming Zhou [Thu, 16 Jun 2016 08:54:53 +0000 (16:54 +0800)]
drm/amdgpu: add amdgpu_irq_gpu_reset_resume_helper

irq need to update when gpu reset happens.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/powerplay: make sure VCE is disabled by default
Arindam Nath [Mon, 20 Jun 2016 10:35:01 +0000 (16:05 +0530)]
drm/amd/powerplay: make sure VCE is disabled by default

This patch is a port of similar patch for amdgpu
when PP is disabled. Since the code flow is little
different when PP is enabled, we need to make sure
the patch is applied for PP enabled path as well.

With the current code, when we boot with the amdgpu
driver enabled and loaded, the VCE also automatically
remains enabled since bootup. This can be verified from
the output of amdgpu_pm_info. It does not matter whether
we boot into command line directly or into X, the VCE
stays enabled the entire time.

This patch addresses the issue and makes sure that
VCE is turned on only during playback, and remains
disabled otherwise.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amd/amdgpu: make sure VCE is disabled by default
Arindam Nath [Mon, 20 Jun 2016 08:47:49 +0000 (14:17 +0530)]
drm/amd/amdgpu: make sure VCE is disabled by default

With the current code, when we boot with the amdgpu
driver enabled and loaded, the VCE also automatically
remains enabled since bootup. This can be verified from
the output of amdgpu_pm_info. It does not matter whether
we boot into command line directly or into X, the VCE
stays enabled the entire time.

This patch addresses the issue and makes sure that
VCE is turned on only during playback, and remains
disaled otherwise.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: disable compute pipeline sync workaround when using fixed fw
Alex Deucher [Fri, 17 Jun 2016 21:05:15 +0000 (17:05 -0400)]
drm/amdgpu: disable compute pipeline sync workaround when using fixed fw

No need to stall the pipe when we are using firmware with the
fix.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gfx8: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter
Nicolai Hähnle [Fri, 17 Jun 2016 17:31:35 +0000 (19:31 +0200)]
drm/amdgpu/gfx8: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter

v2: do not overwrite register when bitmap is zero

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu/gfx7: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter
Nicolai Hähnle [Fri, 17 Jun 2016 17:31:34 +0000 (19:31 +0200)]
drm/amdgpu/gfx7: set USER_SHADER_ARRAY_CONFIG based on disable_cu parameter

v2: do not overwrite register when bitmap is zero

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: add disable_cu parameter
Nicolai Hähnle [Fri, 17 Jun 2016 17:31:33 +0000 (19:31 +0200)]
drm/amdgpu: add disable_cu parameter

This parameter will allow disabling individual CUs on module load, e.g.
amdgpu.disable_cu=2.0.3,2.0.4 to disable CUs 3 and 4 of SE2.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: evict vram when gpu reset
Chunming Zhou [Sun, 12 Jun 2016 07:43:20 +0000 (15:43 +0800)]
drm/amdgpu: evict vram when gpu reset

On workstation cards with ECC vram, the entirety of vram is cleared to 0
on asic init to set the ECC status correctly.  On non ECC boards, I don't
think they do any explicit clearing, but the vram controller is reset
which may cause issues with the data there.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: block scheduler when gpu reset
Chunming Zhou [Sun, 12 Jun 2016 07:41:58 +0000 (15:41 +0800)]
drm/amdgpu: block scheduler when gpu reset

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agoamdgpu: use NULL instead of 0 for pointer
Arnd Bergmann [Wed, 15 Jun 2016 20:15:00 +0000 (22:15 +0200)]
amdgpu: use NULL instead of 0 for pointer

In the AMD powerplay driver, a pointer is checked for validity by
comparing against an integer '0', which causes a harmless warning
when building with "make W=1":

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/processpptables.c:1502:16: error: ordered comparison of pointer with integer zero [-Werror=extra]

This changes the code to the more conventional "if (pointer)" check.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: pipeline evictions as well
Christian König [Wed, 15 Jun 2016 11:44:05 +0000 (13:44 +0200)]
drm/amdgpu: pipeline evictions as well

This boosts Xonotic from 38fps to 47fps when artificially limiting VRAM to
256MB for testing. It should improve all CPU bound rendering situations
where we have a lot of swapping to/from VRAM.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: save the PD addr before scheduling the job
Christian König [Wed, 15 Jun 2016 11:44:04 +0000 (13:44 +0200)]
drm/amdgpu: save the PD addr before scheduling the job

When we pipeline evictions the page directory could already be
moving somewhere else when grab_id is called.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: add the infrastructure for pipelined evictions
Christian König [Wed, 15 Jun 2016 11:44:03 +0000 (13:44 +0200)]
drm/ttm: add the infrastructure for pipelined evictions

Free up the memory immediately, remember the last eviction for each domain and
make new allocations depend on the last eviction to be completed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: simplify ttm_bo_wait
Christian König [Wed, 15 Jun 2016 11:44:02 +0000 (13:44 +0200)]
drm/ttm: simplify ttm_bo_wait

As far as I can see no need for a custom implementation any more.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: remove TTM_BO_PRIV_FLAG_MOVING
Christian König [Wed, 15 Jun 2016 11:44:01 +0000 (13:44 +0200)]
drm/ttm: remove TTM_BO_PRIV_FLAG_MOVING

Instead of using the flag just remember the fence of the last move operation.

This avoids waiting for command submissions pipelined after the move, but
before accessing the BO with the CPU again.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: remove no_gpu_wait param from ttm_bo_move_accel_cleanup
Christian König [Wed, 15 Jun 2016 11:44:00 +0000 (13:44 +0200)]
drm/ttm: remove no_gpu_wait param from ttm_bo_move_accel_cleanup

It isn't used and not waiting for the GPU after scheduling a move is
actually quite dangerous.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: remove pre move wait
Christian König [Mon, 6 Jun 2016 08:17:59 +0000 (10:17 +0200)]
drm/amdgpu: remove pre move wait

Not needed any more.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/amdgpu: sync to buffer moves before VM updates
Christian König [Mon, 6 Jun 2016 08:17:58 +0000 (10:17 +0200)]
drm/amdgpu: sync to buffer moves before VM updates

Otherwise we could update the VM page tables while the move is only scheduled.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: wait for BO idle after the move in ttm_bo_swapout
Christian König [Mon, 6 Jun 2016 08:17:57 +0000 (10:17 +0200)]
drm/ttm: wait for BO idle after the move in ttm_bo_swapout

Final part to avoid pre move waits.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: drop waiting for idle in ttm_bo_evict.
Christian König [Mon, 6 Jun 2016 08:17:56 +0000 (10:17 +0200)]
drm/ttm: drop waiting for idle in ttm_bo_evict.

That is unnecessary now.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: drop wait for idle in ttm_bo_move_buffer
Christian König [Mon, 6 Jun 2016 08:17:55 +0000 (10:17 +0200)]
drm/ttm: drop wait for idle in ttm_bo_move_buffer

That is unnecessary now.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
8 years agodrm/ttm: wait for BO idle in ttm_bo_move_memcpy
Christian König [Mon, 6 Jun 2016 08:17:54 +0000 (10:17 +0200)]
drm/ttm: wait for BO idle in ttm_bo_move_memcpy

When we want to pipeline accelerated moves we need to wait in the fallback path.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>