From patchwork Sat Nov 23 05:44:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13883760 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1C56E6ADE2 for ; Sat, 23 Nov 2024 05:45:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9243810E259; Sat, 23 Nov 2024 05:45:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="khMrq/19"; dkim-atps=neutral Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35A0F10E259 for ; Sat, 23 Nov 2024 05:45:05 +0000 (UTC) Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-53dd0cb9ce3so2462414e87.3 for ; Fri, 22 Nov 2024 21:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732340703; x=1732945503; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=F/nCfdT94fyFdmLpDtTnLp3HU3nkqA/lIsXWnP4b+r8=; b=khMrq/19voFc4MFTQYANUpAqGJTniaUmvc5CNeFzRPzImc/4oq3GRApAakhWCKHEY2 j3LYpLYvNWRc0Xardnun1n32eELJx3M6pfPq3mSpdw4woXhOlU7MAQVFk8MkMMdRzX+M BfMSzAqhe/UZmHyraqBpgOIH3sb2Dkct8ZhghQW9q3Pd1us2A4ws72GAZ1xcX7XixJb1 DdrU3f5Tt8ikGxdcYj9zoPdrINav4bfCI9bGeJM9VamR4DOn0WvmoWrX25O0CHfN4L/a eEl+rMu2l9LeR9seman4OaGj6Y2MgA0BLuMvjLtldp3IEjfSGAVB+RpQjRtirT1V7jas uoRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732340703; x=1732945503; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F/nCfdT94fyFdmLpDtTnLp3HU3nkqA/lIsXWnP4b+r8=; b=AQvQwwFznFSJO1IbMMMBy4ExnY4MrLlooSQZ74n5IzeOi9LwMBLzGHWDXcgSFmFGq1 sSbce/6xf6ZibXrGa/7vZ4kJabQPytS7ce4+nhDBG4Bw821r+VfQ6GjED4L11r4jNDJg yqX71/7Y3gyfI5AMjK+rilyDpzTk94Qj+mWbez4FVr1NUY151CZJYfLcKYmMSujQhV+T IK0GLUiFffQi8l268e1i5f6S1vBV4i3qXEvlXkmPyyAWfOPeJdoUxtpzldCZKfyrJyQN Z/ovxbzJGAh1gt26y6kZburkNtHqTdoHcsooN/T9Qn8qxXNFv7sVyTUICLk9nXjfl/g9 nZgg== X-Forwarded-Encrypted: i=1; AJvYcCW/J9ls3bbyaxjr486IJWTwOlabAI1TOduFq2raYLb7S/OaMQzTabydFSGs9VuBLt3TWzLFf60YZOs=@lists.freedesktop.org X-Gm-Message-State: AOJu0YzR+Hfq3xvnrxvJ8QmgKwj/BufxFyP7JR5hCUBq0k8M3jOgvF0h hIADpdDfJBJYzKgTserJAXvpZ78i2HULzEL68gTGsE2k4MsjWxz8C4LNxYJFaac= X-Gm-Gg: ASbGnctxxDhjNnPMob8kMFE9b/a7iaLZsDm+dum2MbOxf+JtYN+2J1ErQO23ozMxZC6 GlnkUL+sznL+OSX1GqeI5S1LE+8+mggSSkprH/0MV+yDpdyEeky8vvcHCLU9UYrarHCVPngLEzE vxpfaxp7vzJWefsNcZ0QF5W1Xbyhm7URUv0LWe+YHpu0cUNd3cxzVKej7pxCEjwn0Dl33wn3DEJ OTRkREMXIhljy5/1IJcJ6tl+2AwPsGN+Pep47O5+Mlx5wsb6H4LIy0mOA== X-Google-Smtp-Source: AGHT+IFY49Rgn1MaIQDHpFNZUMu1vu8VWeMQfbuzyBAcqr3XvF3KCIyE4wfVVxUlCuwrgJywOYILLg== X-Received: by 2002:ac2:4f11:0:b0:539:e1c6:9d7f with SMTP id 2adb3069b0e04-53dd389d698mr2913067e87.25.1732340703363; Fri, 22 Nov 2024 21:45:03 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53dd24457e1sm740143e87.34.2024.11.22.21.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 21:45:02 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 23 Nov 2024 07:44:54 +0200 Subject: [PATCH v2 1/3] drm/msm/mdss: define bitfields for the UBWC_STATIC register MIME-Version: 1.0 Message-Id: <20241123-msm-mdss-ubwc-v2-1-41344bc6ef9c@linaro.org> References: <20241123-msm-mdss-ubwc-v2-0-41344bc6ef9c@linaro.org> In-Reply-To: <20241123-msm-mdss-ubwc-v2-0-41344bc6ef9c@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Connor Abbott , David Airlie , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5924; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=Y68Ugbn4mNiWYoL63ZWT5oQDamfsA6evrZEL1K8NhkE=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnQWvax+ERF5jWnoJ2D5csc83mmx3JD2vw5Eoms uXY7FLT8QWJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0Fr2gAKCRCLPIo+Aiko 1UZBB/45xpSd2K4g1tGqC0fO7jL9S+4VJS9xjljQccCOrTeJuqqpnlre/xgbYxLWh0uVQwgR5KC 2sTB8byJ384FGqyK4mwOxKEa3UP7jsQUYECX73tQrVyPPQS7Yj3s+dkJND+bU/h8/2REK+3+PFr DoJbdGpQ9jvHySdJW6oF5FF64pOx6kP2eiC2y+2k1iRHFkdHyTGVT1vlix/Wi2Hp6l34JPpfrq3 JXxOnreX/vtQYG053n+RPGI+anQ/Sf0llf0CsIMaYTVgjuhgcCBvp9SXdLbV2bOZ5NFxFEw+u5L SVj7ibE6LGutfSSRWWyv2lKtRr5Zn3++rKnpfCYb/gvtyexG X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Rather than hand-coding UBWC_STATIC value calculation, define corresponding bitfields and use them to setup the register value. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_mdss.c | 38 +++++++++++++++----------- drivers/gpu/drm/msm/msm_mdss.h | 3 +- drivers/gpu/drm/msm/registers/display/mdss.xml | 11 +++++++- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index b7bd899ead44bf86998e7295bccb31a334fa6811..4b57f39bec4e6232a0f5b4d49f8ae1200e74ac78 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -173,15 +173,17 @@ static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss) static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss) { const struct msm_mdss_data *data = msm_mdss->mdss_data; - u32 value = (data->ubwc_swizzle & 0x1) | - (data->highest_bank_bit & 0x3) << 4 | - (data->macrotile_mode & 0x1) << 12; + u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle & 0x1) | + MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit); + + if (data->macrotile_mode) + value |= MDSS_UBWC_STATIC_MACROTILE_MODE; if (data->ubwc_enc_version == UBWC_3_0) - value |= BIT(10); + value |= MDSS_UBWC_STATIC_UBWC_AMSBC; if (data->ubwc_enc_version == UBWC_1_0) - value |= BIT(8); + value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN; writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC); } @@ -189,10 +191,14 @@ static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss) static void msm_mdss_setup_ubwc_dec_40(struct msm_mdss *msm_mdss) { const struct msm_mdss_data *data = msm_mdss->mdss_data; - u32 value = (data->ubwc_swizzle & 0x7) | - (data->ubwc_static & 0x1) << 3 | - (data->highest_bank_bit & 0x7) << 4 | - (data->macrotile_mode & 0x1) << 12; + u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle) | + MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit); + + if (data->ubwc_bank_spread) + value |= MDSS_UBWC_STATIC_UBWC_BANK_SPREAD; + + if (data->macrotile_mode) + value |= MDSS_UBWC_STATIC_MACROTILE_MODE; writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC); @@ -572,7 +578,7 @@ static const struct msm_mdss_data sa8775p_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_dec_version = UBWC_4_0, .ubwc_swizzle = 4, - .ubwc_static = 1, + .ubwc_bank_spread = true, .highest_bank_bit = 0, .macrotile_mode = 1, .reg_bus_bw = 74000, @@ -590,7 +596,7 @@ static const struct msm_mdss_data sc7280_data = { .ubwc_enc_version = UBWC_3_0, .ubwc_dec_version = UBWC_4_0, .ubwc_swizzle = 6, - .ubwc_static = 1, + .ubwc_bank_spread = true, .highest_bank_bit = 1, .macrotile_mode = 1, .reg_bus_bw = 74000, @@ -608,7 +614,7 @@ static const struct msm_mdss_data sc8280xp_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_dec_version = UBWC_4_0, .ubwc_swizzle = 6, - .ubwc_static = 1, + .ubwc_bank_spread = true, .highest_bank_bit = 3, .macrotile_mode = 1, .reg_bus_bw = 76800, @@ -671,7 +677,7 @@ static const struct msm_mdss_data sm8250_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_dec_version = UBWC_4_0, .ubwc_swizzle = 6, - .ubwc_static = 1, + .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, .macrotile_mode = 1, @@ -682,7 +688,7 @@ static const struct msm_mdss_data sm8350_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_dec_version = UBWC_4_0, .ubwc_swizzle = 6, - .ubwc_static = 1, + .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, .macrotile_mode = 1, @@ -693,7 +699,7 @@ static const struct msm_mdss_data sm8550_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_dec_version = UBWC_4_3, .ubwc_swizzle = 6, - .ubwc_static = 1, + .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, .macrotile_mode = 1, @@ -704,7 +710,7 @@ static const struct msm_mdss_data x1e80100_data = { .ubwc_enc_version = UBWC_4_0, .ubwc_dec_version = UBWC_4_3, .ubwc_swizzle = 6, - .ubwc_static = 1, + .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, .macrotile_mode = 1, diff --git a/drivers/gpu/drm/msm/msm_mdss.h b/drivers/gpu/drm/msm/msm_mdss.h index 3afef4b1786d28902799333ff66c8b3ad0ab77fa..715e1426093de5a4f3b7d2b66b889573c30b7b5c 100644 --- a/drivers/gpu/drm/msm/msm_mdss.h +++ b/drivers/gpu/drm/msm/msm_mdss.h @@ -13,7 +13,8 @@ struct msm_mdss_data { u32 ubwc_swizzle; u32 ubwc_static; u32 highest_bank_bit; - u32 macrotile_mode; + bool ubwc_bank_spread; + bool macrotile_mode; u32 reg_bus_bw; }; diff --git a/drivers/gpu/drm/msm/registers/display/mdss.xml b/drivers/gpu/drm/msm/registers/display/mdss.xml index ac85caf1575c7908bcf68f0249da38dccf4f07b6..b6f93984928522a35a782cbad9de006eac225725 100644 --- a/drivers/gpu/drm/msm/registers/display/mdss.xml +++ b/drivers/gpu/drm/msm/registers/display/mdss.xml @@ -21,7 +21,16 @@ xsi:schemaLocation="https://gitlab.freedesktop.org/freedreno/ rules-fd.xsd"> - + + + + + + + + + + From patchwork Sat Nov 23 05:44:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13883761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1DB2E6ADC6 for ; Sat, 23 Nov 2024 05:45:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37D8A10E30F; Sat, 23 Nov 2024 05:45:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qc+ZMlVw"; dkim-atps=neutral Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEBDA10E25A for ; Sat, 23 Nov 2024 05:45:07 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-53da209492cso3717386e87.3 for ; Fri, 22 Nov 2024 21:45:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732340706; x=1732945506; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7DrDg8Sfy8VjRbQb9wXIsHbLpgOpk0bBFDGmPm833LU=; b=qc+ZMlVwu5P1azF8Q1G4287QgL5uWh/vR2pPRLbw/I04dQHH2bM48INzhStlXhQxOk VqC4MU1ok6DHcDv6fRQhdPmu7NuwjJbuCavR18RplIiuB6UJaXOTOzFWtTB+s1OtHkbS 8as7D0NbklxpxpLCB1vnyHPuhew1opkNsNzWrRCirSNqH7OEdmksX2UOCiOMn9xqmdpi Bau6jvsKIWF2zy7xYmtw3ZDO3Aqx6D90A5DjLjAobuQwbmSJpncTLqBchHIxIx1xlZGh PC9X6nzBEflqh6lJpKg01Audp43CnFnH6Y1uevbnZbnr2Acz51J9FtnYKmvE2Jg6O7cS oKJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732340706; x=1732945506; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7DrDg8Sfy8VjRbQb9wXIsHbLpgOpk0bBFDGmPm833LU=; b=cTiQ4eJRrrLImLdpwLjnso1FQNMkdWzEMqfn4+n9JQAPOZERTE5Bei69QUrk0UYRJj wt+GLtSUMwNmtNo/9mwO4jClPFOtRJDN2UoZ80oG3INSRUN9LZWAamGe3+my1ALwdhIB sJTeSbN5/2V1+asSMS2yIkLUWNSBhziY8Rm724oBWboH5IdDG9ciVcg0Hw0H3Cv+9yoX S+HXpgkZQKl+/8HNF/ZlyJEt9jXONpDk1GjUi56v/9kD3s4enX8ETF/OqxxHv5g6vTCI m/z6Yhhl2mgYpPSS6e0iNIEYzsE2bRdytqNBijjLlKl3FTg1UG4pUF2+IKGB0RsMGVDG zulg== X-Forwarded-Encrypted: i=1; AJvYcCVESku75auFEZdBqmvbctt1/UZR3N1t8hZ1TTSfBpv9HTSl1FukPEDz5LVDPSEvjBAbvAIXxO/MbgQ=@lists.freedesktop.org X-Gm-Message-State: AOJu0Ywu/jnu1iW44IcVZGqjvoaj+MFSLNJGcQne68fjJqD/gAgt9PRS fWnRt+17TPlZYjnE6WXtwDY3BEDiik/y4blohIaytlHRI8aLCv9L3BY0bEhPJ18= X-Gm-Gg: ASbGncssDdD5oe+tdP7JB2YEz9I7dXb7ZjqXWva+djHZxJKR/WTmFR+vcMTEEF5MDgA f//kieqP2Q1H1XXOEYPVZsJRRrDW/wUlXuAw/iQQwOggMa6ud658tALSFL3n697IrFI21H3xPMR lmwFG2JVQdcj8xTl4lb22QygO9OKXLgOWXNGtS3ZiAtAnvn2mo3OWGFtgJWfFdza+phemM0hSEE wgspLt0sLc/kAAkl6T55sXXQpoRBIISaXADKYXvtC/tBNK8Z5ZbTfKQdg== X-Google-Smtp-Source: AGHT+IHNt5F2db538ToS6v4lWa1hIYzGmz2N5AfeJ0J+hmybh71MXci0fQWRwaxAHDyf839+P0+6rw== X-Received: by 2002:a05:6512:3c83:b0:539:f7c1:5feb with SMTP id 2adb3069b0e04-53dd39a4b16mr2495567e87.39.1732340705843; Fri, 22 Nov 2024 21:45:05 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53dd24457e1sm740143e87.34.2024.11.22.21.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 21:45:04 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 23 Nov 2024 07:44:55 +0200 Subject: [PATCH v2 2/3] drm/msm/mdss: reuse defined bitfields for UBWC 2.0 MIME-Version: 1.0 Message-Id: <20241123-msm-mdss-ubwc-v2-2-41344bc6ef9c@linaro.org> References: <20241123-msm-mdss-ubwc-v2-0-41344bc6ef9c@linaro.org> In-Reply-To: <20241123-msm-mdss-ubwc-v2-0-41344bc6ef9c@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Connor Abbott , David Airlie , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2725; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=RCQrEDg9Jf371ZVvZyxUNDcRd0dYuvhxst+HGMFH54g=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnQWvaJC/hfMr53Xnp+aU8MlaVVv17sAyaPbzhy 7IVBxOCTZ2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0Fr2gAKCRCLPIo+Aiko 1dkOB/401lf+nszpksFsYEwE+4wZaylb0UuOyr6FiEosWoZPPznYOblrU4AVUIRMXw3X+cqS+cK jLxPa+zbtH+nUwqueapeeZHBZ6cjSuvYAvDUU77o/kz4/4gfdjyLSMvS2jJCRNFbvINciLFo78z soguSxPjKZ5eS+o4seBUMs6iuEGAstV1VGVfOI/tsTRWyCb6Wg1UxOpE8mIAgVz7SZhQOBtNjvQ VXCcQcK8JzupqDL9bJyAGAfGjKitrHrnzPpD2vopgG/x/WhsdtIGKevxK4aYoG5OhhG57xIe2ox AQWwwp26Gx5Tgj7y6lAtqfaiTCZLz5umIPQqiamiivqCkqLa X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Follow other msm_mdss_setup_ubwc_dec_nn functions and use individual bits instead of just specifying the value to be programmed to the UBWC_STATIC register. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_mdss.c | 17 +++++++++++++---- drivers/gpu/drm/msm/msm_mdss.h | 1 - 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index 4b57f39bec4e6232a0f5b4d49f8ae1200e74ac78..2fdad0fa4bc159e9a10755da2c0402fd87734aee 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -166,8 +166,16 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss) static void msm_mdss_setup_ubwc_dec_20(struct msm_mdss *msm_mdss) { const struct msm_mdss_data *data = msm_mdss->mdss_data; + u32 value = MDSS_UBWC_STATIC_UBWC_SWIZZLE(data->ubwc_swizzle) | + MDSS_UBWC_STATIC_HIGHEST_BANK_BIT(data->highest_bank_bit); - writel_relaxed(data->ubwc_static, msm_mdss->mmio + REG_MDSS_UBWC_STATIC); + if (data->ubwc_bank_spread) + value |= MDSS_UBWC_STATIC_UBWC_BANK_SPREAD; + + if (data->ubwc_enc_version == UBWC_1_0) + value |= MDSS_UBWC_STATIC_UBWC_MIN_ACC_LEN; + + writel_relaxed(value, msm_mdss->mmio + REG_MDSS_UBWC_STATIC); } static void msm_mdss_setup_ubwc_dec_30(struct msm_mdss *msm_mdss) @@ -587,7 +595,8 @@ static const struct msm_mdss_data sa8775p_data = { static const struct msm_mdss_data sc7180_data = { .ubwc_enc_version = UBWC_2_0, .ubwc_dec_version = UBWC_2_0, - .ubwc_static = 0x1e, + .ubwc_swizzle = 6, + .ubwc_bank_spread = true, .highest_bank_bit = 0x1, .reg_bus_bw = 76800, }; @@ -638,7 +647,7 @@ static const struct msm_mdss_data sm6350_data = { .ubwc_enc_version = UBWC_2_0, .ubwc_dec_version = UBWC_2_0, .ubwc_swizzle = 6, - .ubwc_static = 0x1e, + .ubwc_bank_spread = true, .highest_bank_bit = 1, .reg_bus_bw = 76800, }; @@ -661,7 +670,7 @@ static const struct msm_mdss_data sm6115_data = { .ubwc_enc_version = UBWC_1_0, .ubwc_dec_version = UBWC_2_0, .ubwc_swizzle = 7, - .ubwc_static = 0x11f, + .ubwc_bank_spread = true, .highest_bank_bit = 0x1, .reg_bus_bw = 76800, }; diff --git a/drivers/gpu/drm/msm/msm_mdss.h b/drivers/gpu/drm/msm/msm_mdss.h index 715e1426093de5a4f3b7d2b66b889573c30b7b5c..14dc53704314558841ee1fe08d93309fd2233812 100644 --- a/drivers/gpu/drm/msm/msm_mdss.h +++ b/drivers/gpu/drm/msm/msm_mdss.h @@ -11,7 +11,6 @@ struct msm_mdss_data { /* can be read from register 0x58 */ u32 ubwc_dec_version; u32 ubwc_swizzle; - u32 ubwc_static; u32 highest_bank_bit; bool ubwc_bank_spread; bool macrotile_mode; From patchwork Sat Nov 23 05:44:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 13883762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D49BE6ADE5 for ; Sat, 23 Nov 2024 05:45:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 37DA410E46E; Sat, 23 Nov 2024 05:45:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="zPCRWrBL"; dkim-atps=neutral Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 506CE10E30F for ; Sat, 23 Nov 2024 05:45:09 +0000 (UTC) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2fb5111747cso33389841fa.2 for ; Fri, 22 Nov 2024 21:45:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732340707; x=1732945507; darn=lists.freedesktop.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/hEtTqrfQSr9pI7m+IfwZIAeqdoTOG6+nBJQtRsFkFE=; b=zPCRWrBLTuC/UO1SLwk2wDjX6UjqUil6Bk6+5N3rAX7bDO3EjUn0TRCYt/gF7Apgmb lyWw8D7V5It3iZXuNv7TN78cxcbU+fPX08wJqvb8DluAEQ3jD1w8t8oAV/n6YeWldbAu rcA7kjVV2fpxHBaKh9HQO1N1GSS9MUlDfIdRZWySXkB6QubXl43uYK6OOPxvbnMzwFbq GILH1Il8jMjJNMmwmYwwSj9F4KPDW0Iz1Vpdly5DfFvlHgbmrW9RYvBZw+FuGDSBD+bH cJp/tNSQ+mnK/FFsjA6PaP13PVdHRT2G9QVOUoPI1QSOacN3KHsiu4N8Z7jecALkuRtt WMqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732340707; x=1732945507; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/hEtTqrfQSr9pI7m+IfwZIAeqdoTOG6+nBJQtRsFkFE=; b=S1D1rLYgU9okt5Rq67EatNwwpbzy5WEKqy5xc7q47BvccU8smUHkqUScg4jt2591fH aWapa68mhZKLC5hqvzWkNd4UBQijcpX3Bp3D/L3mNUUna98ie4jeTexdC4dTj3IF+GdA hyJ4axfxF7krSR5yxiBggs34igaDZ0Hq1Zsr/vksKH3GYClraY1qh7SY2LpO2CWm2bpb EARb6uC977CpiPK3Xvrm/ARi6uffJcP3taw6DJ7szcE6ZOzy8VxMwmqAbWdimVUDFbav AQLhEP0XYt3IVWISY/JexBs1vVA+n7WAY9plPTJPUFcYANXmVlMhtl9SUR4M1HdLJ7w3 kQNg== X-Forwarded-Encrypted: i=1; AJvYcCVQIs01jge60ncs8IRNwo7NUa5CySXAmRU3iC2jgzPQNKldsxom3jf0CWHK0aVM210I+2T2PGoTUHE=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yy1Z8t2ZcIbgZy9T8bU6ICjgGnXZY6sA3JHHy6dswdzLicMblqW xQtzqYu/nlosQ6Sn0eDYmOncJMGUe9Ozli1rCPf691CapeUyn7JYrp8PFM2joec= X-Gm-Gg: ASbGncuGgOvuogSA5ZEJUdlzvyVvR2U/eKPXToO55MsovpezN6bE3mtJTQgiYJVZFv4 uloHHFwibN+UqXG4O+q2zgaERO3zIm/dvU3cCzeqbkpxldtJQDLv8k3KRVz87iiB30otnVJlEaQ ZNS7EZvyuY61k5BPHPPZVxHdOor4Uo+WP/yZaJ6ZHzyZtoO3Y9q2vhx57q3asY1ohsFwhIvVBMu 6F/oKbvh5i3SxZJtsTjewlNWKXu6H9Xno4p8I1tSSipUykQXR+p430wTA== X-Google-Smtp-Source: AGHT+IEJNfzSkuCdzOOYuqLdhThDbipynbQzrrmzQe+8Fcb8wjmn7htIVDE2uytHwA9HycVmGGo/ww== X-Received: by 2002:a05:6512:3a8d:b0:53d:dbec:9fca with SMTP id 2adb3069b0e04-53ddbeca289mr516396e87.0.1732340707412; Fri, 22 Nov 2024 21:45:07 -0800 (PST) Received: from umbar.lan ([192.130.178.90]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53dd24457e1sm740143e87.34.2024.11.22.21.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 21:45:07 -0800 (PST) From: Dmitry Baryshkov Date: Sat, 23 Nov 2024 07:44:56 +0200 Subject: [PATCH v2 3/3] drm/msm/mdss: use boolean values for macrotile_mode MIME-Version: 1.0 Message-Id: <20241123-msm-mdss-ubwc-v2-3-41344bc6ef9c@linaro.org> References: <20241123-msm-mdss-ubwc-v2-0-41344bc6ef9c@linaro.org> In-Reply-To: <20241123-msm-mdss-ubwc-v2-0-41344bc6ef9c@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Connor Abbott , David Airlie , Simona Vetter Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2536; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=gdM2PmIA7KXreNC4e0p5DKW62M8digF3+8KzLk+7N4s=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBnQWvaGO+Y6FoVYTBQaZpzt8UIWJKd7OgPZXoQb 1CWB/ILgCCJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZ0Fr2gAKCRCLPIo+Aiko 1aiHCACm2sH3vJTnYnx5BmVp1ztQ3EUYnPTFk6PpxdglQX8AeznE9hDRIEelD+LPW43iHWofTU6 pkI62suQqYHajFWAEqWMO18EwqVqy8xODNIIV0GBVjgYSpuWvZlSix4uU/5q/T/Kwi9ygdrhe2z sNdynfWUQE2Ey1w1uwdNpWI2v/n4ETEGp+y50kNNaroNRRgX0nJOy4Qt4zwdij2pr6Fg/QvqHi5 6DpG0F50H4ZDjhi8BmRCgHDpijcmR2jRVWR9JaGB2LlmjHrVbRK0IiWFItjDK72fIio18UrkFxZ Ek0kVpOmVc/k+s/ED6PQDFAFrTg+2vnXABrRLWw9SGP24yXx X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The macrotile_mode is a flag, not a bit value. Use true/false values to set it rather than 1/0. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_mdss.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index 2fdad0fa4bc159e9a10755da2c0402fd87734aee..2d9db179accb0fd8666fe80371ea44a1fcc15e1f 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -588,7 +588,7 @@ static const struct msm_mdss_data sa8775p_data = { .ubwc_swizzle = 4, .ubwc_bank_spread = true, .highest_bank_bit = 0, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 74000, }; @@ -607,7 +607,7 @@ static const struct msm_mdss_data sc7280_data = { .ubwc_swizzle = 6, .ubwc_bank_spread = true, .highest_bank_bit = 1, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 74000, }; @@ -615,7 +615,7 @@ static const struct msm_mdss_data sc8180x_data = { .ubwc_enc_version = UBWC_3_0, .ubwc_dec_version = UBWC_3_0, .highest_bank_bit = 3, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 76800, }; @@ -625,7 +625,7 @@ static const struct msm_mdss_data sc8280xp_data = { .ubwc_swizzle = 6, .ubwc_bank_spread = true, .highest_bank_bit = 3, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 76800, }; @@ -689,7 +689,7 @@ static const struct msm_mdss_data sm8250_data = { .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 76800, }; @@ -700,7 +700,7 @@ static const struct msm_mdss_data sm8350_data = { .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 74000, }; @@ -711,7 +711,7 @@ static const struct msm_mdss_data sm8550_data = { .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, - .macrotile_mode = 1, + .macrotile_mode = true, .reg_bus_bw = 57000, }; @@ -722,7 +722,7 @@ static const struct msm_mdss_data x1e80100_data = { .ubwc_bank_spread = true, /* TODO: highest_bank_bit = 2 for LP_DDR4 */ .highest_bank_bit = 3, - .macrotile_mode = 1, + .macrotile_mode = true, /* TODO: Add reg_bus_bw with real value */ };