Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-01-31 Thread Dan Carpenter
I don't totally understand the stack trace but I do see a double free bug. drivers/gpu/drm/vgem/vgem_drv.c 186 static struct drm_gem_object *vgem_gem_create(struct drm_device *dev, 187struct drm_file *file, 188

RE: [Patch v2 3/4] drm/amdkfd: refactor runtime pm for baco

2020-01-31 Thread Zeng, Oak
[AMD Official Use Only - Internal Distribution Only] Patch 1,2,3 work for me. See one comment inline, otherwise Reviewed-by: Oak Zeng Regards, Oak -Original Message- From: amd-gfx On Behalf Of Rajneesh Bhardwaj Sent: Friday, January 31, 2020 10:37 PM To:

[Patch v2 3/4] drm/amdkfd: refactor runtime pm for baco

2020-01-31 Thread Rajneesh Bhardwaj
So far the kfd driver implemented same routines for runtime and system wide suspend and resume (s2idle or mem). During system wide suspend the kfd aquires an atomic lock that prevents any more user processes to create queues and interact with kfd driver and amd gpu. This mechanism created problem

[Patch v2 0/4] Enable BACO with KFD

2020-01-31 Thread Rajneesh Bhardwaj
Changes in v2: * Rebased on latest amd-staging-drm-next * Addressed review comments from Felix, Oak and Alex for v1 * Removed 60 second hack for auto-suspend delay and simplified the logic * Dropped kfd debugfs patch * Folded in Alex's patch from this series to enable and test with kfd.

[Patch v2 4/4] drm/amdgpu/runpm: enable runpm on baco capable VI+ asics

2020-01-31 Thread Rajneesh Bhardwaj
From: Alex Deucher Seems to work reliably on VI+. [rajneesh] Picked https://patchwork.freedesktop.org/patch/335402/ to enable runtime pm with baco for kfd. Also fixed a checkpatch warning and dropped below patch from previous series in favor of Alex's patch.

[Patch v2 1/4] drm/amdgpu: Fix missing error check in suspend

2020-01-31 Thread Rajneesh Bhardwaj
amdgpu_device_suspend might return an error code since it can be called from both runtime and system suspend flows. Add the missing return code in case of a failure. Reviewed-by: Alex Deucher Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +++ 1 file changed,

[Patch v2 2/4] drm/amdkfd: show warning when kfd is locked

2020-01-31 Thread Rajneesh Bhardwaj
During system suspend the kfd driver aquires a lock that prohibits further kfd actions unless the gpu is resumed. This adds some info which can be useful while debugging. Signed-off-by: Rajneesh Bhardwaj --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 ++ 1 file changed, 2 insertions(+) diff

[PATCH 33/33] drm/amd/display: turn off the mst hub before we do detection

2020-01-31 Thread Bhawanpreet Lakha
From: Joseph Gravenor [why] not turning off the mst hub before detection on reboot causes us to not be able to light up displays with mst hook [how] on hw init, see if any displays are lit up. if so, turn them off Signed-off-by: Joseph Gravenor Reviewed-by: Eric Yang Acked-by: Bhawanpreet

[PATCH 23/33] drm/amd/display: Check hyperV flag in DC.

2020-01-31 Thread Bhawanpreet Lakha
From: Yongqiang Sun [Why] hyperV flag should be passed from dm to DC, and override the nv12 flip workaround flag. [How] Add flag to phy address config struct and pass the value in dm. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Bhawanpreet Lakha ---

[PATCH 20/33] drm/amd/display: Check engine is not NULL before acquiring

2020-01-31 Thread Bhawanpreet Lakha
From: Aric Cyr [Why] Engine can be NULL in some cases, so we must not acquire it. [How] Check for NULL engine before acquiring. Signed-off-by: Aric Cyr Reviewed-by: Harry Wentland Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 2 +- 1 file changed, 1

[PATCH 16/33] drm/amd/display: remove early break in interdependent_lock

2020-01-31 Thread Bhawanpreet Lakha
From: Roman Li [Why] The break in apply_ctx_interdependent_lock() may potentially lead to early break from the loop leaving update plane unlocked [How] Remove break Signed-off-by: Roman Li Reviewed-by: Anthony Koo --- drivers/gpu/drm/amd/display/dc/core/dc.c | 1 - 1 file changed, 1

[PATCH 30/33] drm/amd/display: linux enable oled panel support dc part

2020-01-31 Thread Bhawanpreet Lakha
From: Hersen Wu [Why] old panel has been enabled for window driver but not linux. [How] enable oled panel support for linux. this patch is dc part. Signed-off-by: Hersen Wu Reviewed-by: Harry Wentland Reviewed-by: Hersen Wu Acked-by: Bhawanpreet Lakha ---

[PATCH 03/33] drm/amd/display: remove invalid dc_is_hw_initialized function

2020-01-31 Thread Bhawanpreet Lakha
From: Joseph Gravenor [why/how] We found out that the register we read actually gets reset by SMU after we loose power, meaning this always returns true Signed-off-by: Joseph Gravenor Reviewed-by: Eric Yang Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 --

[PATCH 26/33] drm/amd/display: Limit minimum DPPCLK to 100MHz.

2020-01-31 Thread Bhawanpreet Lakha
From: Yongqiang Sun [Why] Underflow is observed when plug in a 4K@60 monitor with 1366x768 eDP due to DPPCLK is too low. [How] Limit minimum DPPCLK to 100MHz. Signed-off-by: Yongqiang Sun Reviewed-by: Eric Yang Acked-by: Bhawanpreet Lakha ---

[PATCH 32/33] drm/amd/display: Add initialitions for PLL2 clock source

2020-01-31 Thread Bhawanpreet Lakha
From: Isabel Zhang [Why] Starting from 14nm, the PLL is built into the PHY and the PLL is mapped to PHY on 1 to 1 basis. In the code, the DP port is mapped to a PLL that was not initialized. This causes DP to HDMI dongle to not light up the display. [How] Initializations added for PLL2 when

[PATCH 08/33] drm/amd/display: Fix various issues found by compiler warning as errors

2020-01-31 Thread Bhawanpreet Lakha
From: Eric Bernstein [Why] Diagnostics team reported various issues found when enabling warnings as errors [How] Fix implicit conversions Signed-off-by: Eric Bernstein Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 2 +-

[PATCH 28/33] drm/amd/display: Add DMUB tracebuffer debugfs

2020-01-31 Thread Bhawanpreet Lakha
From: Nicholas Kazlauskas [Why] The DMUB tracebuffer is useful for understanding DMCUB execution state. [How] Add a "show" attribute debugfs so we can loop through the buffer and print the entries. The structs for the entry format are defined in the debugfs since the tracebuffer header no

[PATCH 31/33] drm/amd/display: fix workaround for incorrect double buffer register for DLG ADL and TTU

2020-01-31 Thread Bhawanpreet Lakha
From: Tony Cheng [Why] these registers should have been double buffered. SW workaround we will have SW program the more aggressive (lower) values whenever we are upating this register, so we will not have underflow at expense of less optimzal request pattern. [How] there is a driver bug where

[PATCH 11/33] drm/amd/display: Added locking for atomic update stream and update planes

2020-01-31 Thread Bhawanpreet Lakha
From: Anthony Koo [Why] Screen flickering when HDR switches between FP16 and ARGB2101010 [How] Moved pipe_control_lock so stream update and plane update occur atomically Signed-off-by: Anthony Koo Signed-off-by: Lucy Li Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha ---

[PATCH 07/33] drm/amd/display: Indicate dsc updates explicitly

2020-01-31 Thread Bhawanpreet Lakha
From: Anthony Koo [Why] DSC updates only set type to FULL UPDATE, but doesn't flag the change [How] Add DSC flag update flag Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/core/dc.c | 19 ---

[PATCH 19/33] drm/amd/display: Use dcfclk to populate watermark ranges

2020-01-31 Thread Bhawanpreet Lakha
From: Sung Lee [WHY & HOW] Previously drain clk was unconstrained and fill clk was constrained on fclk. We want to change it to fill clk unconstrained and drain clock constrained to dcfclk. Signed-off-by: Sung Lee Reviewed-by: Tony Cheng Acked-by: Bhawanpreet Lakha ---

[PATCH 18/33] drm/amd/display: add stream_enc_inst for PSP HDCP inst use

2020-01-31 Thread Bhawanpreet Lakha
From: Charlene Liu [why] new HW engine mapping requirment use in PSP [how] report stream_enc_inst Signed-off-by: Charlene Liu Reviewed-by: Wenjing Liu Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-

[PATCH 09/33] drm/amd/display: Add GPINT handler interface

2020-01-31 Thread Bhawanpreet Lakha
From: Nicholas Kazlauskas [Why] The General Purpose Interrupt is used on the DMCUB to pass lightweight commands via a register to the DMCUB. This is limited to 32-bit command and 32-bit response. This will be used for shutting down the firmware in a clean manner. [How] Add the command IDs and

[PATCH 24/33] drm/amd/display: Add wm ranges to clk_mgr

2020-01-31 Thread Bhawanpreet Lakha
From: Sung Lee [WHY & HOW] Having watermark ranges saved inside clk_mgr to be available for debug at all times would be useful. Add it to the clk_mgr_internal struct for reference. Only populated for Renoir, unused for other asics. Signed-off-by: Sung Lee Reviewed-by: Yongqiang Sun Acked-by:

[PATCH 00/33] DC Patches 31 Jan 2020

2020-01-31 Thread Bhawanpreet Lakha
Summary Of Changes *DMCUB changes *psr frame calculation fix *fix compile warnings *refactor front end programing *enable OLED support in DC Anthony Koo (3): drm/amd/display: Split program front end part that occur outside lock drm/amd/display: Indicate dsc updates explicitly

[PATCH 27/33] drm/amd/display: 3.2.71

2020-01-31 Thread Bhawanpreet Lakha
From: Aric Cyr Signed-off-by: Aric Cyr Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index

[PATCH 25/33] drm/amd/display: Use uint64_t logger_mask instead of uint32_t

2020-01-31 Thread Bhawanpreet Lakha
From: David Galiffi [WHY] enum dc_log_type has more than 32 entries. User cannot set larger entries, like LOG_DSC. Logs from LOG_GAMMA_DEBUG where being printed even though flag was not enabled, because dal_logger_should_log check erroneously passed. [HOW] Change struct dal_logger.mask and

[PATCH 14/33] drm/amd/display: 3.2.70

2020-01-31 Thread Bhawanpreet Lakha
From: Aric Cyr Signed-off-by: Aric Cyr Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index

[PATCH 06/33] drm/amd/display: Split program front end part that occur outside lock

2020-01-31 Thread Bhawanpreet Lakha
From: Anthony Koo [Why] Eventually want to lock at a higher level in stack. To do this, we need to be able to isolate the parts that need to be done after pipe unlock. [How] Split out programming that is done post unlock. Signed-off-by: Anthony Koo Reviewed-by: Aric Cyr Acked-by: Bhawanpreet

[PATCH 22/33] drm/amd/display: fix inputting clk lvl into dml for RN

2020-01-31 Thread Bhawanpreet Lakha
From: Eric Yang [Why] Previous logic is only good for 15W parts. Other configuration need a smarter logic to match clk levels with pp table in the fuse. [How] Cache all 8 DPM level's clock data, find lvl that match each pstate in the pp table and build input into DML base on that

[PATCH 17/33] drm/amd/display: Update hubbub description comment

2020-01-31 Thread Bhawanpreet Lakha
From: Peikang Zhang Description for DCHUBBUB_TEST_DEBUG_DATA is changed to avoid any future confusions. Signed-off-by: Peikang Zhang Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha --- .../drm/amd/display/dc/dcn10/dcn10_hubbub.c | 63 +-- 1 file changed, 3

[PATCH 05/33] drm/amd/display: Do not set optimized_require to false after plane disable

2020-01-31 Thread Bhawanpreet Lakha
From: Sung Lee [WHY] The optimized_require flag is needed to set watermarks and clocks lower in certain conditions. This flag is set to true and then set to false while programming front end in dcn20. [HOW] Do not set the flag to false while disabling plane. Signed-off-by: Sung Lee

[PATCH 04/33] drm/amd/display: Fix psr static frames calculation

2020-01-31 Thread Bhawanpreet Lakha
From: Roman Li [Why] Driver crash with psr feature enabled due to divide-by-zero error. This is a regression after rework to calculate static screen frame number entry time. [How] Correct order of operations to avoid divide-by-zero. Signed-off-by: Roman Li Reviewed-by: Zhan Liu Acked-by:

[PATCH 29/33] drm/amd/display: external monitor abm enabled in modern standby

2020-01-31 Thread Bhawanpreet Lakha
From: Jing Zhou [why] Resume from modern standby, edp stream disabled but abm keep enabled. External monitor select OTG source 0 which ABM enabled. [how] Disable abm before disable crtc when reset path mode not call core link disable stream. Signed-off-by: Jing Zhou Reviewed-by: Anthony Koo

[PATCH 10/33] drm/amd/display: Wait for clean shutdown in DMCUB reset

2020-01-31 Thread Bhawanpreet Lakha
From: Nicholas Kazlauskas [Why] The DMCUB may be currently executing commands when the reset is triggered. Before issuing a reset we should first wait for the DMCUB to finish its work. [How] Send the GPINT command for halting the firmware before reset. Get the ack for the command then wait

[PATCH 21/33] drm/amd/display: decouple global lock out of pipe control lock

2020-01-31 Thread Bhawanpreet Lakha
From: Wenjing Liu [why] hwss should not guess what type of pipe lock is needed. The caller of the lock function should know the right type of pipe lock. Decouple the setup of global lock outside of pipe control lock logic. Signed-off-by: Wenjing Liu Reviewed-by: Anthony Koo Acked-by:

[PATCH 02/33] drm/amd/display: Move USB-C workaround to after parameter variables are set

2020-01-31 Thread Bhawanpreet Lakha
From: George Shen [Why] The call to dp_enable_link_phy are using default/invalid values for clock id and link settings. [How] Move workaround code to after its parameter variables are determined. Signed-off-by: George Shen Reviewed-by: Tony Cheng Acked-by: Bhawanpreet Lakha ---

[PATCH 12/33] drm/amd/display: Fix GSL acquire

2020-01-31 Thread Bhawanpreet Lakha
From: Aric Cyr [Why] After locking refactor GSL is not acquired properly resulting in immediate flip issues. [How] Do not copy old GSL state anymore since GSL is acquired earlier now. Signed-off-by: Aric Cyr Reviewed-by: Anthony Koo Acked-by: Bhawanpreet Lakha ---

[PATCH 13/33] drm/amd/display: remove unused variable

2020-01-31 Thread Bhawanpreet Lakha
From: Aric Cyr Signed-off-by: Aric Cyr Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/dc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index e8d126890d7e..d00b72df469a

[PATCH 15/33] drm/amd/display: dc_get_vmid_use_vector() crashes when get called

2020-01-31 Thread Bhawanpreet Lakha
From: Peikang Zhang [Why] int i can go out of boundary which will cause crash [How] Fixed the maximum value of i to avoid i going out of boundary Signed-off-by: Peikang Zhang Reviewed-by: Jun Lei Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/core/dc_vm_helper.c | 2 +- 1

[PATCH 01/33] drm/amd/display: Add set psr version message

2020-01-31 Thread Bhawanpreet Lakha
From: Wyatt Wood [Why] Must know psr version during runtime. [How] Add set psr version message structures. Signed-off-by: Wyatt Wood Reviewed-by: Nicholas Kazlauskas Acked-by: Bhawanpreet Lakha --- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 6 +-

Re: Asking for Direction

2020-01-31 Thread Josh Fuhs
Thanks. I can confirm kernel 5.5rc7 improves things significantly. I'll post this to the various channels I've asked in. Josh ‐‐‐ Original Message ‐‐‐ On Friday, January 31, 2020 2:05 PM, Deucher, Alexander wrote: > [AMD Official Use Only - Internal Distribution Only] > > Please make

Re: [PATCH V5] drm: Add support for DP 1.4 Compliance edid corruption test

2020-01-31 Thread Harry Wentland
On 2020-01-31 3:24 p.m., Jerry (Fangzhi) Zuo wrote: > Unlike DP 1.2 edid corruption test, DP 1.4 requires to calculate > real CRC value of the last edid data block, and write it back. > Current edid CRC calculates routine adds the last CRC byte, > and check if non-zero. > > This behavior is not

[PATCH V5] drm: Add support for DP 1.4 Compliance edid corruption test

2020-01-31 Thread Jerry (Fangzhi) Zuo
Unlike DP 1.2 edid corruption test, DP 1.4 requires to calculate real CRC value of the last edid data block, and write it back. Current edid CRC calculates routine adds the last CRC byte, and check if non-zero. This behavior is not accurate; actually, we need to return the actual CRC value when

Re: [PATCH v2] drm/amdkfd: Add queue information to sysfs

2020-01-31 Thread Felix Kuehling
On 2020-01-31 1:47 p.m., Lin, Amber wrote: [AMD Official Use Only - Internal Distribution Only] It doesn't apply to this one because 1. It only has one set of attribute (dma32 or highmem) using the kobj_type, so it can set the default_attrs. In my case, I have multiple queues/QIDs that share

Re: Asking for Direction

2020-01-31 Thread Deucher, Alexander
[AMD Official Use Only - Internal Distribution Only] Please make sure your kernel has this patch: commit 46203a508f64b4bfa150a9d25eab1dc891e7e650 Author: Alex Deucher Date: Tue Oct 29 17:14:15 2019 -0400 drm/amdgpu/gmc10: properly set BANK_SELECT and FRAGMENT_SIZE These were not

RE: [PATCH v2] drm/amdkfd: Add queue information to sysfs

2020-01-31 Thread Lin, Amber
[AMD Official Use Only - Internal Distribution Only] It doesn't apply to this one because 1. It only has one set of attribute (dma32 or highmem) using the kobj_type, so it can set the default_attrs. In my case, I have multiple queues/QIDs that share the same kobj_type while each of them has

Asking for Direction

2020-01-31 Thread Josh Fuhs
Hi all, I am trying to use a Radeon RX 5700XT via OpenCL with kernel 5.3.0 (I have also tried kernel 5.3.18) on Ubuntu 18.04. I have noticed that this combination is much slower than expected. I'm trying to find out why, and how to fix it. If I'm in the wrong place to ask, would you be able to

Re: [PATCH v2] drm/amdkfd: Add queue information to sysfs

2020-01-31 Thread Felix Kuehling
You could save yourself the trouble of manually adding and removed individual sysfs files by setting the default_attrs in the kobj_type. See ttm_memory.c for an example how this is done. More comments inline. On 2020-01-31 8:45 a.m., Amber Lin wrote: Provide compute queues information in

RE: [PATCH] drm/amd/display: Fix a typo when computing dsc configuration

2020-01-31 Thread Liu, Zhan
> -Original Message- > From: amd-gfx On Behalf Of > mikita.lip...@amd.com > Sent: 2020/January/31, Friday 10:00 AM > To: amd-gfx@lists.freedesktop.org > Cc: Deucher, Alexander ; Lipski, Mikita > ; Wentland, Harry > Subject: [PATCH] drm/amd/display: Fix a typo when computing dsc >

[PATCH] drm/amd/display: Fix a typo when computing dsc configuration

2020-01-31 Thread mikita.lipski
From: Mikita Lipski [why] Remove a backslash symbol accidentally left in increase bpp function when computing mst dsc configuration. Signed-off-by: Mikita Lipski --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2] drm/amdkfd: Add queue information to sysfs

2020-01-31 Thread Amber Lin
Provide compute queues information in sysfs under /sys/class/kfd/kfd/proc. The format is /sys/class/kfd/kfd/proc//queues//XX where XX are size, type, and gpuid three files to represent queue size, queue type, and the GPU this queue uses. folder and files underneath are generated when a queue is

Re: [PATCH 1/5] drm/amdgpu: fix braces in amdgpu_vm_update_ptes

2020-01-31 Thread Christian König
Am 30.01.20 um 23:11 schrieb Felix Kuehling: On 2020-01-30 7:49, Christian König wrote: For the root PD mask can be 0x as well which would overrun to 0 if we don't cast it before we add one. You're fixing parentheses, not braces. Parentheses: () Brackets: [] Braces: {} Yeah, I

[PATCH] drm/amd/display: Possible divide by zero in set_speed()

2020-01-31 Thread Dan Carpenter
If "speed" is zero then we use it as a divisor to find "prescale". It's better to move the check for zero to the very start of the function. Fixes: 9eeec26a1339 ("drm/amd/display: Refine i2c frequency calculating sequence") Signed-off-by: Dan Carpenter ---

Re: Suspecting corrupted VBIOS after update of AMDGPU on AMD7870

2020-01-31 Thread Jacob Hrbek
*Hello Zhan,* Here is it: https://gist.githubusercontent.com/Kreyren/e35587d8710e63e511e69d8653fd996b/raw/628df1c76ff99adab1d2161e6a20f631de101d5c/gistfile1.txt Note that I'm updating previous gists with new findings ( https://gist.github.com/Kreyren/3e55e9a754e58956e1690e38b1888de7). If

Re: Suspecting corrupted VBIOS after update of AMDGPU on AMD7870

2020-01-31 Thread Jacob Hrbek
I'm sorry for the wrong link, this one should work https://gist.github.com/Kreyren/3e55e9a754e58956e1690e38b1888de7 I've manually compiled kernel-5.5 which results in this dmesg -