[PATCH v3] drm/amd/display: Prevent potential buffer overflow in map_hw_resources

2024-02-21 Thread Srinivasan Shanmugam
Adds a check in the map_hw_resources function to prevent a potential buffer overflow. The function was accessing arrays using an index that could potentially be greater than the size of the arrays, leading to a buffer overflow. Adds a check to ensure that the index is within the bounds of the

RE: [PATCH Review 1/1] drm/amdgpu: Fix ineffective ras_mask settings

2024-02-21 Thread Zhou1, Tao
[AMD Official Use Only - General] Reviewed-by: Tao Zhou > -Original Message- > From: amd-gfx On Behalf Of > Stanley.Yang > Sent: Wednesday, February 21, 2024 10:27 PM > To: amd-gfx@lists.freedesktop.org > Cc: Yang, Stanley > Subject: [PATCH Review 1/1] drm/amdgpu: Fix ineffective

[PATCH] drm/amdgpu: break COW for user ptr during fork()

2024-02-21 Thread Lang Yu
This is useful to prevent copy-on-write semantics from changing the physical location of a page if the parent writes to it after a fork(). Signed-off-by: Lang Yu --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/amd/amdkfd/kfd_svm.c| 1 + 2 files changed, 2 insertions(+)

Re: AMDGPU crash - request for assistance triaging / reporting

2024-02-21 Thread Matthew Hall
Hi All, Even using the older stock Ubuntu kernel, I am still seeing this GPU crash killing my user sessions, even without intense 3-D activity. It happens with X.org or Wayland, older kernel 6.5.0, and all recent latest non-snapshot releases from kernel.org as well. The more Wayland, and the

Re: [PATCH] drm/amd/display: Use kcalloc() instead of kzalloc()

2024-02-21 Thread Rodrigo Siqueira Jordao
On 1/28/24 02:04, Lenko Donchev wrote: We are trying to get rid of all multiplications from allocation functions to prevent integer overflows. Here the multiplication is obviously safe, but using kcalloc() is more appropriate and improves readability. This patch has no effect on runtime

Re: [PATCH] drm/amd/display: Add prefix to functions inside dnc10_cm_common.h

2024-02-21 Thread Alex Deucher
On Wed, Feb 21, 2024 at 2:31 PM Joao Paulo Pereira da Silva wrote: > > While debugging with ftrace, it's useful to create filters to search > within the codebase. However, since some function names lack prefixes, > creating a good filter may become more difficult. > > Because of this, add prefix

Re: [PATCH 0/3] drm/amdgpu: Use KMEM_CACHE instead of kmem_cache_create

2024-02-21 Thread Alex Deucher
Applied. Thanks! On Wed, Feb 21, 2024 at 6:08 AM Christian König wrote: > > Am 21.02.24 um 10:59 schrieb Kunwu Chan: > > For where the cache name and the structure name match. > > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > > to simplify the creation of SLAB caches. > >

[PATCH] drm/amd/display: Add prefix to functions inside dnc10_cm_common.h

2024-02-21 Thread Joao Paulo Pereira da Silva
While debugging with ftrace, it's useful to create filters to search within the codebase. However, since some function names lack prefixes, creating a good filter may become more difficult. Because of this, add prefix to functions declared inside the header dcn10/dcn10_cm_common.h to facilitate

Re: [PATCH] drm/amdkfd: fix process reference drop on debug ioctl

2024-02-21 Thread Felix Kuehling
On 2024-02-21 05:54, Jonathan Kim wrote: Prevent dropping the KFD process reference at the end of a debug IOCTL call where the acquired process value is an error. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 + 1 file

Re: [PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-21 Thread Matthew Auld
On 21/02/2024 12:18, Arunpravin Paneer Selvam wrote: Add a function to support defragmentation. v1: - Defragment the memory beginning from min_order till the required memory space is available. v2(Matthew): - add amdgpu user for defragmentation - add a warning if the two blocks

RE: [PATCH 4/4] drm/amdgpu: add vcn 4.0.6 discovery support

2024-02-21 Thread Liu, Leo
[AMD Official Use Only - General] The series of 4 patches are: Reviewed-by: Leo Liu > -Original Message- > From: amd-gfx On Behalf Of Alex > Deucher > Sent: Wednesday, February 21, 2024 12:00 PM > To: amd-gfx@lists.freedesktop.org > Cc: Zhang, Yifan ; Deucher, Alexander > > Subject:

Re: [PATCH] drm/amd/display: clean unnecessary braces

2024-02-21 Thread Rodrigo Siqueira Jordao
Hi Túlio, First of all thanks for your patch. See my comments inline. On 2/17/24 13:20, Túlio Fernandes wrote: Clean unnecessary braces in dc/dcn32/dcn32_resource_helpers.c and dc/dcn32/dcn201_link_encoder.c Did you identify this issue with checkpatch? If so, I recommend you paste the

Re: [PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-21 Thread Matthew Auld
On 21/02/2024 12:40, Paneer Selvam, Arunpravin wrote: On 2/16/2024 5:33 PM, Matthew Auld wrote: On 08/02/2024 15:49, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path.

Re: [PATCH] drm/amdgpu/display: Address kdoc for 'is_psr_su' in 'fill_dc_dirty_rects'

2024-02-21 Thread Rodrigo Siqueira Jordao
On 2/15/24 05:57, Srinivasan Shanmugam wrote: The is_psr_su parameter is a boolean flag indicating whether the Panel Self Refresh Selective Update (PSR SU) feature is enabled which is a power-saving feature that allows only the updated regions of the screen to be refreshed, reducing the

[PATCH 3/4] drm/amdgpu/soc21: Enabling PG and CG flags for VCN 4.0.6

2024-02-21 Thread Alex Deucher
From: Veerabadhran Gopalakrishnan Enabled the VCN Power Gating and Clock Gating flags for VCN 4.0.6. Signed-off-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc21.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH 1/4] drm/amdgpu/vcn: Enable VCN 4.0.6 Support

2024-02-21 Thread Alex Deucher
From: Veerabadhran Gopalakrishnan Modified driver to use the appropriate FW files and instance. v2: squash in fixes (Alex) Signed-off-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 2 ++ drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 3

[PATCH 4/4] drm/amdgpu: add vcn 4.0.6 discovery support

2024-02-21 Thread Alex Deucher
From: Yifan Zhang This patch is to add vcn 4.0.6 support Signed-off-by: Yifan Zhang Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

[PATCH 2/4] drm/amdgpu/soc21: Added Video Capabilities for VCN 406

2024-02-21 Thread Alex Deucher
From: Veerabadhran Gopalakrishnan Updated Query Video codecs for VCN 406 Signed-off-by: Veerabadhran Gopalakrishnan Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c

Re: [PATCH] drm/amd: Update atomfirmware.h for DCN401

2024-02-21 Thread Alex Deucher
On Tue, Feb 20, 2024 at 2:38 PM Aurabindo Pillai wrote: > > Add new firmware header definitions reqiured for DCN401 > > Signed-off-by: Aurabindo Pillai Acked-by: Alex Deucher > --- > drivers/gpu/drm/amd/include/atomfirmware.h | 33 ++ > 1 file changed, 33 insertions(+) >

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Alex Deucher
On Wed, Feb 21, 2024 at 1:06 AM Linux regression tracking (Thorsten Leemhuis) wrote: > > On 20.02.24 21:18, Alex Deucher wrote: > > On Tue, Feb 20, 2024 at 2:41 PM Romano wrote: > >> > >> If the increased low range is allowed via boot option, like in proposed > >> patch, user clearly made an

Re: [PATCH] drm/amdgpu: Fix the runtime resume failure issue

2024-02-21 Thread Mario Limonciello
On 2/21/2024 03:35, Ma Jun wrote: Don't set power state flag when system enter runtime suspend, or it may cause runtime resume failure issue. Signed-off-by: Ma Jun Reviewed-by: Mario Limonciello Please add a fixes tag for 3a9626c816db901def438dc2513622e281186d39 when committing. ---

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Christian König
Am 21.02.24 um 07:06 schrieb Linux regression tracking (Thorsten Leemhuis): On 20.02.24 21:18, Alex Deucher wrote: On Tue, Feb 20, 2024 at 2:41 PM Romano wrote: If the increased low range is allowed via boot option, like in proposed patch, user clearly made an intentional decision. Undefined,

[PATCH v2] drm/amd/display: Prevent potential buffer overflow in map_hw_resources

2024-02-21 Thread Srinivasan Shanmugam
Adds a check in the map_hw_resources function to prevent a potential buffer overflow. The function was accessing arrays using an index that could potentially be greater than the size of the arrays, leading to a buffer overflow. Adds a check to ensure that the index is within the bounds of the

Re: [PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-21 Thread Christian König
Am 21.02.24 um 13:18 schrieb Arunpravin Paneer Selvam: Add a function to support defragmentation. Thinking more about it maybe you want to call this function differently. Essentially we are force merging pages even if their cleared flag doesn't match, that is something different than

[PATCH Review 1/1] drm/amdgpu: Fix ineffective ras_mask settings

2024-02-21 Thread Stanley . Yang
Check amdgpu_ras_mask to fix ineffective ras_mask setting due to special asic without sram ecc enable but with poison supported. Signed-off-by: Stanley.Yang --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

[PATCH 1/3] drm/amdgpu: Simplify the allocation of fence slab caches

2024-02-21 Thread Kunwu Chan
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

[PATCH 3/3] drm/amdgpu: Simplify the allocation of sync slab caches

2024-02-21 Thread Kunwu Chan
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan --- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c

[PATCH 0/3] drm/amdgpu: Use KMEM_CACHE instead of kmem_cache_create

2024-02-21 Thread Kunwu Chan
For where the cache name and the structure name match. Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Kunwu Chan (3): drm/amdgpu: Simplify the allocation of fence slab caches drm/amdgpu: Simplify the allocation of mux_chunk slab

[PATCH 2/3] drm/amdgpu: Simplify the allocation of mux_chunk slab caches

2024-02-21 Thread Kunwu Chan
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan --- drivers/gpu/drm/amd/amdgpu/amdgpu_ring_mux.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

Re: [PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-21 Thread Paneer Selvam, Arunpravin
On 2/16/2024 5:33 PM, Matthew Auld wrote: On 08/02/2024 15:49, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path. On the otherhand,    DRM buddy marks each block as

Re: [PATCH v6 1/3] drm/buddy: Implement tracking clear page feature

2024-02-21 Thread Paneer Selvam, Arunpravin
On 2/16/2024 5:33 PM, Matthew Auld wrote: On 08/02/2024 15:49, Arunpravin Paneer Selvam wrote: - Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it    successfully clears the blocks in the free path. On the otherhand,    DRM buddy marks each block as

[PATCH v7 3/3] drm/buddy: Add defragmentation support

2024-02-21 Thread Arunpravin Paneer Selvam
Add a function to support defragmentation. v1: - Defragment the memory beginning from min_order till the required memory space is available. v2(Matthew): - add amdgpu user for defragmentation - add a warning if the two blocks are incompatible on defragmentation - call full

[PATCH v7 2/3] drm/amdgpu: Enable clear page functionality

2024-02-21 Thread Arunpravin Paneer Selvam
Add clear page support in vram memory region. v1(Christian): - Dont handle clear page as TTM flag since when moving the BO back in from GTT again we don't need that. - Make a specialized version of amdgpu_fill_buffer() which only clears the VRAM areas which are not already cleared -

[PATCH v7 1/3] drm/buddy: Implement tracking clear page feature

2024-02-21 Thread Arunpravin Paneer Selvam
- Add tracking clear page feature. - Driver should enable the DRM_BUDDY_CLEARED flag if it successfully clears the blocks in the free path. On the otherhand, DRM buddy marks each block as cleared. - Track the available cleared pages size - If driver requests cleared memory we prefer cleared

Re: [PATCH 0/3] drm/amdgpu: Use KMEM_CACHE instead of kmem_cache_create

2024-02-21 Thread Christian König
Am 21.02.24 um 10:59 schrieb Kunwu Chan: For where the cache name and the structure name match. Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Reviewed-by: Christian König for the entire series. Kunwu Chan (3): drm/amdgpu:

[PATCH] drm/amdkfd: fix process reference drop on debug ioctl

2024-02-21 Thread Jonathan Kim
Prevent dropping the KFD process reference at the end of a debug IOCTL call where the acquired process value is an error. Signed-off-by: Jonathan Kim --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c

[PATCH] drm/amdgpu: Fix the runtime resume failure issue

2024-02-21 Thread Ma Jun
Don't set power state flag when system enter runtime suspend, or it may cause runtime resume failure issue. Signed-off-by: Ma Jun --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Linux regression tracking (Thorsten Leemhuis)
On 20.02.24 21:18, Alex Deucher wrote: > On Tue, Feb 20, 2024 at 2:41 PM Romano wrote: >> >> If the increased low range is allowed via boot option, like in proposed >> patch, user clearly made an intentional decision. Undefined, but won't >> fry his hardware for sure. Undefined is also

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Romano
For Windows, apps like MSI Afterburner is the one to try and what most people go for. Using it in the past myself, I would be surprised if it adhered to such a high min power cap. But even if it did, why would we have to. Relying on vendors cap in this case has already proven wrong because

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Romano
This setting does not introduce stability problems or bugs. Voltage/frequency ratio is dynamic relative to power cap, GPU auto adjust to it. This is not like lowering voltage alone. By lowering GPU power, it simply auto-adjust its frequency and voltage on the fly and remain stable without

[PATCH 3/3] drm/amd/display: add prefix to rv1_clk_mgr_vbios_smu.c functions

2024-02-21 Thread David Tadokoro
The functions defined in dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c don't have names that indicate where they were declared. To better filter results in debug tools like ftrace, prefix these functions with 'rv1_clk_mgr_vbios_smu_'. Signed-off-by: David Tadokoro ---

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Romano
If the increased low range is allowed via boot option, like in proposed patch, user clearly made an intentional decision. Undefined, but won't fry his hardware for sure. Undefined is also overclocking in that matter. You can go out of range with ratio of voltage vs frequency(still within

[PATCH 1/3] drm/amd/display: add prefix to rv1_clk_mgr_clk.c function

2024-02-21 Thread David Tadokoro
The function defined in dc/clk_mgr/dcn10/rv1_clk_mgr_clk.c doesn't have a name that indicates where it was declared. To better filter results in debug tools like ftrace, prefix this function with 'rv1_clk_mgr_clk_'. Signed-off-by: David Tadokoro ---

[PATCH 0/3] drm/amd/display: add prefix to dc/clk_mgr/dcn10 functions

2024-02-21 Thread David Tadokoro
This patchset has three commits that add prefix to all the functions defined in dc/clk_mgr/dcn10 that indicate the file that they were defined. Enforcing this pattern makes filtering results in debug tools like ftrace better. David Tadokoro (3): drm/amd/display: add prefix to rv1_clk_mgr_clk.c

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Linux regression tracking (Thorsten Leemhuis)
On 20.02.24 16:27, Hans de Goede wrote: > Hi, > > On 2/20/24 16:15, Alex Deucher wrote: >> On Tue, Feb 20, 2024 at 10:03 AM Linux regression tracking (Thorsten >> Leemhuis) wrote: >>> >>> On 20.02.24 15:45, Alex Deucher wrote: On Mon, Feb 19, 2024 at 9:47 AM Linux regression tracking

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Linux regression tracking (Thorsten Leemhuis)
On 20.02.24 15:45, Alex Deucher wrote: > On Mon, Feb 19, 2024 at 9:47 AM Linux regression tracking (Thorsten > Leemhuis) wrote: >> >> On 17.02.24 14:30, Greg KH wrote: >>> On Sat, Feb 17, 2024 at 02:01:54PM +0100, Roman Benes wrote: Minimum power limit on latest(6.7+) kernels is 190W for my

[PATCH 2/3] drm/amd/display: add prefix to rv1_clk_mgr.c functions

2024-02-21 Thread David Tadokoro
The functions defined in dc/clk_mgr/dcn10/rv1_clk_mgr.c don't have names that indicates where they were declared. To better filter results in debug tools like ftrace, prefix these functions with 'rv1_clk_mgr_'. Signed-off-by: David Tadokoro --- .../display/dc/clk_mgr/dcn10/rv1_clk_mgr.c|

Re: Kernel 6.7+ broke under-powering of my RX 6700XT. (Archlinux, mesa/amdgpu)

2024-02-21 Thread Hans de Goede
Hi, On 2/20/24 16:15, Alex Deucher wrote: > On Tue, Feb 20, 2024 at 10:03 AM Linux regression tracking (Thorsten > Leemhuis) wrote: >> >> On 20.02.24 15:45, Alex Deucher wrote: >>> On Mon, Feb 19, 2024 at 9:47 AM Linux regression tracking (Thorsten >>> Leemhuis) wrote: On 17.02.24