From 493400cf1e2bf5bf81d927ea637d1c5f55c6aae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 18 Nov 2020 17:54:19 +0100 Subject: [PATCH] ac: Don't negate strstr return values in ac_query_gpu_info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- 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 8f3562cf425..3bfa1259ef1 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -441,9 +441,9 @@ bool ac_query_gpu_info(int fd, void *dev_p, 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")); + (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 =