From patchwork Mon Sep 4 02:04:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 720028 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 D0B35CA0FE3 for ; Mon, 4 Sep 2023 02:05:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350530AbjIDCFD (ORCPT ); Sun, 3 Sep 2023 22:05:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350360AbjIDCFC (ORCPT ); Sun, 3 Sep 2023 22:05:02 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 845E810A for ; Sun, 3 Sep 2023 19:04:58 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2bcc4347d2dso12733611fa.0 for ; Sun, 03 Sep 2023 19:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1693793096; x=1694397896; darn=vger.kernel.org; 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=VHLsmawO8YJUbD7foYhvrS8ZuNZpxIJ9tps5XjxyA5M=; b=o4VCPj5YHi86+i+DCU+i99vF1sgdu4n3ZT5RtKPXCS2FLsQ6o5pcwRRtCX2MA2faX7 YGlTDQeg/mwac2V+60L7mZzrnfdfjSuPLL7rzhohWVC07wqeFZEzOBO2rMUxmMeY4xEQ bQv1jVJSsuIsN7vps/24SlLWpo0CAUMHPVvxuVF30SFLfHYNpvn02+du/CvYaOr4UYXW x7+Rcwxx1Tjb+5RGMXJIDS6wQDitxtO5PxEGgnFV60lCCV/xpIbVKXawHYkRSp7nwfNm wSE4BQlCRQ91eUSyHHN9BWrHg2ScA2zV9TUauzlpP/u+7ZBsmQcSZEj8rcXS1nO4/kTc 1noA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693793096; x=1694397896; 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=VHLsmawO8YJUbD7foYhvrS8ZuNZpxIJ9tps5XjxyA5M=; b=GY3wyzx1lDj9yWQL16U9ybSUZmjzJxPD5onxVXc+VV2H+D7tPySFB76GOAMCYDR9jg /D5QB9/24V5BQKWY4UHKgKxcI8uOvcY/gNGxb7syOMxiV6uJsXc/ptmkx2NgdypsJ27v 3aTPNZFHw0UUGG8zUQO1LcbsmqAulFNiFnEIBtCRbP4b/tu+ETehj1cQHFI1AMUIOUm3 etDihBJdVAqlwpWrAEC3GH5gh9muHjxfeDQFY5uugghObCbipoRg1HmJjVX7rcAJpYo0 mym049hG1nDJkUfNBMbiCWDRjtlYmMI7c+mrl1lf017R1t+BuNwtHk46uid3dnoQD5Aw n+8w== X-Gm-Message-State: AOJu0Yx3wlV6y9U6vLDW/Y3UTQnljqAh/dzFwkdr09H8K4KE7YAKCvls xyajsV86uwkxBvaQYxCyIEYYRg== X-Google-Smtp-Source: AGHT+IE+2Yfq4u0kqraestEWo6xIjCVBQAPimXZVSpTk8IG0P/wMEfJmC/oNd+wc9c9gApNKbSJjTg== X-Received: by 2002:a2e:888f:0:b0:2b6:de52:357 with SMTP id k15-20020a2e888f000000b002b6de520357mr6156564lji.40.1693793095982; Sun, 03 Sep 2023 19:04:55 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id t13-20020a2e9c4d000000b002bce0e9385asm1818237ljj.9.2023.09.03.19.04.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Sep 2023 19:04:55 -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 v3 1/8] drm/msm/dpu: inline _setup_pingpong_ops() Date: Mon, 4 Sep 2023 05:04:47 +0300 Message-Id: <20230904020454.2945667-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230904020454.2945667-1-dmitry.baryshkov@linaro.org> References: <20230904020454.2945667-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Inline the _setup_pingpong_ops() function, it makes it easier to handle different conditions involving PINGPONG configuration. Reviewed-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd --- .../gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c index 437d9e62a841..9298c166b213 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_pingpong.c @@ -281,27 +281,6 @@ static int dpu_hw_pp_setup_dsc(struct dpu_hw_pingpong *pp) return 0; } -static void _setup_pingpong_ops(struct dpu_hw_pingpong *c, - unsigned long features) -{ - if (test_bit(DPU_PINGPONG_TE, &features)) { - c->ops.enable_tearcheck = dpu_hw_pp_enable_te; - c->ops.disable_tearcheck = dpu_hw_pp_disable_te; - c->ops.connect_external_te = dpu_hw_pp_connect_external_te; - c->ops.get_line_count = dpu_hw_pp_get_line_count; - c->ops.disable_autorefresh = dpu_hw_pp_disable_autorefresh; - } - - if (test_bit(DPU_PINGPONG_DSC, &features)) { - c->ops.setup_dsc = dpu_hw_pp_setup_dsc; - c->ops.enable_dsc = dpu_hw_pp_dsc_enable; - c->ops.disable_dsc = dpu_hw_pp_dsc_disable; - } - - if (test_bit(DPU_PINGPONG_DITHER, &features)) - c->ops.setup_dither = dpu_hw_pp_setup_dither; -}; - struct dpu_hw_pingpong *dpu_hw_pingpong_init(const struct dpu_pingpong_cfg *cfg, void __iomem *addr) { @@ -316,7 +295,23 @@ struct dpu_hw_pingpong *dpu_hw_pingpong_init(const struct dpu_pingpong_cfg *cfg, c->idx = cfg->id; c->caps = cfg; - _setup_pingpong_ops(c, c->caps->features); + + if (test_bit(DPU_PINGPONG_TE, &cfg->features)) { + c->ops.enable_tearcheck = dpu_hw_pp_enable_te; + c->ops.disable_tearcheck = dpu_hw_pp_disable_te; + c->ops.connect_external_te = dpu_hw_pp_connect_external_te; + c->ops.get_line_count = dpu_hw_pp_get_line_count; + c->ops.disable_autorefresh = dpu_hw_pp_disable_autorefresh; + } + + if (test_bit(DPU_PINGPONG_DSC, &cfg->features)) { + c->ops.setup_dsc = dpu_hw_pp_setup_dsc; + c->ops.enable_dsc = dpu_hw_pp_dsc_enable; + c->ops.disable_dsc = dpu_hw_pp_dsc_disable; + } + + if (test_bit(DPU_PINGPONG_DITHER, &cfg->features)) + c->ops.setup_dither = dpu_hw_pp_setup_dither; return c; }