From patchwork Sun Apr 30 20:35:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 678035 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 078DBC77B7C for ; Sun, 30 Apr 2023 20:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbjD3UgC (ORCPT ); Sun, 30 Apr 2023 16:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjD3UgB (ORCPT ); Sun, 30 Apr 2023 16:36:01 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E8E9D2 for ; Sun, 30 Apr 2023 13:36:00 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2a8ba23a2abso17661301fa.2 for ; Sun, 30 Apr 2023 13:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682886959; x=1685478959; 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=5J+iFxf1ulALPVvSRXTgTvfbQT2He6CPNoNs7jBvyPc=; b=VBBHhsEGzJGwH7b+7+6WwqX45vTlQIaZmZKB8iwGFrpnihADVMv9NV95MaqONthA+V Kvzak/8iFyJzNrWbeppaFfaJRRH/Fl3CIcN8W/ZWkIW7L1gAGHQlIeL2ngLpVBAcykU6 XRq6XqqPQ675r+OS1+hn4CCTR1EBg1qPIvRRdNo97q6F91BOychzA68Ysc+bRQ0vs154 Tw15JB4jcO1MCw+MqgTtsEU+wA1bBQ38r679ebDfG0+p1koAn5q47Xc8wH3Laeq93Dqf VXaNiVwhL7rI6wlfzsPfZeDYRE8yu3W9wBlrI8VXcjk2zKoLFMIWfbQoZjZxiBwUaZB4 ldhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682886959; x=1685478959; 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=5J+iFxf1ulALPVvSRXTgTvfbQT2He6CPNoNs7jBvyPc=; b=kDrOwfcDJBa1JJKbiu/Ws3kCb2RkPDM+Ecw2SGFULwMRTAgYpfeZkkzgwvTYnD9XmU C9/oEY5L2hs8pkie3Sym8ihc9m8ATl4f5JAqeXCdUk61oXKTFSgYDysAZrUQWBXpulo7 tGvmeNm/LX/lHt9Dx0ZB+K3GDQF2Qd4Sp2E7oYzfEWwtC/3lT35WCON1FSMkATgNsTwc 09w/ZlA6SWpMbkdQXqWO3Hcpe59E9e5ro2Ogg7SaOgIyW2R1gun38lTzciBpyAF5Pd1/ iSErYuM8XuEJeG1e19VisB7NWJOfS7uqITs7IcoXZ9ik5wPryllPZtOpfZzWh4PjZfUu +c8A== X-Gm-Message-State: AC+VfDxR6rUmxzL2JMtpdlY1NO7suIazzrISMsL2WjEf3a0qEYDmUfe4 L04uO6cV6sCYPyFMxzvU1w1wRg== X-Google-Smtp-Source: ACHHUZ6hAAXso5vr870a9YPhqsjmLnZ4zsuXWtqlIk3M9l9AMNkHKknxJGOg9J9duRdBLxw2von2Tw== X-Received: by 2002:a2e:8608:0:b0:2a9:f9d2:7b44 with SMTP id a8-20020a2e8608000000b002a9f9d27b44mr3183297lji.40.1682886958885; Sun, 30 Apr 2023 13:35:58 -0700 (PDT) Received: from eriador.lan (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id b24-20020ac247f8000000b004edd4d1e55dsm4324634lfp.284.2023.04.30.13.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Apr 2023 13:35:58 -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 1/4] drm/msm/dpu: replace IS_ERR_OR_NULL with IS_ERR during DSC init Date: Sun, 30 Apr 2023 23:35:53 +0300 Message-Id: <20230430203556.3184252-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> References: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Using IS_ERR_OR_NULL() together with PTR_ERR() is a typical mistake. If the value is NULL, then the function will return 0 instead of a proper return code. Moreover dpu_hw_dsc_init() can not return NULL. Replace all dpu_rm_init()'s IS_ERR_OR_NULL() calls with IS_ERR(). This follows the commit 740828c73a36 ("drm/msm/dpu: fix error handling in dpu_rm_init"), which removed IS_ERR_OR_NULL() from RM init code, but then the commit f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM") added it back for DSC init. Suggested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index f0fc70422e56..dffd3dd0a877 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -247,7 +247,7 @@ int dpu_rm_init(struct dpu_rm *rm, const struct dpu_dsc_cfg *dsc = &cat->dsc[i]; hw = dpu_hw_dsc_init(dsc, mmio); - if (IS_ERR_OR_NULL(hw)) { + if (IS_ERR(hw)) { rc = PTR_ERR(hw); DPU_ERROR("failed dsc object creation: err %d\n", rc); goto fail; From patchwork Sun Apr 30 20:35:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 678033 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 B6264C77B73 for ; Sun, 30 Apr 2023 20:36:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbjD3UgD (ORCPT ); Sun, 30 Apr 2023 16:36:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjD3UgC (ORCPT ); Sun, 30 Apr 2023 16:36:02 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7822AE46 for ; Sun, 30 Apr 2023 13:36:01 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4eff50911bfso2296663e87.2 for ; Sun, 30 Apr 2023 13:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682886959; x=1685478959; 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=VHx+FQUbQw63eL4XXyWHX139/FutFZv8MJNz7Im6ZFU=; b=zb5a1gPzBj4i7Iq7BSjZSH2Vgagqp8OIesB143RJvz5QhN5eRk6AwezJ1D/pwz8bTj 7s2MYjbfAHQzdqZeDS7zKgyMI0YZYVaItaOapfbDxuEPPFV1RWpiFOJ8Pc9NlZQ3Ut8+ kfH2WT3LSsXBn9AXTCLi20Yk4fdXFTeu+s68wZP0iUoVig0fDhSyKD/Vf91ix1B23yMI tt0/Dmc4sdhq3KeFf4RNmK0avPvz8kRhZrUXyZKSllSk3c6nszx11CsKkbKCYGvdfvuW z1hYxzdUt7/Ou7779IBWblhzD0+3kA4nIuHDy6PgrN7M9mxvXhkYJ+5Iwo86OYEROcsH eQwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682886959; x=1685478959; 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=VHx+FQUbQw63eL4XXyWHX139/FutFZv8MJNz7Im6ZFU=; b=bVAnxu2pM4mcSIZfsIlg54Q+YpL1YtlHpydjXm7GCGbAYtj+fMVfNhwJFz+Z7QwL0b BiNxToZ3NDP1nmiK6iXd6Ox9TVjaUC+QXsQfGs4rU4Bxas79QeYl3muMhj2t+FntJtzt QTkFpQlv5zJqIzV4H2Y+s4dokLnMsJpg8dkTMMc/dEgs/0xM4eQecYRPPPbZkDKrESDH 7WKO5lPOgtVgtVzn/+RXNFPZqjTLWxsonEoxJeizwcYoe2tBTUnEnW248KTnE5kchatY RMXRjYcCs3y8K3F0J0wgwsc2BvQ1JwZuOgB5xcpvdpPWo/s77iORBzL+70+SgNcPASdw dWjw== X-Gm-Message-State: AC+VfDwDZv9CATTwxfoUG+3u+FSjLYAzJ9rxLP6wgp91itohxXkibaHf +P0kIbj2swBCrGGBnfHTgo9zzw== X-Google-Smtp-Source: ACHHUZ7rf85dypKGZgKj2L/G9uk1VPLUqTFodUanDhXNgOqobkulBVhyS7PRD+PuTNClDBk7qXYA9w== X-Received: by 2002:ac2:57cf:0:b0:4ed:c8ba:dfb2 with SMTP id k15-20020ac257cf000000b004edc8badfb2mr3412886lfo.65.1682886959578; Sun, 30 Apr 2023 13:35:59 -0700 (PDT) Received: from eriador.lan (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id b24-20020ac247f8000000b004edd4d1e55dsm4324634lfp.284.2023.04.30.13.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Apr 2023 13:35:59 -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 2/4] drm/msm/dpu: remove futile checks from dpu_rm_init() Date: Sun, 30 Apr 2023 23:35:54 +0300 Message-Id: <20230430203556.3184252-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> References: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dpu_rm_init() contains checks for block->id values. These were logical in the vendor driver, when one can not be sure which values were passed from DT. In the upstream driver this is not necessary: the catalog is a part of the driver, we control specified IDs. Suggested-by: Marijn Suijten Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 34 -------------------------- 1 file changed, 34 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index dffd3dd0a877..d5a06628885e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -122,10 +122,6 @@ int dpu_rm_init(struct dpu_rm *rm, continue; } - if (lm->id < LM_0 || lm->id >= LM_MAX) { - DPU_ERROR("skip mixer %d with invalid id\n", lm->id); - continue; - } hw = dpu_hw_lm_init(lm, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -139,10 +135,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_merge_3d *hw; const struct dpu_merge_3d_cfg *merge_3d = &cat->merge_3d[i]; - if (merge_3d->id < MERGE_3D_0 || merge_3d->id >= MERGE_3D_MAX) { - DPU_ERROR("skip merge_3d %d with invalid id\n", merge_3d->id); - continue; - } hw = dpu_hw_merge_3d_init(merge_3d, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -157,10 +149,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_pingpong *hw; const struct dpu_pingpong_cfg *pp = &cat->pingpong[i]; - if (pp->id < PINGPONG_0 || pp->id >= PINGPONG_MAX) { - DPU_ERROR("skip pingpong %d with invalid id\n", pp->id); - continue; - } hw = dpu_hw_pingpong_init(pp, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -177,10 +165,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_intf *hw; const struct dpu_intf_cfg *intf = &cat->intf[i]; - if (intf->id < INTF_0 || intf->id >= INTF_MAX) { - DPU_ERROR("skip intf %d with invalid id\n", intf->id); - continue; - } hw = dpu_hw_intf_init(intf, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -194,11 +178,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_wb *hw; const struct dpu_wb_cfg *wb = &cat->wb[i]; - if (wb->id < WB_0 || wb->id >= WB_MAX) { - DPU_ERROR("skip intf %d with invalid id\n", wb->id); - continue; - } - hw = dpu_hw_wb_init(wb, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -212,10 +191,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_ctl *hw; const struct dpu_ctl_cfg *ctl = &cat->ctl[i]; - if (ctl->id < CTL_0 || ctl->id >= CTL_MAX) { - DPU_ERROR("skip ctl %d with invalid id\n", ctl->id); - continue; - } hw = dpu_hw_ctl_init(ctl, mmio, cat->mixer_count, cat->mixer); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -229,10 +204,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_dspp *hw; const struct dpu_dspp_cfg *dspp = &cat->dspp[i]; - if (dspp->id < DSPP_0 || dspp->id >= DSPP_MAX) { - DPU_ERROR("skip dspp %d with invalid id\n", dspp->id); - continue; - } hw = dpu_hw_dspp_init(dspp, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw); @@ -259,11 +230,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_sspp *hw; const struct dpu_sspp_cfg *sspp = &cat->sspp[i]; - if (sspp->id < SSPP_NONE || sspp->id >= SSPP_MAX) { - DPU_ERROR("skip intf %d with invalid id\n", sspp->id); - continue; - } - hw = dpu_hw_sspp_init(sspp, mmio, cat->ubwc); if (IS_ERR(hw)) { rc = PTR_ERR(hw); From patchwork Sun Apr 30 20:35:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 678034 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 49D10C7EE24 for ; Sun, 30 Apr 2023 20:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbjD3UgE (ORCPT ); Sun, 30 Apr 2023 16:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjD3UgD (ORCPT ); Sun, 30 Apr 2023 16:36:03 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DA4AC1 for ; Sun, 30 Apr 2023 13:36:02 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2a8c28158e2so17758491fa.0 for ; Sun, 30 Apr 2023 13:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682886960; x=1685478960; 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=1z0wTDitZ+gnKwYBCCk5Nz8/vpEbM2i/0l3o9/Ite8Q=; b=bh7w9+OtR7liuWR6o0f8z2yxiERyBwCcEE+vuJVYz0tOzNmhnfR69BU7R4QI6zx2da A8vNAtr28uxKOBoTP+0CC6vbtnZMGmq9MYh9JL+tI2Rx68ZooO3/3KqEKZCz3+1YdB3X 6Bb1nwsGgRgfEH4y+Ap517bc2WIMnCu8iVkSVrvifYWp7AW0da/Yrw1XPRuzORl70I8t 1tHBgGMMTjnVpDFVx9+j66DvUPyBCgFwKW4ZEIP47SFBEQ2Sd5FvL6qSe+Hs/A8ibTyY x6wn4lmmBIFoNZaxxuOWgPZUqI5bpw2+AwJmWxhtf/XYsNgnb71SLUSfCp6qcvEamkhd qAUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682886960; x=1685478960; 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=1z0wTDitZ+gnKwYBCCk5Nz8/vpEbM2i/0l3o9/Ite8Q=; b=k5VI8lUCJY7Y2Rgu52vY71jN/f8Ns4E4FGu1LK5X4jAJZJFSsB1lIIIHH02JogmlpX QGLnErRf9zy34MkJfCt9tXIY/3Ly/5gdwpUp9Iccmn+8l8vnUGVmDtXNyTmPrerfWHZ+ 01V3dcsbEtl5t1zvS7AsQ4iNf0t+2cPi4FnKAEZgBGY9tXk3LAE151xLyPhMf5mCjS+Q Ht0emoF3nyEHZ44izuNGVtQBTH+JkYrwEB1rD0Bti/i4xxpWgfF07Lcdg2ytyvos/rv3 3evg+AY989UvVbmlfmbmF4Tuo9/eOrC2WG2lM/B606JaLhdAf59SOxhjoVWlplWqAsMz 3W9Q== X-Gm-Message-State: AC+VfDzbL8+G2Q7zYArZANhFSnMASIx7jD3ZgAss/lGdiic4WDPxxedg TCBdcejKARGgew8jrGKOpZmHoQ== X-Google-Smtp-Source: ACHHUZ61lTnTm2vJed0Hbx8L4qCVWHfDv5fhWb0j9H/0AMiX+fz8xaElCfmxlsdHh3Ooixn/ajvxpg== X-Received: by 2002:a05:6512:11c1:b0:4e1:36a:eda5 with SMTP id h1-20020a05651211c100b004e1036aeda5mr3134672lfr.30.1682886960376; Sun, 30 Apr 2023 13:36:00 -0700 (PDT) Received: from eriador.lan (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id b24-20020ac247f8000000b004edd4d1e55dsm4324634lfp.284.2023.04.30.13.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Apr 2023 13:35:59 -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 3/4] drm/msm/dpu: use PINGPONG_NONE for LMs with no PP attached Date: Sun, 30 Apr 2023 23:35:55 +0300 Message-Id: <20230430203556.3184252-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> References: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On msm8998/sdm845 some LM blocks do not have corresponding PINGPONG block. Currently the driver uses PINGPONG_MAX for such cases. Switch that to use PINGPONG_NONE instead, which is more logical. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_4_0_sdm845.h | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 3 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h index bdcd554fc8a8..6ae30f806ebc 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_3_0_msm8998.h @@ -104,9 +104,9 @@ static const struct dpu_lm_cfg msm8998_lm[] = { LM_BLK("lm_2", LM_2, 0x46000, MIXER_MSM8998_MASK, &msm8998_lm_sblk, PINGPONG_2, LM_5, 0), LM_BLK("lm_3", LM_3, 0x47000, MIXER_MSM8998_MASK, - &msm8998_lm_sblk, PINGPONG_MAX, 0, 0), + &msm8998_lm_sblk, PINGPONG_NONE, 0, 0), LM_BLK("lm_4", LM_4, 0x48000, MIXER_MSM8998_MASK, - &msm8998_lm_sblk, PINGPONG_MAX, 0, 0), + &msm8998_lm_sblk, PINGPONG_NONE, 0, 0), LM_BLK("lm_5", LM_5, 0x49000, MIXER_MSM8998_MASK, &msm8998_lm_sblk, PINGPONG_3, LM_2, 0), }; 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 ceca741e93c9..4a94fd9b64a9 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 @@ -102,9 +102,9 @@ static const struct dpu_lm_cfg sdm845_lm[] = { LM_BLK("lm_2", LM_2, 0x46000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_2, LM_5, 0), LM_BLK("lm_3", LM_3, 0x0, MIXER_SDM845_MASK, - &sdm845_lm_sblk, PINGPONG_MAX, 0, 0), + &sdm845_lm_sblk, PINGPONG_NONE, 0, 0), LM_BLK("lm_4", LM_4, 0x0, MIXER_SDM845_MASK, - &sdm845_lm_sblk, PINGPONG_MAX, 0, 0), + &sdm845_lm_sblk, PINGPONG_NONE, 0, 0), LM_BLK("lm_5", LM_5, 0x49000, MIXER_SDM845_MASK, &sdm845_lm_sblk, PINGPONG_3, LM_2, 0), }; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h index 2d9192a6ce00..56826a92c155 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h @@ -191,7 +191,8 @@ enum dpu_dsc { }; enum dpu_pingpong { - PINGPONG_0 = 1, + PINGPONG_NONE, + PINGPONG_0, PINGPONG_1, PINGPONG_2, PINGPONG_3, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index d5a06628885e..bf7b8e7c45b1 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -117,7 +117,7 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_mixer *hw; const struct dpu_lm_cfg *lm = &cat->mixer[i]; - if (lm->pingpong == PINGPONG_MAX) { + if (lm->pingpong == PINGPONG_NONE) { DPU_DEBUG("skip mixer %d without pingpong\n", lm->id); continue; } From patchwork Sun Apr 30 20:35:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 678176 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 3315BC7EE26 for ; Sun, 30 Apr 2023 20:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229659AbjD3UgE (ORCPT ); Sun, 30 Apr 2023 16:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjD3UgD (ORCPT ); Sun, 30 Apr 2023 16:36:03 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AD59D2 for ; Sun, 30 Apr 2023 13:36:02 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2a8b1b51dbdso17423521fa.0 for ; Sun, 30 Apr 2023 13:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682886961; x=1685478961; 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=+6NmOsCOeaXlBzztrIruv87ZFWNmW9EDHTimbYIfZmU=; b=q7IaEjj/KVy2H/qnIImiEslsTrlvC/3AuDTdkLJyCAiyWvwkBcLQWhLrRmg5zgsxMR GXXAtiQAADRbSmFzuwE82x30spj//x5oYuVRFRvyvCv6LCLsROou5qOfLMPAyrXV0VGo ACJuAsR0kg6ljQA8NLgjLYVnoNlU1pDctXClbPiXooqx+1cyUzTbHLUk33p6iQ4EjOXi 7p/VD/m3Ug7Xlhg6kpE1lumoLvJlOdjMXcwpY5yqAYD9w+uNC/St1SenebeIODX1UVHI 6jVqCKgQOMXWLPtytFe62iFy9JK+vbkjPFUO7fOR+L296PVSUImfUsbyWHFIJEbLONdb 8ElA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682886961; x=1685478961; 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=+6NmOsCOeaXlBzztrIruv87ZFWNmW9EDHTimbYIfZmU=; b=Dv7yM8kmwqUiMFjOrID8xZwVcbda1xKL5aXbzAMz4jqelW3+2bKf3rYE2+yAHIzpPW NJ7HTDBVeyl8Pn5DtaxeEKcsItZNSlUVHXrMPjk24/V7dOMjTtggyhSJL6wmTA/9L9m/ QwBz39JEk3mFbvR9Ys1kUpr10BqqgS537i24hF6TuGM0rSu1g5Dj1tFJRhacWVauZwfg dYJ2x5jaDBXNT9L5l7wkm9O4+kwKsCSW78qZnxAouMMr09VhJEyHBrleLSLUY+v3QtXV I/EgJh0SbV9GyUnTWNsi0BLDHGhNrWFI6DjEzmdD/y3dD8e+eFw4y+2gJRpDUl1vnGZU Arxw== X-Gm-Message-State: AC+VfDxU1fgreRxFhl0Evi2hSpfTWRznwaa0R2Q4bsl3lWW7iF+4GUEr /frWJDlCv93M86GMY13JBkr2Bg== X-Google-Smtp-Source: ACHHUZ7DMUyJmLG/H5hj/g6h14Qp8kr3jbzjgiorKr9BIA1e5M3k1Nv13J8nx+stFIzYh+9mtGSszA== X-Received: by 2002:a05:651c:14f:b0:2a8:e6fd:5e57 with SMTP id c15-20020a05651c014f00b002a8e6fd5e57mr3419713ljd.11.1682886961048; Sun, 30 Apr 2023 13:36:01 -0700 (PDT) Received: from eriador.lan (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id b24-20020ac247f8000000b004edd4d1e55dsm4324634lfp.284.2023.04.30.13.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Apr 2023 13:36:00 -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 4/4] drm/msm/dpu: move PINGPONG_NONE check to dpu_lm_init() Date: Sun, 30 Apr 2023 23:35:56 +0300 Message-Id: <20230430203556.3184252-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> References: <20230430203556.3184252-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Move the check for lm->pingpong being not NONE from dpu_rm_init() to dpu_lm_init(), following the change to dpu_hw_intf_init(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c | 5 +++++ drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c index 214f207ddf8a..d1c3bd8379ea 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c @@ -161,6 +161,11 @@ struct dpu_hw_mixer *dpu_hw_lm_init(const struct dpu_lm_cfg *cfg, { struct dpu_hw_mixer *c; + if (cfg->pingpong == PINGPONG_NONE) { + DPU_DEBUG("skip mixer %d without pingpong\n", cfg->id); + return NULL; + } + c = kzalloc(sizeof(*c), GFP_KERNEL); if (!c) return ERR_PTR(-ENOMEM); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c index bf7b8e7c45b1..2ca3c666e22f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c @@ -117,11 +117,6 @@ int dpu_rm_init(struct dpu_rm *rm, struct dpu_hw_mixer *hw; const struct dpu_lm_cfg *lm = &cat->mixer[i]; - if (lm->pingpong == PINGPONG_NONE) { - DPU_DEBUG("skip mixer %d without pingpong\n", lm->id); - continue; - } - hw = dpu_hw_lm_init(lm, mmio); if (IS_ERR(hw)) { rc = PTR_ERR(hw);