RE: [PATCH] BACKPORT: drm/amdgpu/disply: set num_crtc earlier

2022-05-31 Thread Lin, Tsung-hua (Ryan)
[AMD Official Use Only - General] Hi Greg, Thanks for your advice. I have modified the commit and submitted it to Gerrit and it's under code review now. Many thanks, Ryan Lin. -Original Message- From: Greg KH Sent: Monday, May 30, 2022 9:05 PM To: Lin, Tsung-hua (Ryan) Cc: Li, Leon

RE: [PATCH] drm/amdgpu: convert nbio_v2_3_clear_doorbell_interrupt() to IP version

2022-05-31 Thread Chen, Guchun
Reviewed-by: Guchun Chen Regards, Guchun -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Wednesday, June 1, 2022 5:14 AM To: Deucher, Alexander Cc: amd-gfx list Subject: Re: [PATCH] drm/amdgpu: convert nbio_v2_3_clear_doorbell_interrupt() to IP version Ping? On

RE: [PATCH] drm/amdgpu: simplify the logic in amdgpu_device_parse_gpu_info_fw()

2022-05-31 Thread Chen, Guchun
Reviewed-by: Guchun Chen Regards, Guchun -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Wednesday, June 1, 2022 5:13 AM To: Deucher, Alexander Cc: amd-gfx list Subject: Re: [PATCH] drm/amdgpu: simplify the logic in amdgpu_device_parse_gpu_info_fw() Ping? On Tue,

RE: [PATCH] drm/amdgpu: convert sienna_cichlid_populate_umd_state_clk() to use IP version

2022-05-31 Thread Chen, Guchun
Reviewed-by: Guchun Chen Regards, Guchun -Original Message- From: amd-gfx On Behalf Of Alex Deucher Sent: Wednesday, June 1, 2022 5:13 AM To: Deucher, Alexander Cc: amd-gfx list Subject: Re: [PATCH] drm/amdgpu: convert sienna_cichlid_populate_umd_state_clk() to use IP version Ping?

[PATCH v2] drm/amdkfd: add pinned BOs to kfd_bo_list

2022-05-31 Thread Lang Yu
The kfd_bo_list is used to restore process BOs after evictions. As page tables could be destroyed during evictions, we should also update pinned BOs' page tables during restoring to make sure they are valid. So for pinned BOs, 1, Validating them and update their page tables. 2, Don't add eviction

gcc 12.1.1 warnings around display writeback

2022-05-31 Thread Dave Airlie
I recently finally got my build box updated to a modern gcc, and I started seeing /home/airlied/devel/kernel/dim/src/drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ‘dc_stream_remove_writeback’:

Re: [PATCH 2/3] drm/amdgpu/swsmu: add SMU mailbox registers in SMU context

2022-05-31 Thread Wang, Yang(Kevin)
[AMD Official Use Only - General] Series is Reviewed-by: Yang Wang Best Regards, Kevin From: amd-gfx on behalf of Alex Deucher Sent: Friday, May 27, 2022 2:00 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander Subject: [PATCH 2/3] drm/amdgpu/swsmu:

[PATCH] drm/amdkfd: Add GC 10.3.6 and 10.3.7 KFD definitions

2022-05-31 Thread Mario Limonciello
Loading amdgpu on GC 10.3.7 shows an ERR level message: `kfd kfd: amdgpu: GC IP 0a0307 not supported in kfd` Add these targets to match yellow carp structures. Reported-by: David Chang Reviewed-by: Felix Kuehling Tested-by: Jesse(Jie) Zhang Signed-off-by: Mario Limonciello ---

Re: Per file OOM badness

2022-05-31 Thread Alex Deucher
+ dri-devel On Tue, May 31, 2022 at 6:00 AM Christian König wrote: > > Hello everyone, > > To summarize the issue I'm trying to address here: Processes can allocate > resources through a file descriptor without being held responsible for it. > > Especially for the DRM graphics driver subsystem

Re: [PATCH] drm/amdgpu: make gfx_v11_0_rlc_stop static

2022-05-31 Thread Alex Deucher
Applied. Thanks! Alex On Sun, May 29, 2022 at 7:50 AM sunliming wrote: > > This symbol is not used outside of gfx_v11_0.c, so marks it static. > > Fixes the following w1 warning: > > drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1945:6: warning: no previous > prototype for function

Re: [PATCH] drm/amdgpu: fix a missing break in gfx_v11_0_handle_priv_fault

2022-05-31 Thread Alex Deucher
Applied. Thanks! On Sun, May 29, 2022 at 7:50 AM sunliming wrote: > > Fixes the following w1 warning: > > drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:5873:2: warning: unannotated > fall-through between switch labels [-Wimplicit-fallthrough]. > > Reported-by: kernel test robot > Signed-off-by:

Re: [PATCH 3/3] drm/amdgpu/swsmu: use new register offsets for smu_cmn.c

2022-05-31 Thread Alex Deucher
Ping? On Thu, May 26, 2022 at 2:01 PM Alex Deucher wrote: > > Use the per asic offsets so the we don't have to have > asic specific logic in the common code. > > Signed-off-by: Alex Deucher > --- > drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 77 +++--- > 1 file changed, 7

Re: [PATCH 2/3] drm/amdgpu/swsmu: add SMU mailbox registers in SMU context

2022-05-31 Thread Alex Deucher
Ping? On Thu, May 26, 2022 at 2:00 PM Alex Deucher wrote: > > So we can eventaully use them in the common smu code for > accessing the SMU mailboxes without needing a lot of > per asic logic in the common code. > > Signed-off-by: Alex Deucher > --- >

Re: [PATCH] drm/amdgpu/soc21: add mode2 asic reset for SMU IP v13.0.4

2022-05-31 Thread Alex Deucher
Ping? On Thu, May 26, 2022 at 1:58 PM Alex Deucher wrote: > > Set the default reset method to mode2 for SMU IP v13.0.4 > > Signed-off-by: Tim Huang > Signed-off-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/soc21.c | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git

Re: [PATCH 2/2] drm/amdgpu/gmc11: enable AGP aperture

2022-05-31 Thread Alex Deucher
Ping? On Thu, May 26, 2022 at 1:58 PM Alex Deucher wrote: > > Enable the AGP aperture on chips with GMC v11. > > Signed-off-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c | 7 --- > drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c| 1 + >

Re: [PATCH] drm/amdgpu: fix up comment in amdgpu_device_asic_has_dc_support()

2022-05-31 Thread Alex Deucher
Ping? On Tue, May 24, 2022 at 10:09 PM Alex Deucher wrote: > > LVDS support was implemented in DC a while ago. Just DAC > support is left to do. > > Signed-off-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff

Re: [PATCH] drm/amdgpu: convert nbio_v2_3_clear_doorbell_interrupt() to IP version

2022-05-31 Thread Alex Deucher
Ping? On Tue, May 24, 2022 at 10:09 PM Alex Deucher wrote: > > Check IP version rather than asic type. > > Signed-off-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c

Re: [PATCH] drm/amdgpu: simplify the logic in amdgpu_device_parse_gpu_info_fw()

2022-05-31 Thread Alex Deucher
Ping? On Tue, May 24, 2022 at 10:09 PM Alex Deucher wrote: > > Drop all of the extra cases in the default case. > > Signed-off-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 29 -- > 1 file changed, 29 deletions(-) > > diff --git

Re: [PATCH] drm/amdgpu: convert sienna_cichlid_populate_umd_state_clk() to use IP version

2022-05-31 Thread Alex Deucher
Ping? On Tue, May 24, 2022 at 10:09 PM Alex Deucher wrote: > > Rather than asic type. > > Signed-off-by: Alex Deucher > --- > .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c| 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git

[PATCH v5 12/13] tools: add hmm gup tests for device coherent type

2022-05-31 Thread Alex Sierra
The intention is to test hmm device coherent type under different get user pages paths. Also, test gup with FOLL_LONGTERM flag set in device coherent pages. These pages should get migrated back to system memory. Signed-off-by: Alex Sierra Reviewed-by: Alistair Popple ---

[PATCH v5 13/13] tools: add selftests to hmm for COW in device memory

2022-05-31 Thread Alex Sierra
The objective is to test device migration mechanism in pages marked as COW, for private and coherent device type. In case of writing to COW private page(s), a page fault will migrate pages back to system memory first. Then, these pages will be duplicated. In case of COW device coherent type, pages

[PATCH v5 11/13] tools: update test_hmm script to support SP config

2022-05-31 Thread Alex Sierra
Add two more parameters to set spm_addr_dev0 & spm_addr_dev1 addresses. These two parameters configure the start SP addresses for each device in test_hmm driver. Consequently, this configures zone device type as coherent. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair

[PATCH v5 10/13] tools: update hmm-test to support device coherent type

2022-05-31 Thread Alex Sierra
Test cases such as migrate_fault and migrate_multiple, were modified to explicit migrate from device to sys memory without the need of page faults, when using device coherent type. Snapshot test case updated to read memory device type first and based on that, get the proper returned results

[PATCH v5 09/13] lib: add support for device coherent type in test_hmm

2022-05-31 Thread Alex Sierra
Device Coherent type uses device memory that is coherently accesible by the CPU. This could be shown as SP (special purpose) memory range at the BIOS-e820 memory enumeration. If no SP memory is supported in system, this could be faked by setting CONFIG_EFI_FAKE_MEMMAP. Currently, test_hmm only

[PATCH v5 03/13] mm: add device coherent vma selection for memory migration

2022-05-31 Thread Alex Sierra
This case is used to migrate pages from device memory, back to system memory. Device coherent type memory is cache coherent from device and CPU point of view. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair Poppple Signed-off-by: Christoph Hellwig ---

[PATCH v5 06/13] drm/amdkfd: add SPM support for SVM

2022-05-31 Thread Alex Sierra
When CPU is connected throug XGMI, it has coherent access to VRAM resource. In this case that resource is taken from a table in the device gmc aperture base. This resource is used along with the device type, which could be DEVICE_PRIVATE or DEVICE_COHERENT to create the device page map region.

[PATCH v5 07/13] lib: test_hmm add ioctl to get zone device type

2022-05-31 Thread Alex Sierra
new ioctl cmd added to query zone device type. This will be used once the test_hmm adds zone device coherent type. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair Poppple Signed-off-by: Christoph Hellwig --- lib/test_hmm.c | 11 +-- lib/test_hmm_uapi.h

[PATCH v5 04/13] mm: remove the vma check in migrate_vma_setup()

2022-05-31 Thread Alex Sierra
From: Alistair Popple migrate_vma_setup() checks that a valid vma is passed so that the page tables can be walked to find the pfns associated with a given address range. However in some cases the pfns are already known, such as when migrating device coherent pages during pin_user_pages() meaning

[PATCH v5 08/13] lib: test_hmm add module param for zone device type

2022-05-31 Thread Alex Sierra
In order to configure device coherent in test_hmm, two module parameters should be passed, which correspond to the SP start address of each device (2) spm_addr_dev0 & spm_addr_dev1. If no parameters are passed, private device type is configured. Signed-off-by: Alex Sierra Acked-by: Felix

[PATCH v5 05/13] mm/gup: migrate device coherent pages when pinning instead of failing

2022-05-31 Thread Alex Sierra
From: Alistair Popple Currently any attempts to pin a device coherent page will fail. This is because device coherent pages need to be managed by a device driver, and pinning them would prevent a driver from migrating them off the device. However this is no reason to fail pinning of these

[PATCH v5 02/13] mm: handling Non-LRU pages returned by vm_normal_pages

2022-05-31 Thread Alex Sierra
With DEVICE_COHERENT, we'll soon have vm_normal_pages() return device-managed anonymous pages that are not LRU pages. Although they behave like normal pages for purposes of mapping in CPU page, and for COW. They do not support LRU lists, NUMA migration or THP. We also introduced a FOLL_LRU flag

[PATCH v5 01/13] mm: add zone device coherent type memory support

2022-05-31 Thread Alex Sierra
Device memory that is cache coherent from device and CPU point of view. This is used on platforms that have an advanced system bus (like CAPI or CXL). Any page of a process can be migrated to such memory. However, no one should be allowed to pin such memory so that it can always be evicted.

[PATCH v5 00/13] Add MEMORY_DEVICE_COHERENT for coherent device memory mapping

2022-05-31 Thread Alex Sierra
This is our MEMORY_DEVICE_COHERENT patch series rebased and updated for current 5.18.0 Changes since the last version: - Fixed problems with migration during long-term pinning in get_user_pages - Open coded vm_normal_lru_pages as suggested in previous code review - Update hmm_gup_test with more

Re: [PATCH 0/3] Fix issues when unplung monitor under mst scenario

2022-05-31 Thread Lyude Paul
For the whole series: Acked-by: Lyude Paul This looks a lot better for sure :) On Tue, 2022-05-10 at 17:56 +0800, Wayne Lin wrote: > This patch set is trying to resolve issues observed when unplug monitors > under mst scenario. Revert few commits which cause side effects and seems > no longer

Re: [PATCH v4 07/13] lib: test_hmm add ioctl to get zone device type

2022-05-31 Thread Sierra Guiza, Alejandro (Alex)
On 5/31/2022 12:31 PM, Andrew Morton wrote: On Tue, 31 May 2022 10:56:23 -0500 Alex Sierra wrote: new ioctl cmd added to query zone device type. This will be used once the test_hmm adds zone device coherent type. @@ -1026,6 +1027,15 @@ static int dmirror_snapshot(struct dmirror *dmirror,

Re: [PATCH v4 07/13] lib: test_hmm add ioctl to get zone device type

2022-05-31 Thread Andrew Morton
On Tue, 31 May 2022 10:56:23 -0500 Alex Sierra wrote: > new ioctl cmd added to query zone device type. This will be > used once the test_hmm adds zone device coherent type. > > @@ -1026,6 +1027,15 @@ static int dmirror_snapshot(struct dmirror *dmirror, > return ret; > } > > +static int

[PATCH 3/3] drm/amdkfd: Extend KFD device topology to surface peer-to-peer links

2022-05-31 Thread Ramesh Errabolu
Extend KFD device topology to surface peer-to-peer links among GPU devices connected over PCIe or xGMI. Enabling HSA_AMD_P2P is REQUIRED to surface peer-to-peer links. Signed-off-by: Ramesh Errabolu --- drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 332 +-

[PATCH 1/3] drm/amdkfd: Define config HSA_AMD_P2P to support peer-to-peer

2022-05-31 Thread Ramesh Errabolu
Extend current kernel config requirements of amdgpu by adding config HSA_AMD_P2P. Enabling HSA_AMD_P2P is REQUIRED to support peer-to-peer communication, in both data and control planes, among AMD GPU devices that are connected via PCIe and have large BAR vBIOS Signed-off-by: Ramesh Errabolu ---

[PATCH 2/3] drm/amdgpu: Add peer-to-peer support among PCIe connected AMD GPUs

2022-05-31 Thread Ramesh Errabolu
Add support for peer-to-peer communication, in both data and control planes, among AMD GPUs that are connected PCIe and have large BAR vBIOS. Support REQUIRES enablement of config HSA_AMD_P2P. Signed-off-by: Ramesh Errabolu --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 1 +

[PATCH v4 13/13] tools: add selftests to hmm for COW in device memory

2022-05-31 Thread Alex Sierra
The objective is to test device migration mechanism in pages marked as COW, for private and coherent device type. In case of writing to COW private page(s), a page fault will migrate pages back to system memory first. Then, these pages will be duplicated. In case of COW device coherent type, pages

[PATCH v4 11/13] tools: update test_hmm script to support SP config

2022-05-31 Thread Alex Sierra
Add two more parameters to set spm_addr_dev0 & spm_addr_dev1 addresses. These two parameters configure the start SP addresses for each device in test_hmm driver. Consequently, this configures zone device type as coherent. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair

[PATCH v4 12/13] tools: add hmm gup tests for device coherent type

2022-05-31 Thread Alex Sierra
The intention is to test hmm device coherent type under different get user pages paths. Also, test gup with FOLL_LONGTERM flag set in device coherent pages. These pages should get migrated back to system memory. Signed-off-by: Alex Sierra Reviewed-by: Alistair Popple ---

[PATCH v4 08/13] lib: test_hmm add module param for zone device type

2022-05-31 Thread Alex Sierra
In order to configure device coherent in test_hmm, two module parameters should be passed, which correspond to the SP start address of each device (2) spm_addr_dev0 & spm_addr_dev1. If no parameters are passed, private device type is configured. Signed-off-by: Alex Sierra Acked-by: Felix

[PATCH v4 05/13] mm/gup: migrate device coherent pages when pinning instead of failing

2022-05-31 Thread Alex Sierra
From: Alistair Popple Currently any attempts to pin a device coherent page will fail. This is because device coherent pages need to be managed by a device driver, and pinning them would prevent a driver from migrating them off the device. However this is no reason to fail pinning of these

[PATCH v4 10/13] tools: update hmm-test to support device coherent type

2022-05-31 Thread Alex Sierra
Test cases such as migrate_fault and migrate_multiple, were modified to explicit migrate from device to sys memory without the need of page faults, when using device coherent type. Snapshot test case updated to read memory device type first and based on that, get the proper returned results

[PATCH v4 09/13] lib: add support for device coherent type in test_hmm

2022-05-31 Thread Alex Sierra
Device Coherent type uses device memory that is coherently accesible by the CPU. This could be shown as SP (special purpose) memory range at the BIOS-e820 memory enumeration. If no SP memory is supported in system, this could be faked by setting CONFIG_EFI_FAKE_MEMMAP. Currently, test_hmm only

[PATCH v4 07/13] lib: test_hmm add ioctl to get zone device type

2022-05-31 Thread Alex Sierra
new ioctl cmd added to query zone device type. This will be used once the test_hmm adds zone device coherent type. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair Poppple Signed-off-by: Christoph Hellwig --- lib/test_hmm.c | 23 +--

[PATCH v4 04/13] mm: remove the vma check in migrate_vma_setup()

2022-05-31 Thread Alex Sierra
From: Alistair Popple migrate_vma_setup() checks that a valid vma is passed so that the page tables can be walked to find the pfns associated with a given address range. However in some cases the pfns are already known, such as when migrating device coherent pages during pin_user_pages() meaning

[PATCH v4 06/13] drm/amdkfd: add SPM support for SVM

2022-05-31 Thread Alex Sierra
When CPU is connected throug XGMI, it has coherent access to VRAM resource. In this case that resource is taken from a table in the device gmc aperture base. This resource is used along with the device type, which could be DEVICE_PRIVATE or DEVICE_COHERENT to create the device page map region.

[PATCH v4 00/13] Add MEMORY_DEVICE_COHERENT for coherent device memory mapping

2022-05-31 Thread Alex Sierra
This is our MEMORY_DEVICE_COHERENT patch series rebased and updated for current 5.18.0 Changes since the last version: - Fixed problems with migration during long-term pinning in get_user_pages - Open coded vm_normal_lru_pages as suggested in previous code review - Update hmm_gup_test with more

[PATCH v4 03/13] mm: add device coherent vma selection for memory migration

2022-05-31 Thread Alex Sierra
This case is used to migrate pages from device memory, back to system memory. Device coherent type memory is cache coherent from device and CPU point of view. Signed-off-by: Alex Sierra Acked-by: Felix Kuehling Reviewed-by: Alistair Poppple Signed-off-by: Christoph Hellwig ---

[PATCH v4 01/13] mm: add zone device coherent type memory support

2022-05-31 Thread Alex Sierra
Device memory that is cache coherent from device and CPU point of view. This is used on platforms that have an advanced system bus (like CAPI or CXL). Any page of a process can be migrated to such memory. However, no one should be allowed to pin such memory so that it can always be evicted.

[PATCH v4 02/13] mm: handling Non-LRU pages returned by vm_normal_pages

2022-05-31 Thread Alex Sierra
With DEVICE_COHERENT, we'll soon have vm_normal_pages() return device-managed anonymous pages that are not LRU pages. Although they behave like normal pages for purposes of mapping in CPU page, and for COW. They do not support LRU lists, NUMA migration or THP. We also introduced a FOLL_LRU flag

Re: [PATCH] drm/amd/pm: suppress compile warnings about possible unaligned accesses

2022-05-31 Thread Alex Deucher
Reviewed-by: Alex Deucher On Mon, May 30, 2022 at 2:10 AM Evan Quan wrote: > > Suppress the following compile warnings: > >> drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v11_0_pptable.h:163:17: > warning: field smc_pptable within 'struct smu_11_0_powerplay_table' is > less aligned than

Re: [PATCH v3 7/7] drm/amdgpu: Stop any pending reset if another in progress.

2022-05-31 Thread Felix Kuehling
Am 2022-05-31 um 11:31 schrieb Felix Kuehling: Am 2022-05-25 um 15:04 schrieb Andrey Grodzovsky: We skip rest requests if another one is already in progress. Signed-off-by: Andrey Grodzovsky ---   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 27 ++   1 file changed, 27

Re: [PATCH v3 5/7] drm/amdgpu: Add work_struct for GPU reset from kfd.

2022-05-31 Thread Felix Kuehling
Am 2022-05-25 um 15:04 schrieb Andrey Grodzovsky: We need to have a work_struct to cancel this reset if another already in progress. Signed-off-by: Andrey Grodzovsky Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 15 ++-

Re: [PATCH v3 7/7] drm/amdgpu: Stop any pending reset if another in progress.

2022-05-31 Thread Felix Kuehling
Am 2022-05-25 um 15:04 schrieb Andrey Grodzovsky: We skip rest requests if another one is already in progress. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 27 ++ 1 file changed, 27 insertions(+) diff --git

Re: [PATCH] drm/amdkfd: Fix GTT BO CPU mapping

2022-05-31 Thread Felix Kuehling
Please ignore this patch. Lang's patch already handles this and also covers a corner case I missed (not adding eviction fences to pinned BOs after restore). I will update my patch later to only remove the unused parameter and add kernel-doc comments. Regards,   Felix Am 2022-05-31 um 11:14

Re: [PATCH] drm/amdkfd: add pinned BOs to kfd_bo_list

2022-05-31 Thread Felix Kuehling
Am 2022-05-31 um 04:34 schrieb Lang Yu: The kfd_bo_list is used to restore process BOs after evictions. As page tables could be destroyed during evictions, we should also update pinned BOs' page tables during restoring to make sure they are valid. So for pinned BOs, 1, Don't validate them, but

[PATCH] drm/amdkfd: Fix GTT BO CPU mapping

2022-05-31 Thread Felix Kuehling
Leave CPU-mapped BOs on the validate list to allow restoring their GPU mappings after page tables were evicted. Also removed an unused parameter and added kernel-doc comments. Signed-off-by: Felix Kuehling CC: Christian Koenig --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h| 7 ++---

Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting

2022-05-31 Thread Hans de Goede
Hi, On 5/30/22 13:34, Hsin-Yi Wang wrote: > On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: >> >> Hi, >> >> On 5/30/22 10:19, Hsin-Yi Wang wrote: >>> Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the >>> orientation. Panel calls drm_connector_set_panel_orientation() to

RE: [PATCH Review 1/1] drm/amdgpu: fix ras suppoted check

2022-05-31 Thread Zhang, Hawking
[AMD Official Use Only - General] Reviewed-by: Hawking Zhang Regards, Hawking -Original Message- From: Stanley.Yang Sent: Tuesday, May 31, 2022 19:06 To: amd-gfx@lists.freedesktop.org; Zhang, Hawking ; Zhou1, Tao Cc: Yang, Stanley Subject: [PATCH Review 1/1] drm/amdgpu: fix ras

Re: [PATCH v2 1/2] drm/amdgpu: save the reset dump register value for devcoredump

2022-05-31 Thread Christian König
I strongly recommend installing coding style setting for your favorite editor. Those should be available for pretty much every more widely used code editor. Regards, Christian. Am 31.05.22 um 15:17 schrieb Sharma, Shashank: It’s not correct even in the snapshot . The

RE: [PATCH v2 1/2] drm/amdgpu: save the reset dump register value for devcoredump

2022-05-31 Thread Sharma, Shashank
It’s not correct even in the snapshot . [cid:image001.png@01D87501.96BF5BD0] The *a*dev->reset_dump line should start just below the open brace in the line above “dumps*(*adev->reset”. Check the Linux kernel coding guidelines for extending the line below the open brace. Regards Shashank

Re: [PATCH v2 2/2] drm/amdgpu: adding device coredump support

2022-05-31 Thread Somalapuram, Amaranath
On 5/26/2022 3:56 PM, Wang, Yang(Kevin) wrote: [AMD Official Use Only - General] *From:* amd-gfx on behalf of Somalapuram Amaranath *Sent:* Thursday, May 26, 2022 5:48 PM *To:* amd-gfx@lists.freedesktop.org *Cc:*

Re: [PATCH v2 1/2] drm/amdgpu: save the reset dump register value for devcoredump

2022-05-31 Thread Somalapuram, Amaranath
On 5/26/2022 3:24 PM, Sharma, Shashank wrote: Hey Amar, On 5/26/2022 11:48 AM, Somalapuram Amaranath wrote: Allocate memory for register value and use the same values for devcoredump. v1 -> V2: Change krealloc_array() to kmalloc_array() Signed-off-by: Somalapuram Amaranath ---  

[PATCH Review 1/1] drm/amdgpu: fix ras suppoted check

2022-05-31 Thread Stanley . Yang
Fix aldebaran ras supported check on SRIOV guest side, the previous check conditicon block all ras feature on baremetal Signed-off-by: Stanley.Yang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] drm/amdgpu: suppress the compile warning about 64 bit type

2022-05-31 Thread Michel Dänzer
On 2022-05-30 09:06, Evan Quan wrote: > Suppress the compile warning below: > drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 > gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 > bit type? > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by:

[PATCH 09/13] drm/i915: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/i915/i915_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index

[PATCH 12/13] drm/vmwgfx: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index

[PATCH 10/13] drm/nouveau: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index

[PATCH 13/13] drm/tegra: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/tegra/drm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 9464f522e257..89ea4f658815 100644 ---

[PATCH 11/13] drm/omap: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/omapdrm/omap_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index

[PATCH 05/13] drm/gem: adjust per file OOM badness on handling buffers

2022-05-31 Thread Christian König
From: Andrey Grodzovsky Large amounts of VRAM are usually not CPU accessible, so they are not mapped into the processes address space. But since the device drivers usually support swapping buffers from VRAM to system memory we can still run into an out of memory situation when userspace starts

[PATCH 06/13] drm/gma500: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/gma500/psb_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index

[PATCH 07/13] drm/amdgpu: Use drm_oom_badness for amdgpu

2022-05-31 Thread Christian König
From: Andrey Grodzovsky This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

[PATCH 08/13] drm/radeon: use drm_oom_badness

2022-05-31 Thread Christian König
This allows the OOM killer to make a better decision which process to reap. Signed-off-by: Christian König --- drivers/gpu/drm/radeon/radeon_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index

[PATCH 03/13] mm: shmem: provide oom badness for shmem files

2022-05-31 Thread Christian König
This gives the OOM killer an additional hint which processes are referencing shmem files with potentially no other accounting for them. Signed-off-by: Christian König --- mm/shmem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/mm/shmem.c b/mm/shmem.c index

[PATCH 02/13] oom: take per file badness into account

2022-05-31 Thread Christian König
From: Andrey Grodzovsky Try to make better decisions which process to kill based on per file OOM badness. For this the per file oom badness is queried from every file which supports that and divided by the number of references to that file structure. Signed-off-by: Andrey Grodzovsky ---

[PATCH 04/13] dma-buf: provide oom badness for DMA-buf files

2022-05-31 Thread Christian König
For now just return the size of the DMA-buf in pages as badness in the OOM situation. That should probably be extended to be in control of the exporter in the future. Signed-off-by: Christian König --- drivers/dma-buf/dma-buf.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 01/13] fs: add OOM badness callback to file_operatrations struct

2022-05-31 Thread Christian König
From: Andrey Grodzovsky This allows file_operation implementations to specify an additional badness for the OOM killer when they allocate memory on behalf of userspace. This badness is per file because file descriptor and therefor the reference to the allocated memory can migrate between

Per file OOM badness

2022-05-31 Thread Christian König
Hello everyone, To summarize the issue I'm trying to address here: Processes can allocate resources through a file descriptor without being held responsible for it. Especially for the DRM graphics driver subsystem this is rather problematic. Modern games tend to allocate huge amounts of system

[PATCH] drm/amdkfd: add pinned BOs to kfd_bo_list

2022-05-31 Thread Lang Yu
The kfd_bo_list is used to restore process BOs after evictions. As page tables could be destroyed during evictions, we should also update pinned BOs' page tables during restoring to make sure they are valid. So for pinned BOs, 1, Don't validate them, but update their page tables. 2, Don't add

Re: [PATCH] BACKPORT: drm/amdgpu/disply: set num_crtc earlier

2022-05-31 Thread Greg KH
On Mon, May 30, 2022 at 05:29:02PM +0800, Ryan Lin wrote: > From: Alex Deucher > > To avoid a recently added warning: > Bogus possible_crtcs: [ENCODER:65:TMDS-65] possible_crtcs=0xf (full crtc > mask=0x7) > WARNING: CPU: 3 PID: 439 at drivers/gpu/drm/drm_mode_config.c:617 >

Re: [PATCH v6 14/22] dma-buf: Introduce new locking convention

2022-05-31 Thread Dmitry Osipenko
On 5/30/22 16:41, Christian König wrote: > Hi Dmitry, > > Am 30.05.22 um 15:26 schrieb Dmitry Osipenko: >> Hello Christian, >> >> On 5/30/22 09:50, Christian König wrote: >>> Hi Dmitry, >>> >>> First of all please separate out this patch from the rest of the series, >>> since this is a complex

Re: [PATCH v6 14/22] dma-buf: Introduce new locking convention

2022-05-31 Thread Dmitry Osipenko
Hello Christian, On 5/30/22 09:50, Christian König wrote: > Hi Dmitry, > > First of all please separate out this patch from the rest of the series, > since this is a complex separate structural change. I assume all the patches will go via the DRM tree in the end since the rest of the DRM

Re: [PATCH v10 1/4] gpu: drm: separate panel orientation property creating and value setting

2022-05-31 Thread Hans de Goede
Hi, On 5/30/22 10:57, Hans de Goede wrote: > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: >> drm_dev_register() sets connector->registration_state to >> DRM_CONNECTOR_REGISTERED and dev->registered to true. If >> drm_connector_set_panel_orientation() is first called after >> drm_dev_register(),

Re: [PATCH v10 1/4] gpu: drm: separate panel orientation property creating and value setting

2022-05-31 Thread Hans de Goede
Hi, On 5/30/22 10:19, Hsin-Yi Wang wrote: > drm_dev_register() sets connector->registration_state to > DRM_CONNECTOR_REGISTERED and dev->registered to true. If > drm_connector_set_panel_orientation() is first called after > drm_dev_register(), it will fail several checks and results in following

Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting

2022-05-31 Thread Hans de Goede
Hi, On 5/30/22 10:19, Hsin-Yi Wang wrote: > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > orientation. Panel calls drm_connector_set_panel_orientation() to create > orientation property and sets the value. However, connector properties > can't be created after

[PATCH v10 2/4] drm/mediatek: init panel orientation property

2022-05-31 Thread Hsin-Yi Wang
Init panel orientation property after connector is initialized. Let the panel driver decides the orientation value later. Signed-off-by: Hsin-Yi Wang Acked-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_dsi.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

Re: [PATCH v10 0/4] Separate panel orientation property creating and value setting

2022-05-31 Thread Hsin-Yi Wang
On Mon, May 30, 2022 at 4:53 PM Hans de Goede wrote: > > Hi, > > On 5/30/22 10:19, Hsin-Yi Wang wrote: > > Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the > > orientation. Panel calls drm_connector_set_panel_orientation() to create > > orientation property and sets the value.

[PATCH v10 4/4] arm64: dts: mt8183: Add panel rotation

2022-05-31 Thread Hsin-Yi Wang
krane, kakadu, and kodama boards have a default panel rotation. Signed-off-by: Hsin-Yi Wang Reviewed-by: Enric Balletbo i Serra Tested-by: Enric Balletbo i Serra --- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v10 1/4] gpu: drm: separate panel orientation property creating and value setting

2022-05-31 Thread Hsin-Yi Wang
drm_dev_register() sets connector->registration_state to DRM_CONNECTOR_REGISTERED and dev->registered to true. If drm_connector_set_panel_orientation() is first called after drm_dev_register(), it will fail several checks and results in following warning. Add a function to create panel

[PATCH v10 3/4] drm/msm: init panel orientation property

2022-05-31 Thread Hsin-Yi Wang
Init panel orientation property after connector is initialized. Let the panel driver decides the orientation value later. Signed-off-by: Hsin-Yi Wang --- drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c

[PATCH v10 0/4] Separate panel orientation property creating and value setting

2022-05-31 Thread Hsin-Yi Wang
Some drivers, eg. mtk_drm and msm_drm, rely on the panel to set the orientation. Panel calls drm_connector_set_panel_orientation() to create orientation property and sets the value. However, connector properties can't be created after drm_dev_register() is called. The goal is to separate the