From patchwork Thu Feb 17 03:45:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 543345 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp85715imn; Wed, 16 Feb 2022 19:45:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYaPpXnXmWg0ryt1th3d7RO9/RdwQHBYazyvjmWFDWCPSJYiTr7hMaIVsMUT4QzOU/wiXu X-Received: by 2002:a05:6a00:1709:b0:4c8:42df:c87c with SMTP id h9-20020a056a00170900b004c842dfc87cmr1020661pfc.5.1645069507488; Wed, 16 Feb 2022 19:45:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645069507; cv=none; d=google.com; s=arc-20160816; b=wILO7pmu5IjXSuBSm6xIlGp2TLmGEEv2I/67euo+wgqhX9CJH8PvIjbD1KPm3+0AYa FnH9XuJWEU03EmLA8McFJhrCp1BfoNupH7NLcMqIj1SiFEgYleYSgxCUR39b+WQxsPi4 CYdOiLMpEf5RnL2Ab9Js/GhdboQc4v/FwfUh1ZpIR259Flf43SBsVoplz82CcQlVN7hD gdqKuWfeOq+6YL5piziBjwxszzR4B/Hb3vy63R/ufDlY3YCkxsIzGcraxkXMXGt+GFmB U2HydWfRzpF5LOx6cTS18CMB0eiS+vA+yjOgaeA/mv6wMDtcUhY+i6XwcrThgRz1a1/p vI5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :delivered-to; bh=IAh0GHr6QAyjkXd5m09Dh9dt1yGOf2SEqgy6aXSSp8s=; b=JKdm2hVSwvZ/U/ZAmUQ02A3JsTuNhQU5DDwK4U8aY7LfCz4pYRS4ldzsr7rj9b8nJ9 2EGGR8rS2uVMxdJArrCNe8qtQRMVSUgcaLNyprL5zVph15zq5Olug1KLiq1IKYz6Zjb9 T/XTduADOUWWCpqTI9yXNJUvrx3e88EpTvzPNAJ+QcODkL9tML1VjYHtjiyhlarpptbQ mzDI8xeYaihUzkD6WgrgfX+GxoqKdH06lyvsQSG1fTiiPuhhtTJnX32QGdN+BRYOEm43 Pb9sQz8da9EhJXLfW4D8etUTNl/xuTd/CDzBwjFvfdzSpE6f/elmlhOmmaQnNklX/q8K j7lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Sj8HfpMu; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id k10si39495746pff.167.2022.02.16.19.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 19:45:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Sj8HfpMu; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EED0B10E1EF; Thu, 17 Feb 2022 03:45:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 09FC810E1EF for ; Thu, 17 Feb 2022 03:45:05 +0000 (UTC) Received: by mail-lf1-x130.google.com with SMTP id p22so7548822lfu.5 for ; Wed, 16 Feb 2022 19:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IAh0GHr6QAyjkXd5m09Dh9dt1yGOf2SEqgy6aXSSp8s=; b=Sj8HfpMuQAeke1UPC2DXm4jhATBx2/E6Oaum/n/lr/Y2vBKfyRvnOyP6ZHaYO4rbof 5wGK8xNyZUMZ3MZAuv5De0rbQdDZjNnjEj96kiRks0Iigj92P2rcP/UtJB7TWfITCFO/ aaiY46SOZ2lVkXF/UPyYPokqvbFMPWkzjXx32z8RTXgYR7pEYtU/SvQEpC7UED49TX6r 54MN/0327J6Lsx0jNIfwdoCBff3IJPqIoTF3PpEqUagRCh+ustd7VF0CKuDo7cjqqNOM baorGoTTXiDahNfX21+dV4qHDkBzrhMkN89VzYmcrZxHAaMrldBwWS8QP/zbS4rqTc00 lDpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IAh0GHr6QAyjkXd5m09Dh9dt1yGOf2SEqgy6aXSSp8s=; b=LOTsT+qD9/LO2iyR8aC/re1owI2waiGwiV1P/5uBm4pS+Py5WfkGhzLQ2LrPF+tsg1 kI0veECY7wHk83nmBFxL7lOsINmB0PRSLtTj8boJS22BpGtkMkEx/38I0P322m8rynAy NRljZSELe/02OV/ieu5n7i9NQPlgdIgmsNH0caLSGSyJP3dnuaGWkv2BOZr/MbVv4f1V CyRvrK+/InX5WtWlVOkxQ8lZhqTmyZfLisEcilD0SAyoi9I2RDN2kyazhEOvG7BZIAvr j0W1Qc2/b19dpiwCdgBRAjC+OOCA125c2ZbxKxpad7SCJd9fJre4vQNmo0VPi740FDB7 vwXQ== X-Gm-Message-State: AOAM5305X9m5mS60k/vBG3rfcdIJh15HfyXOcZHoEj5DdiOCe6eQ+19u G8Bks26TzKkG5ImdglnQzCEkbg== X-Received: by 2002:ac2:4150:0:b0:441:39dd:922b with SMTP id c16-20020ac24150000000b0044139dd922bmr801795lfi.340.1645069503336; Wed, 16 Feb 2022 19:45:03 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id c25sm822268lfc.22.2022.02.16.19.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 19:45:02 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 1/3] drm/msm/dpu: index dpu_kms->hw_vbif using vbif_idx Date: Thu, 17 Feb 2022 06:45:00 +0300 Message-Id: <20220217034502.464312-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Remove loops over hw_vbif. Instead always VBIF's idx as an index in the array. This fixes an error in dpu_kms_hw_init(), where we fill dpu_kms->hw_vbif[i], but check for an error pointer at dpu_kms->hw_vbif[vbif_idx]. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 10 ++++---- drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 29 +++++++++++------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index d0653a9ec694..81a35c8d62e7 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -790,11 +790,9 @@ static void _dpu_kms_hw_destroy(struct dpu_kms *dpu_kms) _dpu_kms_mmu_destroy(dpu_kms); if (dpu_kms->catalog) { - for (i = 0; i < dpu_kms->catalog->vbif_count; i++) { - u32 vbif_idx = dpu_kms->catalog->vbif[i].id; - - if ((vbif_idx < VBIF_MAX) && dpu_kms->hw_vbif[vbif_idx]) - dpu_hw_vbif_destroy(dpu_kms->hw_vbif[vbif_idx]); + for (i = 0; i < ARRAY_SIZE(dpu_kms->hw_vbif); i++) { + if (dpu_kms->hw_vbif[i]) + dpu_hw_vbif_destroy(dpu_kms->hw_vbif[i]); } } @@ -1102,7 +1100,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) for (i = 0; i < dpu_kms->catalog->vbif_count; i++) { u32 vbif_idx = dpu_kms->catalog->vbif[i].id; - dpu_kms->hw_vbif[i] = dpu_hw_vbif_init(vbif_idx, + dpu_kms->hw_vbif[vbif_idx] = dpu_hw_vbif_init(vbif_idx, dpu_kms->vbif[vbif_idx], dpu_kms->catalog); if (IS_ERR_OR_NULL(dpu_kms->hw_vbif[vbif_idx])) { rc = PTR_ERR(dpu_kms->hw_vbif[vbif_idx]); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c index 21d20373eb8b..cbbf77b17fc3 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c @@ -11,6 +11,14 @@ #include "dpu_hw_vbif.h" #include "dpu_trace.h" +static struct dpu_hw_vbif *dpu_get_vbif(struct dpu_kms *dpu_kms, enum dpu_vbif vbif_idx) +{ + if (vbif_idx > ARRAY_SIZE(dpu_kms->hw_vbif)) + return dpu_kms->hw_vbif[vbif_idx]; + + return NULL; +} + /** * _dpu_vbif_wait_for_xin_halt - wait for the xin to halt * @vbif: Pointer to hardware vbif driver @@ -148,20 +156,15 @@ static u32 _dpu_vbif_get_ot_limit(struct dpu_hw_vbif *vbif, void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, struct dpu_vbif_set_ot_params *params) { - struct dpu_hw_vbif *vbif = NULL; + struct dpu_hw_vbif *vbif; struct dpu_hw_mdp *mdp; bool forced_on = false; u32 ot_lim; - int ret, i; + int ret; mdp = dpu_kms->hw_mdp; - for (i = 0; i < ARRAY_SIZE(dpu_kms->hw_vbif); i++) { - if (dpu_kms->hw_vbif[i] && - dpu_kms->hw_vbif[i]->idx == params->vbif_idx) - vbif = dpu_kms->hw_vbif[i]; - } - + vbif = dpu_get_vbif(dpu_kms, params->vbif_idx); if (!vbif || !mdp) { DRM_DEBUG_ATOMIC("invalid arguments vbif %d mdp %d\n", vbif != NULL, mdp != NULL); @@ -204,7 +207,7 @@ void dpu_vbif_set_ot_limit(struct dpu_kms *dpu_kms, void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms, struct dpu_vbif_set_qos_params *params) { - struct dpu_hw_vbif *vbif = NULL; + struct dpu_hw_vbif *vbif; struct dpu_hw_mdp *mdp; bool forced_on = false; const struct dpu_vbif_qos_tbl *qos_tbl; @@ -216,13 +219,7 @@ void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms, } mdp = dpu_kms->hw_mdp; - for (i = 0; i < ARRAY_SIZE(dpu_kms->hw_vbif); i++) { - if (dpu_kms->hw_vbif[i] && - dpu_kms->hw_vbif[i]->idx == params->vbif_idx) { - vbif = dpu_kms->hw_vbif[i]; - break; - } - } + vbif = dpu_get_vbif(dpu_kms, params->vbif_idx); if (!vbif || !vbif->cap) { DPU_ERROR("invalid vbif %d\n", params->vbif_idx); From patchwork Thu Feb 17 03:45:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 543347 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp85761imn; Wed, 16 Feb 2022 19:45:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwjVqtBUnWlBo2f0Usp45+3+DGJRDrhOmqk2T/CKyii17sPUvs+WNsgAMLSdAQbYMC4dzY X-Received: by 2002:aa7:9dde:0:b0:4e0:5125:a72d with SMTP id g30-20020aa79dde000000b004e05125a72dmr1213412pfq.83.1645069514930; Wed, 16 Feb 2022 19:45:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645069514; cv=none; d=google.com; s=arc-20160816; b=V0u0lh0m8TnGrDkMvdpno0w50pnnL/p0HbBQ4poz9hkKfJfVp4Y9oFy3mih9jgdwVK wkL0e4WqsoUNeXvZ+nakRIGC8dECeQbmW4/JXsatSw5FSfRqVF8/1VmJobwMiM0q+bxM rqVcxTSi/TyGELjL4ctN0nfcvF7X+Pr4Kyuy5cCITrHaOc+gdtvAPBz+VQz1Y6ZaknS9 9+ZmXSSCaUUQqn0REamexRA23K+d4ZE/xz91//bPAPPfrHmcUA/+3Ua4yvXdXOb25PUm 4NGO+bZgjLIV0PlmxdVbrPH4IMoLgCWokQBQNdC8BakiRURw7y625eVXv2wXZInZeH5B LD2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=U/YRcQBG+8CmKlfSNRGmKhbYNFYa0GOg31OmQ3eN8P4=; b=A+XT3F3FlpjLgjd+KKyKIxAkItlgmIQbyugisoCnn7D8+2lYxsKRU/WP4HeXln3889 yMQabrAnj7b51eEp1IA+i2Cl4u9gzKbbPBAbv5RKgvlhaVlkyQ+IVu/ZSr7cfIkrMmqR 3uRrEDOPzVB8NbKpNAieE1KBizwJQvfBNrSO87YsVWM399kQbEWU+Ufi8qzKSrh1AmLZ Z9ocw0WSMeuwtrA2EVtodn0fwyYn/Z39XIQC1D4LGDv8JjseP88flcWo/ulOsAxhqwuX wNXixTsvTztgTxdx1bFJEcPNRH4bewL4l8E3Ea1JQXu9ncekhc/zoSNJlvUUY8vi2iGV akOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JlqKAQ6A; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id f64si7564802pgc.204.2022.02.16.19.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 19:45:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JlqKAQ6A; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32F2410E738; Thu, 17 Feb 2022 03:45:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8E5810E21B for ; Thu, 17 Feb 2022 03:45:05 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id o6so6359528ljp.3 for ; Wed, 16 Feb 2022 19:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U/YRcQBG+8CmKlfSNRGmKhbYNFYa0GOg31OmQ3eN8P4=; b=JlqKAQ6AUL8g9W9NO3LJ6vb9NdsRoKYoAyf63GcrRH3GnZy7hPS068H52YdeHrYmAF XaqrMBVvCQf9LbU+0j4n+SaekNIjKsNx8bnk+TE+3MHPTGX0RH0Nt3zspYARomIBe0Nw BGBQZWKMKZjfR4xuvrbUe+oz9UT3DkI2rzP//GhSSSRwT7KM8Ou8uwBy6z88/v4cZZUa rBMtfeSJ95LVdF+z3JIVTptiaj1ms5gKUbkLHE/84CnxOSbJlboEkjLamKSKGLX81WFo ms1Ytw7jPbIEygTsEyQSiHQymiR0OpnyJtCoIhGuVRF+Bo+vmtgUhVA147ns8LP6arHw 6amA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U/YRcQBG+8CmKlfSNRGmKhbYNFYa0GOg31OmQ3eN8P4=; b=b+KqwRJaOu/6Xg9tItAt92aOpnVrOS8oZOzHrB4+q4oLb3EiiBrW1gzoiAzFW4AA5E HhkTA2JyEWbJXW2gDla5L103UXIrRyUvKqx44jjhrO7u3agVNGY91wKP74siP6B8fB9H ylfcMxo1kvlVkvLPZJNpdh7RaOFcjanFZgiCxFqQChrWGxofLUlvDs9oO4O6u2MKyEY6 NW/pZCnqoIzKgtsuu2w2/CJeyYs3eQUhRcFp17W6BgnWzKKNT5YdiZQP54ol5JQ/xcNN uutFP6YGNAda33144U8MuDhzUjmulZm91stFI8x2gThx8O+TBKGbaxS9qedb6vhb/Eqp diAA== X-Gm-Message-State: AOAM531LdmyW+dIBQzbNv60iHn6oHnd7djD0VRUqkcodtt32yGMzcAGl jUxxtwJDZZUTwTaz8KvbaGgm1A== X-Received: by 2002:a2e:87d3:0:b0:244:c1ab:91ae with SMTP id v19-20020a2e87d3000000b00244c1ab91aemr820892ljj.277.1645069504092; Wed, 16 Feb 2022 19:45:04 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id c25sm822268lfc.22.2022.02.16.19.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 19:45:03 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 2/3] drm/msm/dpu: fix error handling around dpu_hw_vbif_init Date: Thu, 17 Feb 2022 06:45:01 +0300 Message-Id: <20220217034502.464312-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220217034502.464312-1-dmitry.baryshkov@linaro.org> References: <20220217034502.464312-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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_vbif_init() function can not return NULL. So, replace corresponding IS_ERR_OR_NULL() call with IS_ERR(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 81a35c8d62e7..f8f1bf3b511d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1102,10 +1102,8 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif_idx] = dpu_hw_vbif_init(vbif_idx, dpu_kms->vbif[vbif_idx], dpu_kms->catalog); - if (IS_ERR_OR_NULL(dpu_kms->hw_vbif[vbif_idx])) { + if (IS_ERR(dpu_kms->hw_vbif[vbif_idx])) { rc = PTR_ERR(dpu_kms->hw_vbif[vbif_idx]); - if (!dpu_kms->hw_vbif[vbif_idx]) - rc = -EINVAL; DPU_ERROR("failed to init vbif %d: %d\n", vbif_idx, rc); dpu_kms->hw_vbif[vbif_idx] = NULL; goto power_error; From patchwork Thu Feb 17 03:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 543346 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp85747imn; Wed, 16 Feb 2022 19:45:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKcWsL6eLz7xArUL0VFdeZnjg471BqioMoMsPbVX9rlAXDCgKOslmnHCfpZx7CFwbR8PBY X-Received: by 2002:a65:6941:0:b0:372:b6bc:4328 with SMTP id w1-20020a656941000000b00372b6bc4328mr952137pgq.106.1645069512549; Wed, 16 Feb 2022 19:45:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645069512; cv=none; d=google.com; s=arc-20160816; b=ynD5JXGctnCtAAYySHN0kcyLtWUlpBstboGiLo19w7+rypbdGfl85yRg9UetgxmY7j GQVR7oZBbTeGQdGVuFL+E3SSXuOvxwL8zxxhf5I2bJMDmu3z+/S5Rq6yWXlPwY9mbr7c d+LmqvYEV5BD6P1cPGwq6PePbjO3zT7epRwW5nKiSjcvkA98lsvY3N0WGC4cTactmOwu ztJv3Tbvp8kT6/+gE9py07N8HGa277vRLhMY5P2UQgqyKAJN9aPWC1sL579NbSGd0kjI V4pJ4yiJvK9Ix6v51TRF4B0HGjjgRcyIzfoSRW8awDTE1NtlNbgfi/0cSpBJi3HdewCk iIAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=dysF/AP9QrJMWquX5SIkWcaQNfAWXARtu2Y4zNfbQ6Y=; b=KsouCQxzwveIa4oP1tQ3yvFscz4FOBX584WqTm7PMKPaP9reZQ8wZY3nPIeGsxBCUx 4gLQirpE4F5SCUFDPUHoISOYg2BTuGUKypjzIM44LMaq/0VNeCSfifkjlRpCuUS3FHxL Ubzi2tSUIADemSrCDgz3cP9VoYBjYhGpdEObooa01soyFxCX/nfOWs06GAUW2KJdGKLH mBsEUACRt+vERlmTZTvfqOQZ6m/H5FlZeBT2QxKMID4i/ouqGOdkg8G8vZm6LlkRI7AF XIBo2nnYLMCXZx1WN/MCTX8SSy2aesmeWMau+rDg2fQAITEh1YM+LUDv15mGUFq3gTQY SlRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="rfKoIO/T"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id x9si8010294pgf.12.2022.02.16.19.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 19:45:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="rfKoIO/T"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF95F10E72A; Thu, 17 Feb 2022 03:45:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id B552410E745 for ; Thu, 17 Feb 2022 03:45:06 +0000 (UTC) Received: by mail-lj1-x230.google.com with SMTP id r20so6376824ljj.1 for ; Wed, 16 Feb 2022 19:45:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dysF/AP9QrJMWquX5SIkWcaQNfAWXARtu2Y4zNfbQ6Y=; b=rfKoIO/TT0FpbBVRgmJfnMsCvEmVCEunaz/kfpFZYAHnEjxFUgxcRn1yUIRvovksaZ DPkxdpMLFLpZy1IZ2fVtV3qpo+0GYk3gCtuqYezuvY3ykyxYvd5RmhoLWu1IjEFFWGLh NZVnoYNn4G9L7Wdv0fTE67lJFr11EO1tfPeUFy57IvJ3sbaqSZ438/0UvniSUUEHrLh1 G3ps85iIUOuizIMBF8clZrlJZT6Ec5kfo6REQgSucJQr28gXnLhlaE3L8/MUb7shYDmQ 86S1F2M6Ajc96UPr0yB8+/+jcVzb4ce1LEh+7wxa7nlOUb2cwABxlTQ3GruYfMO3cMw0 cyJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dysF/AP9QrJMWquX5SIkWcaQNfAWXARtu2Y4zNfbQ6Y=; b=Zcnovo5uQq+/lHyjQ9DTShfJXhtHvWImW2+pYHYpynOsjEWX5Z9A03aEljGyhoGq8Q xsQPyIQBN6plNFrOllPtT51hmyprvx2nokv6y87DsO15B2jQwXK/6oNmKGWQykkf2XZV DUTwCIwlrgOUFegGgVGtQ4fOwtd7UFp/Y8n0do8gWpzwvA6ddVpFVu24nns6L76NCyuk kTi1IEyaLAlqly0rkrIr8cJQN91h1+blu15lfK1fYbcduXtHKa6kzO80L7atH6p2P9N0 JUg1EkCaZFVFcIpJVAUd10x94614MdLRaM8d9rC04XLqQ2QeX3nlryYWCbtnLocp8qwo UieA== X-Gm-Message-State: AOAM532Kqhfs0HGOA/VBLP/h++Zm5DUn2c4o9gNOGKXOUSi6UmREXEm1 VOcoNrmGgc52jGWtXoisraUBzg== X-Received: by 2002:a05:651c:307:b0:244:c6a1:167d with SMTP id a7-20020a05651c030700b00244c6a1167dmr833196ljp.263.1645069504902; Wed, 16 Feb 2022 19:45:04 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id c25sm822268lfc.22.2022.02.16.19.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Feb 2022 19:45:04 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 3/3] drm/msm/dpu: drop VBIF indices Date: Thu, 17 Feb 2022 06:45:02 +0300 Message-Id: <20220217034502.464312-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220217034502.464312-1-dmitry.baryshkov@linaro.org> References: <20220217034502.464312-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 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: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We do not expect to have other VBIFs. Drop VBIF_n indices and always use VBIF_RT and VBIF_NRT. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 4 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 6 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c | 36 ++++++++++++------- 3 files changed, 28 insertions(+), 18 deletions(-) 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 aa4d20762ccb..dbb853042aa0 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c @@ -1115,7 +1115,7 @@ static const struct dpu_vbif_dynamic_ot_cfg msm8998_ot_rdwr_cfg[] = { static const struct dpu_vbif_cfg msm8998_vbif[] = { { - .name = "vbif_0", .id = VBIF_0, + .name = "vbif_rt", .id = VBIF_RT, .base = 0, .len = 0x1040, .default_ot_rd_limit = 32, .default_ot_wr_limit = 32, @@ -1144,7 +1144,7 @@ static const struct dpu_vbif_cfg msm8998_vbif[] = { static const struct dpu_vbif_cfg sdm845_vbif[] = { { - .name = "vbif_0", .id = VBIF_0, + .name = "vbif_rt", .id = VBIF_RT, .base = 0, .len = 0x1040, .features = BIT(DPU_VBIF_QOS_REMAP), .xin_halt_timeout = 0x4000, 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 bb9ceadeb0bb..598c201ae50d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h @@ -254,11 +254,9 @@ enum dpu_wd_timer { }; enum dpu_vbif { - VBIF_0, - VBIF_1, + VBIF_RT, + VBIF_NRT, VBIF_MAX, - VBIF_RT = VBIF_0, - VBIF_NRT = VBIF_1 }; /** diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c index cbbf77b17fc3..c011d4ab6acc 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_vbif.c @@ -19,6 +19,18 @@ static struct dpu_hw_vbif *dpu_get_vbif(struct dpu_kms *dpu_kms, enum dpu_vbif v return NULL; } +static const char *dpu_vbif_name(enum dpu_vbif idx) +{ + switch (idx) { + case VBIF_RT: + return "VBIF_RT"; + case VBIF_NRT: + return "VBIF_NRT"; + default: + return "??"; + } +} + /** * _dpu_vbif_wait_for_xin_halt - wait for the xin to halt * @vbif: Pointer to hardware vbif driver @@ -50,12 +62,12 @@ static int _dpu_vbif_wait_for_xin_halt(struct dpu_hw_vbif *vbif, u32 xin_id) if (!status) { rc = -ETIMEDOUT; - DPU_ERROR("VBIF %d client %d not halting. TIMEDOUT.\n", - vbif->idx - VBIF_0, xin_id); + DPU_ERROR("%s client %d not halting. TIMEDOUT.\n", + dpu_vbif_name(vbif->idx), xin_id); } else { rc = 0; - DRM_DEBUG_ATOMIC("VBIF %d client %d is halted\n", - vbif->idx - VBIF_0, xin_id); + DRM_DEBUG_ATOMIC("%s client %d is halted\n", + dpu_vbif_name(vbif->idx), xin_id); } return rc; @@ -95,8 +107,8 @@ static void _dpu_vbif_apply_dynamic_ot_limit(struct dpu_hw_vbif *vbif, } } - DRM_DEBUG_ATOMIC("vbif:%d xin:%d w:%d h:%d fps:%d pps:%llu ot:%u\n", - vbif->idx - VBIF_0, params->xin_id, + DRM_DEBUG_ATOMIC("%s xin:%d w:%d h:%d fps:%d pps:%llu ot:%u\n", + dpu_vbif_name(vbif->idx), params->xin_id, params->width, params->height, params->frame_rate, pps, *ot_lim); } @@ -141,8 +153,8 @@ static u32 _dpu_vbif_get_ot_limit(struct dpu_hw_vbif *vbif, } exit: - DRM_DEBUG_ATOMIC("vbif:%d xin:%d ot_lim:%d\n", - vbif->idx - VBIF_0, params->xin_id, ot_lim); + DRM_DEBUG_ATOMIC("%s xin:%d ot_lim:%d\n", + dpu_vbif_name(vbif->idx), params->xin_id, ot_lim); return ot_lim; } @@ -242,8 +254,8 @@ void dpu_vbif_set_qos_remap(struct dpu_kms *dpu_kms, forced_on = mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, true); for (i = 0; i < qos_tbl->npriority_lvl; i++) { - DRM_DEBUG_ATOMIC("vbif:%d xin:%d lvl:%d/%d\n", - params->vbif_idx, params->xin_id, i, + DRM_DEBUG_ATOMIC("%s xin:%d lvl:%d/%d\n", + dpu_vbif_name(params->vbif_idx), params->xin_id, i, qos_tbl->priority_lvl[i]); vbif->ops.set_qos_remap(vbif, params->xin_id, i, qos_tbl->priority_lvl[i]); @@ -263,8 +275,8 @@ void dpu_vbif_clear_errors(struct dpu_kms *dpu_kms) if (vbif && vbif->ops.clear_errors) { vbif->ops.clear_errors(vbif, &pnd, &src); if (pnd || src) { - DRM_DEBUG_KMS("VBIF %d: pnd 0x%X, src 0x%X\n", - vbif->idx - VBIF_0, pnd, src); + DRM_DEBUG_KMS("%s: pnd 0x%X, src 0x%X\n", + dpu_vbif_name(vbif->idx), pnd, src); } } }