Module: Mesa
Branch: master
Commit: 13b2beb41597a8c89fa1f74639c143d95931ed56
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=13b2beb41597a8c89fa1f74639c143d95931ed56

Author: Michel Dänzer <[email protected]>
Date:   Wed Nov 18 17:54:19 2020 +0100

ac: Don't negate strstr return values in ac_query_gpu_info

strstr returns a pointer to the needle sub-string within the haystack
string if the latter contains the former, or NULL otherwise. So this
essentially always set info->is_pro_graphics = true, since probably no
marketing name ever contains all of these sub-strings.

Fixes: b635dff25620 "ac: fix detection of Pro graphics"
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7675>

---

 src/amd/common/ac_gpu_info.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c
index 75f3a466113..dd52f38b573 100644
--- a/src/amd/common/ac_gpu_info.c
+++ b/src/amd/common/ac_gpu_info.c
@@ -468,9 +468,9 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct 
radeon_info *info,
    info->family_id = amdinfo->family_id;
    info->chip_external_rev = amdinfo->chip_external_rev;
    info->marketing_name = amdgpu_get_marketing_name(dev);
-   info->is_pro_graphics = info->marketing_name && 
(!strstr(info->marketing_name, "Pro") ||
-                                                    
!strstr(info->marketing_name, "PRO") ||
-                                                    
!strstr(info->marketing_name, "Frontier"));
+   info->is_pro_graphics = info->marketing_name && 
(strstr(info->marketing_name, "Pro") ||
+                                                    
strstr(info->marketing_name, "PRO") ||
+                                                    
strstr(info->marketing_name, "Frontier"));
 
    /* Set which chips have dedicated VRAM. */
    info->has_dedicated_vram = !(amdinfo->ids_flags & AMDGPU_IDS_FLAGS_FUSION);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to