Re: [PATCH] MAINTAINERS: update radeon/amdgpu/amdkfd git trees

2021-01-08 Thread Abramov, Slava
[AMD Official Use Only - Internal Distribution Only]

Why not just https://gitlab.freedesktop.org/agd5f/linux ?

From: amd-gfx  on behalf of Alex Deucher 

Sent: Friday, January 8, 2021 2:30 PM
To: amd-gfx list ; Maling list - DRI developers 
; Dave Airlie ; Daniel 
Vetter 
Cc: Deucher, Alexander 
Subject: Re: [PATCH] MAINTAINERS: update radeon/amdgpu/amdkfd git trees

On Tue, Jan 5, 2021 at 3:15 PM Alex Deucher  wrote:
>
> FDO is out of space, so move to gitlab.
>
> Signed-off-by: Alex Deucher 

Ping?  Any objections?

Alex

> ---
>  MAINTAINERS | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index eb18459c1d16..e2877be6b10d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -907,7 +907,7 @@ AMD KFD
>  M: Felix Kuehling 
>  L: amd-...@lists.freedesktop.org
>  S: Supported
> -T: git git://people.freedesktop.org/~agd5f/linux
> +T: git 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fagd5f%2Flinux.gitdata=04%7C01%7Cslava.abramov%40amd.com%7Cb4e8adc5393c4b052d6908d8b40bd5db%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637457310677496846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=xK4Oo8juN%2FoF1jVnLclPtt9MKLzRQ3GPiercdH9ogFE%3Dreserved=0
>  F: drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd*.[ch]
>  F: drivers/gpu/drm/amd/amdkfd/
>  F: drivers/gpu/drm/amd/include/cik_structs.h
> @@ -14596,7 +14596,7 @@ M:  Alex Deucher 
>  M: Christian König 
>  L: amd-...@lists.freedesktop.org
>  S: Supported
> -T: git git://people.freedesktop.org/~agd5f/linux
> +T: git 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fagd5f%2Flinux.gitdata=04%7C01%7Cslava.abramov%40amd.com%7Cb4e8adc5393c4b052d6908d8b40bd5db%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637457310677506842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=ANez%2BLHaergD6Lae8arcJDyibaf5yPgRyrBfzBpd3vY%3Dreserved=0
>  F: drivers/gpu/drm/amd/
>  F: drivers/gpu/drm/radeon/
>  F: include/uapi/drm/amdgpu_drm.h
> --
> 2.29.2
>
___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfxdata=04%7C01%7Cslava.abramov%40amd.com%7Cb4e8adc5393c4b052d6908d8b40bd5db%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637457310677506842%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000sdata=gyiwTSaZfiAQpII%2BJUprm5wINz5QEWdQYnm05WoDbD0%3Dreserved=0
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/amd/display: avoid 64-bit division

2019-07-09 Thread Abramov, Slava
Hi Arnd!


Thanks for bisecting this issue.


I wonder whether you are going to commit your patch or planning to update it 
and it's still in your work queue.  We have one of our 32-bit builds failing 
because of this issue, so that I would like either to fix it or wait to your 
fix if it has chances to go upstream today.


Sincerely,



Slava Abramov


From: amd-gfx  on behalf of Arnd 
Bergmann 
Sent: Monday, July 8, 2019 9:52:08 AM
To: Wentland, Harry; Li, Sun peng (Leo); Deucher, Alexander; Koenig, Christian; 
Zhou, David(ChunMing); David Airlie; Daniel Vetter
Cc: Liu, Charlene; Park, Chris; Arnd Bergmann; Cheng, Tony; Francis, David; 
linux-ker...@vger.kernel.org; amd-...@lists.freedesktop.org; Cornij, Nikola; 
Laktyushkin, Dmytro; dri-devel@lists.freedesktop.org; Lei, Jun; Lakha, 
Bhawanpreet; Koo, Anthony
Subject: [PATCH] drm/amd/display: avoid 64-bit division

On 32-bit architectures, dividing a 64-bit integer in the kernel
leads to a link error:

ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

Change the two recently introduced instances to a multiply+shift
operation that is also much cheaper on 32-bit architectures.
We can do that here, since both of them are really 32-bit numbers
that change a few percent.

Fixes: bedbbe6af4be ("drm/amd/display: Move link functions from dc to dc_link")
Fixes: f18bc4e53ad6 ("drm/amd/display: update calculated bounding box logic for 
NV")
Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index c17db5c144aa..8dbf759eba45 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -3072,8 +3072,8 @@ uint32_t dc_link_bandwidth_kbps(
  * but the difference is minimal and is in a safe direction,
  * which all works well around potential ambiguity of DP 1.4a 
spec.
  */
-   long long fec_link_bw_kbps = link_bw_kbps * 970LL;
-   link_bw_kbps = (uint32_t)(fec_link_bw_kbps / 1000LL);
+   link_bw_kbps = mul_u64_u32_shr(BIT_ULL(32) * 970LL / 1000,
+  link_bw_kbps, 32);
 }
 #endif

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
index b35327bafbc5..70ac8a95d2db 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
@@ -2657,7 +2657,7 @@ static void update_bounding_box(struct dc *dc, struct 
_vcs_dpi_soc_bounding_box_
 calculated_states[i].dram_speed_mts = uclk_states[i] * 16 / 
1000;

 // FCLK:UCLK ratio is 1.08
-   min_fclk_required_by_uclk = ((unsigned long 
long)uclk_states[i]) * 1080 / 100;
+   min_fclk_required_by_uclk = mul_u64_u32_shr(BIT_ULL(32) * 1080 
/ 100, uclk_states[i], 32);

 calculated_states[i].fabricclk_mhz = 
(min_fclk_required_by_uclk < min_dcfclk) ?
 min_dcfclk : min_fclk_required_by_uclk;
--
2.20.0

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/display: avoid 64-bit division

2019-07-08 Thread Abramov, Slava
Acked-by: Slava Abramov 

Tested-by: Slava Abramov 


From: amd-gfx  on behalf of Arnd 
Bergmann 
Sent: Monday, July 8, 2019 9:52:08 AM
To: Wentland, Harry; Li, Sun peng (Leo); Deucher, Alexander; Koenig, Christian; 
Zhou, David(ChunMing); David Airlie; Daniel Vetter
Cc: Liu, Charlene; Park, Chris; Arnd Bergmann; Cheng, Tony; Francis, David; 
linux-ker...@vger.kernel.org; amd-...@lists.freedesktop.org; Cornij, Nikola; 
Laktyushkin, Dmytro; dri-devel@lists.freedesktop.org; Lei, Jun; Lakha, 
Bhawanpreet; Koo, Anthony
Subject: [PATCH] drm/amd/display: avoid 64-bit division

On 32-bit architectures, dividing a 64-bit integer in the kernel
leads to a link error:

ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!

Change the two recently introduced instances to a multiply+shift
operation that is also much cheaper on 32-bit architectures.
We can do that here, since both of them are really 32-bit numbers
that change a few percent.

Fixes: bedbbe6af4be ("drm/amd/display: Move link functions from dc to dc_link")
Fixes: f18bc4e53ad6 ("drm/amd/display: update calculated bounding box logic for 
NV")
Signed-off-by: Arnd Bergmann 
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 ++--
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c 
b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index c17db5c144aa..8dbf759eba45 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -3072,8 +3072,8 @@ uint32_t dc_link_bandwidth_kbps(
  * but the difference is minimal and is in a safe direction,
  * which all works well around potential ambiguity of DP 1.4a 
spec.
  */
-   long long fec_link_bw_kbps = link_bw_kbps * 970LL;
-   link_bw_kbps = (uint32_t)(fec_link_bw_kbps / 1000LL);
+   link_bw_kbps = mul_u64_u32_shr(BIT_ULL(32) * 970LL / 1000,
+  link_bw_kbps, 32);
 }
 #endif

diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c 
b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
index b35327bafbc5..70ac8a95d2db 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
@@ -2657,7 +2657,7 @@ static void update_bounding_box(struct dc *dc, struct 
_vcs_dpi_soc_bounding_box_
 calculated_states[i].dram_speed_mts = uclk_states[i] * 16 / 
1000;

 // FCLK:UCLK ratio is 1.08
-   min_fclk_required_by_uclk = ((unsigned long 
long)uclk_states[i]) * 1080 / 100;
+   min_fclk_required_by_uclk = mul_u64_u32_shr(BIT_ULL(32) * 1080 
/ 100, uclk_states[i], 32);

 calculated_states[i].fabricclk_mhz = 
(min_fclk_required_by_uclk < min_dcfclk) ?
 min_dcfclk : min_fclk_required_by_uclk;
--
2.20.0

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH][next] drm/amd/powerplay: fix out of memory check on od8_settings

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 11:13:54 AM
To: Wang, Kevin(Yang); Rex Zhu; Quan, Evan; Deucher, Alexander; Koenig, 
Christian; Zhou, David(ChunMing); David Airlie; Daniel Vetter; 
amd-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH][next] drm/amd/powerplay: fix out of memory check on 
od8_settings

From: Colin Ian King 

The null pointer check on od8_settings is currently the opposite of what
it is intended to do. Fix this by adding in the missing ! operator.

Addressed-Coverity: ("Resource leak")
Fixes: 0c83d32c565c ("drm/amd/powerplay: simplified od_settings for each asic")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c 
b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
index 0f14fe14ecd8..eb9e6b3a5265 100644
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
@@ -1501,8 +1501,7 @@ static int vega20_set_default_od8_setttings(struct 
smu_context *smu)
 return -EINVAL;

 od8_settings = kzalloc(sizeof(struct vega20_od8_settings), GFP_KERNEL);
-
-   if (od8_settings)
+   if (!od8_settings)
 return -ENOMEM;

 smu->od_settings = (void *)od8_settings;
--
2.20.1

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH][next] drm/amdgpu/mes10.1: fix duplicated assignment to adev->mes.ucode_fw_version

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 11:05:39 AM
To: Deucher, Alexander; Koenig, Christian; Zhou, David(ChunMing); David Airlie; 
Daniel Vetter; Xiao, Jack; Zhang, Hawking; amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH][next] drm/amdgpu/mes10.1: fix duplicated assignment to 
adev->mes.ucode_fw_version

From: Colin Ian King 

Currently adev->mes.ucode_fw_version is being assigned twice with
different values. This looks like a cut-n-paste error and instead
the second assignment should be adev->mes.data_fw_version. Fix
this.

Addresses-Coverity: ("Unused value")
Fixes: 298d05460cc4 ("drm/amdgpu/mes10.1: load mes firmware file to CPU buffer")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/amdgpu/mes_v10_1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c 
b/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
index 29fab7984855..2a27f0b30bb5 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
@@ -91,7 +91,7 @@ static int mes_v10_1_init_microcode(struct amdgpu_device 
*adev)

 mes_hdr = (const struct mes_firmware_header_v1_0 *)adev->mes.fw->data;
 adev->mes.ucode_fw_version = le32_to_cpu(mes_hdr->mes_ucode_version);
-   adev->mes.ucode_fw_version =
+   adev->mes.data_fw_version =
 le32_to_cpu(mes_hdr->mes_ucode_data_version);
 adev->mes.uc_start_addr =
 le32_to_cpu(mes_hdr->mes_uc_start_addr_lo) |
--
2.20.1

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH][next] drm/amd/powerplay: remove a less than zero uint32_t check

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 11:28:04 AM
To: Rex Zhu; Quan, Evan; Deucher, Alexander; Koenig, Christian; Zhou, 
David(ChunMing); David Airlie; Daniel Vetter; amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH][next] drm/amd/powerplay: remove a less than zero uint32_t check

From: Colin Ian King 

The check to see if the uint32_t variable 'size' is less than zero
is redundant as it is unsigned and can never be less than zero.
Remove this redundant check.

Addresses-Coverity: ("Unsigned compared to zero")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c 
b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index ac151da..6ea48d6 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1043,9 +1043,6 @@ static int navi10_set_power_profile_mode(struct 
smu_context *smu, long *input, u
 }

 if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-   if (size < 0)
-   return -EINVAL;
-
 ret = smu_update_table(smu,
SMU_TABLE_ACTIVITY_MONITOR_COEFF | 
WORKLOAD_PPLIB_CUSTOM_BIT << 16,
(void *)(_monitor), false);
--
2.7.4

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/powerplay: fix incorrect assignments to mclk_mask and soc_mask

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 10:45:17 AM
To: Wang, Kevin(Yang); Rex Zhu; Quan, Evan; Deucher, Alexander; Koenig, 
Christian; Zhou, David(ChunMing); David Airlie; Daniel Vetter; 
amd-...@lists.freedesktop.org; dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH] drm/amd/powerplay: fix incorrect assignments to mclk_mask and 
soc_mask

From: Colin Ian King 

There are null pointer checks on mlck_mask and soc_mask however the
sclk_mask is being used in assignments in what looks to be a cut-n-paste
coding error. Fix this by using the correct pointers in the assignments.

Addresses-Coverity: ("Dereference after null check")
Fixes: 2d9fb9b06643 ("drm/amd/powerplay: add function get_profiling_clk_mask 
for navi10")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c 
b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 27e5c80..ac151da 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -1134,14 +1134,14 @@ static int navi10_get_profiling_clk_mask(struct 
smu_context *smu,
 ret = smu_get_dpm_level_count(smu, SMU_MCLK, 
_count);
 if (ret)
 return ret;
-   *sclk_mask = level_count - 1;
+   *mclk_mask = level_count - 1;
 }

 if(soc_mask) {
 ret = smu_get_dpm_level_count(smu, SMU_SOCCLK, 
_count);
 if (ret)
 return ret;
-   *sclk_mask = level_count - 1;
+   *soc_mask = level_count - 1;
 }
 }

--
2.7.4

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/powerplay: fix off-by-one array bounds check

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 10:24:02 AM
To: Rex Zhu; Quan, Evan; Deucher, Alexander; Koenig, Christian; Zhou, 
David(ChunMing); David Airlie; Daniel Vetter; amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH] drm/amd/powerplay: fix off-by-one array bounds check

From: Colin Ian King 

The array bounds check for index is currently off-by-one and should
be using >= rather than > on the upper bound. Fix this.

Addresses-Coverity: ("Out-of-bounds read")
Fixes: b3490673f905 ("drm/amd/powerplay: introduce the navi10 pptable 
implementation")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c 
b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 27e5c80..f678700 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -210,7 +210,7 @@ static int navi10_workload_map[] = {
 static int navi10_get_smu_msg_index(struct smu_context *smc, uint32_t index)
 {
 int val;
-   if (index > SMU_MSG_MAX_COUNT)
+   if (index >= SMU_MSG_MAX_COUNT)
 return -EINVAL;

 val = navi10_message_map[index];
--
2.7.4

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH][next] drm/amdkfd: fix a missing break in a switch statement

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 10:54:43 AM
To: Cox, Philip; Oded Gabbay; Deucher, Alexander; Koenig, Christian; Zhou, 
David(ChunMing); David Airlie; Daniel Vetter; dri-devel@lists.freedesktop.org; 
amd-...@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH][next] drm/amdkfd: fix a missing break in a switch statement

From: Colin Ian King 

Currently for the CHIP_RAVEN case there is a missing break
causing the code to fall through to the new CHIP_NAVI10 case.
Fix this by adding in the missing break statement.

Fixes: 14328aa58ce5 ("drm/amdkfd: Add navi10 support to amdkfd. (v3)")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
index 792371442195..4e3fc284f6ac 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
@@ -668,6 +668,7 @@ static int kfd_fill_gpu_cache_info(struct kfd_dev *kdev,
 case CHIP_RAVEN:
 pcache_info = raven_cache_info;
 num_of_cache_types = ARRAY_SIZE(raven_cache_info);
+   break;
 case CHIP_NAVI10:
 pcache_info = navi10_cache_info;
 num_of_cache_types = ARRAY_SIZE(navi10_cache_info);
--
2.20.1

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH][next] drm/amdgpu: fix off-by-one comparison on a WARN_ON message

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 10:08:01 AM
To: Zhang, Hawking; Deucher, Alexander; Koenig, Christian; Zhou, 
David(ChunMing); David Airlie; Daniel Vetter; amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH][next] drm/amdgpu: fix off-by-one comparison on a WARN_ON 
message

From: Colin Ian King 

The WARN_ON is currently throwing a warning when i is 65 or higher which
is off by one. It should be 64 or higher (64 queues from 0..63 inclusive),
so fix this off-by-one comparison.

Fixes: 849aca9f9c03 ("drm/amdgpu: Move common code to amdgpu_gfx.c")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 74066e1466f7..c8d106c59e27 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -501,7 +501,7 @@ int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev)
 /* This situation may be hit in the future if a new HW
  * generation exposes more than 64 queues. If so, the
  * definition of queue_mask needs updating */
-   if (WARN_ON(i > (sizeof(queue_mask)*8))) {
+   if (WARN_ON(i >= (sizeof(queue_mask)*8))) {
 DRM_ERROR("Invalid KCQ enabled: %d\n", i);
 break;
 }
--
2.20.1

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

2019-06-28 Thread Abramov, Slava
Acked-by: Slava Abramov 


From: amd-gfx  on behalf of Colin King 

Sent: Friday, June 28, 2019 10:33:20 AM
To: Zhang, Hawking; Deucher, Alexander; Koenig, Christian; Zhou, 
David(ChunMing); David Airlie; Daniel Vetter; amd-...@lists.freedesktop.org; 
dri-devel@lists.freedesktop.org
Cc: kernel-janit...@vger.kernel.org; linux-ker...@vger.kernel.org
Subject: [PATCH] drm/amdgpu: fix a missing break in a switch statement

From: Colin Ian King 

Currently for the AMDGPU_IRQ_STATE_DISABLE there is a missing break
causing the code to fall through to the AMDGPU_IRQ_STATE_ENABLE case.
Fix this by adding in the missing break statement.

Addresses-Coverity: ("Missing break in switch")
Fixes: a644d85a5cd4 ("drm/amdgpu: add gfx v10 implementation (v10)")
Signed-off-by: Colin Ian King 
---
 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index 2932ade7dbd0..c165200361b2 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -4608,6 +4608,7 @@ gfx_v10_0_set_gfx_eop_interrupt_state(struct 
amdgpu_device *adev,
 cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0,
 TIME_STAMP_INT_ENABLE, 0);
 WREG32(cp_int_cntl_reg, cp_int_cntl);
+   break;
 case AMDGPU_IRQ_STATE_ENABLE:
 cp_int_cntl = RREG32(cp_int_cntl_reg);
 cp_int_cntl = REG_SET_FIELD(cp_int_cntl, CP_INT_CNTL_RING0,
--
2.20.1

___
amd-gfx mailing list
amd-...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel