Re: [PATCH] drm/amdgpu: Fix double free of dmabuf

2021-11-19 Thread Felix Kuehling
On 2021-11-19 5:17 a.m., xinhui pan wrote: amdgpu_amdkfd_gpuvm_free_memory_of_gpu drop dmabuf reference increased in amdgpu_gem_prime_export. amdgpu_bo_destroy drop dmabuf reference increased in amdgpu_gem_prime_import. OK. This was not obvious at all. The get_dma_buf in

Re: [PATCH v2] drm/amdkfd: handle IH ring1 overflow

2021-11-19 Thread Felix Kuehling
On 2021-11-19 3:22 p.m., Philip Yang wrote: IH ring1 is used to process GPU retry fault, overflow is enabled to drain retry fault because we want receive other interrupts while handling retry fault to recover range. There is no overflow flag set when wptr pass rptr. Use timestamp of rptr and

Re: [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-11-19 Thread jim . cromie
On Fri, Nov 19, 2021 at 9:21 AM Jason Baron wrote: > > > > On 11/18/21 10:24 AM, Pekka Paalanen wrote: > > On Thu, 18 Nov 2021 09:29:27 -0500 > > Jason Baron wrote: > > > >> On 11/16/21 3:46 AM, Pekka Paalanen wrote: > >>> On Fri, 12 Nov 2021 10:08:41 -0500 > >>> Jason Baron wrote: > >>> >

[PATCH v2 1/3] drm/amdkfd: process exit and retry fault race

2021-11-19 Thread Philip Yang
kfd_process_wq_release drain retry fault to ensure no retry fault comes after removing kfd process from the hash table, otherwise svm page fault handler will fail to recover the fault and dump GPU vm fault log. Refactor deferred list work to get_task_mm and take mmap write lock to handle all

[PATCH v2 3/3] drm/amdkfd: simplify drain retry fault

2021-11-19 Thread Philip Yang
unmap range always increase atomic svms->drain_pagefaults to simplify both parent range and child range unmap, page fault handle ignores the retry fault if svms->drain_pagefaults is set to speed up interrupt handling. svm_range_drain_retry_fault restart draining if another range unmap from cpu.

[PATCH v2 2/3] drm/amdkfd: handle VMA remove race

2021-11-19 Thread Philip Yang
VMA may be removed before unmap notifier callback, and deferred list work remove range, return success for this special case as we are handling stale retry fault. Signed-off-by: Philip Yang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 22 +- 1 file changed, 13 insertions(+), 9

Re: [PATCH v2 4/4] drm/amdkfd: remove hardcoded device_info structs

2021-11-19 Thread Felix Kuehling
On 2021-11-19 2:52 p.m., Graham Sider wrote: With device_info initialization being handled in kfd_device_info_init, these structs may be removed. Also add comments to help matching IP versions to asic names. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling ---

Re: [PATCH v2 3/4] drm/amdkfd: move to dynamic device_info creation

2021-11-19 Thread Felix Kuehling
On 2021-11-19 2:52 p.m., Graham Sider wrote: Change unsupported asic condition to only probe f2g, move device_info initialization post-switch and map to heap. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 183 ++--

Re: [PATCH v2 2/4] drm/amdkfd: add kfd_device_info_init function

2021-11-19 Thread Felix Kuehling
On 2021-11-19 2:52 p.m., Graham Sider wrote: Initializes device_info structs given either asic_type (enum) if GFX version is less than GFX9, or GC IP version if greater. Also takes in vf and the target compiler gfx version. Inclusion/exclusion to certain conditions for certain GC IP versions

Re: [PATCH v2 1/4] drm/amdkfd: replace asic_name with amdgpu_asic_name

2021-11-19 Thread Felix Kuehling
On 2021-11-19 2:52 p.m., Graham Sider wrote: device_info->asic_name and amdgpu_asic_name[adev->asic_type] both provide asic name strings, with the only difference being casing. That could still break compatibility since this name gets exposed to user mode. You could convert the name in

[PATCH v2] drm/amdkfd: handle IH ring1 overflow

2021-11-19 Thread Philip Yang
IH ring1 is used to process GPU retry fault, overflow is enabled to drain retry fault because we want receive other interrupts while handling retry fault to recover range. There is no overflow flag set when wptr pass rptr. Use timestamp of rptr and wptr to handle overflow and drain retry fault.

[PATCH v2 4/4] drm/amdkfd: remove hardcoded device_info structs

2021-11-19 Thread Graham Sider
With device_info initialization being handled in kfd_device_info_init, these structs may be removed. Also add comments to help matching IP versions to asic names. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 469 +--- 1 file changed, 17

[PATCH v2 2/4] drm/amdkfd: add kfd_device_info_init function

2021-11-19 Thread Graham Sider
Initializes device_info structs given either asic_type (enum) if GFX version is less than GFX9, or GC IP version if greater. Also takes in vf and the target compiler gfx version. Inclusion/exclusion to certain conditions for certain GC IP versions may be necessary on npi bringup on a case-by-case

[PATCH v2 3/4] drm/amdkfd: move to dynamic device_info creation

2021-11-19 Thread Graham Sider
Change unsupported asic condition to only probe f2g, move device_info initialization post-switch and map to heap. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 183 ++-- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 2 files changed, 79

[PATCH v2 1/4] drm/amdkfd: replace asic_name with amdgpu_asic_name

2021-11-19 Thread Graham Sider
device_info->asic_name and amdgpu_asic_name[adev->asic_type] both provide asic name strings, with the only difference being casing. Propose to remove asic_name from device_info and replace sysfs entry with amdgpu_asic_name[]. Signed-off-by: Graham Sider ---

[PATCH 15/16] drm/amd/display: [FW Promotion] Release 0.0.94

2021-11-19 Thread Qingqing Zhuo
From: Anthony Koo [Why & How] - Remove tick count definition since it can be different per HW revision Acked-by: Qingqing Zhuo Signed-off-by: Anthony Koo --- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git

[PATCH 16/16] drm/amd/display: 3.2.163

2021-11-19 Thread Qingqing Zhuo
From: Aric Cyr This version brings along the following: - FW promotion to 0.0.94 - Enable seamless boot for DCN301 - Improvements in bandwidth validation - Fixes in flags update, link encoder assignments, DSC, ODM combine and more Acked-by: Qingqing Zhuo Signed-off-by: Aric Cyr ---

[PATCH 14/16] drm/amd/display: add else to avoid double destroy clk_mgr

2021-11-19 Thread Qingqing Zhuo
From: Martin Leung [Why & How] when changing some code we accidentally changed else if-> if. reverting that. Reviewed-by: Aric Cyr Acked-by: Qingqing Zhuo Signed-off-by: Martin Leung --- drivers/gpu/drm/amd/display/dc/clk_mgr/clk_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

[PATCH 13/16] drm/amd/display: Fix ODM combine issue with fast boot

2021-11-19 Thread Qingqing Zhuo
From: sungwang [Why] When systme power up and eDP lit up by VBIOS, in the core_link_enable_stream(), the function will early return due to apply apply_edp_fast_boot_optimization, resulting the DP_PIXEL_COMBINE cannot get set in enc3_dp_set_odm_combine. [How] Check ODM PIPE to avoid early

[PATCH 12/16] drm/amd/display: Fixed DSC would not PG after removing DSC stream

2021-11-19 Thread Qingqing Zhuo
From: Yi-Ling Chen [WHY] Due to pass the wrong parameter down to the enable_stream_gating(), it would cause the DSC of the removing stream would not be PG. [HOW] To pass the correct parameter down th the enable_stream_gating(). Reviewed-by: Anthony Koo Acked-by: Qingqing Zhuo Signed-off-by:

[PATCH 11/16] drm/amd/display: Display object info table changes

2021-11-19 Thread Qingqing Zhuo
From: Nevenko Stupar [Why] display_object_info_table_v1_5 with atom_display_object_path_v3 will be used. [How] Add bios parser support for display_object_info_table_v1_5 with atom_display_object_path_v3 for all existing, in use bios records as well as for new records:

[PATCH 10/16] drm/amd/display: fix accidental casting enum to bool

2021-11-19 Thread Qingqing Zhuo
From: Mikita Lipski [why/how] Fixing -Wint-in-bool-context Clang Build Failure Reviewed-by: Nicholas Choi Acked-by: Qingqing Zhuo Signed-off-by: Mikita Lipski --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 09/16] drm/amd/display: retain/release at proper places in link_enc assignment

2021-11-19 Thread Qingqing Zhuo
From: Sung Joon Kim [why] Need to keep track of number of references to stream pointer. [how] Call stream retain/release whenever necessary in link_enc table assignment sequence. Reviewed-by: Aric Cyr Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim ---

[PATCH 08/16] drm/amd/display: Rename dcn_validate_bandwidth to dcn10_validate_bandwidth

2021-11-19 Thread Qingqing Zhuo
From: Zhan Liu [Why] Rename function name so it aligns with other resource function names being used by dcn10. [How] Rename function name for consistency. Reviewed-by: Ahmad Othman Acked-by: Qingqing Zhuo Signed-off-by: Zhan Liu --- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c

[PATCH 07/16] drm/amd/display: Reset link encoder assignments for GPU reset

2021-11-19 Thread Qingqing Zhuo
From: Nicholas Kazlauskas [Why] A warning appears in the log on GPU reset for link_enc_cfg_link_encs_assign for the following condition: ASSERT(state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].valid == false); This is not expected behavior and may result in link encoders being

[PATCH 06/16] drm/amd/display: fixed an error related to 4:2:0/4:2:2 DSC

2021-11-19 Thread Qingqing Zhuo
From: "Guo, Bing" [Why] OPTC_BYTES_PER_PIXEL calculation for 4:2:2 and 4:2:0 could have error. [How] Change to use following formula: OPTC_DSC_BYTES_PER_PIXEL = ceiling((chunk size * 2^28) / slice width) Reviewed-by: Wenjing Liu Acked-by: Qingqing Zhuo Signed-off-by: Bing Guo ---

[PATCH 05/16] drm/amd/display: Set plane update flags for all planes in reset

2021-11-19 Thread Qingqing Zhuo
From: Nicholas Kazlauskas [Why] We're only setting the flags on stream[0]'s planes so this logic fails if we have more than one stream in the state. This can cause a page flip timeout with multiple displays in the configuration. [How] Index into the stream_status array using the stream index -

[PATCH 04/16] drm/amd/display: enable seamless boot for DCN301

2021-11-19 Thread Qingqing Zhuo
From: Zhan Liu [Why] DCN301 is capable of running seamless boot if keep_stolen_vga_memory is not set. [How] Add a helper to check whether an ASIC can support seamless boot and set it based on base driver flags. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Zhan Liu ---

[PATCH 01/16] drm/amd/display: Fix DPIA outbox timeout after GPU reset

2021-11-19 Thread Qingqing Zhuo
From: Nicholas Kazlauskas [Why] The HW interrupt gets disabled after GPU reset so we don't receive notifications for HPD or AUX from DMUB - leading to timeout and black screen with (or without) DPIA links connected. [How] Re-enable the interrupt after GPU reset like we do for the other DC

[PATCH 03/16] drm/amd/display: Run full global validation in dc_commit_state

2021-11-19 Thread Qingqing Zhuo
From: Nicholas Kazlauskas [Why] Dynamic link encoder assignment expects that it can modify DC current_state and the links associated with the incoming state when performing full validation. This does not align with our actual synchronization constraints in DM's atomic_check. [How] Since link

[PATCH 02/16] drm/amd/display: based on flag reset z10 function pointer

2021-11-19 Thread Qingqing Zhuo
From: Charlene Liu [Why & How] Per hardware requirements, add a flag to control z10 enable/disable. Reviewed-by: Sung joon Kim Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu --- drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 5 + 1 file changed, 5 insertions(+) diff --git

[PATCH 00/16] DC Patches November 22nd, 2021

2021-11-19 Thread Qingqing Zhuo
This DC patchset brings improvements in multiple areas. In summary, we highlight: - DC 3.2.163 - FW promotion to 0.0.94 - Enable seamless boot for DCN301 - Improvements in bandwidth validation - Fixes in flags update, link encoder assignments, DSC, ODM combine and more Thank you, Lillian ---

RE: [PATCH 2/4] drm/amdkfd: add kfd_device_info_init function

2021-11-19 Thread Sider, Graham
[AMD Official Use Only] > -Original Message- > From: Alex Deucher > Sent: Friday, November 19, 2021 1:55 PM > To: Sider, Graham > Cc: amd-gfx list ; Kuehling, Felix > > Subject: Re: [PATCH 2/4] drm/amdkfd: add kfd_device_info_init function > > On Fri, Nov 19, 2021 at 11:28 AM Graham

Re: [PATCH 2/4] drm/amdkfd: add kfd_device_info_init function

2021-11-19 Thread Alex Deucher
On Fri, Nov 19, 2021 at 11:28 AM Graham Sider wrote: > > Initializes device_info structs given either asic_type (enum) if GFX > version is less than GFX9, or GC IP version if greater. Also takes in vf > and the target compiler gfx version. > > Inclusion/exclusion to certain conditions for certain

Re: [PATCH 4/4] drm/amdkfd: remove hardcoded device_info structs

2021-11-19 Thread Alex Deucher
Please use C comments (/* */) rather than C++ comments. Same for the previous patches in the series. Alex On Fri, Nov 19, 2021 at 11:28 AM Graham Sider wrote: > > With device_info initialization being handled in kfd_device_info_init, > these structs may be removed. Also add comments to help

Re: [PATCH v10 08/10] dyndbg: add print-to-tracefs, selftest with it - RFC

2021-11-19 Thread Jason Baron
On 11/18/21 10:24 AM, Pekka Paalanen wrote: > On Thu, 18 Nov 2021 09:29:27 -0500 > Jason Baron wrote: > >> On 11/16/21 3:46 AM, Pekka Paalanen wrote: >>> On Fri, 12 Nov 2021 10:08:41 -0500 >>> Jason Baron wrote: >>> On 11/12/21 6:49 AM, Vincent Whitchurch wrote: > On Thu, Nov

[PATCH 3/4] drm/amdkfd: move to dynamic device_info creation

2021-11-19 Thread Graham Sider
Change unsupported asic condition to only probe f2g, move device_info initialization post-switch and map to heap. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 190 ++-- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 2 +- 2 files changed, 83

[PATCH 4/4] drm/amdkfd: remove hardcoded device_info structs

2021-11-19 Thread Graham Sider
With device_info initialization being handled in kfd_device_info_init, these structs may be removed. Also add comments to help matching IP versions to asic names. Signed-off-by: Graham Sider --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 469 +--- 1 file changed, 17

[PATCH 1/4] drm/amdkfd: replace asic_name with amdgpu_asic_name

2021-11-19 Thread Graham Sider
device_info->asic_name and amdgpu_asic_name[adev->asic_type] both provide asic name strings, with the only difference being casing. Propose to remove asic_name from device_info and replace sysfs entry with amdgpu_asic_name[]. Signed-off-by: Graham Sider ---

[PATCH 2/4] drm/amdkfd: add kfd_device_info_init function

2021-11-19 Thread Graham Sider
Initializes device_info structs given either asic_type (enum) if GFX version is less than GFX9, or GC IP version if greater. Also takes in vf and the target compiler gfx version. Inclusion/exclusion to certain conditions for certain GC IP versions may be necessary on npi bringup on a case-by-case

Re: [PATCH] drm/amdgpu: Fix double free of dmabuf

2021-11-19 Thread Felix Kuehling
I'm pretty sure I needed this dma_buf_put to avoid a memory leak. I will double check later today. Regards,   Felix Am 2021-11-19 um 5:52 a.m. schrieb Christian König: > Am 19.11.21 um 11:17 schrieb xinhui pan: >> amdgpu_amdkfd_gpuvm_free_memory_of_gpu drop dmabuf reference >> increased in >>

Re: [RFC 0/3] Add Smart Trace Buffers support

2021-11-19 Thread Alex Deucher
Series is: Acked-by: Alex Deucher On Fri, Nov 19, 2021 at 10:39 AM Andrey Grodzovsky wrote: > > Ping - mostly just to get final ack to push it into amd-stagin-drm-next > > Andrey > > On 2021-11-18 1:18 p.m., Andrey Grodzovsky wrote: > > The Smart Trace Buffer (STB), is a cyclic data buffer used

Re: [RFC 0/3] Add Smart Trace Buffers support

2021-11-19 Thread Andrey Grodzovsky
Ping - mostly just to get final ack to push it into amd-stagin-drm-next Andrey On 2021-11-18 1:18 p.m., Andrey Grodzovsky wrote: The Smart Trace Buffer (STB), is a cyclic data buffer used to log information about system execution for characterization and debug purposes. If at any point should

Re: [PATCH] drm/amdgpu: Fix double free of dmabuf

2021-11-19 Thread Christian König
Am 19.11.21 um 11:17 schrieb xinhui pan: amdgpu_amdkfd_gpuvm_free_memory_of_gpu drop dmabuf reference increased in amdgpu_gem_prime_export. amdgpu_bo_destroy drop dmabuf reference increased in amdgpu_gem_prime_import. So remove this extra dma_buf_put to avoid double free. Signed-off-by: xinhui

[PATCH] drm/amdgpu: Fix double free of dmabuf

2021-11-19 Thread xinhui pan
amdgpu_amdkfd_gpuvm_free_memory_of_gpu drop dmabuf reference increased in amdgpu_gem_prime_export. amdgpu_bo_destroy drop dmabuf reference increased in amdgpu_gem_prime_import. So remove this extra dma_buf_put to avoid double free. Signed-off-by: xinhui pan ---

Re: [radeon] connector_info_from_object_table

2021-11-19 Thread Amol
On 19/11/2021, Alex Deucher wrote: > On Thu, Nov 18, 2021 at 11:37 AM Amol wrote: >> >> Hello, >> >> The function radeon_get_atom_connector_info_from_object_table, >> at location [1], ends up parsing ATOM_COMMON_TABLE_HEADER >> as ATOM_COMMON_RECORD_HEADER if >>

[PATCH] drm/radeon: more sanity checks (usRecordOffset) to obj info record parsing

2021-11-19 Thread Amol Surati
When parsing Encoder, Connector, or Router records, if the usRecordOffset field is 0, the driver ends up dereferencing ATOM_COMMON_TABLE_HEADER of the Object Table as ATOM_COMMON_RECORD_HEADER. A BIOS, which triggers such dereferences when parsing the Encoder records, is found on Cedar Radeon HD

[PATCH v1] drm/amd/display: add connector type check for CRC source set

2021-11-19 Thread Perry Yuan
[Why] IGT bypass test will set crc source as DPRX,and display DM didn`t check connection type, it run the test on the HDMI connector ,then the kernel will be crashed because aux->transfer is set null for HDMI connection. This patch will skip the invalid connection test and fix kernel crash

Re: [PATCH RFC 4/4] bpf,cgroup,perf: extend bpf-cgroup to support tracepoint attachment

2021-11-19 Thread Alexei Starovoitov
On Thu, Nov 18, 2021 at 03:28:40PM -0500, Kenny Ho wrote: > @@ -245,6 +256,21 @@ static int compute_effective_progs(struct cgroup *cgrp, > if (!progs) > return -ENOMEM; > > + if (atype == CGROUP_TRACEPOINT) { > + /* TODO: only create event for cgroup that can