From patchwork Wed Dec 4 15:07:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13893938 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 29B60E7716B for ; Wed, 4 Dec 2024 15:07:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D014810E2AD; Wed, 4 Dec 2024 15:07:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Ph52gUE5"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86B1210E1AF; Wed, 4 Dec 2024 15:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733324868; x=1764860868; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lwbRLL/fjrUy9Lhps+Cchzjcz8tCLrh7jJ9xqaT5Zk0=; b=Ph52gUE5kT4yt5m3A0JboBV84l73+WtnkNbpyUzOj1aqLBCAfy5j9jg1 AOX1zomSFDZNKkr7OY9f4rGyZKHIX4ATSHy3+7sMrT+Vv7eZPu811WZkY 6z8FpsEJkE55AYEbBRHhJkxAMZWGCIWJsEimeDjOZvd02Q/16ePiLeJdX pp3B8RoB9IlBO3bnXZTtVRB/kdzGubp26x+HYBYaA374s6fuiK91Lvx7k yqyBPxU87UfFZB6neTSw3Xu2gjmNFXvPAvr3oIe/NKMwdwASk3bLn0Ydr z8JM+h8H/XPH5px2edaBVdl/kT2Aoh7j54YOkyf2fxgb06an96UfEVL49 w==; X-CSE-ConnectionGUID: WrkI73dgS62XMXOzhK2MzA== X-CSE-MsgGUID: oWAqUCK5So2yW6ZYfVcZjQ== X-IronPort-AV: E=McAfee;i="6700,10204,11276"; a="33745719" X-IronPort-AV: E=Sophos;i="6.12,207,1728975600"; d="scan'208";a="33745719" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2024 07:07:48 -0800 X-CSE-ConnectionGUID: tHLoE31ZSval+d1zchqvHA== X-CSE-MsgGUID: +tG4sFOdTpKJtaD7WenkRw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,207,1728975600"; d="scan'208";a="117038274" Received: from mwiniars-desk2.ger.corp.intel.com (HELO localhost) ([10.245.246.205]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2024 07:07:45 -0800 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com, Sergey Senozhatsky , Ville Syrjala Subject: [PATCH v2 4/5] drm/i915/display: add intel_encoder_is_hdmi() Date: Wed, 4 Dec 2024 17:07:20 +0200 Message-Id: <4292505b249268d824834d545b73aa0ad2d33984.1733324735.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 Signed-off-by: Jani Nikula Reviewed-by: Suraj Kandpal --- 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 167aa8ec4948..0ae026a850c2 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1959,6 +1959,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) {