[PATCH 4/6] drm/amdgpu/vi: add HDP asic callbacks for VI

2017-09-06 Thread Samuel Li
From: Alex Deucher Needed to flush and invalidate the HDP block using the CPU. Signed-off-by: Alex Deucher Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/vi.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amd

[PATCH 6/6] drm/amdgpu: Add gem_prime_mmap support

2017-09-06 Thread Samuel Li
Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 95 ++- 3 files changed, 99 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amd

[PATCH 2/6] drm/amdgpu/vi: add HDP asic callbacks for SI

2017-09-06 Thread Samuel Li
From: Alex Deucher Needed to flush and invalidate the HDP block using the CPU. Signed-off-by: Alex Deucher Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/si.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amd

[PATCH 5/6] drm/amdgpu/vi: add HDP asic callbacks for SOC15

2017-09-06 Thread Samuel Li
From: Alex Deucher Needed to flush and invalidate the HDP block using the CPU. Signed-off-by: Alex Deucher Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/soc15.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/dr

[PATCH 3/6] drm/amdgpu/vi: add HDP asic callbacks for CIK

2017-09-06 Thread Samuel Li
From: Alex Deucher Needed to flush and invalidate the HDP block using the CPU. Signed-off-by: Alex Deucher Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/cik.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/a

[PATCH 1/6] drm/amdgpu: add new asic callbacks for HDP flush/invalidation

2017-09-06 Thread Samuel Li
From: Alex Deucher Needed to properly flush the HDP cache with the CPU from rather than the GPU. Signed-off-by: Alex Deucher Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/driver

Re: [PATCH 0/8] Retry page fault handling for Vega10

2017-09-06 Thread Felix Kuehling
I realized that the drm-next-4.15-wip branch isn't very useful for testing this, because it has no display support for Vega10 and no KFD support for Vega10. So you can't test graphics or compute on Vega10 with this branch. On the other hand, I need to make changes in both KFD and AMDGPU, so I tried

Re: [PATCH 3/3] drm/amdgpu: rework amdgpu_cs_find_mapping

2017-09-06 Thread Leo Liu
On 09/06/2017 11:51 AM, Christian König wrote: From: Christian König Use the VM instead of the BO list to find the BO for a virtual address. This fixes UVD/VCE in physical mode with VM local BOs. The series is Tested-by: Leo Liu Signed-off-by: Christian König --- drivers/gpu/drm/amd

Re: [PATCH 6/6] drm/amdgpu: keep the MMU lock until the update ends v2

2017-09-06 Thread Felix Kuehling
On 2017-09-06 02:42 PM, Christian König wrote: >> I think all this does (compared to v1) is, avoid taking the same read >> lock twice, but keep track of how many readers there are outside the >> rw_semaphore to avoid recursive lock warnings. > Well the primary problem is that taking a read side twi

Re: [PATCH 6/6] drm/amdgpu: keep the MMU lock until the update ends v2

2017-09-06 Thread Christian König
I think all this does (compared to v1) is, avoid taking the same read lock twice, but keep track of how many readers there are outside the rw_semaphore to avoid recursive lock warnings. Well the primary problem is that taking a read side twice in the same thread can cause a deadlock and is forbid

Re: A few vega10 powerplay cleanups

2017-09-06 Thread Tom St Denis
On 06/09/17 12:54 PM, Deucher, Alexander wrote: -Original Message- From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf Of Tom St Denis Sent: Wednesday, September 06, 2017 8:07 AM To: amd-gfx@lists.freedesktop.org Subject: A few vega10 powerplay cleanups Started looking

RE: [PATCH 3/3] drm/amdgpu: unify amd_pm_funcitons in dpm and powerplay

2017-09-06 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Rex Zhu > Sent: Wednesday, September 06, 2017 7:37 AM > To: amd-gfx@lists.freedesktop.org > Cc: Zhu, Rex > Subject: [PATCH 3/3] drm/amdgpu: unify amd_pm_funcitons in dpm and > powerplay > > d

RE: A few vega10 powerplay cleanups

2017-09-06 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Tom St Denis > Sent: Wednesday, September 06, 2017 8:07 AM > To: amd-gfx@lists.freedesktop.org > Subject: A few vega10 powerplay cleanups > > Started looking at tidying up the powerplay code

Re: [PATCH 5/6] drm/amdgpu: stop reserving the BO in the MMU callback v2

2017-09-06 Thread Felix Kuehling
On 2017-09-06 08:34 AM, Christian König wrote: > +struct amdgpu_mn *amdgpu_mn_get(struct amdgpu_device *adev) { return NULL; } This one still needs to be static inline. Regards, Felix ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists

Re: [PATCH 6/6] drm/amdgpu: keep the MMU lock until the update ends v2

2017-09-06 Thread Felix Kuehling
I think all this does (compared to v1) is, avoid taking the same read lock twice, but keep track of how many readers there are outside the rw_semaphore to avoid recursive lock warnings. I don't really understand why you need to count readers per task (using the task hashtable in the amdgpu_mn stru

[PATCH 3/3] drm/amdgpu: rework amdgpu_cs_find_mapping

2017-09-06 Thread Christian König
From: Christian König Use the VM instead of the BO list to find the BO for a virtual address. This fixes UVD/VCE in physical mode with VM local BOs. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 42 +++--- drivers/gpu/drm/amd/amdgpu/am

[PATCH 2/3] drm/amdgpu: move amdgpu_cs_sysvm_access_required into find_mapping

2017-09-06 Thread Christian König
From: Christian König When we need to find the mapping we need sysvm access anyway. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 8 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 64 - drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1

[PATCH 1/3] drm/ttm: allow mapping BOs while they are still on the swap list

2017-09-06 Thread Christian König
From: Christian König With shared reservation objects it is possible that we want to temporary kmap an BO while it is still on the swap list. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.

[PATCH 6/6] drm/amdgpu: keep the MMU lock until the update ends v2

2017-09-06 Thread Christian König
From: Christian König This is quite controversial because it adds another lock which is held during page table updates, but I don't see much other option. v2: allow multiple updates to be in flight at the same time Signed-off-by: Christian König Reviewed-by: Felix Kuehling (v1) --- drivers/g

[PATCH 5/6] drm/amdgpu: stop reserving the BO in the MMU callback v2

2017-09-06 Thread Christian König
From: Christian König Instead take the callback lock during the final parts of CS. This should solve the last remaining locking order problems with BO reservations. v2: rebase, make dummy functions static inline Signed-off-by: Christian König Reviewed-by: Felix Kuehling --- drivers/gpu/drm

[PATCH 3/6] drm/amdgpu: move userptr BOs to CPU domain during CS v2

2017-09-06 Thread Christian König
From: Christian König Instead of moving them in the MMU notifier move them during CS. v2: still mark pages as accessed/dirty Signed-off-by: Christian König Reviewed-by: Felix Kuehling (v1) --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 ++

[PATCH 4/6] drm/amdgpu: use a rw_semaphore for MMU notifiers

2017-09-06 Thread Christian König
From: Christian König Allow at least some parallel processing. Signed-off-by: Christian König Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdg

[PATCH 2/6] drm/amdgpu: stop using BO status for user pages

2017-09-06 Thread Christian König
From: Christian König Instead use a counter to figure out if we need to set new pages or not. Signed-off-by: Christian König Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 11 +++ drivers/gpu/drm/amd/amdgpu/amd

[PATCH 1/6] drm/amdgpu: move taking mmap_sem into get_user_pages v2

2017-09-06 Thread Christian König
From: Christian König This didn't helped as intended, just simplify the code. v2: unlock mmap_sem in the error path as well Signed-off-by: Christian König Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 12 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 4 -

[PATCH 4/4] drm/amd/powerplay: Port vega10_didt_set_mask() to new macros

2017-09-06 Thread Tom St Denis
Start using new CGS bitmask macros. Signed-off-by: Tom St Denis --- .../gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 60 -- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c b/drivers/gpu/drm/amd/powerp

A few vega10 powerplay cleanups

2017-09-06 Thread Tom St Denis
Started looking at tidying up the powerplay code a bit. I stopped to send these out because I want to get feedback on the new CGS macros before I go too far down this path. Thanks, Tom ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://list

[PATCH 3/4] drm/amd/powerplay: Introduction of bitmask macros for registers

2017-09-06 Thread Tom St Denis
Signed-off-by: Tom St Denis --- drivers/gpu/drm/amd/include/cgs_common.h | 16 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/amd/include/cgs_common.h b/drivers/gpu/drm/amd/include/cgs_common.h index 0214f63f52fc..92eaa81f9fcb 100644 --- a/drivers/gpu/drm/amd/inc

[PATCH 1/4] drm/amd/powerplay: Simplify vega10_patch_voltage_dependency_tables_with_lookup_table()

2017-09-06 Thread Tom St Denis
Signed-off-by: Tom St Denis --- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 75 +++--- 1 file changed, 23 insertions(+), 52 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c index 5110086d65

[PATCH 2/4] drm/amd/powerplay: Simplify vega10_acg_disable()

2017-09-06 Thread Tom St Denis
Signed-off-by: Tom St Denis --- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c index 1b6aae5c90c1..ee98a4146d

[PATCH 3/3] drm/amdgpu: unify amd_pm_funcitons in dpm and powerplay

2017-09-06 Thread Rex Zhu
delete amd_pm_funcs in amdgpu_pm, put pm function table in struct powerplay for all asics. Change-Id: I6248c4bd4cf23ae406a540bb5225c991fb9aca6e Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c| 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 120 ++--- dr

[PATCH 1/3] drm/amdgpu: rename amdgpu_dpm_funcs to amd_pp_funcs

2017-09-06 Thread Rex Zhu
renamed amdgpu_dpm_funcs and moved to amd_shared.h so can shared with powerplay. Change-Id: I3a008099fcceb2f58605224ffc2db73b18f6acac Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 47 +- drivers

[PATCH 2/3] drm/amd/powerplay: use struct amd_pm_functions in powerplay

2017-09-06 Thread Rex Zhu
Change-Id: I1a8828ab1db49638c6205043600685f0179226fb Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/include/amd_shared.h | 15 +++ drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 50 +++--- .../drm/amd/powerplay/hwmgr/cz_clockpowergating.c | 8 +--- .../drm/am

RE: [PATCH] drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"

2017-09-06 Thread Liu, Monk
Reviewed-by: Monk Liu monk@amd.com I’m thinking of directly call “ttm_eu_fence_buffer_object” before ctx_ad_fence(), and right after “fence_get(&job->base.s_fence->finished);” Since that time we already have parser->ticket/validated/fence, BR Monk From: Christian

Re: [PATCH] drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"

2017-09-06 Thread Christian König
What’s you plan ? Not 100% sure yet. I need to move the fencing around to fix userptrs anyway. When I'm done with that and when the UVD/VCE stuff is fixed then I'm going to tackle this next. Regards, Christian. Am 06.09.2017 um 11:25 schrieb Liu, Monk: Yeah, you are right, although it has

RE: [PATCH] drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"

2017-09-06 Thread Liu, Monk
Yeah, you are right, although it has 32 slots (compared with entit_push_job which only waits for two slots in gpu scheduler) but still have chance to wait and meanwhile one job could under processing by gpu reset What’s you plan ? Revert this patch is correct since it have potential dirty refer

Re: [PATCH] drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"

2017-09-06 Thread Christian König
but how to understand 1) what do you mean "The CS can still be blocked because of amdgpu_ctx_add_fence()." See amdgpu_ctx_add_fence(), it can block for previous command submissions just like entity_push_job(). So only moving entity_push_job() out of locking the PD doesn't help at all. for 2

Re: [PATCH] drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"

2017-09-06 Thread Liu, Monk
>The patch doesn't work at all: 1. The CS can still be blocked because of amdgpu_ctx_add_fence(). 2. The order of submission isn't correct any more. 3. We could end up using freed up memory because we now drop the ctx reference to early. I suddenly found that the parser->job is really a wild p

Re: [PATCH] drm/amdgpu: revert "fix deadlock of reservation between cs and gpu reset v2"

2017-09-06 Thread Christian König
BTW: I'm working of fixing the underlying issue in general. But this is going to need some more time. Regards, Christian. Am 06.09.2017 um 05:08 schrieb zhoucm1: +Monk. Moving push_job out of reservation lock indeed not a good idea. Hi Monk, How about Christian's revert? Regards, David Zho