From patchwork Fri Jan 7 02:01:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530460 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12325imp; Thu, 6 Jan 2022 18:01:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2W0EaGVtB5cclCqN0SVbvcU3IlJEPpVZmRy+1AgYUlvaFJHWZ4WdagRPfiTVMSW+gxn3u X-Received: by 2002:a63:7459:: with SMTP id e25mr54097881pgn.471.1641520901950; Thu, 06 Jan 2022 18:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520901; cv=none; d=google.com; s=arc-20160816; b=BdkgA+pmCnkYbigq02W7LsOU2iQJdC+2eojuGdi8l5SXPrqZ/9t13zM4yiLfk3uL/0 N4T+SWl+v0i9cWd/o9xk+mEA/USLpSZqK7yfqJw2TEGaiexyRkTPOi1GMRjartnWyW6Z 9fmZbYIS4xO5D0ptspzlE/7rIm0IJ+/fjdNd4jopIa5pJe7u62HsgUqdIdSUYuAeo7Br 8Uc6fLOqKrFEhbyEQvgnnqQoixUgPWHxza7Kd/yZrWY2LSVf8MJ1qKuDV+FjM5O2KSWX 2iYo24qv7YLDD7NAHn1819bwyc1hdI9e0ZBIToV4Sbxdi+M7KnE0uc1dHDboywOd8yGD rgNw== 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=Mbm89ogoQZqGUNZ1cj9r9KOUuoZZufgU+BA4OgVhn8g=; b=hqnJXzyIe3iib9rEq4fsw/T/MqclKwhnWbkO429647ygsscqEWkASkX7gsHLnNyiVh vPqlDVBZ/tm7cdGpfIPf+5Wv0JwhDvWwdoq+oc2AC3DOFyK/QSXrPYkFOQQlS7oPwuct 6vw9kl3jFHKjYgqaPwIOLG7O9gUcjGqLEWT6zM/+wII5Rmd2KLuXDhDoYfheN7pEZkxD bsiTTTohq7384HnS/YZGf6jFt4pYFfimf4iHX9AcF0Mpi/ByghYgBzQXgqVXngVFHFn6 MN0kBxgN2QA3My8Wt7hDZXJkD60HKipVQGz1JSy29D3T4Mqiejx96lGL0qiuPBRnW9aW xTaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HrN+k7FX; 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 bg12si3521678plb.400.2022.01.06.18.01.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:41 -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=HrN+k7FX; 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 AAEDA10ED91; Fri, 7 Jan 2022 02:01:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1AED110ED91 for ; Fri, 7 Jan 2022 02:01:38 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id k21so10357597lfu.0 for ; Thu, 06 Jan 2022 18:01:38 -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=Mbm89ogoQZqGUNZ1cj9r9KOUuoZZufgU+BA4OgVhn8g=; b=HrN+k7FXfHQQe4fZOWaNS+ppaD7a7gXvvZDegmpMvzQKseetFljT8hqddGMz3fFiRT KyPsaxbZVyXpGYswOGyEsC+HU/omhYvjVaTGJuWzy+4ZNNR3ecNCcaSB0Q855PmBFGm2 A3WgU8g+zFdAux7e5RLGjVaoCetcFKlNgh6fVjIhvljN2Emv7lwDwpQelIfHVpQ8VrN+ bXpj/Aj4FvBRGYJYEBHa3RARSSHlMYA7r80qxbe5Rdir2H0sPTmcDHJdpMXECYxqVBYW pbliLniuHG0XFBZw8upVWYwr5AsrfaZOk7iqbbr9TTMOkNk604WgAMs5scr4yhZfC4f5 cNXA== 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=Mbm89ogoQZqGUNZ1cj9r9KOUuoZZufgU+BA4OgVhn8g=; b=HHa3NBKDjHf2ju3ODe8yT2uLWevhEcUhv2rip6LVwmcyKvMwLg+rivYzUXi2Uujg8r a25geMOiej6tFFdn5Nf5CNkz0ZYiPiu1WZxjgXgrHXJopE9nl31S0NTbCdCgOJUC6EqL mzvNZM9AfmMhXFifMUfF9SzDDXuWAsGB3JKNDf5f11uiWfTymH7cZW3lfVh2BmaQRg5j wt6XLrR/wJchbXKzgS/g3SCK9cbU5tfGxna8zXvp8CIqzF9mKgRNNeup5y61g6nvRRXQ LvOIFWJzAPw9TBgu3RakZky27/hdnzJhoQnVQM7Tp1x1Bo4wrJ4aN9BEiBLM9cfSSLXy YO0w== X-Gm-Message-State: AOAM5331f5MI/QdOIZzkL1372MUFN+7XNf0MyIXHc0v1RXER7q0gckkB ZkCMUvUbMhtsp+B0Qu6nadrdXQ== X-Received: by 2002:a2e:878f:: with SMTP id n15mr49924515lji.347.1641520896414; Thu, 06 Jan 2022 18:01:36 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:36 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 1/7] drm/msm/dp: fix panel bridge attachment Date: Fri, 7 Jan 2022 05:01:26 +0300 Message-Id: <20220107020132.587811-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" In commit 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") the DP driver received a drm_bridge instance, which is always attached to the encoder as a root bridge. However it conflicts with the panel_bridge support for eDP panels. Change panel_bridge attachment to come after dp_bridge attachment. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Cc: Kuogee Hsieh Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_drm.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index d4d360d19eba..26ef41a4c1b6 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -169,16 +169,6 @@ struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display) drm_connector_attach_encoder(connector, dp_display->encoder); - if (dp_display->panel_bridge) { - ret = drm_bridge_attach(dp_display->encoder, - dp_display->panel_bridge, NULL, - DRM_BRIDGE_ATTACH_NO_CONNECTOR); - if (ret < 0) { - DRM_ERROR("failed to attach panel bridge: %d\n", ret); - return ERR_PTR(ret); - } - } - return connector; } @@ -246,5 +236,16 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi return ERR_PTR(rc); } + if (dp_display->panel_bridge) { + rc = drm_bridge_attach(dp_display->encoder, + dp_display->panel_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (rc < 0) { + DRM_ERROR("failed to attach panel bridge: %d\n", rc); + drm_bridge_remove(bridge); + return ERR_PTR(rc); + } + } + return bridge; } From patchwork Fri Jan 7 02:01:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530463 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12430imp; Thu, 6 Jan 2022 18:01:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQSgz2aG5OUG7sh2D0Awmq1xUtBxGsWt+cxwKbvEK79HN+jALlx0Uj/sfP8CwimFIm0jfB X-Received: by 2002:a63:2a4f:: with SMTP id q76mr54588334pgq.303.1641520912924; Thu, 06 Jan 2022 18:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520912; cv=none; d=google.com; s=arc-20160816; b=EVfnz6WG7D52HumgigTLsAZb61tn9LWFCtIOqi9D2GP6JUcELDkb0pdqiuEhWyBGtt z+Mn0nA068+WGKxMsDd1GYeb0MJ1eQc4r9I9e8iK40KkLpH4/fAVEHhX9Vx6MzV34Ayi 1WuWWFhN1tuDEiDzCxqXIl+gjhwXfT/9dREwX+CT54kyBdFDjrY2MHr+DM50Ec02JRLA 8lcEMPFjOya2yKJhBO/9muw3+BX2TRas2JeKkDiE5/BJmxDpDohy8hJizx6IVvBoMw3X gmrslcfk+nDQDoMdvuigGUeIwC6/HjM4t+KrR5NENxBwIqeMIyofmfgFokAXVCd1M0n7 f8kQ== 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=/81ihr5/bmjqyS1R9V0PUwYFeshMlAAJdXhf9FQFGo0=; b=038OeFbjOKQmzY8KjVac3T8zAaRAtvHTH27iQ+5RAhyF5kmkdWDYeYdImk1uK68O2v +zUc20LRZR8l/TyIctz6cEObVXW3FQDzBJ+RJ2p3DwlBdmNEvUd/JrcqpgzPlpVHg5Fp +ddTwYvt+ZhVV6ugtPujb8VLZrOiyn9JcEOPTTkr7ZxzBhQh3tRIA44Fc44Qa/OfN4bH jfX8hySvHtTQ+0O7HwWfmrhfsxP3RM6rRsg5wC5oKZ+YXm37uJdc0Pa6WeoWx9cUHiBd mWhT9VGbLTN650pKVBvDYYtMxXri+ofDZiJTRnjm+9jEJvV1hXCqlH1TYAUZ4iAe5Yjj acYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w9VpM9kp; 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 z3si3896236pgp.142.2022.01.06.18.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:52 -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=w9VpM9kp; 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 5543710ED97; Fri, 7 Jan 2022 02:01:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by gabe.freedesktop.org (Postfix) with ESMTPS id F26BB10ED97 for ; Fri, 7 Jan 2022 02:01:38 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id x6so10259853lfa.5 for ; Thu, 06 Jan 2022 18:01:38 -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=/81ihr5/bmjqyS1R9V0PUwYFeshMlAAJdXhf9FQFGo0=; b=w9VpM9kphaymoMYswx2q1h2u96x8Bp/d9hioCKc52SKFhflWbL8GZmpFvevv+QTZQw bNKLBtiXxdxF2MBOyV1QI9dHVK80WZggq1nVhXgnoD9s0Zm4NEeOYzvdUk6DZqBVYqxX zJDGc3/BLhMA23tZ+xbvMZKLHR/yD3mrc2f8lOGDD7kwFLgnUGKPoJv/dktdDQb7X4JI gtXJPV2kODDgBCN3x9cR0unh2tShFipyTUnQ5ldF50lkDuYnMm5PXSZ0a4O0t3opOcH+ oGl3A3FWxd24lVw2ATlhHdVhFSn4f6z/PSuaPgQOh7NcXS0Ok/qRdVOWrjV4YTZFDx8T 4UnA== 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=/81ihr5/bmjqyS1R9V0PUwYFeshMlAAJdXhf9FQFGo0=; b=mpk6jQt01bznLLA3Qfv1zUzJbda8iNWU8NnAHxzY9MvdY16G0nl7mFym8FHejWBq/y PqBKFfUV5zQvZ5Gpips5rEAe1B3A5fsgLJCoWdk4oRA8WNBbiD/MKH2EFERsE15PjusT lIlUcVfaNJJeVy+5g3vcqdZ82kOlEwiB9ErvSrAclZXuVQEAv4ZEusyJhoqUWvbznG34 XKxqj9q9mgnqyOkncV/ptE/iAXKEfa12CKqI4yGkQp7y0xYBru8acsJS6OV25pC6/hL0 mvEscNnfI91jJqzzzI9Lef1Nu4pGKZ1kL4xmgJEvZ1ZSyTibIh4MFlG6TonJW9W/6mYM ZFqQ== X-Gm-Message-State: AOAM533gYFeh296iVbuynQbOo5VCi7OaGzxT/jSh7MuktBB/7+P7Lbp1 sxX/UD3x2Mvwqsl0liqmxr1lcA== X-Received: by 2002:a05:6512:2304:: with SMTP id o4mr52821174lfu.563.1641520897174; Thu, 06 Jan 2022 18:01:37 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:36 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 2/7] drm/msm/dp: support attaching bridges to the DP encoder Date: Fri, 7 Jan 2022 05:01:27 +0300 Message-Id: <20220107020132.587811-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" Currently DP driver will allocate panel bridge for eDP panels. Simplify this code to just check if there is any next bridge in the chain (be it a panel bridge or regular bridge). Rename panel_bridge field to next_bridge accordingly. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- drivers/gpu/drm/msm/dp/dp_display.h | 2 +- drivers/gpu/drm/msm/dp/dp_drm.c | 4 ++-- drivers/gpu/drm/msm/dp/dp_parser.c | 26 ++++++++------------------ drivers/gpu/drm/msm/dp/dp_parser.h | 2 +- 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 7cc4d21f2091..184a1d1470e6 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -246,7 +246,7 @@ static int dp_display_bind(struct device *dev, struct device *master, goto end; } - dp->dp_display.panel_bridge = dp->parser->panel_bridge; + dp->dp_display.next_bridge = dp->parser->next_bridge; dp->aux->drm_dev = drm; rc = dp_aux_register(dp->aux); diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h index e3adcd578a90..7af2b186d2d9 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.h +++ b/drivers/gpu/drm/msm/dp/dp_display.h @@ -16,7 +16,7 @@ struct msm_dp { struct drm_bridge *bridge; struct drm_connector *connector; struct drm_encoder *encoder; - struct drm_bridge *panel_bridge; + struct drm_bridge *next_bridge; bool is_connected; bool audio_enabled; bool power_on; diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 26ef41a4c1b6..80f59cf99089 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -236,9 +236,9 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi return ERR_PTR(rc); } - if (dp_display->panel_bridge) { + if (dp_display->next_bridge) { rc = drm_bridge_attach(dp_display->encoder, - dp_display->panel_bridge, bridge, + dp_display->next_bridge, bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc < 0) { DRM_ERROR("failed to attach panel bridge: %d\n", rc); diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c index a7acc23f742b..5de21f3d0812 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.c +++ b/drivers/gpu/drm/msm/dp/dp_parser.c @@ -265,22 +265,14 @@ static int dp_parser_clock(struct dp_parser *parser) return 0; } -static int dp_parser_find_panel(struct dp_parser *parser) +static int dp_parser_find_next_bridge(struct dp_parser *parser) { struct device *dev = &parser->pdev->dev; - struct drm_panel *panel; - int rc; - rc = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL); - if (rc) { - DRM_ERROR("failed to acquire DRM panel: %d\n", rc); - return rc; - } - - parser->panel_bridge = devm_drm_panel_bridge_add(dev, panel); - if (IS_ERR(parser->panel_bridge)) { - DRM_ERROR("failed to create panel bridge\n"); - return PTR_ERR(parser->panel_bridge); + parser->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); + if (IS_ERR(parser->next_bridge)) { + DRM_ERROR("failed to create next bridge\n"); + return PTR_ERR(parser->next_bridge); } return 0; @@ -307,11 +299,9 @@ static int dp_parser_parse(struct dp_parser *parser, int connector_type) if (rc) return rc; - if (connector_type == DRM_MODE_CONNECTOR_eDP) { - rc = dp_parser_find_panel(parser); - if (rc) - return rc; - } + rc = dp_parser_find_next_bridge(parser); + if (rc) + return rc; /* Map the corresponding regulator information according to * version. Currently, since we only have one supported platform, diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h index 3172da089421..4cec851e38d9 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.h +++ b/drivers/gpu/drm/msm/dp/dp_parser.h @@ -123,7 +123,7 @@ struct dp_parser { struct dp_display_data disp_data; const struct dp_regulator_cfg *regulator_cfg; u32 max_dp_lanes; - struct drm_bridge *panel_bridge; + struct drm_bridge *next_bridge; int (*parse)(struct dp_parser *parser, int connector_type); }; From patchwork Fri Jan 7 02:01:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530462 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12409imp; Thu, 6 Jan 2022 18:01:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDPAVqQpXAcm//OSqgACehIDtxy2fnRKn+ppbxx0N3Dfc50wL8LLuh2jlW8IfZ1EBCYtSu X-Received: by 2002:a63:3647:: with SMTP id d68mr55046673pga.500.1641520909922; Thu, 06 Jan 2022 18:01:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520909; cv=none; d=google.com; s=arc-20160816; b=K8NITC7a4Nv1SRSmj+4C7SywshITSp2zaBs6fAWC4N/FkCpumMWjbjTvyIvcTBTuWX tHg4w2G6VJ4kSDqmP2TJN4E6vBIityg6zXjVnGFlq6915VgRw00y79jXy5eUNTmlR0c1 Ipoyu72WpSkJ5cSzpDpesgfoEyvGRH0DaeLQUsyHPMPmC20A1Hb/e5NTSlubFcuupZ1Y O6AZ6H6h7oZI8e0oLiH9ictn1lKqysQmYch2hft9+GbWho6G7Y5Jzwte1m5ATYrrH4Pm 5Y+p24vypaAds6JXd4NCZe+qMeQNVSNqPvyP2nuL5rlgfK6HbAcRTT56GNdIE9OuzcLg VyhQ== 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=2kKn6GMuD4BqegleOJkLqeWgWY3ZMCteXaiTRVTlMIo=; b=uUDS8vk8Lx2xyenrPq0dlx+lP8uGrHsIV0cvRwmPEV0XRmdhlVoX3NPgpe+w6mz/wb j9KPSeiF0q4WS2hO9kL8bu12OIjj73LrIhPa3LtX/X3mBgM2+PqvOy7znCJp8Evp3J/q ngmvklgte9MnF1/mybK1l1BW7GPsJznZhn5a7yE+OyCs3hSYmnpp6IeU9w9ebYPS/8k+ E75HMF4beKOWROvrxEjItBOj17/IlMNRy+HUVSRvtyT2+n5MAKkvtRAYJEJpL7h7sLSo QrIfntaQysFd9SnhdaDkqgUk2DBEdgbjpiltrw3mwP70B3kFqhdABtpwGdG4to9lBxAU 0/uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=i7DNpypG; 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 h10si6990994pjq.80.2022.01.06.18.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:49 -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=i7DNpypG; 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 DD4FE10EDB6; Fri, 7 Jan 2022 02:01:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by gabe.freedesktop.org (Postfix) with ESMTPS id BABDE10EDAE for ; Fri, 7 Jan 2022 02:01:39 +0000 (UTC) Received: by mail-lf1-x12e.google.com with SMTP id g11so10306399lfu.2 for ; Thu, 06 Jan 2022 18:01:39 -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=2kKn6GMuD4BqegleOJkLqeWgWY3ZMCteXaiTRVTlMIo=; b=i7DNpypGI8bXIGruxJcqRVnAcTF+Ol9RNHPOWcQzajIGaQCD4ZzKgLde6eB3/mPlM6 00kRB/LuyFlq0Z5hHBHAPjISpH4QxuDKXNse8TWu65vufTZfv3xPADgWnY0Rbln2sf9P fFPxoC/DiW9hAa1HA0FzJjb4woLyzZSH+RCbIXQRFen1xc8aAGDK9IqcpRzYHgsbjZSy JCbRVFJ92BkQMtTzDOhtbxtXFoZ1hoY3cROk52sCY/pcGjaGR6lTsmbsm5X8pvxgV3yR 3lgNxQo83I/UMgEIpnNZ57rS/nRfeTR9hgwFsiA761LWt3w8k6j57r6S8WsFFEi1H539 XVwA== 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=2kKn6GMuD4BqegleOJkLqeWgWY3ZMCteXaiTRVTlMIo=; b=AjKd6A5ecICky+ZTYfQRfDm5LdldMeO1Hi1HJOfYsTf0gwCzSj1UNgH8eXp1CHoeiR /bfCE6xq9hG8j0AtTc1qT+oAgA9iX19OrRoUfjdpJ5Bfw+npuGKkLaW98vZG3RBgr6Lu ev6d4xjguSZmdIfkGNxVbDZOaibXOXJSLg/cTh6N2HGy5AO26jkUoitD6TdTICIMvq1X qVpLTpJptez3zsWdfYcaobgB8vz+n2Fw3F8sRtXAtHxlRZvDOrOd/erBAFbGqVakyrwq Qx84ZYRBzRF1KkmNeUKzGW0Od/7FSQcyNNiNgWDSZLHJYsbj6MU4q27luP6MNefN7GFN HPQA== X-Gm-Message-State: AOAM532Xlc5Mdp6xibjX/YNxa5pUERABQqzH5yekEJABzescPfWx4pmD GGf1u1N7j/cHZuRNoDx6/izyUQ== X-Received: by 2002:a05:6512:4ca:: with SMTP id w10mr52955617lfq.32.1641520898064; Thu, 06 Jan 2022 18:01:38 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:37 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 3/7] drm/msm/dp: replace dp_connector with drm_bridge_connector Date: Fri, 7 Jan 2022 05:01:28 +0300 Message-Id: <20220107020132.587811-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" There is little point in having both connector and root bridge implementation in the same driver. Move connector's functionality to the bridge to let next bridge in chain to override it. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 22 +++--- drivers/gpu/drm/msm/dp/dp_drm.c | 111 ++++++++++------------------ 2 files changed, 51 insertions(+), 82 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 184a1d1470e6..539aac117184 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1476,17 +1476,6 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, dp_display->encoder = encoder; - dp_display->connector = dp_drm_connector_init(dp_display); - if (IS_ERR(dp_display->connector)) { - ret = PTR_ERR(dp_display->connector); - DRM_DEV_ERROR(dev->dev, - "failed to create dp connector: %d\n", ret); - dp_display->connector = NULL; - return ret; - } - - priv->connectors[priv->num_connectors++] = dp_display->connector; - dp_display->bridge = msm_dp_bridge_init(dp_display, dev, encoder); if (IS_ERR(dp_display->bridge)) { ret = PTR_ERR(dp_display->bridge); @@ -1498,6 +1487,17 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, priv->bridges[priv->num_bridges++] = dp_display->bridge; + dp_display->connector = dp_drm_connector_init(dp_display); + if (IS_ERR(dp_display->connector)) { + ret = PTR_ERR(dp_display->connector); + DRM_DEV_ERROR(dev->dev, + "failed to create dp connector: %d\n", ret); + dp_display->connector = NULL; + return ret; + } + + priv->connectors[priv->num_connectors++] = dp_display->connector; + return 0; } diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index 80f59cf99089..5f093d90d227 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "msm_drv.h" @@ -20,24 +21,16 @@ struct msm_dp_bridge { #define to_dp_display(x) container_of((x), struct msm_dp_bridge, bridge) -struct dp_connector { - struct drm_connector base; - struct msm_dp *dp_display; -}; -#define to_dp_connector(x) container_of(x, struct dp_connector, base) - /** - * dp_connector_detect - callback to determine if connector is connected - * @conn: Pointer to drm connector structure - * @force: Force detect setting from drm framework - * Returns: Connector 'is connected' status + * dp_bridge_detect - callback to determine if connector is connected + * @bridge: Pointer to drm bridge structure + * Returns: Bridge's 'is connected' status */ -static enum drm_connector_status dp_connector_detect(struct drm_connector *conn, - bool force) +static enum drm_connector_status dp_bridge_detect(struct drm_bridge *bridge) { struct msm_dp *dp; - dp = to_dp_connector(conn)->dp_display; + dp = to_dp_display(bridge)->dp_display; DRM_DEBUG_DP("is_connected = %s\n", (dp->is_connected) ? "true" : "false"); @@ -48,10 +41,11 @@ static enum drm_connector_status dp_connector_detect(struct drm_connector *conn, /** * dp_connector_get_modes - callback to add drm modes via drm_mode_probed_add() + * @bridge: Poiner to drm bridge * @connector: Pointer to drm connector structure * Returns: Number of modes added */ -static int dp_connector_get_modes(struct drm_connector *connector) +static int dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector *connector) { int rc = 0; struct msm_dp *dp; @@ -61,7 +55,7 @@ static int dp_connector_get_modes(struct drm_connector *connector) if (!connector) return 0; - dp = to_dp_connector(connector)->dp_display; + dp = to_dp_display(bridge)->dp_display; dp_mode = kzalloc(sizeof(*dp_mode), GFP_KERNEL); if (!dp_mode) @@ -102,18 +96,20 @@ static int dp_connector_get_modes(struct drm_connector *connector) } /** - * dp_connector_mode_valid - callback to determine if specified mode is valid - * @connector: Pointer to drm connector structure + * dp_bridge_mode_valid - callback to determine if specified mode is valid + * @bridge: Pointer to drm bridge structure + * @info: display info * @mode: Pointer to drm mode structure * Returns: Validity status for specified mode */ -static enum drm_mode_status dp_connector_mode_valid( - struct drm_connector *connector, - struct drm_display_mode *mode) +static enum drm_mode_status dp_bridge_mode_valid( + struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) { struct msm_dp *dp_disp; - dp_disp = to_dp_connector(connector)->dp_display; + dp_disp = to_dp_display(bridge)->dp_display; if ((dp_disp->max_pclk_khz <= 0) || (dp_disp->max_pclk_khz > DP_MAX_PIXEL_CLK_KHZ) || @@ -123,55 +119,6 @@ static enum drm_mode_status dp_connector_mode_valid( return dp_display_validate_mode(dp_disp, mode->clock); } -static const struct drm_connector_funcs dp_connector_funcs = { - .detect = dp_connector_detect, - .fill_modes = drm_helper_probe_single_connector_modes, - .destroy = drm_connector_cleanup, - .reset = drm_atomic_helper_connector_reset, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -}; - -static const struct drm_connector_helper_funcs dp_connector_helper_funcs = { - .get_modes = dp_connector_get_modes, - .mode_valid = dp_connector_mode_valid, -}; - -/* connector initialization */ -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display) -{ - struct drm_connector *connector = NULL; - struct dp_connector *dp_connector; - int ret; - - dp_connector = devm_kzalloc(dp_display->drm_dev->dev, - sizeof(*dp_connector), - GFP_KERNEL); - if (!dp_connector) - return ERR_PTR(-ENOMEM); - - dp_connector->dp_display = dp_display; - - connector = &dp_connector->base; - - ret = drm_connector_init(dp_display->drm_dev, connector, - &dp_connector_funcs, - dp_display->connector_type); - if (ret) - return ERR_PTR(ret); - - drm_connector_helper_add(connector, &dp_connector_helper_funcs); - - /* - * Enable HPD to let hpd event is handled when cable is connected. - */ - connector->polled = DRM_CONNECTOR_POLL_HPD; - - drm_connector_attach_encoder(connector, dp_display->encoder); - - return connector; -} - static void dp_bridge_mode_set(struct drm_bridge *drm_bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) @@ -211,6 +158,9 @@ static const struct drm_bridge_funcs dp_bridge_ops = { .disable = dp_bridge_disable, .post_disable = dp_bridge_post_disable, .mode_set = dp_bridge_mode_set, + .mode_valid = dp_bridge_mode_valid, + .get_modes = dp_bridge_get_modes, + .detect = dp_bridge_detect, }; struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, @@ -228,7 +178,12 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi bridge = &dp_bridge->bridge; bridge->funcs = &dp_bridge_ops; - bridge->encoder = encoder; + bridge->type = DRM_MODE_CONNECTOR_DisplayPort; + + bridge->ops = + DRM_BRIDGE_OP_DETECT | + DRM_BRIDGE_OP_HPD | + DRM_BRIDGE_OP_MODES; rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); if (rc) { @@ -249,3 +204,17 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi return bridge; } + +/* connector initialization */ +struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display) +{ + struct drm_connector *connector = NULL; + + connector = drm_bridge_connector_init(dp_display->drm_dev, dp_display->encoder); + if (IS_ERR(connector)) + return connector; + + drm_connector_attach_encoder(connector, dp_display->encoder); + + return connector; +} From patchwork Fri Jan 7 02:01:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530466 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12486imp; Thu, 6 Jan 2022 18:01:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxL//MfXQc7i703gN+x4aJF0/tLL/vkuSuqHTrzLlkMZjsXcZopiUs0EIYGa5/3vaFQZNhM X-Received: by 2002:a63:790a:: with SMTP id u10mr26290843pgc.384.1641520919034; Thu, 06 Jan 2022 18:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520919; cv=none; d=google.com; s=arc-20160816; b=VVMIsLySiIfAy1zOZ3g0Q+yViuO/iZOU/jLXWi5Ab1Aj0Pyn2vEx/30kDNmzvMf780 x5TSnuz5I9fx6xvNFoe8x0InuCBtybIHTrkUbTZm4ONVI6NbY40waAzDd8jBFUHFvTTw LmKRAPg8Z4d9sUIdt67/RDVy0oM6QkncNV/Rn0VeNXvp8dSJ+muOq9RprHLGt/QRrDqq DMUdCKhHyvk8TIy4SHiekp1KDut4eNoYjwtvPDbnIljmHwaxLcguss67q8QCdoPHb9g5 lQ5EpPpWm6yewVBnyh5QozoW5EhEBpNooF4MycFcI8g+cHk7JlSMsGNqwk9ulVI4ZOLp SDvg== 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=70+PdGpMJ5tp6zQgSExFrwrnDScoxbL2cjSa7HHuNKA=; b=BJ5P8YeRl6UM+cj17nzvPiLwHsY513gegHyX6xxRQZZYUk2Jg/+FB/XamXiD9NFw/4 bmVw+g/nRUmnZx7xI0Gj9TXAlz4g2kmbe2doIQ1+TMMgTHjomJJgM/S3gAfdfiWAr3ws Vp4g2JdBriSiEyF1N4/6Fy+BAuP+qhjL4VeN92mRGNuRx7IfjPcLFuhXb+Gk4RLGXrCN leBhxR1CPTZOhkxkNFyfwQXQGNc/mprzkMlvrlwrEIyFLlRpMrHBA0BtiqoPDOUHF6GK Z9lgQYOmkj38B+UsZ1PzMXPw6d2Gl3yYMAm3hV2L9shHyae+6GBtTM5KrFVcguv1BsSn 9Adg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kC29Jnv3; 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 z18si3555041pgv.392.2022.01.06.18.01.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:59 -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=kC29Jnv3; 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 DBED910EDCF; Fri, 7 Jan 2022 02:01:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAAB310EDB2 for ; Fri, 7 Jan 2022 02:01:40 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id i31so10181974lfv.10 for ; Thu, 06 Jan 2022 18:01:40 -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=70+PdGpMJ5tp6zQgSExFrwrnDScoxbL2cjSa7HHuNKA=; b=kC29Jnv3J6vOrS75vtzgGtTxhPFxpLMUZqjPXx703qjFapTfrawemIt350gnmd0+QV RI9Tq3FvAM/lJrCu9KSkV6HzLcnorFDzzyXE2NZ7A4cL2ckeuzfgXGJkKpZz4nm9ziAC BTEqtPnYC5MVILQHazugrz68DG6qcZeRhZq4KEg1N6OXxVvzFa9JmDfM5foUqZjDKH0K 770JiCFg3fVEaJd/2waZIJ3BQSFINMmjeUh3rPox2yi5WUnYXsa82lJcMqauOW2nvN44 gSQK7X4QNm5Y+MiXv38QGblwp2pIn5+d4n/QxJwwshbn99/2z4/V6Qz+V1eMMS4ghN2e znlw== 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=70+PdGpMJ5tp6zQgSExFrwrnDScoxbL2cjSa7HHuNKA=; b=EAf6ZJbOROg3scj3Y8UU6gFLttu83OtCY1su6M6hFyto7bQx+82Vzg71Asw247TyeJ 5FGKNqQwF8rjNpYKR3sCrA2upByS77LPv+AILQJoHs6bvE/nSQD939iW9Ej+eFAyajP0 NqJPpgqVFCJO2lbsh/un054re3m+39peoQhRqOA71cIprzdoQeum5vQSF01cb+2iYsL5 DwvtS4YYcHoYWqSqbPLDSkw7TPHrZDLx7dZW1WTM7MNSsOKZApsKWYV5C/VXOcxVzn7N qAYU2ScMDeOz8CaYZcpm2fJFqEJ2tsZ6xbMTTNMH5r1PBN8E51hKeRyB05MhD1+8Pusy s+6g== X-Gm-Message-State: AOAM533gAPlVEFKQyl+ucv0nU6l5737FURfDm5bdL4GXneP9K/MWR9Zh RCtnQTes5EcWEWy2F/1iix00Ag== X-Received: by 2002:a2e:b710:: with SMTP id j16mr49258463ljo.460.1641520899117; Thu, 06 Jan 2022 18:01:39 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:38 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 4/7] drm/msm/dp: remove extra wrappers and public functions Date: Fri, 7 Jan 2022 05:01:29 +0300 Message-Id: <20220107020132.587811-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" dp_bridge's functions are thin wrappers around the msm_dp_display_* family. Squash dp_bridge callbacks into respective msm_dp_display functions, removing the latter functions from public space. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/Makefile | 1 - drivers/gpu/drm/msm/dp/dp_display.c | 184 +++++++++++++++++++++-- drivers/gpu/drm/msm/dp/dp_display.h | 3 - drivers/gpu/drm/msm/dp/dp_drm.c | 220 ---------------------------- drivers/gpu/drm/msm/msm_drv.h | 32 +--- 5 files changed, 171 insertions(+), 269 deletions(-) delete mode 100644 drivers/gpu/drm/msm/dp/dp_drm.c diff --git a/drivers/gpu/drm/msm/Makefile b/drivers/gpu/drm/msm/Makefile index 03ab55c37beb..354ccf793f4a 100644 --- a/drivers/gpu/drm/msm/Makefile +++ b/drivers/gpu/drm/msm/Makefile @@ -104,7 +104,6 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ dp/dp_catalog.o \ dp/dp_ctrl.o \ dp/dp_display.o \ - dp/dp_drm.o \ dp/dp_hpd.o \ dp/dp_link.o \ dp/dp_panel.o \ diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 539aac117184..7b4f40cb9a58 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -10,7 +10,9 @@ #include #include #include -#include + +#include +#include #include "msm_drv.h" #include "msm_kms.h" @@ -30,6 +32,13 @@ #define HPD_STRING_SIZE 30 +struct msm_dp_bridge { + struct drm_bridge bridge; + struct msm_dp *dp_display; +}; + +#define to_dp_display(x) container_of((x), struct msm_dp_bridge, bridge) + enum { ISR_DISCONNECTED, ISR_CONNECT_PENDING, @@ -924,18 +933,30 @@ int dp_display_set_plugged_cb(struct msm_dp *dp_display, return 0; } -int dp_display_validate_mode(struct msm_dp *dp, u32 mode_pclk_khz) +static enum drm_mode_status dp_bridge_mode_valid( + struct drm_bridge *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) { const u32 num_components = 3, default_bpp = 24; struct dp_display_private *dp_display; struct dp_link_info *link_info; u32 mode_rate_khz = 0, supported_rate_khz = 0, mode_bpp = 0; + struct msm_dp *dp; + int mode_pclk_khz = mode->clock; + + dp = to_dp_display(bridge)->dp_display; if (!dp || !mode_pclk_khz || !dp->connector) { DRM_ERROR("invalid params\n"); return -EINVAL; } + if ((dp->max_pclk_khz <= 0) || + (dp->max_pclk_khz > DP_MAX_PIXEL_CLK_KHZ) || + (mode->clock > dp->max_pclk_khz)) + return MODE_BAD; + dp_display = container_of(dp, struct dp_display_private, dp_display); link_info = &dp_display->panel->link_info; @@ -1456,6 +1477,23 @@ void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor) } } +/* connector initialization */ +struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display) +{ + struct drm_connector *connector = NULL; + + connector = drm_bridge_connector_init(dp_display->drm_dev, dp_display->encoder); + if (IS_ERR(connector)) + return connector; + + drm_connector_attach_encoder(connector, dp_display->encoder); + + return connector; +} + +static struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, + struct drm_encoder *encoder); + int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, struct drm_encoder *encoder) { @@ -1501,8 +1539,10 @@ int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, return 0; } -int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder) +static void dp_bridge_enable(struct drm_bridge *drm_bridge) { + struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); + struct msm_dp *dp = dp_bridge->dp_display; int rc = 0; struct dp_display_private *dp_display; u32 state; @@ -1510,7 +1550,7 @@ int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder) dp_display = container_of(dp, struct dp_display_private, dp_display); if (!dp_display->dp_mode.drm_mode.clock) { DRM_ERROR("invalid params\n"); - return -EINVAL; + return; } mutex_lock(&dp_display->event_mutex); @@ -1522,14 +1562,14 @@ int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder) if (rc) { DRM_ERROR("Failed to perform a mode set, rc=%d\n", rc); mutex_unlock(&dp_display->event_mutex); - return rc; + return; } rc = dp_display_prepare(dp); if (rc) { DRM_ERROR("DP display prepare failed, rc=%d\n", rc); mutex_unlock(&dp_display->event_mutex); - return rc; + return; } state = dp_display->hpd_state; @@ -1554,23 +1594,23 @@ int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder) dp_display->hpd_state = ST_CONNECTED; mutex_unlock(&dp_display->event_mutex); - - return rc; } -int msm_dp_display_pre_disable(struct msm_dp *dp, struct drm_encoder *encoder) +static void dp_bridge_disable(struct drm_bridge *drm_bridge) { + struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); + struct msm_dp *dp = dp_bridge->dp_display; struct dp_display_private *dp_display; dp_display = container_of(dp, struct dp_display_private, dp_display); dp_ctrl_push_idle(dp_display->ctrl); - - return 0; } -int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder) +static void dp_bridge_post_disable(struct drm_bridge *drm_bridge) { + struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); + struct msm_dp *dp = dp_bridge->dp_display; int rc = 0; u32 state; struct dp_display_private *dp_display; @@ -1597,13 +1637,14 @@ int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder) } mutex_unlock(&dp_display->event_mutex); - return rc; } -void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder, +static void dp_bridge_mode_set(struct drm_bridge *drm_bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode) { + struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); + struct msm_dp *dp = dp_bridge->dp_display; struct dp_display_private *dp_display; dp_display = container_of(dp, struct dp_display_private, dp_display); @@ -1626,3 +1667,118 @@ void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder, dp_display->dp_mode.h_active_low = !!(dp_display->dp_mode.drm_mode.flags & DRM_MODE_FLAG_NHSYNC); } + +static enum drm_connector_status dp_bridge_detect(struct drm_bridge *bridge) +{ + struct msm_dp *dp; + + dp = to_dp_display(bridge)->dp_display; + + DRM_DEBUG_DP("is_connected = %s\n", + (dp->is_connected) ? "true" : "false"); + + return (dp->is_connected) ? connector_status_connected : + connector_status_disconnected; +} + +static int dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector *connector) +{ + int rc = 0; + struct msm_dp *dp; + struct dp_display_mode *dp_mode = NULL; + struct drm_display_mode *m, drm_mode; + + if (!connector) + return 0; + + dp = to_dp_display(bridge)->dp_display; + + dp_mode = kzalloc(sizeof(*dp_mode), GFP_KERNEL); + if (!dp_mode) + return 0; + + /* pluggable case assumes EDID is read when HPD */ + if (dp->is_connected) { + /* + *The get_modes() function might return one mode that is stored + * in dp_mode when compliance test is in progress. If not, the + * return value is equal to the total number of modes supported + * by the sink + */ + rc = dp_display_get_modes(dp, dp_mode); + if (rc <= 0) { + DRM_ERROR("failed to get DP sink modes, rc=%d\n", rc); + kfree(dp_mode); + return rc; + } + if (dp_mode->drm_mode.clock) { /* valid DP mode */ + memset(&drm_mode, 0x0, sizeof(drm_mode)); + drm_mode_copy(&drm_mode, &dp_mode->drm_mode); + m = drm_mode_duplicate(connector->dev, &drm_mode); + if (!m) { + DRM_ERROR("failed to add mode %ux%u\n", + drm_mode.hdisplay, + drm_mode.vdisplay); + kfree(dp_mode); + return 0; + } + drm_mode_probed_add(connector, m); + } + } else { + DRM_DEBUG_DP("No sink connected\n"); + } + kfree(dp_mode); + return rc; +} + +static const struct drm_bridge_funcs dp_bridge_ops = { + .enable = dp_bridge_enable, + .disable = dp_bridge_disable, + .post_disable = dp_bridge_post_disable, + .mode_set = dp_bridge_mode_set, + .mode_valid = dp_bridge_mode_valid, + .get_modes = dp_bridge_get_modes, + .detect = dp_bridge_detect, +}; + +static struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, + struct drm_encoder *encoder) +{ + int rc; + struct msm_dp_bridge *dp_bridge; + struct drm_bridge *bridge; + + dp_bridge = devm_kzalloc(dev->dev, sizeof(*dp_bridge), GFP_KERNEL); + if (!dp_bridge) + return ERR_PTR(-ENOMEM); + + dp_bridge->dp_display = dp_display; + + bridge = &dp_bridge->bridge; + bridge->funcs = &dp_bridge_ops; + bridge->type = DRM_MODE_CONNECTOR_DisplayPort; + + bridge->ops = + DRM_BRIDGE_OP_DETECT | + DRM_BRIDGE_OP_HPD | + DRM_BRIDGE_OP_MODES; + + rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (rc) { + DRM_ERROR("failed to attach bridge, rc=%d\n", rc); + return ERR_PTR(rc); + } + + if (dp_display->next_bridge) { + rc = drm_bridge_attach(dp_display->encoder, + dp_display->next_bridge, bridge, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (rc < 0) { + DRM_ERROR("failed to attach panel bridge: %d\n", rc); + drm_bridge_remove(bridge); + return ERR_PTR(rc); + } + } + + return bridge; +} diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h index 7af2b186d2d9..cabf439af9ee 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.h +++ b/drivers/gpu/drm/msm/dp/dp_display.h @@ -32,9 +32,6 @@ struct msm_dp { int dp_display_set_plugged_cb(struct msm_dp *dp_display, hdmi_codec_plugged_cb fn, struct device *codec_dev); -int dp_display_validate_mode(struct msm_dp *dp_display, u32 mode_pclk_khz); -int dp_display_get_modes(struct msm_dp *dp_display, - struct dp_display_mode *dp_mode); int dp_display_request_irq(struct msm_dp *dp_display); bool dp_display_check_video_test(struct msm_dp *dp_display); int dp_display_get_test_bpp(struct msm_dp *dp_display); diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c deleted file mode 100644 index 5f093d90d227..000000000000 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ /dev/null @@ -1,220 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. - */ - -#include -#include -#include -#include -#include - -#include "msm_drv.h" -#include "msm_kms.h" -#include "dp_drm.h" - - -struct msm_dp_bridge { - struct drm_bridge bridge; - struct msm_dp *dp_display; -}; - -#define to_dp_display(x) container_of((x), struct msm_dp_bridge, bridge) - -/** - * dp_bridge_detect - callback to determine if connector is connected - * @bridge: Pointer to drm bridge structure - * Returns: Bridge's 'is connected' status - */ -static enum drm_connector_status dp_bridge_detect(struct drm_bridge *bridge) -{ - struct msm_dp *dp; - - dp = to_dp_display(bridge)->dp_display; - - DRM_DEBUG_DP("is_connected = %s\n", - (dp->is_connected) ? "true" : "false"); - - return (dp->is_connected) ? connector_status_connected : - connector_status_disconnected; -} - -/** - * dp_connector_get_modes - callback to add drm modes via drm_mode_probed_add() - * @bridge: Poiner to drm bridge - * @connector: Pointer to drm connector structure - * Returns: Number of modes added - */ -static int dp_bridge_get_modes(struct drm_bridge *bridge, struct drm_connector *connector) -{ - int rc = 0; - struct msm_dp *dp; - struct dp_display_mode *dp_mode = NULL; - struct drm_display_mode *m, drm_mode; - - if (!connector) - return 0; - - dp = to_dp_display(bridge)->dp_display; - - dp_mode = kzalloc(sizeof(*dp_mode), GFP_KERNEL); - if (!dp_mode) - return 0; - - /* pluggable case assumes EDID is read when HPD */ - if (dp->is_connected) { - /* - *The get_modes() function might return one mode that is stored - * in dp_mode when compliance test is in progress. If not, the - * return value is equal to the total number of modes supported - * by the sink - */ - rc = dp_display_get_modes(dp, dp_mode); - if (rc <= 0) { - DRM_ERROR("failed to get DP sink modes, rc=%d\n", rc); - kfree(dp_mode); - return rc; - } - if (dp_mode->drm_mode.clock) { /* valid DP mode */ - memset(&drm_mode, 0x0, sizeof(drm_mode)); - drm_mode_copy(&drm_mode, &dp_mode->drm_mode); - m = drm_mode_duplicate(connector->dev, &drm_mode); - if (!m) { - DRM_ERROR("failed to add mode %ux%u\n", - drm_mode.hdisplay, - drm_mode.vdisplay); - kfree(dp_mode); - return 0; - } - drm_mode_probed_add(connector, m); - } - } else { - DRM_DEBUG_DP("No sink connected\n"); - } - kfree(dp_mode); - return rc; -} - -/** - * dp_bridge_mode_valid - callback to determine if specified mode is valid - * @bridge: Pointer to drm bridge structure - * @info: display info - * @mode: Pointer to drm mode structure - * Returns: Validity status for specified mode - */ -static enum drm_mode_status dp_bridge_mode_valid( - struct drm_bridge *bridge, - const struct drm_display_info *info, - const struct drm_display_mode *mode) -{ - struct msm_dp *dp_disp; - - dp_disp = to_dp_display(bridge)->dp_display; - - if ((dp_disp->max_pclk_khz <= 0) || - (dp_disp->max_pclk_khz > DP_MAX_PIXEL_CLK_KHZ) || - (mode->clock > dp_disp->max_pclk_khz)) - return MODE_BAD; - - return dp_display_validate_mode(dp_disp, mode->clock); -} - -static void dp_bridge_mode_set(struct drm_bridge *drm_bridge, - const struct drm_display_mode *mode, - const struct drm_display_mode *adjusted_mode) -{ - struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); - struct msm_dp *dp_display = dp_bridge->dp_display; - - msm_dp_display_mode_set(dp_display, drm_bridge->encoder, mode, adjusted_mode); -} - -static void dp_bridge_enable(struct drm_bridge *drm_bridge) -{ - struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); - struct msm_dp *dp_display = dp_bridge->dp_display; - - msm_dp_display_enable(dp_display, drm_bridge->encoder); -} - -static void dp_bridge_disable(struct drm_bridge *drm_bridge) -{ - struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); - struct msm_dp *dp_display = dp_bridge->dp_display; - - msm_dp_display_pre_disable(dp_display, drm_bridge->encoder); -} - -static void dp_bridge_post_disable(struct drm_bridge *drm_bridge) -{ - struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); - struct msm_dp *dp_display = dp_bridge->dp_display; - - msm_dp_display_disable(dp_display, drm_bridge->encoder); -} - -static const struct drm_bridge_funcs dp_bridge_ops = { - .enable = dp_bridge_enable, - .disable = dp_bridge_disable, - .post_disable = dp_bridge_post_disable, - .mode_set = dp_bridge_mode_set, - .mode_valid = dp_bridge_mode_valid, - .get_modes = dp_bridge_get_modes, - .detect = dp_bridge_detect, -}; - -struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, - struct drm_encoder *encoder) -{ - int rc; - struct msm_dp_bridge *dp_bridge; - struct drm_bridge *bridge; - - dp_bridge = devm_kzalloc(dev->dev, sizeof(*dp_bridge), GFP_KERNEL); - if (!dp_bridge) - return ERR_PTR(-ENOMEM); - - dp_bridge->dp_display = dp_display; - - bridge = &dp_bridge->bridge; - bridge->funcs = &dp_bridge_ops; - bridge->type = DRM_MODE_CONNECTOR_DisplayPort; - - bridge->ops = - DRM_BRIDGE_OP_DETECT | - DRM_BRIDGE_OP_HPD | - DRM_BRIDGE_OP_MODES; - - rc = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); - if (rc) { - DRM_ERROR("failed to attach bridge, rc=%d\n", rc); - return ERR_PTR(rc); - } - - if (dp_display->next_bridge) { - rc = drm_bridge_attach(dp_display->encoder, - dp_display->next_bridge, bridge, - DRM_BRIDGE_ATTACH_NO_CONNECTOR); - if (rc < 0) { - DRM_ERROR("failed to attach panel bridge: %d\n", rc); - drm_bridge_remove(bridge); - return ERR_PTR(rc); - } - } - - return bridge; -} - -/* connector initialization */ -struct drm_connector *dp_drm_connector_init(struct msm_dp *dp_display) -{ - struct drm_connector *connector = NULL; - - connector = drm_bridge_connector_init(dp_display->drm_dev, dp_display->encoder); - if (IS_ERR(connector)) - return connector; - - drm_connector_attach_encoder(connector, dp_display->encoder); - - return connector; -} diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index d7574e6bd4e4..a48e0737692c 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -385,16 +385,7 @@ int __init msm_dp_register(void); void __exit msm_dp_unregister(void); int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, struct drm_encoder *encoder); -int msm_dp_display_enable(struct msm_dp *dp, struct drm_encoder *encoder); -int msm_dp_display_disable(struct msm_dp *dp, struct drm_encoder *encoder); -int msm_dp_display_pre_disable(struct msm_dp *dp, struct drm_encoder *encoder); -void msm_dp_display_mode_set(struct msm_dp *dp, struct drm_encoder *encoder, - const struct drm_display_mode *mode, - const struct drm_display_mode *adjusted_mode); - -struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, - struct drm_device *dev, - struct drm_encoder *encoder); + void msm_dp_irq_postinstall(struct msm_dp *dp_display); void msm_dp_snapshot(struct msm_disp_state *disp_state, struct msm_dp *dp_display); @@ -414,27 +405,6 @@ static inline int msm_dp_modeset_init(struct msm_dp *dp_display, { return -EINVAL; } -static inline int msm_dp_display_enable(struct msm_dp *dp, - struct drm_encoder *encoder) -{ - return -EINVAL; -} -static inline int msm_dp_display_disable(struct msm_dp *dp, - struct drm_encoder *encoder) -{ - return -EINVAL; -} -static inline int msm_dp_display_pre_disable(struct msm_dp *dp, - struct drm_encoder *encoder) -{ - return -EINVAL; -} -static inline void msm_dp_display_mode_set(struct msm_dp *dp, - struct drm_encoder *encoder, - const struct drm_display_mode *mode, - const struct drm_display_mode *adjusted_mode) -{ -} static inline void msm_dp_irq_postinstall(struct msm_dp *dp_display) { From patchwork Fri Jan 7 02:01:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530464 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12450imp; Thu, 6 Jan 2022 18:01:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8El4l4KFt92Rq3LgTyUCF6Y945P0ZheFsTS3upGmiYyM5xqyXz1+EmIAuSdSNjmD8eUbe X-Received: by 2002:a17:90a:f316:: with SMTP id ca22mr13254467pjb.171.1641520915237; Thu, 06 Jan 2022 18:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520915; cv=none; d=google.com; s=arc-20160816; b=Sz2Qg4KY5XstPh0NGCOScA1jHWVtkvxV8BJjn0Rsq0URVEQN0vceFvPzksySOJaM9z 3QYweA6RFOGMWKc3CEzFotIg1sT95O4i5VK0MGckbKppjHjGOj+ilH9FI+E89/qhY7BK I+oowqX/WNuTfJpRDcykkjO3AkzofxTw2CB5Qu+9MEUley/NGeZ3IX5vSQrn9JE79IHw dWm0dbsg74CcjPZALxtW+Di4eNPEzLANkGX7czult7m6/P7rNaL4xGkmqtLDwUg81Wfg hMsYRDfZ+RG+GTG7hj7z19FjGMR0YbKErJLoQ4HfWppbUAXwMM82LJ7hNmC0gRJSBd1h c6/g== 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=M8SfnRamYFGQOJ4PWO6EKe5+yLLAmHFD9wjpR/2Zexc=; b=eKGYFgEcNHTwVj25YZJ/WuSFrNLJAppHafd2YbDFgKEu1Z7HyUyyuEQHD0IepD06Y1 s14RIHAukw/CPpEIn6T88xtvKq3qz16fAbbDM9OfizKJjlaZ83ExkaghmUclZmHAGej7 bUonV6+eMYsQcePFhdfJtAQ6Y49EBFapkjKW+75G0j+foHm0P9Sh9cIWhbOWaZ5Pg39m /chamgfCCHsmt8f5OeB4LYhovgU08xyCttA6SjilQF6uGLCnw3P1iZ+gTEW32seuXBDG OWk8luMeMjh7mEfSWSs4Xyk8BQYRamQAYexmKKaUDE2J+v0xdWzo6Hz4/fzsoDcVoHzg Wobg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AowHc8AE; 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 q7si3703074pfs.261.2022.01.06.18.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:55 -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=AowHc8AE; 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 1D36310EDBA; Fri, 7 Jan 2022 02:01:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BEEB10EDBA for ; Fri, 7 Jan 2022 02:01:41 +0000 (UTC) Received: by mail-lf1-x132.google.com with SMTP id r4so10239699lfe.7 for ; Thu, 06 Jan 2022 18:01:41 -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=M8SfnRamYFGQOJ4PWO6EKe5+yLLAmHFD9wjpR/2Zexc=; b=AowHc8AE/XeQA4r/BEYswX3hjpxJFdtwVGGIyoIzVVsiaFUmboGVrfax5nWi6ww8yY w9WExs9JYuJdXJtohETe4rfrEWnZI/AL+w6UNNCVMxnZtHzQEZaGRJiLbQX7tKq1tqCq ssk2wPAnCqbRraniOL07B2u3a+o/j1AW5/RgVGS8vrcrwJUhNKQBTZEkg1Rx/WSesVUZ C5CsLLk8cdfqL548AJ6d9Op8ahDQYPU4BOQf3TPNJu2e65+UQZ7N2q74JGbZZyMy8KmE pFTQQmYCmWPmP61Tdwh/Qkhf8rn6fKNXN70Lm697D5iuhETA164I4VdR8WWVvMgg/lMa pC+A== 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=M8SfnRamYFGQOJ4PWO6EKe5+yLLAmHFD9wjpR/2Zexc=; b=mizHsDav//vByYgkxiJnAc6kZkUWZ+ZRqVcUWoGVlz/bCCY6sJOcgGdhVx6oG2GZtW hqd+BDFdIDuy/nZfsOAqusn3ox9rLv5GgedL65MG0MPRRicStNTz9hQVV3YpL/r9n9+I bYeweoyigZFJjJcjuE4b10YcHyD9AaRXlRWYR56PkT8/B6B6VylJrLRGC85ocFV+819p Pg4aYFycvQYtrBDMxmQBuf5iMd2Skz2UXUMxUWObXUpUYIaY1/quNI7N2eUDL87hJKe7 Q8jL24SVbK2yLj3PuFWZPd/JbNYQuw8hErOXKD2j8G7s+/hsUtpAB488YOIRFGWfX1dQ Z5QQ== X-Gm-Message-State: AOAM533137tgADHQTqvfFkTkm/uUzbPQwyAJVEKYNq/SCFgPQWyaw5JL DjCOxiN+9zucOARDlgJZC47GTZCH3MAvMw== X-Received: by 2002:ac2:5f55:: with SMTP id 21mr53262771lfz.283.1641520899811; Thu, 06 Jan 2022 18:01:39 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:39 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 5/7] drm/msm/dp: remove unused stubs Date: Fri, 7 Jan 2022 05:01:30 +0300 Message-Id: <20220107020132.587811-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" Refactoring DP code transformed several functions into empty stubs. Remove them. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 35 ----------------------------- 1 file changed, 35 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 7b4f40cb9a58..e63d6056e39d 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -841,11 +841,6 @@ static int dp_display_set_mode(struct msm_dp *dp_display, return 0; } -static int dp_display_prepare(struct msm_dp *dp_display) -{ - return 0; -} - static int dp_display_enable(struct dp_display_private *dp, u32 data) { int rc = 0; @@ -915,11 +910,6 @@ static int dp_display_disable(struct dp_display_private *dp, u32 data) return 0; } -static int dp_display_unprepare(struct msm_dp *dp_display) -{ - return 0; -} - int dp_display_set_plugged_cb(struct msm_dp *dp_display, hdmi_codec_plugged_cb fn, struct device *codec_dev) { @@ -1400,21 +1390,9 @@ static int dp_pm_suspend(struct device *dev) return 0; } -static int dp_pm_prepare(struct device *dev) -{ - return 0; -} - -static void dp_pm_complete(struct device *dev) -{ - -} - static const struct dev_pm_ops dp_pm_ops = { .suspend = dp_pm_suspend, .resume = dp_pm_resume, - .prepare = dp_pm_prepare, - .complete = dp_pm_complete, }; static struct platform_driver dp_display_driver = { @@ -1565,13 +1543,6 @@ static void dp_bridge_enable(struct drm_bridge *drm_bridge) return; } - rc = dp_display_prepare(dp); - if (rc) { - DRM_ERROR("DP display prepare failed, rc=%d\n", rc); - mutex_unlock(&dp_display->event_mutex); - return; - } - state = dp_display->hpd_state; if (state == ST_DISPLAY_OFF) @@ -1583,7 +1554,6 @@ static void dp_bridge_enable(struct drm_bridge *drm_bridge) if (rc) { DRM_ERROR("DP display post enable failed, rc=%d\n", rc); dp_display_disable(dp_display, 0); - dp_display_unprepare(dp); } /* manual kick off plug event to train link */ @@ -1611,7 +1581,6 @@ static void dp_bridge_post_disable(struct drm_bridge *drm_bridge) { struct msm_dp_bridge *dp_bridge = to_dp_display(drm_bridge); struct msm_dp *dp = dp_bridge->dp_display; - int rc = 0; u32 state; struct dp_display_private *dp_display; @@ -1624,10 +1593,6 @@ static void dp_bridge_post_disable(struct drm_bridge *drm_bridge) dp_display_disable(dp_display, 0); - rc = dp_display_unprepare(dp); - if (rc) - DRM_ERROR("DP display unprepare failed, rc=%d\n", rc); - state = dp_display->hpd_state; if (state == ST_DISCONNECT_PENDING) { /* completed disconnection */ From patchwork Fri Jan 7 02:01:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530465 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12464imp; Thu, 6 Jan 2022 18:01:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1AcLkWdShwZ5Jjy/NodQxnVC3yh57rdXY6YPWHIRzUwFtACzY+0nyo8uyJ1cygtsiajoI X-Received: by 2002:a62:4e4a:0:b0:4ba:8079:c463 with SMTP id c71-20020a624e4a000000b004ba8079c463mr62541284pfb.9.1641520917352; Thu, 06 Jan 2022 18:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520917; cv=none; d=google.com; s=arc-20160816; b=p/mpnOYOtL6obkycJXPShRdDQNt2fxcVlyBI/yFxk9Vp9DJoqya+OPVDTVfFsP/5y/ sLewxpMaSmhUnACTbbuwPYFHMyn9q8BsLkRl24+coZ/XW0Fh+W4rp5uKTfULJtVanXJ3 sV05aX3QOzjrObYMW9b0TJ/7b8gplGx72Dy23E7St850Zfz3LgWwHtMgCLmg/4H9MAbV lbZL9ZFaYq9F9PDiNRAKfVlPtoqa3UqmvZ5pETChJVCEl6h3JW7MGJzcdrx2FRtiPx3b 55OuZ8VFIkpk4X5FxdTlVZgaXnRZZFckD8QOBWMbbR8PxKXq4HEWhxQNTdpQShLDOSfO 5Y/w== 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=OHbsyEqfteS19OgRRcOzHQJayCE7Kspad11GnKSJ9XY=; b=GUWe4CSlI9OtvCgTxVBbvnRPoFEw62CqTsNFhWFHOQMb3Un7uL6sYGRnJUey9B4ZTZ x714yYkoRLqtkpoqvcDdBy2tMQv8TsgIta/vNrl9cqAJL0rG+C3Y9UOP4K9gIvUsZHbO 44GP1Yp2Gea5YUQ3JfXG3KTgD/ucFO0/BYVYXbZS7xxEzmCbzsINFKCBo675fjpLVYT5 2rcDoVO6oXclLvU09KMrsnpUiCHBGU6rUGg9KAzGTGef9o0zj0bS1m6chPvj0iK4J84j ICEdncy52fxZ97FjDbs59OjV3vqGBOZSiJQR8VmxobKEaq8A7WTyi6zMNLUbix5w++Ik q1BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XSClUiDy; 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 185si3649381pgj.370.2022.01.06.18.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:57 -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=XSClUiDy; 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 D2B7910EDCE; Fri, 7 Jan 2022 02:01:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by gabe.freedesktop.org (Postfix) with ESMTPS id 192A510EDB5 for ; Fri, 7 Jan 2022 02:01:42 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id h7so10283266lfu.4 for ; Thu, 06 Jan 2022 18:01:42 -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=OHbsyEqfteS19OgRRcOzHQJayCE7Kspad11GnKSJ9XY=; b=XSClUiDypO5YErliO//FA6YKgZb1nKZcX4VYG3rMZJ39C3UsrGP+GpaRA6Z6h2qM+v GIbLcKHSdf5qY+XBsm0rkxj44+wzTQbt0vwSKBH/5DPNzRVzKVIx3ePwCND5L+txbZCg tSc+0sSjh2zNu8nDsdElL4GeIXixf9Ewlg8lXNB8riuFuRUR8cPIfWXKKNr5DmZs8Eud cJBO8Ev3OU2uHU0690cM92iFddrIMJx9SrPFqAKKx6N/Q+xv3TkTlIaF2gXWgSCy+Bq8 YuR8JTWcVb5ZGRstoDj8m0YKFILxR8lVSBIybfVjWLWQozpK85LuFqMKhZYqM03OZh9K 0Akg== 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=OHbsyEqfteS19OgRRcOzHQJayCE7Kspad11GnKSJ9XY=; b=qGX9t9MRWUobyP/Fx+odYFwDlbcZYlONFeGonNnpxtoc92gbQ6SLhps+iqRelrgV6d 84xiLSQaH7k5kUTXjBAf9RpGK8kV0R+Am2unuxXucztmU9teENcdhqSI4soOoX92PrQv FTACuJdkWf6iwn8i4rar247EZpJ/C1Tg4thSAGUwUKDUXNWOTjIC4DlRBiMxxbyKFwKH uIzmFOfjQe7B8HSTUkmfGCNOug6JPA/9JUXFeo4q5E2lSjA7EtsjIGq4l/ltT/Uck7E8 Y1uigiHAmS393/3Tn8Wr0dpJdaE/MQpoqUx6wXLTpBp4eR8d1EQlgY0Ts7vPCYmZBDlL Jelw== X-Gm-Message-State: AOAM531iY4FBPujntHzZo9qq4fn+HbanajVenyA5edkIf9+8pgh/RyUe smUAxBkgCw1m0l5bP6CZWCykayWh0ST2Ng== X-Received: by 2002:a05:6512:2149:: with SMTP id s9mr53882517lfr.96.1641520900476; Thu, 06 Jan 2022 18:01:40 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:40 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 6/7] drm/msm/dp: remove dp_display_en/disable prototypes and data argument Date: Fri, 7 Jan 2022 05:01:31 +0300 Message-Id: <20220107020132.587811-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" Remove unused dp_display_en/disable prototypes. While we are at it, remove extra 'data' argument that is unused. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index e63d6056e39d..720e80ea99cb 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -559,9 +559,6 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data) return 0; }; -static int dp_display_enable(struct dp_display_private *dp, u32 data); -static int dp_display_disable(struct dp_display_private *dp, u32 data); - static int dp_connect_pending_timeout(struct dp_display_private *dp, u32 data) { u32 state; @@ -841,7 +838,7 @@ static int dp_display_set_mode(struct msm_dp *dp_display, return 0; } -static int dp_display_enable(struct dp_display_private *dp, u32 data) +static int dp_display_enable(struct dp_display_private *dp) { int rc = 0; struct msm_dp *dp_display = &dp->dp_display; @@ -878,7 +875,7 @@ static int dp_display_post_enable(struct msm_dp *dp_display) return 0; } -static int dp_display_disable(struct dp_display_private *dp, u32 data) +static int dp_display_disable(struct dp_display_private *dp) { struct msm_dp *dp_display = &dp->dp_display; @@ -1548,12 +1545,12 @@ static void dp_bridge_enable(struct drm_bridge *drm_bridge) if (state == ST_DISPLAY_OFF) dp_display_host_init(dp_display, true); - dp_display_enable(dp_display, 0); + dp_display_enable(dp_display); rc = dp_display_post_enable(dp); if (rc) { DRM_ERROR("DP display post enable failed, rc=%d\n", rc); - dp_display_disable(dp_display, 0); + dp_display_disable(dp_display); } /* manual kick off plug event to train link */ @@ -1591,7 +1588,7 @@ static void dp_bridge_post_disable(struct drm_bridge *drm_bridge) /* stop sentinel checking */ dp_del_event(dp_display, EV_DISCONNECT_PENDING_TIMEOUT); - dp_display_disable(dp_display, 0); + dp_display_disable(dp_display); state = dp_display->hpd_state; if (state == ST_DISCONNECT_PENDING) { From patchwork Fri Jan 7 02:01:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530467 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp12499imp; Thu, 6 Jan 2022 18:02:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDPeqc7b3a+2e6RMCTe0WA1C3IHKvmNQjz16z9jf1yeWTa2CGf1EdR1q+gKApq85x1wasa X-Received: by 2002:a17:903:3009:b0:149:e1c4:2ee1 with SMTP id o9-20020a170903300900b00149e1c42ee1mr8540698pla.89.1641520920546; Thu, 06 Jan 2022 18:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641520920; cv=none; d=google.com; s=arc-20160816; b=gbDIXf/h6VUQBcUp+Ub20dwMQgNqvMb5Dw0HVkYHYudlTmS3vSJ7A24DJE4NVSLPJA bktbMmn7F+MVHRpENll6HH92a/dHnJlCXV3rfCKegrRfCPNnR64z3ru8NK3y4K3hVuNW 7diztPl/mxO0b4aezR9mvHZlUJmMz/hDHiLifK3za60iH0gI5u4iin0uab6JJsIt5XWv wRN527xqeX82GrQ/cz+gaglVgZKBltR7OB2VCLpTjT/LBCQipidE9Q8U3YXDW/1PtZSQ BSQ4KUOSkbhQ7DIpNuCAme0sTYsvmcusmGetLDBJfcGsIUErzDr2H3e8DsqlmXT0N2jN ggQw== 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=cavINj3cofdeKu4U7XMW4TvkQD30lvi7kbRjPCa2LIY=; b=QzQUEerEd8pnXlS4Iod+tc9f5mG0AM5rTt0bWw6ohj1STIgLE4w24iEgudbTrvi9RT Ojm7IxS0WLEhkTkC65pfUzcFcEzkdEEoUlH0ZDiuq8XrbSwXWojAeqmbPpTF7KXuiACz QiZpPu11H5b4MGZH9QOr7NKEMNTW2tZPuyOUoZCFZ+ZEaECHMbmk4HwzfaSfryCNuwsj 48La4mTDoifkOaJqFN0bsKjly1JJPbg0OBvr1B5yMGuIOBIUZSs3GUS2FqBcmN1CVT2M JZxL0jd/czagXIV7ajn1maKXC10zPlbbJM5YLYLFDjU/NVWA7V6SyPsJA4OLpOYZhZOF snkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rqmMHxTR; 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 c10si4029697pgn.293.2022.01.06.18.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:02:00 -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=rqmMHxTR; 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 9FE5510EDC8; Fri, 7 Jan 2022 02:01:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B31310EDD4 for ; Fri, 7 Jan 2022 02:01:43 +0000 (UTC) Received: by mail-lf1-x12e.google.com with SMTP id h2so10227346lfv.9 for ; Thu, 06 Jan 2022 18:01:43 -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=cavINj3cofdeKu4U7XMW4TvkQD30lvi7kbRjPCa2LIY=; b=rqmMHxTRkxBezlU0DpApXj6CmPCvVe6iSMS3gnQffk6cfkuXdhKWWyryRJg2dfyX5r L5qFK9EFsyUKEc4omyAf3RBXFQDmW9ZBRA2KDgVLkliganJiFDzqbBgM7V2s5FAhjvH8 82rZ5C+ZwWCS7+S3mXCsIXsmvjaFPZJnddI2ITMdIhpsI5zaBgNsY65gTd8DwBs4RjSz 21hQ3z4Ikd5kv/4QQVE/75cF+VjmHxyyh2QAQJYgJeaprpD9CFJqvgMQA/b8F76pZPTt MP48hANI89zeJIu3u+77eWR/l+NDl0yQclhyZvbw4Uoo7LbHwWWOgntM5LrL52zVZFpD Fl7A== 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=cavINj3cofdeKu4U7XMW4TvkQD30lvi7kbRjPCa2LIY=; b=KnTgqZkXx+u1R9yiC7VEIQyxygoSfOPROv2elYrszmcLNFCPzzuPLShLVhG2OpyW04 A9cPvHw4+zw4tKFijeoe3v7vTcNtVMTRKxdiH9CLmi9HqDhHLR5yAWPNORWS3HUOCT91 ERpGXDKr06asa+iJWAfxIAKRi+TDDJL4a4sW7q6PM96q6GL+0fZzVJQLqhRIzqesheBV XzLvnCtySl6CG4iMGFIAweGmpB3TBYwQvCngmGNipqJwzvksTH+9+eNkx/hlvrvcTx7O wszCd0Hx2KJFoGxjfGX77wD5mZAea6PMMWqA0haiuRFZsh6dahTdYwOQcOSpXjL3AnGA g5Gg== X-Gm-Message-State: AOAM530M2UumH5871zqv+5R0gFZ6Ogch911e7hv2PD9VpmZM6fFwFJb4 OCM6uqYV0jbchM2WpU8kf/LQwA== X-Received: by 2002:a05:6512:11c9:: with SMTP id h9mr39598037lfr.33.1641520901690; Thu, 06 Jan 2022 18:01:41 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id w12sm382837lfe.256.2022.01.06.18.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:01:40 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh Subject: [RFC PATCH 7/7] drm/msm/dp: stop carying about the connector type Date: Fri, 7 Jan 2022 05:01:32 +0300 Message-Id: <20220107020132.587811-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220107020132.587811-1-dmitry.baryshkov@linaro.org> References: <20220107020132.587811-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" After changing dp_parser code to always check for the next bridge, it does not check connector type anymore. Remove connector type from the dp_paser_parse() arguments list and from the struct msm_dp_desc fields list. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dp/dp_display.c | 9 ++++----- drivers/gpu/drm/msm/dp/dp_parser.c | 2 +- drivers/gpu/drm/msm/dp/dp_parser.h | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 720e80ea99cb..0a71a17975b0 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -129,7 +129,6 @@ struct dp_display_private { struct msm_dp_desc { phys_addr_t io_start; - unsigned int connector_type; }; struct msm_dp_config { @@ -139,15 +138,15 @@ struct msm_dp_config { static const struct msm_dp_config sc7180_dp_cfg = { .descs = (const struct msm_dp_desc[]) { - [MSM_DP_CONTROLLER_0] = { .io_start = 0x0ae90000, .connector_type = DRM_MODE_CONNECTOR_DisplayPort }, + [MSM_DP_CONTROLLER_0] = { .io_start = 0x0ae90000 }, }, .num_descs = 1, }; static const struct msm_dp_config sc7280_dp_cfg = { .descs = (const struct msm_dp_desc[]) { - [MSM_DP_CONTROLLER_0] = { .io_start = 0x0ae90000, .connector_type = DRM_MODE_CONNECTOR_DisplayPort }, - [MSM_DP_CONTROLLER_1] = { .io_start = 0x0aea0000, .connector_type = DRM_MODE_CONNECTOR_eDP }, + [MSM_DP_CONTROLLER_0] = { .io_start = 0x0ae90000 }, + [MSM_DP_CONTROLLER_1] = { .io_start = 0x0aea0000 }, }, .num_descs = 2, }; @@ -249,7 +248,7 @@ static int dp_display_bind(struct device *dev, struct device *master, dp->dp_display.drm_dev = drm; priv->dp[dp->id] = &dp->dp_display; - rc = dp->parser->parse(dp->parser, dp->dp_display.connector_type); + rc = dp->parser->parse(dp->parser); if (rc) { DRM_ERROR("device tree parsing failed\n"); goto end; diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c index 5de21f3d0812..044ab0b63b14 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.c +++ b/drivers/gpu/drm/msm/dp/dp_parser.c @@ -278,7 +278,7 @@ static int dp_parser_find_next_bridge(struct dp_parser *parser) return 0; } -static int dp_parser_parse(struct dp_parser *parser, int connector_type) +static int dp_parser_parse(struct dp_parser *parser) { int rc = 0; diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h index 4cec851e38d9..1f036dd3e224 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.h +++ b/drivers/gpu/drm/msm/dp/dp_parser.h @@ -125,7 +125,7 @@ struct dp_parser { u32 max_dp_lanes; struct drm_bridge *next_bridge; - int (*parse)(struct dp_parser *parser, int connector_type); + int (*parse)(struct dp_parser *parser); }; /**