From patchwork Tue Dec 3 17:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 11271781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 660CE930 for ; Tue, 3 Dec 2019 17:37:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48D8C206EC for ; Tue, 3 Dec 2019 17:37:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48D8C206EC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=poorly.run Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CBD6892D6; Tue, 3 Dec 2019 17:37:35 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BFDD89939 for ; Tue, 3 Dec 2019 17:37:34 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id h126so1635563ywc.6 for ; Tue, 03 Dec 2019 09:37:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=agSIMt9qL1hxT3fbJ0reE7XcbpJIccyYjH/rTo8BTDM=; b=EA4Laj58OUiu+Yi39aXe6UJFtTR3l6GLvKKdLWfX2SRmN6eXfRGFLegqDRx6rBfXMW QE4wsH71HJhKmRequ3B89Ny9xruazmJHv5ZJetC/xs4q/XFyrOobINYci8yjv5yYwuYA k2x7VAoGSb777aTkskKEUrV1HQ/bfklJvJLvgYp0qI5K7A1DRGaY1B+Cx0OhnaCVZuk2 8IW1eegJfn81/BA7Rn7qmOL9iCCI4L/XhdFVY4kEKoTBSzjjTbTDM6LATs5j8nxC90Eo slt1gHWOtrwz6SSq71f/dKuk2oUM9UE/3AVnTr0tt13Z2V4CjzptiAXrQ8aZ+TyPk82W hMwQ== X-Gm-Message-State: APjAAAXLoPYqL4EXzY6imqOsVaP6pBxnlZbrqLitugyQ3kz1NKagzAau r9MaDF/23udmUAatlkte7p5ZYA== X-Google-Smtp-Source: APXvYqx4IVEfP7pQN+lP5WTSHgMM7XPAJ14VoUzEu3yt+G7yWz8prX6m1eairvUDa9pdwOuBO86Miw== X-Received: by 2002:a81:47d7:: with SMTP id u206mr4789709ywa.15.1575394653270; Tue, 03 Dec 2019 09:37:33 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id g190sm1729426ywf.41.2019.12.03.09.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2019 09:37:32 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, ramalingm.c@intel.com Date: Tue, 3 Dec 2019 12:36:31 -0500 Message-Id: <20191203173638.94919-9-sean@poorly.run> X-Mailer: git-send-email 2.24.0.393.g34dc348eaf-goog In-Reply-To: <20191203173638.94919-1-sean@poorly.run> References: <20191203173638.94919-1-sean@poorly.run> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=agSIMt9qL1hxT3fbJ0reE7XcbpJIccyYjH/rTo8BTDM=; b=ChDdZ6TjP5A9oU/M88m7XHvamZnU26ETrpdD7G17nvWnJhul4L21AbY6XaT+9PVDA1 TymOOsv/7E/flmRjZMQsUJ/xn7rDJC7u0WY6ngxDhcbfG8x/Shjq7JskSNqHGgaaXPNV O1+Ci4EA/ttgstGHRV9zULi23BuFrREVrxSRH9eTPTkdIgH5hxMsLY3FgQh+RATCGo4Y wevD2/2HjXOPjCiswgN0v9nYrqls2JxiC6tJ8e1X2IKXSNX8Cq6fZWanQGPWO29DKSBe z47INp+KiQlxM2VAjBR8qmnzdpXPGz/eXxwQwvHVYZm7F50LjB2o6CfPxa5bHRqPn2+8 yb/w== Subject: [Intel-gfx] [PATCH 08/11] drm/i915: Support DP MST in enc_to_dig_port() function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Sean Paul Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Sean Paul Although DP_MST fake encoders are not subclassed from digital ports, they are associated with them. Support these encoders. Signed-off-by: Sean Paul --- .../drm/i915/display/intel_display_types.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 489e1d00928b..4924784f3f4c 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1414,6 +1414,17 @@ static inline bool intel_encoder_is_dig_port(struct intel_encoder *encoder) } } +static inline bool intel_encoder_is_mst(struct intel_encoder *encoder) +{ + return encoder->type == INTEL_OUTPUT_DP_MST; +} + +static inline struct intel_dp_mst_encoder * +enc_to_mst(struct drm_encoder *encoder) +{ + return container_of(encoder, struct intel_dp_mst_encoder, base.base); +} + static inline struct intel_digital_port * enc_to_dig_port(struct drm_encoder *encoder) { @@ -1422,6 +1433,8 @@ enc_to_dig_port(struct drm_encoder *encoder) if (intel_encoder_is_dig_port(intel_encoder)) return container_of(encoder, struct intel_digital_port, base.base); + else if (intel_encoder_is_mst(intel_encoder)) + return enc_to_mst(encoder)->primary; else return NULL; } @@ -1432,12 +1445,6 @@ conn_to_dig_port(struct intel_connector *connector) return enc_to_dig_port(&intel_attached_encoder(&connector->base)->base); } -static inline struct intel_dp_mst_encoder * -enc_to_mst(struct drm_encoder *encoder) -{ - return container_of(encoder, struct intel_dp_mst_encoder, base.base); -} - static inline struct intel_dp *enc_to_intel_dp(struct drm_encoder *encoder) { return &enc_to_dig_port(encoder)->dp;