Re: [PATCH 1/2] drm/amdgpu: update gart_pin_size if bo is in GTT

2016-09-09 Thread Christian König
Am 09.09.2016 um 08:30 schrieb Flora Cui: Change-Id: Ia2cb8a8f62d0933b7937991bec4eace560745f97 Signed-off-by: Flora Cui --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gp

Re: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Flora Cui
yes. please don't do this, I need them. On Fri, Sep 09, 2016 at 02:41:16PM +0800, zhoucm1 wrote: > > > On 2016年09月08日 21:41, Christian König wrote: > >From: Christian König > > > >Either never used or not used in quite a while. > No, I remember Flora's Direct GMA is using them like GDS use PRIV

Re: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset

2016-09-09 Thread Christian König
NAK, that is clearly incorrect. The gpu_offset are MC addresses while the vram_base_offset is a bud address. Most of the time they are both zero, except for APUs which would break with this change. Regards, Christian. Am 09.09.2016 um 08:30 schrieb Flora Cui: Change-Id: I8112e9d85866104559e

Re: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset

2016-09-09 Thread Flora Cui
what about commit e6eb9e1cdb740f778fbbacc5f62edd0ce97c2d52? should the start addr get updated either? On Fri, Sep 09, 2016 at 09:18:47AM +0200, Christian König wrote: > NAK, that is clearly incorrect. The gpu_offset are MC addresses while the > vram_base_offset is a bud address. > > Most of the t

Re: [PATCH 2/2] drm/amdgpu: calc addr with domain's gpu_offset

2016-09-09 Thread Christian König
No that patch is correct. See we are dealing with different address spaces here. The TTM code works with MC addresses. E.g. the internal address space as seen by everything which runs on system VM (copy operations, ring buffers, UVD, VCE etc...). The MC in turn then works with bus addresses

Re: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Christian König
In this case please just add them back in your tree. That should be a two liner. For upstream it certainly doesn't make sense to keep them. Regards, Christian. Am 09.09.2016 um 09:01 schrieb Flora Cui: yes. please don't do this, I need them. On Fri, Sep 09, 2016 at 02:41:16PM +0800, zhoucm1

[PATCH] drm/amdgpu: use error label to handle exceptional case

2016-09-09 Thread Huang Rui
Use error label to decrease global item unref and make codes more readable. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/

Re: [PATCH] drm/amdgpu: use error label to handle exceptional case

2016-09-09 Thread Christian König
Am 09.09.2016 um 11:50 schrieb Huang Rui: Use error label to decrease global item unref and make codes more readable. Signed-off-by: Huang Rui Nice cleanup, please keep going with that. Probably more than once case where we have things like this. Patch is Reviewed-by: Christian König . Re

Re: [PATCH] drm/amdgpu: use error label to handle exceptional case

2016-09-09 Thread Edward O'Callaghan
On 09/09/2016 07:58 PM, Christian König wrote: > Am 09.09.2016 um 11:50 schrieb Huang Rui: >> Use error label to decrease global item unref and make codes more >> readable. >> >> Signed-off-by: Huang Rui > > Nice cleanup, please keep going with that. Probably more than once case > where we have

RE: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Zhang, Hawking
Hi Chris, Removing the flag will make ttm_mem_type_from_place skip counting the corresponding placement and thus have impact on mem region create and bo movement. There is no guarantee that amdgpu would never introduce new memory domain in future. In such case, I'd like to vote for keeping thes

Re: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Christian König
Hi Hawking, Removing the flag will make ttm_mem_type_from_place skip counting the corresponding placement and thus have impact on mem region create and bo movement. And that is exactly the reason why I want to remove the unused flags. There is no guarantee that amdgpu would never introduce

[PATCH] drm/amdgpu: validate size and offset of user fence BO

2016-09-09 Thread Christian König
From: Christian König We need to validate the offset to make sure that we don't write after the BO. Additional to that a page should be enough and can make address space handling much easier. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 ++ 1 file changed,

RE: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Zhang, Hawking
Hi Chris, Removing the flag will make ttm_mem_type_from_place skip counting the corresponding placement and thus have impact on mem region create and bo movement. There is no guarantee that amdgpu would never introduce new memory domain in future. In such case, I'd like to vote for keeping thes

RE: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Deucher, Alexander
> -Original Message- > From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf > Of Christian König > Sent: Friday, September 09, 2016 7:24 AM > To: Zhang, Hawking; Koenig, Christian; Cui, Flora; Zhou, David(ChunMing); > amd-gfx@lists.freedesktop.org > Cc: dri-de...@lists.fre

[PATCH 1/9] drm/amd/powerplay: mark symbols static where possible on tonga/iceland.

2016-09-09 Thread Rex Zhu
Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c | 6 +++--- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c b/drivers/gpu/drm/am

[PATCH 2/9] drm/amd/powerplay: add feature flags in hwmgr to enable/disable special features.

2016-09-09 Thread Rex Zhu
Change-Id: I8d3a8cbcac10d65d0d7b724dfb6eb6fbaedcfda9 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/h

[PATCH 0/9] misc patches related to powerplay

2016-09-09 Thread Rex Zhu
Rex Zhu (9): drm/amd/powerplay: mark symbols static where possible on tonga. drm/amd/powerplay: add feature flags in hwmgr to enable/disable special features. drm/amd/powerplay: add module parameter for mask pp feature drm/amd/powerplay: initialize platform caps in hwmgr_init. drm/am

[PATCH 6/9] drm/amd/powerplay: wrap get evv voltage of fiji and polaris

2016-09-09 Thread Rex Zhu
Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 17 + drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 3 +++ 2 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerp

[PATCH 9/9] drm/amd/powerplay: delete dupicated function and definition.

2016-09-09 Thread Rex Zhu
Change-Id: I9a03c3aac811259e32edbf7c20ef3eeca69d0252 Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 7 +-- drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c | 8 drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr

[PATCH 8/9] drm/amd/powerplay: delete const flag of hwmgr_funcs for overload.

2016-09-09 Thread Rex Zhu
Change-Id: I832464f3de9cbacd2e0f6b6a22d2d7d9980be418 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c| 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c | 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c | 2 +- driv

[PATCH 01/20] drm/amd/powerplay: add common interface in smumgr to help to visit fw image.

2016-09-09 Thread Rex Zhu
Change-Id: I2ea5b1dc70883e8656fe0b1fd7a2b9a9c4ddcb27 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smumgr.h| 69 ++ drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | 101 +- 2 files changed, 169 insertions(+), 1

[PATCH 00/20] powerplay code refactoring.

2016-09-09 Thread Rex Zhu
implement smu7_hwmgr smu7_smumgr to manager asics with smu version 7. so can delete duplicated code. There are subtle differences in firmware image between different asics implement asic_name_smc.c under smumgr to deal with fw related jobs. Rex Zhu (20): drm/amd/powerplay: add common interfac

[PATCH 04/20] drm/amd/powerplay: use smu7 hwmgr to manager polaris10/11

2016-09-09 Thread Rex Zhu
Change-Id: Ia3dae5b7ef0889acd9479f83d5f3b8a91786f4bf Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 2 -- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 35 ++-- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h| 1 + 3 f

[PATCH 03/20] drm/amd/powerplay: implement fw image related smum interface for Polaris.

2016-09-09 Thread Rex Zhu
Change-Id: I22767dc03fcec497e5cd76e82459916abf130105 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/Makefile |2 +- .../gpu/drm/amd/powerplay/smumgr/polaris10_smc.c | 2284 .../gpu/drm/amd/powerplay/smumgr/polaris10_smc.h

[PATCH 06/20] drm/amd/powerplay: use smu7 hwmgr to manager fiji

2016-09-09 Thread Rex Zhu
Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu --- drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 3 +-- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 25 +++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/Makefile b

[PATCH 08/20] drm/amd/powerplay: use smu7_hwmgr to manager tonga.

2016-09-09 Thread Rex Zhu
Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 5 ++--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 30 +--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/Makefi

[PATCH 09/20] drm/amd/powerplay: implement smu7_smumgr for asics with smu ip version 7.

2016-09-09 Thread Rex Zhu
Change-Id: Id0017fcdd179cc726349eacc2ee56be96279b526 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/inc/smumgr.h | 1 + drivers/gpu/drm/amd/powerplay/smumgr/Makefile | 2 +- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 571

[PATCH 15/20] drm/amd/powerplay: add pp_table_version in hwmgr.

2016-09-09 Thread Rex Zhu
Change-Id: Iee3c7ab9c1318ec7206bf5a5ae59d8c48b8e823b Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher Conflicts: drivers/gpu/drm/amd/powerplay/inc/hwmgr.h --- drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/powerp

[PATCH 13/20] drm/amd/powerplay: use smu7 common functions and data on icelannd.

2016-09-09 Thread Rex Zhu
Change-Id: I8144e52141f7e6a49a18be3523540a6edd898ec0 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- .../gpu/drm/amd/powerplay/hwmgr/iceland_hwmgr.c| 50 +- .../drm/amd/powerplay/hwmgr/iceland_powertune.c| 6 +- .../gpu/drm/amd/powerplay/hwmgr/iceland_thermal.c | 2 +- .../gpu

[PATCH 17/20] drm/amd/powerplay: add pptable point check before use it

2016-09-09 Thread Rex Zhu
Change-Id: Ibad281cd7fd660abe612894df82be284c9b865a9 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay

[PATCH 11/20] drm/amd/powerplay: use smu7 common functions and data on Polars10.

2016-09-09 Thread Rex Zhu
Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- .../gpu/drm/amd/powerplay/inc/polaris10_pwrvirus.h | 3 +- .../gpu/drm/amd/powerplay/smumgr/polaris10_smc.c | 81 +-- .../drm/amd/powerplay/smumgr/polaris10_smumgr.c| 681 ++--- .../drm/amd/powerplay/smumgr/polaris10_s

[PATCH 12/20] drm/amd/powerplay: use smu7 common functions and data on Fiji.

2016-09-09 Thread Rex Zhu
Change-Id: Ie63ee99aa515e37943aee726103260819c9e2913 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c| 69 +-- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 605 + drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr

[PATCH 16/20] drm/amd/powerplay: add pp table v0 support in smu7_hwmgr.

2016-09-09 Thread Rex Zhu
Change-Id: I5cbd25597b02a01e7de28347659139a5e0a30098 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c| 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 704 +++-- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h

[PATCH 18/20] drm/amd/powerplay: implement fw related smu interface for iceland.

2016-09-09 Thread Rex Zhu
Change-Id: Ic5b83029c4e326ef4e02ee341ba8b1109d17328b Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- .../drm/amd/powerplay/hwmgr/iceland_powertune.h| 14 - drivers/gpu/drm/amd/powerplay/smumgr/Makefile |5 +- drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | 2577 +

[PATCH 19/20] drm/amd/powerplay: use smu7 hwmgr to manager iceland

2016-09-09 Thread Rex Zhu
Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/Makefile | 4 +--- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 36 +--- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/Makefi

[PATCH 3/9] drm/amd/powerplay: add module parameter for mask pp feature

2016-09-09 Thread Rex Zhu
Change-Id: I0fad3f4f96a57b41a5c47293e412fca40c741738 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 4 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers

[PATCH 7/9] drm/amd/powerplay: move smu related variable definitions to smumgr.

2016-09-09 Thread Rex Zhu
Change-Id: Ia64aee14b196bef708aded00cc257c7eafcfbcb9 Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu --- .../gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.h| 5 + .../drm/amd/powerplay/hwmgr/polaris10_powertune.h| 13 - .../gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.h

[PATCH 5/9] drm/amd/powerplay: add common functiones for visiting pp table.

2016-09-09 Thread Rex Zhu
Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c | 57 + drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 8 +++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c

[PATCH 4/9] drm/amd/powerplay: initialize platform caps in hwmgr_init.

2016-09-09 Thread Rex Zhu
Reviewed-by: Alex Deucher Signed-off-by: Rex Zhu --- .../gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 34 --- drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c| 109 - .../gpu/drm/amd/powerplay/inc/hardwaremanager.h| 1 - drivers/gpu/drm/amd/powerplay/inc/hwm

[PATCH 05/20] drm/amd/powerplay: implement fw image related smu interface for Fiji.

2016-09-09 Thread Rex Zhu
Change-Id: I1bab73135461c289264b14972fbf15eb424734ee Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/Makefile |2 +- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c| 2371 drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.h

[PATCH 10/20] drm/amd/powerplay: use smu7 common functions and data on Tonga.

2016-09-09 Thread Rex Zhu
Change-Id: If9ca14557f99f3e13e17086e8c0a90c53f232631 Signed-off-by: Rex Zhu Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c | 74 +-- .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c| 657 + .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.h

Re: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Christian König
Am 09.09.2016 um 15:41 schrieb Deucher, Alexander: -Original Message- From: amd-gfx [mailto:amd-gfx-boun...@lists.freedesktop.org] On Behalf Of Christian König Sent: Friday, September 09, 2016 7:24 AM To: Zhang, Hawking; Koenig, Christian; Cui, Flora; Zhou, David(ChunMing); amd-gfx@lists.

Re: [PATCH 0/9] misc patches related to powerplay

2016-09-09 Thread Christian König
Patch #1-#7 and #9 are Acked-by: Christian König . Patch #8: That looks fishy, usually we don't want to override static functions tables. So what is the specific use case here? Regards, Christian. Am 09.09.2016 um 15:37 schrieb Rex Zhu: Rex Zhu (9): drm/amd/powerplay: mark symbols static

Re: [PATCH 1/2] drm/ttm: remove unused placement flags

2016-09-09 Thread Christian König
Am 09.09.2016 um 15:54 schrieb Emil Velikov: On 9 September 2016 at 12:24, Christian König wrote: Hi Hawking, Removing the flag will make ttm_mem_type_from_place skip counting the corresponding placement and thus have impact on mem region create and bo movement. And that is exactly the reaso

[PATCH 1/3] drm/amdgpu: add AMDGPU_BO_INVALID_OFFSET

2016-09-09 Thread Christian König
From: Christian König An invalid offset to be used by custom VRAM/GGT manager when we don't have an offset for an BO. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 ++ 2 files changed, 3 insertions(+) diff -

[PATCH 3/3] drm/amdgpu: add a custom GTT memory manager

2016-09-09 Thread Christian König
From: Christian König Only allocate address space when we really need it. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/Makefile | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 238 +++

[PATCH 2/3] drm/amdgpu: unbind GTT only when it is bound

2016-09-09 Thread Christian König
From: Christian König Doesn't make much sense to clear the GTT when it was never filled. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgp

Re: [PATCH 0/9] misc patches related to powerplay

2016-09-09 Thread Zhu, Rex
Hi Christian, I used smu7_hwmgr for all the asics of smu version 7 , CI and Vi. Please see powerplay code refactoring patches. But some functions in the table were different between those asics. so we needed to overload those functions for some asics. for example: from tonga. we used p

Re: [PATCH 0/9] misc patches related to powerplay

2016-09-09 Thread Christian König
Hi Rex, exactly as I feared, please don't do this. I for example have a system with multiple PEG slots to be able to test different hardware generations at the same time. This is rather common setup for testing and will break horrible and quite unpredictable when the code suddenly overrides

Re: [PATCH 3/3] drm/amdgpu: add a custom GTT memory manager

2016-09-09 Thread Felix Kuehling
Some comments inline. Would it make sense to free the GTT address space in amdgpu_ttm_unbind? Basically the counterpart of amdgpu_gtt_mgr_alloc, call it amdgpu_gtt_mgr_free, that frees the address space but keeps the node allocated and sets its node->start address back to AMDGPU_BO_INVALID_OFFSET?

Re: [PATCH 0/9] misc patches related to powerplay

2016-09-09 Thread Zhu, Rex
Hi Christian, you are right, I missed mult-gpu case. i will refine related patches. Thanks. Best Regards Rex From: Christian König Sent: Saturday, September 10, 2016 1:51:30 AM To: Zhu, Rex; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 0/9] misc patch

amdkfd - misc fixes + get_local_mem_info() port [V.2]

2016-09-09 Thread Edward O'Callaghan
The following series applies on top of either master or the drm-next-4.9 branch. Apart from the couple of misc fixes here we port out the 'get_local_mem_info()' helper out of the ROCm kernel patch mountain and hook that up so to be mainlined. Please review, Edward O'Callaghan (7): [PATCH 1/7]

[PATCH 1/7] amdkfd: Tidy up kfd_generate_gpu_id() uint64_t bitshift unpack

2016-09-09 Thread Edward O'Callaghan
Dereference the one time and unpack the lower and upper 32bit portions with the proper kernel helper macros. Signed-off-by: Edward O'Callaghan Reviewed-by: Oded Gabbay --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drive

[PATCH 2/7] radeonkfd/amdkfd: Implement get_local_mem_info()

2016-09-09 Thread Edward O'Callaghan
Signed-off-by: Edward O'Callaghan --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 32 --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c | 2 +- d

[PATCH 5/7] drm/amdkfd: Remove duplicate pqm_uninit()

2016-09-09 Thread Edward O'Callaghan
pqm_uninit() will be called in kfd_process_notifier_release(), which is when the process exits. Calling it in kfd_unbind_process_from_device() is duplicate and in fact incorrect, because pqm should not be uninitalized as long as the process still exists. Original author: Yong Zhao Hand ported for

[PATCH 4/7] drm/amdkfd: Make kfd_lookup_process_by_pasid() well defined

2016-09-09 Thread Edward O'Callaghan
Ensure we return a NULL on the fail branch so that the call site may BUG_ON() it. Signed-off-by: Edward O'Callaghan --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/am

[PATCH 7/7] drm/amdkfd: Fix possible infinite loop

2016-09-09 Thread Edward O'Callaghan
When the loop predicating timeout parameter passed happens to not be a multiple of 20 the unsigned integer will overflow and the loop will become unbounded. Signed-off-by: Edward O'Callaghan --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c | 17 + drivers/gpu/drm/amd/amdgpu/

[PATCH 6/7] drm/amdkfd: Reuse function to find a process through pasid

2016-09-09 Thread Edward O'Callaghan
The kfd_lookup_process_by_pasid() is just for that purpose, so use it instead of repeating the code. Signed-off-by: Edward O'Callaghan --- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 58 +--- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/d

[PATCH 3/7] amdkfd: Add some missing memset zero'ing in queue init func

2016-09-09 Thread Edward O'Callaghan
Signed-off-by: Edward O'Callaghan Reviewed-by: Oded Gabbay --- drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c b/drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c index 9beae87..291c69d 100644 --- a/d