Re: drm/amdgpu: Add helper function to get buffer domain

2018-05-24 Thread Christian König
Am 25.05.2018 um 02:15 schrieb Deepak Sharma: Move logic of getting supported domain to a helper function Signed-off-by: Deepak Sharma --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 10 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 16 +++- drivers/gpu/drm/amd/amdgpu

Re: [PATCH] gpu: Consistently use octal not symbolic permissions

2018-05-24 Thread Christian König
Well I think we rejected that multiple times now. At least I find the symbolic permissions easier to read and I absolutely don't see any reason why we should only use one form. Christian. Am 24.05.2018 um 22:22 schrieb Joe Perches: There is currently a mixture of octal and symbolic permissio

Re: [PATCH] drm/amdgpu: fix NULL pointer dereference when run App with DRI_PRIME=1

2018-05-24 Thread Christian König
NAK, that probably just fixed the symptom but not the underlying problem. Somebody is accessing the page array when it should never be accessed. How did you manage to trigger this? Regards, Christian. Am 25.05.2018 um 07:41 schrieb Junwei Zhang: [ 632.679861] BUG: unable to handle kernel NUL

Re: [PATCH] gpu: Consistently use octal not symbolic permissions

2018-05-24 Thread Jani Nikula
On Thu, 24 May 2018, Joe Perches wrote: > There is currently a mixture of octal and symbolic permissions uses > in files in drivers/gpu/drm and one file in drivers/gpu. > > There are ~270 existing octal uses and ~115 S_ uses. > > Convert all the S_ symbolic permissions to their octal equivalents >

[PATCH] drm/amdgpu: fix NULL pointer dereference when run App with DRI_PRIME=1

2018-05-24 Thread Junwei Zhang
[ 632.679861] BUG: unable to handle kernel NULL pointer dereference at (null) [ 632.679892] IP: drm_prime_sg_to_page_addr_arrays+0x52/0xb0 [drm] [ 632.680011] Call Trace: [ 632.680082] amdgpu_ttm_tt_populate+0x3e/0xa0 [amdgpu] [ 632.680092] ttm_tt_populate.part.7+0x22/0x60 [amdttm] [ 632.6

drm/amdgpu: Add helper function to get buffer domain

2018-05-24 Thread Deepak Sharma
Move logic of getting supported domain to a helper function Signed-off-by: Deepak Sharma --- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c| 10 +++--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 16 +++- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 2 +- 3 files changed, 15 inser

Re: [PATCH 2/2] drm/amdgpu: add kernel doc for memory domains.

2018-05-24 Thread Alex Deucher
On Thu, May 24, 2018 at 4:35 PM, Samuel Li wrote: Please add a patch description. E.g., Document the GEM domains exposed to userspace. A few comments below. > Signed-off-by: Samuel Li > --- > include/uapi/drm/amdgpu_drm.h | 19 +++ > 1 file changed, 19 insertions(+) > > diff

[PATCH] drm/amdgpu: Use dev_info() to report amdkfd is not supported for this ASIC

2018-05-24 Thread Tom Stellard
This is an important message, so it should be visible to users without having to enable extra debugging. Signed-off-by: Tom Stellard --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/dr

Re: [PATCH 1/2] drm/amdgpu: add kernel doc for amdgpu_object.c

2018-05-24 Thread Alex Deucher
On Thu, May 24, 2018 at 4:35 PM, Samuel Li wrote: Please add a patch description. Something like: Document the amdgpu buffer object API. A few additional comments inline below. > v2: Add a DOC section and some more clarification. > Signed-off-by: Samuel Li > --- > drivers/gpu/drm/amd/amdgpu

[PATCH] gpu: Consistently use octal not symbolic permissions

2018-05-24 Thread Joe Perches
There is currently a mixture of octal and symbolic permissions uses in files in drivers/gpu/drm and one file in drivers/gpu. There are ~270 existing octal uses and ~115 S_ uses. Convert all the S_ symbolic permissions to their octal equivalents as using octal and not symbolic permissions is prefe

[PATCH 2/2] drm/amdgpu: add kernel doc for memory domains.

2018-05-24 Thread Samuel Li
Signed-off-by: Samuel Li --- include/uapi/drm/amdgpu_drm.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index 5b007fa..a2ae752 100644 --- a/include/uapi/drm/amdgpu_drm.h +++ b/include/uapi/drm/amdgpu_drm.h @

[PATCH 1/2] drm/amdgpu: add kernel doc for amdgpu_object.c

2018-05-24 Thread Samuel Li
v2: Add a DOC section and some more clarification. Signed-off-by: Samuel Li --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 266 + 1 file changed, 266 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c

Re: [PATCH xf86-video-amdgpu 00/13] Enabling Color Management - Round 2

2018-05-24 Thread Leo Li
On 2018-05-18 04:10 AM, Michel Dänzer wrote: On 2018-05-17 11:43 PM, Leo Li wrote: On 2018-05-16 01:06 PM, Michel Dänzer wrote: On 2018-05-03 08:31 PM, sunpeng...@amd.com wrote: 3. The three color management properties (Degamma LUT, Color Transform Matrix     (CTM), and Gamma LUT) are hard

[PATCH 16/17] drm/amdgpu: add AMDGPU_HW_IP_VCN_JPEG to info query

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_HW_IP_VCN_JPEG to info query Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 51a4b08..dfe439

[PATCH 13/17] drm/amdgpu: add vcn jpeg ib test

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add an ib test for vcn jpeg Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 86 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- 3 files changed, 88 insertions(+), 1 d

[PATCH 12/17] drm/amdgpu: add vcn jpeg ring test

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add a ring test for vcn jpeg Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 40 + drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 2 ++ drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 2 +- 3 files changed, 43 insertions(+), 1

[PATCH 17/17] drm/amdgpu: add AMDGPU_HW_IP_VCN_JPEG to queue mgr

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_HW_IP_VCN_JPEG to queue mgr Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c inde

[PATCH 03/17] drm/amdgpu: add jpeg packet defines to soc15d.h

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add new packet for vcn jpeg, including condition checks, types and packet Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/soc15d.h | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15d.h b/drivers/gpu/drm/a

[PATCH 09/17] drm/amdgpu: implement patch for fixing a known bug

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Implement a patch to maunally reset read pointer Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu

[PATCH 08/17] drm/amdgpu: initialize vcn jpeg ring

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add implementations for vcn jpeg ring initialization Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_

[PATCH 11/17] drm/amdgpu: add vcn jpeg sw init and fini

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add software initializationa and finish for vcn jpeg ring Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_v

[PATCH 15/17] uapi/drm: add AMDGPU_HW_IP_VCN_JPEG for jpeg CS

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_HW_IP_VCN_JPEG define for jpeg CS Signed-off-by: Boyuan Zhang --- include/uapi/drm/amdgpu_drm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h index 393d183..4381dcc 100644 --- a/

[PATCH 10/17] drm/amdgpu: add patch for fixing a known bug

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Allocate extra space in vcn jpeg ring buffer and store the jpeg ring patch Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_

[PATCH 14/17] drm/amdgpu: enable vcn jpeg ib test

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Enable vcn jpeg ib ring test in amdgpu_ib.c Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 311

[PATCH 01/17] drm/amdgpu: define vcn jpeg ring

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add AMDGPU_RING_TYPE_VCN_JPEG ring define Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h index

[PATCH 07/17] drm/amdgpu: add vcn jpeg irq support

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add vcn jpeg irq support Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 0dde424..9a04a9a 100644 --- a/drive

[PATCH 06/17] drm/amdgpu: set jpeg ring functions

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Set all vcn jpeg ring function pointers Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 41 +++ 1 file changed, 41 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0

[PATCH 04/17] drm/amdgpu: add more jpeg register offset headers

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add more jpeg registers defines that are needed for jpeg ring functions Signed-off-by: Boyuan Zhang --- .../drm/amd/include/asic_reg/vcn/vcn_1_0_offset.h| 20 1 file changed, 20 insertions(+) diff --git a/drivers/gpu/drm/amd/include/asic_reg/vcn/vcn

[PATCH 02/17] drm/amdgpu: add vcn jpeg ring

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Add jpeg to amdgpu_vcn Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h index 2fd7db8..648f662 100644 --- a/drivers

[PATCH 05/17] drm/amdgpu: implement jpeg ring functions

2018-05-24 Thread boyuan.zhang
From: Boyuan Zhang Signed-off-by: Boyuan Zhang --- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 293 ++ 1 file changed, 293 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c index 8c13267..3ddab07 100644 --- a/d

[PATCH 2/3] Revert "drm/amdgpu: add new device to use atpx quirk"

2018-05-24 Thread Alex Deucher
This reverts commit 6c24a85d236eb2348d2e221993769fd93c168f65. This was a workaround for a bug in the HDA driver that prevented the HDA audio chip from going into runtime pm which prevented the GPU from going into runtime pm. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106597 Signed-off-by:

[PATCH 1/3] Revert "drm/amdgpu: Add an ATPX quirk for hybrid laptop"

2018-05-24 Thread Alex Deucher
This reverts commit 13b40935cf64f59b93cf1c716a2033488e5a228c. This was a workaround for a bug in the HDA driver that prevented the HDA audio chip from going into runtime pm which prevented the GPU from going into runtime pm. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106597 Signed-off-by:

[PATCH 3/3] Partially revert: drm/amdgpu: add atpx quirk handling (v2)

2018-05-24 Thread Alex Deucher
Remove the platform specific quirks, but leave the quirk infrastructure in place. This was a workaround for a bug in the HDA driver that prevented the HDA audio chip from going into runtime pm which prevented the GPU from going into runtime pm. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=10

Re: [PATCH xf86-video-amdgpu 10/13] Push staged color properties when DPMS state toggles On

2018-05-24 Thread Leo Li
On 2018-05-18 04:01 AM, Michel Dänzer wrote: On 2018-05-17 11:44 PM, Leo Li wrote: On 2018-05-16 01:10 PM, Michel Dänzer wrote: On 2018-05-03 08:31 PM, sunpeng...@amd.com wrote: From: "Leo (Sunpeng) Li" This will persist color management properties on a CRTC across DPMS state changes. Sig

Re: [PATCH libdrm 3/3] amdgpu: Destroy fd_hash table when the last device is removed.

2018-05-24 Thread Jan Vesely
On Fri, 2018-05-18 at 13:00 -0400, Jan Vesely wrote: > Fixes memory leak on module unload. > Analogous to mesa commit of the same name. > Signed-off-by: Jan Vesely > --- > amdgpu/amdgpu_device.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/amdgpu/amdgpu_device.c b/amdgpu/amdgpu_d

[pull] amdgpu, sched drm-next-4.18

2018-05-24 Thread Alex Deucher
Hi Dave, Last feature request for 4.18. Mostly vega20 support. - Vega20 support - clock and powergating for VCN - misc bug fixes The following changes since commit 315852b422972e6ebb1dfddaadada09e46a2681a: drm: rcar-du: Fix build failure (2018-05-17 15:03:40 +1000) are available in the git

[PATCH v2] drm/amd/display: Implement dm_pp_get_clock_levels_by_type_with_latency

2018-05-24 Thread Harry Wentland
This is required so we use the correct minimum clocks for Vega. Without this pplib will never be able to enter the lowest clock states. Signed-off-by: Harry Wentland Acked-by: Alex Deucher --- .../display/amdgpu_dm/amdgpu_dm_services.c| 46 ++- 1 file changed, 44 insertions(

Re: [PATCH] drm/amd/display: Remove use of division operator for long longs

2018-05-24 Thread Alex Deucher
On Thu, May 24, 2018 at 10:40 AM, wrote: > From: David Francis > > In fixed31_32.h, in dc_fixpt_shl,'/' was used for division of one long > long int by another long long int. As there is no inbuilt long long > int division function in c, gcc inserted its own. However, gcc does not > link the l

[PATCH] drm/amd/display: Remove use of division operator for long longs

2018-05-24 Thread sunpeng.li
From: David Francis In fixed31_32.h, in dc_fixpt_shl,'/' was used for division of one long long int by another long long int. As there is no inbuilt long long int division function in c, gcc inserted its own. However, gcc does not link the library that contains this function. To avoid this, us

Re: [PATCH xf86-video-amdgpu 1/2] Call drmmode_do_crtc_dpms from drmmode_crtc_dpms as well

2018-05-24 Thread Leo Li
On 2018-05-18 06:33 AM, Michel Dänzer wrote: From: Michel Dänzer Leo pointed out that drmmode_do_crtc_dpms wasn't getting called when turning off an output with xrandr --output --off This meant that the vblank sequence number and timestamp wouldn't be saved before turning off the CRTC in

[PATCH umr] Update disasm CPU names to match what mesa uses

2018-05-24 Thread Tom St Denis
Updates the CPU names for vega12/vegam/raven1. Signed-off-by: Tom St Denis --- src/lib/umr_llvm_disasm.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/umr_llvm_disasm.c b/src/lib/umr_llvm_disasm.c index 40e31774457f..f772db2eff29 100644 --- a/src/lib/umr_

Re: GPU hang trying to run OpenCL kernels on x86_64

2018-05-24 Thread Luís Mendes
Additional update... I was able to boot and enter X by installing an NVIDIA GTX 1050 Ti as the primary display card and using an AMD RX 550 as the secondary card on the Tyan S7025 with the same Ubuntu 18.04 and the same Linux kernel 4.17-rc6. However once I try to run an OpenCL kernel on RX 550 I

Re: GPU hang trying to run OpenCL kernels on x86_64

2018-05-24 Thread Michel Dänzer
On 2018-05-24 12:06 AM, Luís Mendes wrote: > I've tried Linux 4.17-rc6 with Ubuntu 18.04 on Tyan S7002 and I am not even > able see lightdm/gdm3 as system hangs when starting X. > Having SR-IOV enabled or disabled makes no difference. > Tested with AMD RX 460. > When X is supposed to start the syst

Re: GPU hang trying to run OpenCL kernels on x86_64

2018-05-24 Thread Luís Mendes
Hi Michel, So summarizing with Linux kernel 4.17-rc6 on Ubuntu 18.04 using AMD RX 460/RX 550 I am not able to enter X. The same system with AMD Radeon R7 240 not only enters X as also runs the OpenCL kernel that RX 460 / RX 550 are unable to run for all the kernels that I have tested. Could this a

Re: GPU hang trying to run OpenCL kernels on x86_64

2018-05-24 Thread Luís Mendes
Hi Michel, I will have to check previous rc releases of 4.17 to see if it wasn't already happening, before trying any possible git bisect. As an update I can say that an AMD Radeon R7 240 works fine on the same system with the same kernel and I am able to run the OpenCL kernels, that I couldn't wi

Re: GPU hang trying to run OpenCL kernels on x86_64

2018-05-24 Thread Luís Mendes
Hi Michel, I also work as a researcher at a university and we are considering buying AMD cards to do OpenCL computations for numerical modelling, but currently I am unable to give a try at the AMD cards I have at home. I couldn't find any working driver for them... also amdgpu-pro drivers don't wo

Re: drm/amdgpu: Use GTT for dumb buffer if sg display enabled (v2)

2018-05-24 Thread Christian König
Am 23.05.2018 um 20:14 schrieb Deepak Sharma: On 05/23/2018 12:31 AM, Christian König wrote: Am 23.05.2018 um 00:31 schrieb Deepak Sharma: When vram size <= THRESHOLD(256M) lets use GTT for dumb buffer allocation. As SG will be enabled with vram size <= 256M scan out will not be an issue. v2

Re: [PATCH] drm/amdgpu: Remove unused variable in amdgpu_device_gpu_recover

2018-05-24 Thread Christian König
Reviewed-by: Christian König as well. Christian. Am 23.05.2018 um 19:11 schrieb Andrey Grodzovsky: Reviewed-by: Andrey Grodzovsky Andrey On 05/23/2018 01:08 PM, Harry Wentland wrote: It throws an unused variable warning. Signed-off-by: Harry Wentland ---   drivers/gpu/drm/amd/amdgpu/amd