From patchwork Sun Jun 4 20:35:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 689357 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3A8EC7EE2F for ; Sun, 4 Jun 2023 20:35:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231390AbjFDUfy (ORCPT ); Sun, 4 Jun 2023 16:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231389AbjFDUfx (ORCPT ); Sun, 4 Jun 2023 16:35:53 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D181DA for ; Sun, 4 Jun 2023 13:35:51 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f619c2ba18so1621900e87.1 for ; Sun, 04 Jun 2023 13:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685910950; x=1688502950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8oXWv92/YQvcSL7BkNAGtHY7pS94v05uKS+kdUroQoA=; b=LkvMQgeo3ws6sLix/VpSD1bG9JNtLBy2G94Cf9G1GHtCCczL5H3PHMyU/iMLc8T/PF 1QabypGwf+1AtMrVYDiMqsaut09wVhNLRiRNwMO85/s3RxZ54DItwWgeST5Ib3LZYG1I 1Ufb0d814L5VQ8F9Xjkc2c1+NxuelRa0Fom4hoPHpBzxpXfjDp5saETQSA6ZXoqhvnJF 9HkEzTu0KlUxRUVwt9rd2AQnZJqA5AsqN3n/jtBVVCANowaDHPpMpmdjUNLWufficY4i sO3dHWGMtDgkEMAfwhkVFF2PaUBWjlNv25qEr61rXmgBJc0ShRSJqoJMxw7ZPOqgFDjZ woLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685910950; x=1688502950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8oXWv92/YQvcSL7BkNAGtHY7pS94v05uKS+kdUroQoA=; b=gBIVPYvxMWtYDS5MQxJsVWZQUKJX3aveOlmbFY0YtzQBv53XC2vj09aU+YCgPs/QuP f96H/ZihzMOCyR0Tvnsjb9WAydCEAJnrumVA+QlzvYLJJ/rbC9vvmEvhQSZ4vMlcVNcL +PDBsB+cRHlQhQuw18dTG7+U4easGL8ii8EtKEtRkfl3MX3yhES8cXBIfyZqXKujq+z5 lwsh5endWc6a6IRncQaarz0PpzKpE0gANKebmQb4bBTJGj10tqd17Y1wlOt7L8Vfy350 DxSTV26aWwW/tB5KZpHUUlqOcU0ugVyF/Iuwjcbq/1mH3jRmT5lx9z67cN4R/519m1Ry vVew== X-Gm-Message-State: AC+VfDyQc0MW/SPQvnfel4S0ILOF1ibDW90XGb9G++63nOjzE6dDj76n 497r9O2Tk8SaFlcLQGSebHlBsg== X-Google-Smtp-Source: ACHHUZ64yQIpAMmpGBusTxhCA+dRRCjHt8YJaXo/2kCHYWVzJzVQeAxYZJ78MSYjNFK+9jHdlZP1Sw== X-Received: by 2002:ac2:47e6:0:b0:4f6:2156:51b5 with SMTP id b6-20020ac247e6000000b004f6215651b5mr1168139lfp.35.1685910949886; Sun, 04 Jun 2023 13:35:49 -0700 (PDT) Received: from eriador.lan (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id a19-20020a19f813000000b004f2794dcb4asm875822lff.255.2023.06.04.13.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jun 2023 13:35:49 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 15/22] drm/msm/dpu: inline DSC_BLK macros Date: Sun, 4 Jun 2023 23:35:25 +0300 Message-Id: <20230604203532.1094249-16-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230604203532.1094249-1-dmitry.baryshkov@linaro.org> References: <20230604203532.1094249-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org To simplify making changes to the hardware block definitions, expand corresponding macros. This way making all the changes are more obvious and visible in the source files. Signed-off-by: Dmitry Baryshkov --- .../msm/disp/dpu1/catalog/dpu_4_0_sdm845.h | 20 ++++++++--- .../msm/disp/dpu1/catalog/dpu_5_0_sm8150.h | 24 ++++++++++--- .../msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h | 36 +++++++++++++++---- .../msm/disp/dpu1/catalog/dpu_6_0_sm8250.h | 24 ++++++++++--- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 10 ------ 5 files changed, 86 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h index c289fbd76080..ab13032c0082 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h @@ -212,10 +212,22 @@ static const struct dpu_pingpong_cfg sdm845_pp[] = { }; static const struct dpu_dsc_cfg sdm845_dsc[] = { - DSC_BLK("dsc_0", DSC_0, 0x80000, 0), - DSC_BLK("dsc_1", DSC_1, 0x80400, 0), - DSC_BLK("dsc_2", DSC_2, 0x80800, 0), - DSC_BLK("dsc_3", DSC_3, 0x80c00, 0), + { + .name = "dsc_0", .id = DSC_0, + .base = 0x80000, .len = 0x1800, + }, + { + .name = "dsc_1", .id = DSC_1, + .base = 0x80400, .len = 0x1800, + }, + { + .name = "dsc_2", .id = DSC_2, + .base = 0x80800, .len = 0x1800, + }, + { + .name = "dsc_3", .id = DSC_3, + .base = 0x80c00, .len = 0x1800, + }, }; static const struct dpu_intf_cfg sdm845_intf[] = { diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h index b26a7d4b0ce7..05a38fd60cd3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_0_sm8150.h @@ -259,10 +259,26 @@ static const struct dpu_merge_3d_cfg sm8150_merge_3d[] = { }; static const struct dpu_dsc_cfg sm8150_dsc[] = { - DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)), + { + .name = "dsc_0", .id = DSC_0, + .base = 0x80000, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_1", .id = DSC_1, + .base = 0x80400, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_2", .id = DSC_2, + .base = 0x80800, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_3", .id = DSC_3, + .base = 0x80c00, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, }; static const struct dpu_intf_cfg sm8150_intf[] = { diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h index 4259de1dbfc2..f0037c1c4e4c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_5_1_sc8180x.h @@ -258,12 +258,36 @@ static const struct dpu_merge_3d_cfg sc8180x_merge_3d[] = { }; static const struct dpu_dsc_cfg sc8180x_dsc[] = { - DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_4", DSC_4, 0x81000, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_5", DSC_5, 0x81400, BIT(DPU_DSC_OUTPUT_CTRL)), + { + .name = "dsc_0", .id = DSC_0, + .base = 0x80000, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_1", .id = DSC_1, + .base = 0x80400, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_2", .id = DSC_2, + .base = 0x80800, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_3", .id = DSC_3, + .base = 0x80c00, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_4", .id = DSC_4, + .base = 0x81000, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_5", .id = DSC_5, + .base = 0x81400, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, }; static const struct dpu_intf_cfg sc8180x_intf[] = { diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h index b268466b2b7e..85b52fc82784 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_6_0_sm8250.h @@ -259,10 +259,26 @@ static const struct dpu_merge_3d_cfg sm8250_merge_3d[] = { }; static const struct dpu_dsc_cfg sm8250_dsc[] = { - DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)), - DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)), + { + .name = "dsc_0", .id = DSC_0, + .base = 0x80000, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_1", .id = DSC_1, + .base = 0x80400, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_2", .id = DSC_2, + .base = 0x80800, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, + { + .name = "dsc_3", .id = DSC_3, + .base = 0x80c00, .len = 0x1800, + .features = BIT(DPU_DSC_OUTPUT_CTRL), + }, }; static const struct dpu_intf_cfg sm8250_intf[] = { diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c index 67cc22210c4c..adc09a87ac48 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c @@ -490,16 +490,6 @@ static const struct dpu_pingpong_sub_blks sc7280_pp_sblk = { .sblk = NULL \ } -/************************************************************* - * DSC sub blocks config - *************************************************************/ -#define DSC_BLK(_name, _id, _base, _features) \ - {\ - .name = _name, .id = _id, \ - .base = _base, .len = 0x140, \ - .features = _features, \ - } - /************************************************************* * INTF sub blocks config *************************************************************/