[PATCH 3/3] drm/amdgpu: Embed drm_device into amdgpu_device (v2)

2020-08-18 Thread Luben Tuikov
a) Embed struct drm_device into struct amdgpu_device. b) Modify the inline-f drm_to_adev() accordingly. c) Modify the inline-f adev_to_drm() accordingly. d) Eliminate the use of drm_device.dev_private, in amdgpu. e) Switch from using drm_dev_alloc() to drm_dev_init(). f) Add a DRM driver

[PATCH 1/3] drm/amdgpu: drm_device to amdgpu_device by inline-f (v2)

2020-08-18 Thread Luben Tuikov
Get the amdgpu_device from the DRM device by use of an inline function, drm_to_adev(). The inline function resolves a pointer to struct drm_device to a pointer to struct amdgpu_device. v2: Use a typed visible static inline function instead of an invisible macro. Signed-off-by: Luben Tuikov

[PATCH 0/3] Embed drm_device and eliminate use of dev_private (v2)

2020-08-18 Thread Luben Tuikov
As per the comments in include/drm/drm_device.h, struct drm_device::dev_private seems to be obsolete and it's recommended that drivers embed struct drm_device into their larger per-device structure. This patchset embeds struct drm_device into struct amdgpu_device, adds inline functions to access

[PATCH 2/3] drm/amdgpu: Get DRM dev from adev by inline-f

2020-08-18 Thread Luben Tuikov
Add a static inline adev_to_drm() to obtain the DRM device pointer from an amdgpu_device pointer. Signed-off-by: Luben Tuikov --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 + drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 10 +- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c| 6 +-

Re: [PATCH v2 2/3] drm/amdkfd: abstract the iommu device checking with ignore_crat

2020-08-18 Thread Huang Rui
On Tue, Aug 18, 2020 at 11:11:48PM +0800, Kuehling, Felix wrote: > I'd recommend making this the first change in the series. Make > 'drm/amdkfd: force raven as "dgpu" path' the second patch. That way it > only needs to change one place. > Yes, right. > A few more comments inline. > > > Am

Re: [PATCH v2 1/3] drm/amdkfd: force raven as "dgpu" path (v2)

2020-08-18 Thread Huang Rui
On Tue, Aug 18, 2020 at 11:01:25PM +0800, Kuehling, Felix wrote: > Am 2020-08-18 um 9:09 a.m. schrieb Huang Rui: > > We still have a few iommu issues which need to address, so force raven > > as "dgpu" path for the moment. > > > > This is to add the fallback path to bypass IOMMU if IOMMU v2 is

[PATCH] drm/amdgpu: fix up DCHUBBUB_SDPIF_MMIO_CNTRL_0 handling

2020-08-18 Thread Alex Deucher
Properly define this register using a relative offset rather than an absolute offset and use the proper SOC15 macros to access it. It's also DCN, not DCE, so remove it from the DCE12 header. No functional change. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Re: [PATCH 2/2] drm/amdgpu: Embed drm_device into amdgpu_device

2020-08-18 Thread Luben Tuikov
On 2020-08-18 2:23 p.m., Alex Deucher wrote: > On Fri, Aug 14, 2020 at 9:25 PM Luben Tuikov wrote: >> >> Embed struct drm_device into struct amdgpu_device. >> Modify the macro DRM_TO_ADEV() >> accordingly. Introduce a new macro to yield the >> DRM device from amdgpu_device, ADEV_TO_DRM(). >>

Re: [PATCH 2/2] drm/amdgpu: Embed drm_device into amdgpu_device

2020-08-18 Thread Dave Airlie
On Wed, 19 Aug 2020 at 04:23, Alex Deucher wrote: > > On Fri, Aug 14, 2020 at 9:25 PM Luben Tuikov wrote: > > > > Embed struct drm_device into struct amdgpu_device. > > Modify the macro DRM_TO_ADEV() > > accordingly. Introduce a new macro to yield the > > DRM device from amdgpu_device,

Re: [PATCH v3] drm/amdkfd: sparse: Fix warning in reading SDMA counters

2020-08-18 Thread Felix Kuehling
Am 2020-08-18 um 12:08 p.m. schrieb Mukul Joshi: > Add __user annotation to fix related sparse warning while reading > SDMA counters from userland. > Also, rework the read SDMA counters function by removing redundant > checks. > > Reported-by: kernel test robot > Signed-off-by: Mukul Joshi

Re: [PATCH 2/2] drm/amdgpu: Embed drm_device into amdgpu_device

2020-08-18 Thread Alex Deucher
On Fri, Aug 14, 2020 at 9:25 PM Luben Tuikov wrote: > > Embed struct drm_device into struct amdgpu_device. > Modify the macro DRM_TO_ADEV() > accordingly. Introduce a new macro to yield the > DRM device from amdgpu_device, ADEV_TO_DRM(). > Eliminate the use of drm_device.dev_private, > in amdgpu.

Re: [PATCH v2] drm/amd/display: use correct scale for actual_brightness

2020-08-18 Thread Kazlauskas, Nicholas
No objections from my side - and thanks for addressing my feedback. Regards, Nicholas Kazlauskas On 2020-08-18 12:15 p.m., Alex Deucher wrote: Applied. Thanks! Alex On Mon, Aug 17, 2020 at 1:59 PM Alex Deucher wrote: On Mon, Aug 17, 2020 at 3:09 AM Alexander Monakov wrote: Ping.

Re: TTM/nouveau conflict in drm-misc-next

2020-08-18 Thread Deucher, Alexander
[AMD Public Use] Double check for mis-merges on patches that went upstream via -fixes and -next. Alex From: Christian König Sent: Tuesday, August 18, 2020 11:06 AM To: Thomas Zimmermann ; Koenig, Christian ; Alex Deucher Cc: Deucher, Alexander ;

Re: [PATCH v2] drm/amd/display: use correct scale for actual_brightness

2020-08-18 Thread Alex Deucher
Applied. Thanks! Alex On Mon, Aug 17, 2020 at 1:59 PM Alex Deucher wrote: > > On Mon, Aug 17, 2020 at 3:09 AM Alexander Monakov wrote: > > > > Ping. > > Patch looks good to me: > Reviewed-by: Alex Deucher > > Nick, unless you have any objections, I'll go ahead and apply it. > > Alex > > > >

[PATCH v3] drm/amdkfd: sparse: Fix warning in reading SDMA counters

2020-08-18 Thread Mukul Joshi
Add __user annotation to fix related sparse warning while reading SDMA counters from userland. Also, rework the read SDMA counters function by removing redundant checks. Reported-by: kernel test robot Signed-off-by: Mukul Joshi --- .../drm/amd/amdkfd/kfd_device_queue_manager.c | 28

Re: [PATCH v2 3/3] drm/amdkfd: remove iommu v2 for old apu series

2020-08-18 Thread Felix Kuehling
Interesting. Does this actually work on Carrizo or Kaveri? I'd like to see any Thunk changes needed to support this before giving my R-b. For now this patch is Acked-by: Felix Kuehling Am 2020-08-18 um 9:09 a.m. schrieb Huang Rui: > We already support the fallback path, so it doesn't need

Re: [PATCH v2 2/3] drm/amdkfd: abstract the iommu device checking with ignore_crat

2020-08-18 Thread Felix Kuehling
I'd recommend making this the first change in the series. Make 'drm/amdkfd: force raven as "dgpu" path' the second patch. That way it only needs to change one place. A few more comments inline. Am 2020-08-18 um 9:09 a.m. schrieb Huang Rui: > It's better to use inline function to wrap the iommu

Re: TTM/nouveau conflict in drm-misc-next

2020-08-18 Thread Christian König
Am 17.08.20 um 08:31 schrieb Thomas Zimmermann: Hi Am 14.08.20 um 18:21 schrieb Koenig, Christian: Am 14.08.2020 17:53 schrieb Alex Deucher : On Fri, Aug 14, 2020 at 11:22 AM Christian König wrote: > > Hey Thomas & Alex, > > well the TTM and Nouveau changes

Re: [PATCH v2 1/3] drm/amdkfd: force raven as "dgpu" path (v2)

2020-08-18 Thread Felix Kuehling
Am 2020-08-18 um 9:09 a.m. schrieb Huang Rui: > We still have a few iommu issues which need to address, so force raven > as "dgpu" path for the moment. > > This is to add the fallback path to bypass IOMMU if IOMMU v2 is disabled > or ACPI CRAT table not correct. > > v2: use ignore_crat parameter

Re: [PATCH] drm/amd/display: should check error using DC_OK

2020-08-18 Thread Alex Deucher
On Mon, Aug 17, 2020 at 3:08 AM Tong Zhang wrote: > > core_link_read_dpcd returns only DC_OK(1) and DC_ERROR_UNEXPECTED(-1), > the caller should check error using DC_OK instead of checking against 0 > > Signed-off-by: Tong Zhang Applied. Thanks! Alex > --- >

Re: [PATCH][next] drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm

2020-08-18 Thread Alex Deucher
On Tue, Aug 18, 2020 at 8:09 AM Colin King wrote: > > From: Colin Ian King > > The 32 bit unsigned integer bl_pwm is being shifted using 32 bit arithmetic > and then being assigned to a 64 bit unsigned integer. There is a potential > for a 32 bit overflow so cast bl_pwm to enforce a 64 bit

Re: [PATCH 2/2] drm/amdgpu: Limit the error info print rate

2020-08-18 Thread Nirmoy
Acked-by: Nirmoy Das On 8/18/20 3:43 PM, Deng, Emily wrote: [AMD Official Use Only - Internal Distribution Only] [AMD Official Use Only - Internal Distribution Only] Ping ... What about this patch. -Original Message- From: Emily.Deng Sent: Tuesday, August 18, 2020 5:42 PM To:

RE: [PATCH 2/2] drm/amdgpu: Limit the error info print rate

2020-08-18 Thread Deng, Emily
[AMD Official Use Only - Internal Distribution Only] Ping ... What about this patch. >-Original Message- >From: Emily.Deng >Sent: Tuesday, August 18, 2020 5:42 PM >To: amd-gfx@lists.freedesktop.org >Cc: Deng, Emily >Subject: [PATCH 2/2] drm/amdgpu: Limit the error info print rate >

Re: [PATCH 1/2] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Nirmoy
Acked-by: Nirmoy Das On 8/18/20 3:29 PM, Emily.Deng wrote: From: jqdeng Only for no job running test case need to do recover in flr notification. For having job in mirror list, then let guest driver to hit job timeout, and then do recover. Signed-off-by: jqdeng Change-Id:

[PATCH 1/2] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Emily . Deng
From: jqdeng Only for no job running test case need to do recover in flr notification. For having job in mirror list, then let guest driver to hit job timeout, and then do recover. Signed-off-by: jqdeng Change-Id: Ic6234fce46fa1655ba81c4149235eeac75e75868 ---

[PATCH v2 2/3] drm/amdkfd: abstract the iommu device checking with ignore_crat

2020-08-18 Thread Huang Rui
It's better to use inline function to wrap the iommu checking. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_dbgdev.c| 4 ++-- .../gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c | 2 +-

[PATCH v2 3/3] drm/amdkfd: remove iommu v2 for old apu series

2020-08-18 Thread Huang Rui
We already support the fallback path, so it doesn't need IOMMU v2 flag anymore. Signed-off-by: Huang Rui --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index

[PATCH v2 1/3] drm/amdkfd: force raven as "dgpu" path (v2)

2020-08-18 Thread Huang Rui
We still have a few iommu issues which need to address, so force raven as "dgpu" path for the moment. This is to add the fallback path to bypass IOMMU if IOMMU v2 is disabled or ACPI CRAT table not correct. v2: use ignore_crat parameter to decide whether it will go with IOMMUv2. Signed-off-by:

[PATCH][next] drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm

2020-08-18 Thread Colin King
From: Colin Ian King The 32 bit unsigned integer bl_pwm is being shifted using 32 bit arithmetic and then being assigned to a 64 bit unsigned integer. There is a potential for a 32 bit overflow so cast bl_pwm to enforce a 64 bit shift operation to avoid this. Addresses-Coverity:

Re: [PATCH 1/2] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Nirmoy
With below minor comments fixed, the series is Acked-by: Nirmoy Das On 8/18/20 11:41 AM, Emily.Deng wrote: From: jqdeng Only for no job running test case need to do recover in flr notification. For having job in mirror list, then let guest driver to hit job timeout, and then do recover.

[PATCH v3] drm/amdgpu: refine create and release logic of hive info

2020-08-18 Thread Dennis Li
Change to dynamically create and release hive info object, which help driver support more hives in the future. v2: Change to save hive object pointer in adev, to avoid locking xgmi_mutex every time when calling amdgpu_get_xgmi_hive. v3: 1. Change type of hive object pointer in adev from void* to

RE: [PATCH v2] drm/amdgpu: refine create and release logic of hive info

2020-08-18 Thread Li, Dennis
[AMD Official Use Only - Internal Distribution Only] Hi, Christian, Thanks for your review. I will update a new patch according to your suggestion. Best Regards Dennis Li -Original Message- From: Christian König Sent: Tuesday, August 18, 2020 7:50 PM To: Li, Dennis ;

Re: [PATCH v2] drm/amdgpu: refine create and release logic of hive info

2020-08-18 Thread Christian König
Am 18.08.20 um 13:42 schrieb Dennis Li: Change to dynamically create and release hive info object, which help driver support more hives in the future. v2: Change to save hive object pointer in adev, to avoid locking xgmi_mutex every time when calling amdgpu_get_xgmi_hive. Signed-off-by: Dennis

[PATCH v2] drm/amdgpu: refine create and release logic of hive info

2020-08-18 Thread Dennis Li
Change to dynamically create and release hive info object, which help driver support more hives in the future. v2: Change to save hive object pointer in adev, to avoid locking xgmi_mutex every time when calling amdgpu_get_xgmi_hive. Signed-off-by: Dennis Li diff --git

Re: [PATCH] drm/amdgpu: fix amdgpu_bo_release_notify() comment error

2020-08-18 Thread Christian König
Am 17.08.20 um 09:35 schrieb Kevin Wang: fix amdgpu_bo_release_notify() comment error. Signed-off-by: Kevin Wang Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 2/2] drm/amdgpu: Limit the error info print rate

2020-08-18 Thread Emily . Deng
From: jqdeng Use function printk_ratelimit to limit the print rate. Signed-off-by: jqdeng Change-Id: Ief05debe30d975cbcf88e473c9f486d70b5a202c --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 1/2] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Emily . Deng
From: jqdeng Only for no job running test case need to do recover in flr notification. For having job in mirror list, then let guest driver to hit job timeout, and then do recover. Signed-off-by: jqdeng Change-Id: Ic6234fce46fa1655ba81c4149235eeac75e75868 ---

[PATCH 1/2] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Emily . Deng
From: jqdeng Only for no job running test case need to do recover in flr notification. For having job in mirror list, then let guest driver to hit job timeout, and then do recover. Signed-off-by: jqdeng Change-Id: Ic6234fce46fa1655ba81c4149235eeac75e75868 ---

[PATCH v2 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
Add max_segment argument to drm_prime_pages_to_sg(). When set pass it through to the __sg_alloc_table_from_pages() call, otherwise use SCATTERLIST_MAX_SEGMENT. Also add max_segment field to drm driver and pass it to drm_prime_pages_to_sg() calls in drivers and helpers. v2: place max_segment in

Re: [PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
Hi, > > > I'm missing an explanation why this should be useful (it certainly is). > > virtio-gpu needs this to work properly with SEV (see patch 2/2 of this > > series). > > Yeah, that's the problem patch 2/2 never showed up here :) The list should have everything. Your inbox probably has

RE: [PATCH] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Deng, Emily
[AMD Official Use Only - Internal Distribution Only] >-Original Message- >From: Das, Nirmoy >Sent: Tuesday, August 18, 2020 4:22 PM >To: Deng, Emily ; Das, Nirmoy >; amd-gfx@lists.freedesktop.org >Subject: Re: [PATCH] drm/amdgpu: Fix repeatly flr issue > > >On 8/18/20 4:48 AM, Deng,

Re: [PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Christian König
Am 18.08.20 um 10:27 schrieb Gerd Hoffmann: On Tue, Aug 18, 2020 at 09:57:59AM +0200, Christian König wrote: Am 18.08.20 um 09:48 schrieb Gerd Hoffmann: Add max_segment argument to drm_prime_pages_to_sg(). When set pass it through to the __sg_alloc_table_from_pages() call, otherwise use

Re: [PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
On Tue, Aug 18, 2020 at 09:57:59AM +0200, Christian König wrote: > Am 18.08.20 um 09:48 schrieb Gerd Hoffmann: > > Add max_segment argument to drm_prime_pages_to_sg(). When set pass it > > through to the __sg_alloc_table_from_pages() call, otherwise use > > SCATTERLIST_MAX_SEGMENT. > > > > Also

Re: [PATCH 4/4] drm/amdgpu/pm: only hide average power on SI and pre-RENOIR APUs

2020-08-18 Thread Nirmoy
Series is Acked-by: Nirmoy Das On 8/17/20 9:53 PM, Alex Deucher wrote: We can get this on RENOIR and newer via the SMU metrics table. Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] drm/amdgpu: Fix repeatly flr issue

2020-08-18 Thread Nirmoy
On 8/18/20 4:48 AM, Deng, Emily wrote: [AMD Official Use Only - Internal Distribution Only] -Original Message- From: Das, Nirmoy Sent: Wednesday, August 12, 2020 8:18 PM To: Deng, Emily ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH] drm/amdgpu: Fix repeatly flr issue On

Re: [PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Christian König
Am 18.08.20 um 09:48 schrieb Gerd Hoffmann: Add max_segment argument to drm_prime_pages_to_sg(). When set pass it through to the __sg_alloc_table_from_pages() call, otherwise use SCATTERLIST_MAX_SEGMENT. Also add max_segment field to gem objects and pass it to drm_prime_pages_to_sg() calls in

[PATCH 1/2] drm: allow limiting the scatter list size.

2020-08-18 Thread Gerd Hoffmann
Add max_segment argument to drm_prime_pages_to_sg(). When set pass it through to the __sg_alloc_table_from_pages() call, otherwise use SCATTERLIST_MAX_SEGMENT. Also add max_segment field to gem objects and pass it to drm_prime_pages_to_sg() calls in drivers and helpers. Signed-off-by: Gerd