[PATCH AUTOSEL 6.10 142/197] drm/amdgpu: add raven1 gfxoff quirk

2024-09-25 Thread Sasha Levin
From: Peng Liu [ Upstream commit 0126c0ae11e8b52ecfde9d1b174ee2f32d6c3a5d ] Fix screen corruption with openkylin. Link: https://bbs.openkylin.top/t/topic/171497 Signed-off-by: Peng Liu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1

[PATCH AUTOSEL 6.10 143/197] drm/amdgpu: enable gfxoff quirk on HP 705G4

2024-09-25 Thread Sasha Levin
From: Peng Liu [ Upstream commit 2c7795e245d993bcba2f716a8c93a5891ef910c9 ] Enabling gfxoff quirk results in perfectly usable graphical user interface on HP 705G4 DM with R5 2400G. Without the quirk, X server is completely unusable as every few seconds there is gpu reset due to ring gfx timeout

[PATCH AUTOSEL 6.10 144/197] drm/amdkfd: Fix resource leak in criu restore queue

2024-09-25 Thread Sasha Levin
From: Jesse Zhang [ Upstream commit aa47fe8d3595365a935921a90d00bc33ee374728 ] To avoid memory leaks, release q_extra_data when exiting the restore queue. v2: Correct the proto (Alex) Signed-off-by: Jesse Zhang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --

[PATCH AUTOSEL 6.10 113/197] drm/amd/display: Pass non-null to dcn20_validate_apply_pipe_split_flags

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 5559598742fb4538e4c51c48ef70563c49c2af23 ] [WHAT & HOW] "dcn20_validate_apply_pipe_split_flags" dereferences merge, and thus it cannot be a null pointer. Let's pass a valid pointer to avoid null dereference. This fixes 2 FORWARD_NULL issues reported by Coverity

[PATCH AUTOSEL 6.10 116/197] drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer

2024-09-25 Thread Sasha Levin
From: Philip Yang [ Upstream commit c86ad39140bbcb9dc75a10046c2221f657e8083b ] Pass pointer reference to amdgpu_bo_unref to clear the correct pointer, otherwise amdgpu_bo_unref clear the local variable, the original pointer not set to NULL, this could cause use-after-free bug. Signed-off-by: Ph

[PATCH AUTOSEL 6.10 114/197] drm/amd/display: Check null pointers before using them

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 1ff12bcd7deaeed25efb5120433c6a45dd5504a8 ] [WHAT & HOW] These pointers are null checked previously in the same function, indicating they might be null as reported by Coverity. As a result, they need to be checked when used again. This fixes 3 FORWARD_NULL issue

[PATCH AUTOSEL 6.10 115/197] drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit

2024-09-25 Thread Sasha Levin
From: Pierre-Eric Pelloux-Prayer [ Upstream commit fec5f8e8c6bcf83ed7a392801d7b44c5ecfc1e82 ] Before this commit, only submits with both a BO_HANDLES chunk and a 'bo_list_handle' would be rejected (by amdgpu_cs_parser_bos). But if UMD sent multiple BO_HANDLES, what would happen is: * only the l

[PATCH AUTOSEL 6.10 117/197] drm/amd/display: Add null check for head_pipe in dcn201_acquire_free_pipe_for_layer

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit f22f4754aaa47d8c59f166ba3042182859e5dff7 ] This commit addresses a potential null pointer dereference issue in the `dcn201_acquire_free_pipe_for_layer` function. The issue could occur when `head_pipe` is null. The fix adds a check to ensure `head_pip

[PATCH AUTOSEL 6.10 129/197] drm/amd/display: Add NULL check for function pointer in dcn20_set_output_transfer_func

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 62ed6f0f198da04e884062264df308277628004f ] This commit adds a null check for the set_output_gamma function pointer in the dcn20_set_output_transfer_func function. Previously, set_output_gamma was being checked for null at line 1030, but then it was be

[PATCH AUTOSEL 6.10 132/197] drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2)

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit cd9e9e0852d501f169aa3bb34e4b413d2eb48c37 ] This commit adds a null check for the 'afb' variable in the amdgpu_dm_plane_handle_cursor_update function. Previously, 'afb' was assumed to be null, but was used later in the code without a null check. This c

[PATCH AUTOSEL 6.10 133/197] drm/amd/display: fix double free issue during amdgpu module unload

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 20b5a8f9f4670a8503aa9fa95ca632e77c6bf55d ] Flexible endpoints use DIGs from available inflexible endpoints, so only the encoders of inflexible links need to be freed. Otherwise, a double free issue may occur when unloading the amdgpu module. [ 279.190523] RIP:

[PATCH AUTOSEL 6.10 131/197] drm/amd/display: Check null pointers before using dc->clk_mgr

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 95d9e0803e51d5a24276b7643b244c7477daf463 ] [WHY & HOW] dc->clk_mgr is null checked previously in the same function, indicating it might be null. Passing "dc" to "dc->hwss.apply_idle_power_optimizations", which dereferences null "dc->clk_mgr". (The function poin

[PATCH AUTOSEL 6.10 130/197] drm/amd/display: Add NULL check for function pointer in dcn32_set_output_transfer_func

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 28574b08c70e56d34d6f6379326a860b96749051 ] This commit adds a null check for the set_output_gamma function pointer in the dcn32_set_output_transfer_func function. Previously, set_output_gamma was being checked for null, but then it was being dereferen

[PATCH AUTOSEL 6.10 128/197] drm/amd/display: Handle null 'stream_status' in 'planes_changed_for_existing_stream'

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 8141f21b941710ecebe49220b69822cab3abd23d ] This commit adds a null check for 'stream_status' in the function 'planes_changed_for_existing_stream'. Previously, the code assumed 'stream_status' could be null, but did not handle the case where it was act

[PATCH AUTOSEL 6.10 134/197] drm/amdgpu: add list empty check to avoid null pointer issue

2024-09-25 Thread Sasha Levin
From: Yang Wang [ Upstream commit 4416377ae1fdc41a90b665943152ccd7ff61d3c5 ] Add list empty check to avoid null pointer issues in some corner cases. - list_for_each_entry_safe() Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- driver

[PATCH AUTOSEL 6.10 158/197] drm/amd/display: Initialize get_bytes_per_element's default to 1

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 4067f4fa0423a89fb19a30b57231b384d77d2610 ] Variables, used as denominators and maybe not assigned to other values, should not be 0. bytes_per_element_y & bytes_per_element_c are initialized by get_bytes_per_element() which should never return 0. This fixes 10 D

[PATCH AUTOSEL 6.10 157/197] drm/amd/display: Avoid overflow assignment in link_dp_cts

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit a15268787b79fd183dd526cc16bec9af4f4e49a1 ] sampling_rate is an uint8_t but is assigned an unsigned int, and thus it can overflow. As a result, sampling_rate is changed to uint32_t. Similarly, LINK_QUAL_PATTERN_SET has a size of 2 bits, and it should only be ass

[PATCH AUTOSEL 6.10 156/197] drm/amdgpu/gfx9: properly handle error ints on all pipes

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 48695573d2feaf42812c1ad54e01caff0d1c2d71 ] Need to handle the interrupt enables for all pipes. Acked-by: Christian König Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 44 +- drive

[PATCH AUTOSEL 6.10 154/197] drm/amd/display: Fix index out of bounds in degamma hardware format translation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit b7e99058eb2e86aabd7a10761e76cae33d22b49f ] Fixes index out of bounds issue in `cm_helper_translate_curve_to_degamma_hw_format` function. The issue could occur when the index 'i' exceeds the number of transfer function points (TRANSFER_FUNC_POINTS). T

[PATCH AUTOSEL 6.10 155/197] drm/amd/display: Fix index out of bounds in DCN30 color transformation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit d81873f9e715b72d4f8d391c8eb243946f784dfc ] This commit addresses a potential index out of bounds issue in the `cm3_helper_translate_curve_to_hw_format` function in the DCN30 color management module. The issue could occur when the index 'i' exceeds the

[PATCH AUTOSEL 6.10 151/197] drm/amd/display: Check stream before comparing them

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 35ff747c86767937ee1e0ca987545b7eed7a0810 ] [WHAT & HOW] amdgpu_dm can pass a null stream to dc_is_stream_unchanged. It is necessary to check for null before dereferencing them. This fixes 1 FORWARD_NULL issue reported by Coverity. Reviewed-by: Rodrigo Siqueira

[PATCH AUTOSEL 6.10 152/197] drm/amd/display: Check link_res->hpo_dp_link_enc before using it

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 0beca868cde8742240cd0038141c30482d2b7eb8 ] [WHAT & HOW] Functions dp_enable_link_phy and dp_disable_link_phy can pass link_res without initializing hpo_dp_link_enc and it is necessary to check for null before dereferencing. This fixes 2 FORWARD_NULL issues repo

[PATCH AUTOSEL 6.10 153/197] drm/amd/display: Fix index out of bounds in DCN30 degamma hardware format translation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit bc50b614d59990747dd5aeced9ec22f9258991ff ] This commit addresses a potential index out of bounds issue in the `cm3_helper_translate_curve_to_degamma_hw_format` function in the DCN30 color management module. The issue could occur when the index 'i' ex

[PATCH AUTOSEL 6.10 170/197] drm/amdgpu: Block MMR_READ IOCTL in reset

2024-09-25 Thread Sasha Levin
From: Victor Skvortsov [ Upstream commit 9e823f307074c0f82b5f6044943b0086e3079bed ] Register access from userspace should be blocked until reset is complete. Signed-off-by: Victor Skvortsov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm

[PATCH AUTOSEL 6.10 171/197] drm/amdgpu/gfx9: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 3ec2ad7c34c412bd9264cd1ff235d0812be90e82 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --g

[PATCH AUTOSEL 6.10 169/197] drm/radeon/r100: Handle unknown family in r100_cp_init_microcode()

2024-09-25 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit c6dbab46324b1742b50dc2fb5c1fee2c28129439 ] With -Werror: In function ‘r100_cp_init_microcode’, inlined from ‘r100_cp_init’ at drivers/gpu/drm/radeon/r100.c:1136:7: include/linux/printk.h:465:44: error: ‘%s’ directive argument is null [

[PATCH AUTOSEL 6.10 165/197] drm/amdgpu: fix unchecked return value warning for amdgpu_gfx

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit c0277b9d7c2ee9ee5dbc948548984f0fbb861301 ] This resolves the unchecded return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH AUTOSEL 6.10 174/197] drm/amd/pm: ensure the fw_info is not null before using it

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 186fb12e7a7b038c2710ceb2fb74068f1b5d55a4 ] This resolves the dereference null return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/pm/pow

[PATCH AUTOSEL 6.10 180/197] drm/amdgpu/gfx11: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 3f2d35c325534c1b7ac5072173f0dc7ca969dec2 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.10 181/197] drm/amdgpu/gfx10: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit ead60e9c4e29c8574cae1be4fe3af1d9a978fb0f ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.10 175/197] drm/amdkfd: Check int source id for utcl2 poison event

2024-09-25 Thread Sasha Levin
From: Hawking Zhang [ Upstream commit db6341a9168d2a24ded526277eeab29724d76e9d ] Traditional utcl2 fault_status polling does not work in SRIOV environment. The polling of fault status register from guest side will be dropped by hardware. Driver should switch to check utcl2 interrupt source id t

[PATCH AUTOSEL 6.10 166/197] drm/amdgpu: fix unchecked return value warning for amdgpu_atombios

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 92549780e32718d64a6d083c6fffecb541c7 ] This resolves the unchecded return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH AUTOSEL 6.10 172/197] drm/amdgpu/gfx11: enter safe mode before touching CP_INT_CNTL

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit b5be054c585110b2c5c1b180136800e8c41c7bb4 ] Need to enter safe mode before touching GC MMIO. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 4 ++-- 1 file changed, 2 insertions(

[PATCH AUTOSEL 6.6 086/139] drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer

2024-09-25 Thread Sasha Levin
From: Philip Yang [ Upstream commit c86ad39140bbcb9dc75a10046c2221f657e8083b ] Pass pointer reference to amdgpu_bo_unref to clear the correct pointer, otherwise amdgpu_bo_unref clear the local variable, the original pointer not set to NULL, this could cause use-after-free bug. Signed-off-by: Ph

[PATCH AUTOSEL 6.6 085/139] drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit

2024-09-25 Thread Sasha Levin
From: Pierre-Eric Pelloux-Prayer [ Upstream commit fec5f8e8c6bcf83ed7a392801d7b44c5ecfc1e82 ] Before this commit, only submits with both a BO_HANDLES chunk and a 'bo_list_handle' would be rejected (by amdgpu_cs_parser_bos). But if UMD sent multiple BO_HANDLES, what would happen is: * only the l

[PATCH AUTOSEL 6.6 094/139] drm/amd/display: fix double free issue during amdgpu module unload

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 20b5a8f9f4670a8503aa9fa95ca632e77c6bf55d ] Flexible endpoints use DIGs from available inflexible endpoints, so only the encoders of inflexible links need to be freed. Otherwise, a double free issue may occur when unloading the amdgpu module. [ 279.190523] RIP:

[PATCH AUTOSEL 6.6 092/139] drm/amd/display: Check null pointers before using dc->clk_mgr

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 95d9e0803e51d5a24276b7643b244c7477daf463 ] [WHY & HOW] dc->clk_mgr is null checked previously in the same function, indicating it might be null. Passing "dc" to "dc->hwss.apply_idle_power_optimizations", which dereferences null "dc->clk_mgr". (The function poin

[PATCH AUTOSEL 6.6 093/139] drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2)

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit cd9e9e0852d501f169aa3bb34e4b413d2eb48c37 ] This commit adds a null check for the 'afb' variable in the amdgpu_dm_plane_handle_cursor_update function. Previously, 'afb' was assumed to be null, but was used later in the code without a null check. This c

[PATCH AUTOSEL 6.6 087/139] drm/amd/display: Add null check for top_pipe_to_program in commit_planes_for_stream

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 66d71a72539e173a9b00ca0b1852cbaa5f5bf1ad ] This commit addresses a null pointer dereference issue in the `commit_planes_for_stream` function at line 4140. The issue could occur when `top_pipe_to_program` is null. The fix adds a check to ensure `top_p

[PATCH AUTOSEL 6.6 101/139] drm/amdgpu: add raven1 gfxoff quirk

2024-09-25 Thread Sasha Levin
From: Peng Liu [ Upstream commit 0126c0ae11e8b52ecfde9d1b174ee2f32d6c3a5d ] Fix screen corruption with openkylin. Link: https://bbs.openkylin.top/t/topic/171497 Signed-off-by: Peng Liu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1

[PATCH AUTOSEL 6.6 091/139] drm/amd/display: Handle null 'stream_status' in 'planes_changed_for_existing_stream'

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 8141f21b941710ecebe49220b69822cab3abd23d ] This commit adds a null check for 'stream_status' in the function 'planes_changed_for_existing_stream'. Previously, the code assumed 'stream_status' could be null, but did not handle the case where it was act

[PATCH AUTOSEL 6.6 112/139] drm/amd/display: Avoid overflow assignment in link_dp_cts

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit a15268787b79fd183dd526cc16bec9af4f4e49a1 ] sampling_rate is an uint8_t but is assigned an unsigned int, and thus it can overflow. As a result, sampling_rate is changed to uint32_t. Similarly, LINK_QUAL_PATTERN_SET has a size of 2 bits, and it should only be ass

[PATCH AUTOSEL 6.6 108/139] drm/amd/display: Check link_res->hpo_dp_link_enc before using it

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 0beca868cde8742240cd0038141c30482d2b7eb8 ] [WHAT & HOW] Functions dp_enable_link_phy and dp_disable_link_phy can pass link_res without initializing hpo_dp_link_enc and it is necessary to check for null before dereferencing. This fixes 2 FORWARD_NULL issues repo

[PATCH AUTOSEL 6.6 107/139] drm/amd/display: Check stream before comparing them

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 35ff747c86767937ee1e0ca987545b7eed7a0810 ] [WHAT & HOW] amdgpu_dm can pass a null stream to dc_is_stream_unchanged. It is necessary to check for null before dereferencing them. This fixes 1 FORWARD_NULL issue reported by Coverity. Reviewed-by: Rodrigo Siqueira

[PATCH AUTOSEL 6.6 110/139] drm/amd/display: Fix index out of bounds in degamma hardware format translation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit b7e99058eb2e86aabd7a10761e76cae33d22b49f ] Fixes index out of bounds issue in `cm_helper_translate_curve_to_degamma_hw_format` function. The issue could occur when the index 'i' exceeds the number of transfer function points (TRANSFER_FUNC_POINTS). T

[PATCH AUTOSEL 6.6 111/139] drm/amd/display: Fix index out of bounds in DCN30 color transformation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit d81873f9e715b72d4f8d391c8eb243946f784dfc ] This commit addresses a potential index out of bounds issue in the `cm3_helper_translate_curve_to_hw_format` function in the DCN30 color management module. The issue could occur when the index 'i' exceeds the

[PATCH AUTOSEL 6.6 109/139] drm/amd/display: Fix index out of bounds in DCN30 degamma hardware format translation

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit bc50b614d59990747dd5aeced9ec22f9258991ff ] This commit addresses a potential index out of bounds issue in the `cm3_helper_translate_curve_to_degamma_hw_format` function in the DCN30 color management module. The issue could occur when the index 'i' ex

[PATCH AUTOSEL 6.6 113/139] drm/amd/display: Initialize get_bytes_per_element's default to 1

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 4067f4fa0423a89fb19a30b57231b384d77d2610 ] Variables, used as denominators and maybe not assigned to other values, should not be 0. bytes_per_element_y & bytes_per_element_c are initialized by get_bytes_per_element() which should never return 0. This fixes 10 D

[PATCH AUTOSEL 6.11 220/244] drm/amd/display: guard write a 0 post_divider value to HW

2024-09-25 Thread Sasha Levin
From: "Ahmed, Muhammad" [ Upstream commit 5d666496c24129edeb2bcb500498b87cc64e7f07 ] [why] post_divider_value should not be 0. Reviewed-by: Charlene Liu Signed-off-by: Ahmed, Muhammad Signed-off-by: Zaeem Mohamed Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Le

[PATCH AUTOSEL 6.11 130/244] drm/amd/display: Pass non-null to dcn20_validate_apply_pipe_split_flags

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 5559598742fb4538e4c51c48ef70563c49c2af23 ] [WHAT & HOW] "dcn20_validate_apply_pipe_split_flags" dereferences merge, and thus it cannot be a null pointer. Let's pass a valid pointer to avoid null dereference. This fixes 2 FORWARD_NULL issues reported by Coverity

[PATCH AUTOSEL 6.11 131/244] drm/amd/display: Check null pointers before using them

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 1ff12bcd7deaeed25efb5120433c6a45dd5504a8 ] [WHAT & HOW] These pointers are null checked previously in the same function, indicating they might be null as reported by Coverity. As a result, they need to be checked when used again. This fixes 3 FORWARD_NULL issue

[PATCH AUTOSEL 6.11 132/244] drm/amd/display: Check null pointers before used

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit be1fb44389ca3038ad2430dac4234669bc177ee3 ] [WHAT & HOW] Poniters, such as dc->clk_mgr, are null checked previously in the same function, so Coverity warns "implies that "dc->clk_mgr" might be null". As a result, these pointers need to be checked when used again.

[PATCH AUTOSEL 6.11 133/244] drm/amd/display: Check null pointers before multiple uses

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit fdd5ecbbff751c3b9061d8ebb08e5c96119915b4 ] [WHAT & HOW] Poniters, such as stream_enc and dc->bw_vbios, are null checked previously in the same function, so Coverity warns "implies that stream_enc and dc->bw_vbios might be null". They are used multiple times in t

[PATCH AUTOSEL 6.11 134/244] drm/amdgpu: disallow multiple BO_HANDLES chunks in one submit

2024-09-25 Thread Sasha Levin
From: Pierre-Eric Pelloux-Prayer [ Upstream commit fec5f8e8c6bcf83ed7a392801d7b44c5ecfc1e82 ] Before this commit, only submits with both a BO_HANDLES chunk and a 'bo_list_handle' would be rejected (by amdgpu_cs_parser_bos). But if UMD sent multiple BO_HANDLES, what would happen is: * only the l

[PATCH AUTOSEL 6.11 135/244] drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer

2024-09-25 Thread Sasha Levin
From: Philip Yang [ Upstream commit c86ad39140bbcb9dc75a10046c2221f657e8083b ] Pass pointer reference to amdgpu_bo_unref to clear the correct pointer, otherwise amdgpu_bo_unref clear the local variable, the original pointer not set to NULL, this could cause use-after-free bug. Signed-off-by: Ph

[PATCH AUTOSEL 6.11 137/244] drm/amd/display: Add null check for head_pipe in dcn32_acquire_idle_pipe_for_head_pipe_in_layer

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit ac2140449184a26eac99585b7f69814bd3ba8f2d ] This commit addresses a potential null pointer dereference issue in the `dcn32_acquire_idle_pipe_for_head_pipe_in_layer` function. The issue could occur when `head_pipe` is null. The fix adds a check to ensu

[PATCH AUTOSEL 6.11 136/244] drm/amd/display: Add null check for head_pipe in dcn201_acquire_free_pipe_for_layer

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit f22f4754aaa47d8c59f166ba3042182859e5dff7 ] This commit addresses a potential null pointer dereference issue in the `dcn201_acquire_free_pipe_for_layer` function. The issue could occur when `head_pipe` is null. The fix adds a check to ensure `head_pip

[PATCH AUTOSEL 6.11 138/244] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn30_init_hw

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit cba7fec864172dadd953daefdd26e01742b71a6a ] This commit addresses a potential null pointer dereference issue in the `dcn30_init_hw` function. The issue could occur when `dc->clk_mgr` or `dc->clk_mgr->funcs` is null. The fix adds a check to ensure `dc-

[PATCH AUTOSEL 6.11 144/244] drm/amd/display: Use gpuvm_min_page_size_kbytes for DML2 surfaces

2024-09-25 Thread Sasha Levin
From: Nicholas Kazlauskas [ Upstream commit 31663521ede2edb622ee1b397ae3ac666d6351c5 ] [Why] It's currently hard coded to 256 when it should be using the SOC provided values. This can result in corruption with linear surfaces where we prefetch more PTE than the buffer can hold. [How] Update the

[PATCH AUTOSEL 6.11 142/244] drm/amd/display: Add null check for pipe_ctx->plane_state in dcn20_program_pipe

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 8e4ed3cf1642df0c4456443d865cff61a9598aa8 ] This commit addresses a null pointer dereference issue in the `dcn20_program_pipe` function. The issue could occur when `pipe_ctx->plane_state` is null. The fix adds a check to ensure `pipe_ctx->plane_state`

[PATCH AUTOSEL 6.11 140/244] drm/amd/display: Add NULL check for clk_mgr in dcn32_init_hw

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit c395fd47d1565bd67671f45cca281b3acc2c31ef ] This commit addresses a potential null pointer dereference issue in the `dcn32_init_hw` function. The issue could occur when `dc->clk_mgr` is null. The fix adds a check to ensure `dc->clk_mgr` is not null be

[PATCH AUTOSEL 6.11 139/244] drm/amd/display: Add NULL check for clk_mgr and clk_mgr->funcs in dcn401_init_hw

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 4b6377f0e96085cbec96eb7f0b282430ccdd3d75 ] This commit addresses a potential null pointer dereference issue in the `dcn401_init_hw` function. The issue could occur when `dc->clk_mgr` or `dc->clk_mgr->funcs` is null. The fix adds a check to ensure `dc

[PATCH AUTOSEL 6.11 143/244] drm/amd/display: Add null check for top_pipe_to_program in commit_planes_for_stream

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 66d71a72539e173a9b00ca0b1852cbaa5f5bf1ad ] This commit addresses a null pointer dereference issue in the `commit_planes_for_stream` function at line 4140. The issue could occur when `top_pipe_to_program` is null. The fix adds a check to ensure `top_p

[PATCH AUTOSEL 6.11 155/244] drm/amd/display: fix a UBSAN warning in DML2.1

2024-09-25 Thread Sasha Levin
From: Aurabindo Pillai [ Upstream commit eaf3adb8faab611ba57594fa915893fc93a7788c ] When programming phantom pipe, since cursor_width is explicity set to 0, this causes calculation logic to trigger overflow for an unsigned int triggering the kernel's UBSAN check as below: [ 40.962845] UBSAN:

[PATCH AUTOSEL 6.11 152/244] drm/amd/display: Add NULL check for function pointer in dcn20_set_output_transfer_func

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 62ed6f0f198da04e884062264df308277628004f ] This commit adds a null check for the set_output_gamma function pointer in the dcn20_set_output_transfer_func function. Previously, set_output_gamma was being checked for null at line 1030, but then it was be

[PATCH AUTOSEL 6.11 151/244] drm/amd/display: Handle null 'stream_status' in 'planes_changed_for_existing_stream'

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 8141f21b941710ecebe49220b69822cab3abd23d ] This commit adds a null check for 'stream_status' in the function 'planes_changed_for_existing_stream'. Previously, the code assumed 'stream_status' could be null, but did not handle the case where it was act

[PATCH AUTOSEL 6.11 150/244] drm/amd/display: Underflow Seen on DCN401 eGPU

2024-09-25 Thread Sasha Levin
From: Daniel Sa [ Upstream commit ca0fb243c3bb53dbbd71d16c76f319bf923ee3d4 ] [WHY] In dcn401 we read clock values before FW is loaded. These incorrect values cause the driver to believe that we are running higher clocks than what we actually have. This then causes corruption/underflow for the eG

[PATCH AUTOSEL 6.11 154/244] drm/amd/display: Add NULL check for function pointer in dcn32_set_output_transfer_func

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 28574b08c70e56d34d6f6379326a860b96749051 ] This commit adds a null check for the set_output_gamma function pointer in the dcn32_set_output_transfer_func function. Previously, set_output_gamma was being checked for null, but then it was being dereferen

[PATCH AUTOSEL 6.11 153/244] drm/amd/display: Add NULL check for function pointer in dcn401_set_output_transfer_func

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit dd340acd42c24a3f28dd22fae6bf38662334264c ] This commit adds a null check for the set_output_gamma function pointer in the dcn401_set_output_transfer_func function. Previously, set_output_gamma was being checked for null, but then it was being derefere

[PATCH AUTOSEL 6.11 156/244] drm/amd/display: Add null check for 'afb' in amdgpu_dm_update_cursor (v2)

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit 0fe20258b4989b9112b5e9470df33a0939403fd4 ] This commit adds a null check for the 'afb' variable in the amdgpu_dm_update_cursor function. Previously, 'afb' was assumed to be null at line 8388, but was used later in the code without a null check. This c

[PATCH AUTOSEL 6.11 159/244] drm/amd/display: Add null check for 'afb' in amdgpu_dm_plane_handle_cursor_update (v2)

2024-09-25 Thread Sasha Levin
From: Srinivasan Shanmugam [ Upstream commit cd9e9e0852d501f169aa3bb34e4b413d2eb48c37 ] This commit adds a null check for the 'afb' variable in the amdgpu_dm_plane_handle_cursor_update function. Previously, 'afb' was assumed to be null, but was used later in the code without a null check. This c

[PATCH AUTOSEL 6.11 162/244] drm/amdgpu: add list empty check to avoid null pointer issue

2024-09-25 Thread Sasha Levin
From: Yang Wang [ Upstream commit 4416377ae1fdc41a90b665943152ccd7ff61d3c5 ] Add list empty check to avoid null pointer issues in some corner cases. - list_for_each_entry_safe() Signed-off-by: Yang Wang Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- driver

[PATCH AUTOSEL 6.11 161/244] drm/amd/display: fix double free issue during amdgpu module unload

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 20b5a8f9f4670a8503aa9fa95ca632e77c6bf55d ] Flexible endpoints use DIGs from available inflexible endpoints, so only the encoders of inflexible links need to be freed. Otherwise, a double free issue may occur when unloading the amdgpu module. [ 279.190523] RIP:

[PATCH AUTOSEL 6.11 158/244] drm/amd/display: Check null pointer before try to access it

2024-09-25 Thread Sasha Levin
From: Rodrigo Siqueira [ Upstream commit 1b686053c06ffb9f4524b288110cf2a831ff7a25 ] [why & how] Change the order of the pipe_ctx->plane_state check to ensure that plane_state is not null before accessing it. Reviewed-by: Alex Hung Signed-off-by: Rodrigo Siqueira Signed-off-by: Tom Chung Test

[PATCH AUTOSEL 6.11 157/244] drm/amd/display: Check null pointers before using dc->clk_mgr

2024-09-25 Thread Sasha Levin
From: Alex Hung [ Upstream commit 95d9e0803e51d5a24276b7643b244c7477daf463 ] [WHY & HOW] dc->clk_mgr is null checked previously in the same function, indicating it might be null. Passing "dc" to "dc->hwss.apply_idle_power_optimizations", which dereferences null "dc->clk_mgr". (The function poin

Re: [PATCH] drm/display/dsc: Refactor MST DSC Determination Policy

2024-09-25 Thread Dan Carpenter
Hi Fangzhi, kernel test robot noticed the following build warnings: https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Fangzhi-Zuo/drm-display-dsc-Refactor-MST-DSC-Determination-Policy/20240920-014114 base: git://anongit.fr

Re: [PATCH 1/2] drm/amdgpu: Fetch NPS mode for GCv9.4.3 VFs

2024-09-25 Thread Chander, Vignesh
[AMD Official Use Only - AMD Internal Distribution Only] Reviewed-by: vignesh.chan...@amd.com Verified-by: vignesh.chan...@amd.com From: Lijo Lazar Sent: Tuesday, September 24, 2024 2:02:49 AM To: amd-gfx@lists.freedesktop.org Cc: Zhang, Hawking ; Deucher, Alexa

Re: [PATCH v2] drm/ci: uprev mesa, IGT and deqp-runner

2024-09-25 Thread Helen Mae Koike Fornazier
On Tue, 10 Sep 2024 10:19:24 -0300 Vignesh Raman wrote --- > Uprev mesa, IGT to the latest version and deqp-runner > to v0.20.0. Also update expectation files. > > Acked-by: Helen Koike helen.ko...@collabora.com> > Reviewed-by: Daniel Stone dani...@collabora.com> > Signed-o

Re: [PATCH v1 5/9] drm/amd/pm: use pm_runtime_get_if_active for debugfs getters

2024-09-25 Thread Lazar, Lijo
On 9/25/2024 1:24 PM, Pierre-Eric Pelloux-Prayer wrote: > Don't wake up the GPU for reading pm values. Instead, take a runtime > powermanagement ref when trying to read it iff the GPU is already > awake. > > This avoids spurious wake ups (eg: from applets). > > We use pm_runtime_get_if_in_acti

Re: [PATCH v1 6/9] drm/amd/pm: stop extra checks for runtime pm state

2024-09-25 Thread Lazar, Lijo
On 9/25/2024 1:24 PM, Pierre-Eric Pelloux-Prayer wrote: > pm_runtime_get_if_in_use already checks if the GPU is active, > so there's no need for manually checking runtimepm status: > >if (adev->in_suspend && !adev->in_runpm) > return -EPERM; > > Tested-by: Mario Limonciello > Signed

[PATCH AUTOSEL 6.6 123/139] drm/amdgpu/gfx9: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 3ec2ad7c34c412bd9264cd1ff235d0812be90e82 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --g

[PATCH AUTOSEL 6.6 122/139] drm/amdgpu: Block MMR_READ IOCTL in reset

2024-09-25 Thread Sasha Levin
From: Victor Skvortsov [ Upstream commit 9e823f307074c0f82b5f6044943b0086e3079bed ] Register access from userspace should be blocked until reset is complete. Signed-off-by: Victor Skvortsov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm

[PATCH AUTOSEL 6.6 127/139] drm/amdgpu/gfx11: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit 3f2d35c325534c1b7ac5072173f0dc7ca969dec2 ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.6 124/139] drm/amd/pm: ensure the fw_info is not null before using it

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit 186fb12e7a7b038c2710ceb2fb74068f1b5d55a4 ] This resolves the dereference null return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/pm/pow

[PATCH AUTOSEL 6.6 118/139] drm/amdgpu: fix unchecked return value warning for amdgpu_gfx

2024-09-25 Thread Sasha Levin
From: Tim Huang [ Upstream commit c0277b9d7c2ee9ee5dbc948548984f0fbb861301 ] This resolves the unchecded return value warning reported by Coverity. Signed-off-by: Tim Huang Reviewed-by: Jesse Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu

[PATCH AUTOSEL 6.6 102/139] drm/amdgpu: enable gfxoff quirk on HP 705G4

2024-09-25 Thread Sasha Levin
From: Peng Liu [ Upstream commit 2c7795e245d993bcba2f716a8c93a5891ef910c9 ] Enabling gfxoff quirk results in perfectly usable graphical user interface on HP 705G4 DM with R5 2400G. Without the quirk, X server is completely unusable as every few seconds there is gpu reset due to ring gfx timeout

[PATCH AUTOSEL 6.6 103/139] drm/amdkfd: Fix resource leak in criu restore queue

2024-09-25 Thread Sasha Levin
From: Jesse Zhang [ Upstream commit aa47fe8d3595365a935921a90d00bc33ee374728 ] To avoid memory leaks, release q_extra_data when exiting the restore queue. v2: Correct the proto (Alex) Signed-off-by: Jesse Zhang Reviewed-by: Tim Huang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --

[PATCH AUTOSEL 6.6 128/139] drm/amdgpu/gfx10: use rlc safe mode for soft recovery

2024-09-25 Thread Sasha Levin
From: Alex Deucher [ Upstream commit ead60e9c4e29c8574cae1be4fe3af1d9a978fb0f ] Protect the MMIO access with safe mode. Acked-by: Vitaly Prosyak Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ 1 file changed, 2 insertions(+) diff --

[PATCH AUTOSEL 6.6 121/139] drm/radeon/r100: Handle unknown family in r100_cp_init_microcode()

2024-09-25 Thread Sasha Levin
From: Geert Uytterhoeven [ Upstream commit c6dbab46324b1742b50dc2fb5c1fee2c28129439 ] With -Werror: In function ‘r100_cp_init_microcode’, inlined from ‘r100_cp_init’ at drivers/gpu/drm/radeon/r100.c:1136:7: include/linux/printk.h:465:44: error: ‘%s’ directive argument is null [

Re: [PATCH] drm/amdkfd: Remove an unused parameter in queue creation

2024-09-25 Thread Felix Kuehling
On 2024-09-23 05:11, Lang Yu wrote: struct file *f is unused in queue creation, remove it. Signed-off-by: Lang Yu Reviewed-by: Felix Kuehling --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 1 - drivers/gp

[PATCH] drm/amdgpu: fix vbios fetching for SR-IOV

2024-09-25 Thread Alex Deucher
SR-IOV fetches the vbios from VRAM in some cases. Re-enable the VRAM path for dGPUs and rename the function to make it clear that it is not IGP specific. Fixes: 042658d17a54 ("drm/amdgpu: clean up vbios fetching code") Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 11

Re: [PATCH] drm/amdkfd: fix vm-pasid lookup for multiple partitions

2024-09-25 Thread Felix Kuehling
I sort of agree that KFD allocated one PASID per process for historical reasons. KFD used one address space per process that was shared by all GPUs and the CPU, so it seemed wasteful to allocate multiple PASIDs for the same process. On the other hand, I also don't see why you can't use the sam

<    1   2