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 044EACD98CE for ; Mon, 15 Jun 2026 20:35:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 844D610E6C0; Mon, 15 Jun 2026 20:35:46 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="nOJMi1Uv"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75B8110E6C1; Mon, 15 Jun 2026 20:35:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781555746; x=1813091746; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OTivg/FaP+a64WMqCqVDwzQquBQF9jAtLBM81dRAcOE=; b=nOJMi1Uv3nsRqf3tVJgz/e/JmH791fCicneJdFcRh3UaiFiUHWWTQjnx IPagsck+RLpUXqA2a/aRbBgCPYYtdaqpLZCyLseROz5J+AWkr8IeY3Mic aa19GRTBnKnf2opg85jVWDq6StQlN6Vrnw7ND7/nDAXi/1ptByIVUJ0yJ nf9m3j28Xy6UDbsFz4ROP/W/EYdxf8wFbxSbMcORNx+OiTVESxA3wMKnC 4mcJgO/7bIvucZKaqD9jZzNsSJoBQtCfrlMLoKZUCpzAarhqZrEnGwDw3 yt64mwgG2n2xhSjT5Emn9LACEq0D7Ke018/NRWgu0VUtNGmNb5UrX/Toq w==; X-CSE-ConnectionGUID: ONYPymSCS7Gc88jHy/nnyQ== X-CSE-MsgGUID: Ax1K/o9ISjabTkRYSm+WNQ== X-IronPort-AV: E=McAfee;i="6800,10657,11818"; a="93694717" X-IronPort-AV: E=Sophos;i="6.24,207,1774335600"; d="scan'208";a="93694717" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2026 13:35:45 -0700 X-CSE-ConnectionGUID: 4WTeveI6SRWY6D7sOxFOug== X-CSE-MsgGUID: oPukf4E1S+ibdHWfQeWloQ== X-ExtLoop1: 1 Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.190.238.88]) by fmviesa003.fm.intel.com with ESMTP; 15 Jun 2026 13:35:43 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: uma.shankar@intel.com, dibin.moolakadan.subrahmanian@intel.com, ville.syrjala@linux.intel.com, jani.nikula@intel.com, Animesh Manna Subject: [PATCH v9 01/22] drm/i915/cmtg: Add intel_cmtg_is_allowed() for CMTG Date: Tue, 16 Jun 2026 01:33:18 +0530 Message-Id: <20260615200339.885190-2-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20260615200339.885190-1-animesh.manna@intel.com> References: <20260615200339.885190-1-animesh.manna@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" CMTG is supported on transcoder A and transcoder B with EDP, so add a separate helper intel_cmtg_is_allowed() to check the prerequisites for enabling CMTG. CMTG will be enabled only in specific use cases such as PSR2, PR-ALPM, and LOBF, and will be used in conjunction with the DC3CO feature. DC3co will be enabled in a separate patch. Note: Use-case-specific checks and transcoder-port compatibility validation will be handled part of DC3co feature implementation. v2: - Remove separate flag for DC3co from crtc_state. [Uma, Dibin] v3: - Do not access power domain members directly. [Jani] v4: - Remove check for DC3co state now. if needed add Dc3co allow check later once Dc3co patches are merged. [Uma] Bspec: 68915 Reviewed-by: Uma Shankar Reviewed-by: Dibin Moolakadan Subrahmanian Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_cmtg.c | 14 +++++++++++++- drivers/gpu/drm/i915/display/intel_cmtg.h | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_cmtg.c b/drivers/gpu/drm/i915/display/intel_cmtg.c index e1fdc6fe9762..a279f3dcd1ec 100644 --- a/drivers/gpu/drm/i915/display/intel_cmtg.c +++ b/drivers/gpu/drm/i915/display/intel_cmtg.c @@ -4,7 +4,6 @@ */ #include -#include #include #include @@ -16,6 +15,7 @@ #include "intel_display_device.h" #include "intel_display_power.h" #include "intel_display_regs.h" +#include "intel_display_types.h" /** * DOC: Common Primary Timing Generator (CMTG) @@ -185,3 +185,15 @@ void intel_cmtg_sanitize(struct intel_display *display) intel_cmtg_disable(display, &cmtg_config); } + +bool intel_cmtg_is_allowed(const struct intel_crtc_state *crtc_state) +{ + struct intel_display *display = to_intel_display(crtc_state); + enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; + + if ((cpu_transcoder == TRANSCODER_A || cpu_transcoder == TRANSCODER_B) && + DISPLAY_VER(display) == 35 && intel_crtc_has_type(crtc_state, INTEL_OUTPUT_EDP)) + return true; + + return false; +} diff --git a/drivers/gpu/drm/i915/display/intel_cmtg.h b/drivers/gpu/drm/i915/display/intel_cmtg.h index ba62199adaa2..ed540581738f 100644 --- a/drivers/gpu/drm/i915/display/intel_cmtg.h +++ b/drivers/gpu/drm/i915/display/intel_cmtg.h @@ -6,8 +6,12 @@ #ifndef __INTEL_CMTG_H__ #define __INTEL_CMTG_H__ +#include + struct intel_display; +struct intel_crtc_state; void intel_cmtg_sanitize(struct intel_display *display); +bool intel_cmtg_is_allowed(const struct intel_crtc_state *crtc_state); #endif /* __INTEL_CMTG_H__ */ -- 2.29.0