Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp931046pxb; Tue, 9 Feb 2021 17:05:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFGAp1fdvXVqK/KHxyMZGwB96JCkbyi5v2WJ5idGo6iSC/QilGN3gjRr/qBMyJCQFS2b0Q X-Received: by 2002:aa7:c655:: with SMTP id z21mr853402edr.27.1612919148221; Tue, 09 Feb 2021 17:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612919148; cv=none; d=google.com; s=arc-20160816; b=VKDmbb8AlCKjrtTOmEP5g4ogPTrMNJfX/HQlbpdOTW8qGvtoYJzi4JvQGAcvwU164v NDyLFocYy3tHGEVVmhHhgr8ZbcVSgPmgeZnaeh2cb6ewz7wfGwnWCkxUO3BgBKVx6xwy BE4dZpjo+ZjPsuRQTKZv0/naC9mYODQKMbSq8S7KFpb40iRG9AarVEyTpDn6sGJVQFFg VrVW4GZmMC1/xkwgrRmwXRA3DIdMnCB3L0mnGGskh5vwvCTneNEAqSmso2sI0MLtS/WN kSoNMzkzUZn8SsDaqQ84lNAepn4hVfAtaln7Z8kB680O651s397g4+XltxVXcU/mqArz Dd2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vu/MgDLq9F074IoGVBKpvw/wkMsGon8jwgEBBiJIJa4=; b=X24nGFrUXJA28+92eisnWmi6GcvOvtEJzvuC/RmYRf6lXZ0KA6MHW0xLVzMRx4VYdk QeDnFd1r4gwP8X3MiCpxhSFYWvzqN2pnqus/trej4pAkTHDiyH01gf1Kgs/lck1GwG2V XUQ9L06UCsDDpjavgQv/CsnHxC2miDYOs1v1XCCaG42pVcSyZhCJLPDWhG+wu+DOFKna oV5PcgT3kGLt8H3qNV/c4Xnvhf3uxI3EeC03HJ3RvkEiD1k3mFX7BY+lah4W08hO+WOU eP2/DCeOZhSg1RywOkqODL+7HE6H/BaqqQ4BZtyUOfRVMuYledCfGi6PgkQvCd5ClRX4 +GqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XgB2Q4LF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j6si237183ejc.262.2021.02.09.17.05.25; Tue, 09 Feb 2021 17:05:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XgB2Q4LF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234864AbhBJBC5 (ORCPT + 99 others); Tue, 9 Feb 2021 20:02:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39960 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233669AbhBIWUO (ORCPT ); Tue, 9 Feb 2021 17:20:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612909083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vu/MgDLq9F074IoGVBKpvw/wkMsGon8jwgEBBiJIJa4=; b=XgB2Q4LFj1rpoKGDrZpnVD3b88PR3Y1g7JBrqjvbYGh/Oqb3pYEnbZA6mIWZH0rSPMFyy3 ou52fZmYCnGmyjCeLpXN9Mf4QvV/JjMk5pIizUByuFJsuTSGPCf/6SN9IG8vVH93YIWfrN nvoHsjFHqpEYgiGppYotlVKnrcGjre4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-iDxa6JzZP4CZXyHn1GTHZg-1; Tue, 09 Feb 2021 16:29:07 -0500 X-MC-Unique: iDxa6JzZP4CZXyHn1GTHZg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25A16100B3B1; Tue, 9 Feb 2021 21:29:05 +0000 (UTC) Received: from Whitewolf.redhat.com (ovpn-113-53.rdu2.redhat.com [10.10.113.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8D7819C78; Tue, 9 Feb 2021 21:29:02 +0000 (UTC) From: Lyude Paul To: intel-gfx@lists.freedesktop.org Cc: Matt Roper , Jani Nikula , Ville Syrjala , Tejas Upadhyay , Yijun Shen , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , Imre Deak , Uma Shankar , Manasi Navare , Lucas De Marchi , Dave Airlie , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v5 3/4] drm/i915/gen9_bc: Introduce HPD pin mappings for TGP PCH + CML combos Date: Tue, 9 Feb 2021 16:28:30 -0500 Message-Id: <20210209212832.1401815-4-lyude@redhat.com> In-Reply-To: <20210209212832.1401815-1-lyude@redhat.com> References: <20210209212832.1401815-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Next, let's start introducing the HPD pin mappings for Intel's new gen9_bc platform in order to make hotplugging display connectors work. Since gen9_bc is just a TGP PCH along with a CML CPU, except with the same HPD mappings as ICL, we simply add a skl_hpd_pin function that is shared between gen9 and gen9_bc which handles both the traditional gen9 HPD pin mappings and the Icelake HPD pin mappings that gen9_bc uses. Changes since v4: * Split this into its own commit * Introduce skl_hpd_pin() like vsyrjala suggested and use that instead of sticking our HPD pin mappings in TGP code Cc: Matt Roper Cc: Jani Nikula Cc: Ville Syrjala [originally from Tejas's work] Signed-off-by: Tejas Upadhyay Signed-off-by: Lyude Paul --- drivers/gpu/drm/i915/display/intel_ddi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 3c4003605f93..01b171f52694 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -3954,6 +3954,14 @@ static enum hpd_pin cnl_hpd_pin(struct drm_i915_private *dev_priv, return HPD_PORT_A + port - PORT_A; } +static enum hpd_pin skl_hpd_pin(struct drm_i915_private *dev_priv, enum port port) +{ + if (HAS_PCH_TGP(dev_priv)) + return icl_hpd_pin(dev_priv, port); + + return HPD_PORT_A + port - PORT_A; +} + #define port_tc_name(port) ((port) - PORT_TC1 + '1') #define tc_port_name(tc_port) ((tc_port) - TC_PORT_1 + '1') @@ -4070,6 +4078,8 @@ void intel_ddi_init(struct drm_i915_private *dev_priv, enum port port) encoder->hpd_pin = icl_hpd_pin(dev_priv, port); else if (IS_GEN(dev_priv, 10)) encoder->hpd_pin = cnl_hpd_pin(dev_priv, port); + else if (IS_GEN(dev_priv, 9)) + encoder->hpd_pin = skl_hpd_pin(dev_priv, port); else encoder->hpd_pin = intel_hpd_pin_default(dev_priv, port); -- 2.29.2