From patchwork Fri Dec 13 14:15:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13907220 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2C3D8E77180 for ; Fri, 13 Dec 2024 14:16:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C754010F03D; Fri, 13 Dec 2024 14:16:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="lb4t0ju5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8C8010F03B; Fri, 13 Dec 2024 14:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1734099395; x=1765635395; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cWTg7di6sfu/w3uxX1pnJp/dvWXgqkxL8fikXGGsOtA=; b=lb4t0ju5kOYo5v40ut5wpjDfYCpTOmz0PkRUitGBVUyh59F7wfJV96sU //uFORF+2oIxhil0ux0Aj1/390jjR2kJGGroo2r8NOIVuQlFJHFGrItyU vlTSOY0wmrYKrMo0wE6NLg6kIx/bN4SYkEN/UXuAdjPMTFHmirbWEyOPe h2rxXGVNXPcgc5Jgs6D/l+02kdBmWxRvu4YS4BT95xR59FWiwNSzbG/lM skcSiSmT7sWMJBinVxN0DN4TrNj7+kyCK/t7y9RBboNbXpVoXflfQlgfz M77U/ZXFmzeOV6bHt5KDNcJ8+RbIWFSSR7QCcWmep9Jq3jw+74jn+WboT A==; X-CSE-ConnectionGUID: EJAwUqiBTyWhESW8VSAoCg== X-CSE-MsgGUID: 6KP2CWDLTDyzK2Vdtdm5pQ== X-IronPort-AV: E=McAfee;i="6700,10204,11285"; a="34689432" X-IronPort-AV: E=Sophos;i="6.12,231,1728975600"; d="scan'208";a="34689432" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2024 06:16:35 -0800 X-CSE-ConnectionGUID: kZJX/Ai8RxeXDdpOi+OXvA== X-CSE-MsgGUID: /xqc8RLdSUiY+u8wbPG79A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="133916276" Received: from kniemiec-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.246.159]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2024 06:16:33 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, Sergey Senozhatsky , Ville Syrjala , Suraj Kandpal Subject: [PATCH v3 5/6] drm/i915/display: add intel_encoder_is_hdmi() Date: Fri, 13 Dec 2024 16:15:57 +0200 Message-Id: <228152082797a1eb252980c0928566953c2b4859.1734099220.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Similar to intel_encoder_is_dp() and friends. Cc: Sergey Senozhatsky Cc: Ville Syrjala Reviewed-by: Suraj Kandpal Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_display_types.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index b71416ff5b7f..62449b27ee40 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1967,6 +1967,19 @@ static inline bool intel_encoder_is_dp(struct intel_encoder *encoder) } } +static inline bool intel_encoder_is_hdmi(struct intel_encoder *encoder) +{ + switch (encoder->type) { + case INTEL_OUTPUT_HDMI: + return true; + case INTEL_OUTPUT_DDI: + /* See if the HDMI encoder is valid. */ + return i915_mmio_reg_valid(enc_to_intel_hdmi(encoder)->hdmi_reg); + default: + return false; + } +} + static inline struct intel_lspcon * enc_to_intel_lspcon(struct intel_encoder *encoder) {