From patchwork Sat Sep 21 20:42:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Schulz X-Patchwork-Id: 830250 Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51D5A18EA2 for ; Sat, 21 Sep 2024 20:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726951381; cv=none; b=dOauazkLsQyTmr68zKpr3TAuJnx8ZON3P4DvFMU37cG0P2WUkWsHoX5GXKlWpD/68ssgS+SbyPmVQ7moO5L1HoG91LmA1hnxTHNmlhM8ed9fl6k4RxUlnbpz+NQ5oNXdbsN3sG+mMNSdRbCVZjJkYFGb5ewLj5k+dtjkH187ZcI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726951381; c=relaxed/simple; bh=trcYW71Wt+lJxSeuc2MSvhSbsMAH7DlCNGUaHCrVx8E=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=IcrWyBnVoMzrPeRWTNWHEmeGVvkPaKlOsRmyDt90C0jPUnk5jt9I0BtIV/SrH3oj1Z2Tf8fFmMXF0wUqOqgK4RwJ89xjXyfBqL95bb4MBSkbJOheVL6R5FRQ0kgCoIx3xH81wElXk6jmOGA43jj5xhEJjFJFSS5anW0YYe0Tk5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=UrOHHLnY; arc=none smtp.client-ip=185.70.43.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="UrOHHLnY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1726951377; x=1727210577; bh=Bgc9ku9ZnIZuPji3nNLEhFTzuk+iakKOr6H5Ksl/pJo=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=UrOHHLnYiZfgLNjT+q/rbrqWzAue5Tk37qZK8fb6CVl3GrhKNET7B8W8PSqsAoRmt GSqgoeDoR2meVZ6wGRoMKTyy7EQLrEiMmGoR4Fwugrfh/aw0UvE38LWh009mE/LAX6 pkdFTxyuqZoFCZrX8NbNFn4D/nfhAX8NcGyZ+SaTmZQJdlRdtv3NoPZA8I9446Tdcv MbvxzGoDtsYipOgSKptnhcX0VUekFThgkzhp+K9VOhOX1UAnqnmj8zhroWlOmN7Xgd mnwYUpzEtMKCtyh6dhw54MUqOb7XUA3itq1FNQ8I7LdTNNYYBQcjRb8SIhvDPqWyQQ X9yzacTo3AL/w== Date: Sat, 21 Sep 2024 20:42:54 +0000 To: linux-arm-msm@vger.kernel.org From: John Schulz Cc: John Schulz Subject: [PATCH] drivers/gpu: Switching Adreno x1-85 device check to family check. Message-ID: <20240921204237.8006-1-john.schulz1@protonmail.com> Feedback-ID: 15150580:user:proton X-Pm-Message-ID: d4549f5c7f780cbc0fbc7e7ccaf4a4325d948123 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Switches the is_x185 check to is_x1xx_family to accommodate more devices. Note that I got the X1-45 GPU ID from Windows which may not be correct. Signed-off-by: John Schulz --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 3 ++- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 06cab2c6fd66..f04aeacae3c2 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -2,6 +2,7 @@ /* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. */ +#include "adreno_gpu.h" #include "msm_gem.h" #include "msm_mmu.h" #include "msm_gpu_trace.h" @@ -1026,7 +1027,7 @@ static int hw_init(struct msm_gpu *gpu) gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, BIT(7) | 0x1); /* Set weights for bicubic filtering */ - if (adreno_is_a650_family(adreno_gpu) || adreno_is_x185(adreno_gpu)) { + if (adreno_is_a650_family(adreno_gpu) || adreno_is_x1xx_family(adreno_gpu)) { gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_0, 0); gpu_write(gpu, REG_A6XX_TPL1_BICUBIC_WEIGHTS_TABLE_1, 0x3fe05ff4); diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index 58d7e7915c57..ec36fc915433 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -526,9 +526,15 @@ static inline int adreno_is_a750(struct adreno_gpu *gpu) return gpu->info->chip_ids[0] == 0x43051401; } -static inline int adreno_is_x185(struct adreno_gpu *gpu) -{ - return gpu->info->chip_ids[0] == 0x43050c01; +static inline int adreno_is_x1xx_family(struct adreno_gpu *gpu) +{ + switch (gpu->info->chip_ids[0]) { + case 0x1fc31043; // X1-45 + case 0x43050c01; // X1-85 + return 1; + default: + return 0; + } } static inline int adreno_is_a740_family(struct adreno_gpu *gpu)