From patchwork Fri Jun 10 08:54:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hogander, Jouni" X-Patchwork-Id: 12877001 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 78C7FC43334 for ; Fri, 10 Jun 2022 08:55:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4CC2112AD8; Fri, 10 Jun 2022 08:55:00 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7279F10FF89 for ; Fri, 10 Jun 2022 08:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654851298; x=1686387298; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jjmCqITytQYerU5UO6LjivaK7l14044rgaMWKJaDmSE=; b=JxvNxfAtNDAJFBLEqgqh82XYuNsbTYtEuZSH/YC4HzWS256DMaVEvwCd 0AC2UjIHVPDjVfX1vYxifuTN5hbE9vcZKv4HdpGiFRgl77whIUZ2kqMKd WzmdMZCZR1prVUFo5UqxdMGICRGMGEudprrT1ZQMX/hiq3jg3EqB+olST EDE5WMBvgSftBka9XW13rOQraRyDBaq4tvUr369lYHvFWtcOOru0q5rdl gpZzv5K655iSMHEEkrMfj7JEcNQemZviSHLYU2NQo1eWcVIv3ODEYT1Q4 FRLCnM2v9Z6DEY6+nl28By70eA6x8rk5qkWBAcBmTOI11e6IMw2cLtpQ6 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278704908" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="278704908" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:54:53 -0700 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="586105707" Received: from seamusk-mobl2.ger.corp.intel.com (HELO jhogande-mobl1.ger.corp.intel.com) ([10.249.39.102]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:54:51 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Jun 2022 11:54:27 +0300 Message-Id: <20220610085429.52935-2-jouni.hogander@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610085429.52935-1-jouni.hogander@intel.com> References: <20220610085429.52935-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH v3 1/3] drm/i915/opregion: add function to check if headless sku 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: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Export headless sku bit (bit 13) from opregion->header->pcon as an interface to check if our device is headless configuration. This is mainly targeted for hybrid gfx systems. E.g. when display is not supposed to be connected discrete graphics card it's opregion can inform this is headless graphics card. v3: Dummy version is now static inline function v2: Check also opregion version Bspec: 53441 Reviewed-by: Jani Nikula Signed-off-by: Jouni Högander --- drivers/gpu/drm/i915/display/intel_opregion.c | 14 ++++++++++++++ drivers/gpu/drm/i915/display/intel_opregion.h | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c index f31e8c3f8ce0..6876ba30d5a9 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.c +++ b/drivers/gpu/drm/i915/display/intel_opregion.c @@ -53,6 +53,8 @@ #define MBOX_ASLE_EXT BIT(4) /* Mailbox #5 */ #define MBOX_BACKLIGHT BIT(5) /* Mailbox #2 (valid from v3.x) */ +#define PCON_HEADLESS_SKU BIT(13) + struct opregion_header { u8 signature[16]; u32 size; @@ -1135,6 +1137,18 @@ struct edid *intel_opregion_get_edid(struct intel_connector *intel_connector) return new_edid; } +bool intel_opregion_headless_sku(struct drm_i915_private *i915) +{ + struct intel_opregion *opregion = &i915->opregion; + struct opregion_header *header = opregion->header; + + if (!header || header->over.major < 2 || + (header->over.major == 2 && header->over.minor < 3)) + return false; + + return opregion->header->pcon & PCON_HEADLESS_SKU; +} + void intel_opregion_register(struct drm_i915_private *i915) { struct intel_opregion *opregion = &i915->opregion; diff --git a/drivers/gpu/drm/i915/display/intel_opregion.h b/drivers/gpu/drm/i915/display/intel_opregion.h index 82cc0ba34af7..2f261f985400 100644 --- a/drivers/gpu/drm/i915/display/intel_opregion.h +++ b/drivers/gpu/drm/i915/display/intel_opregion.h @@ -76,6 +76,8 @@ int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv, int intel_opregion_get_panel_type(struct drm_i915_private *dev_priv); struct edid *intel_opregion_get_edid(struct intel_connector *connector); +bool intel_opregion_headless_sku(struct drm_i915_private *i915); + #else /* CONFIG_ACPI*/ static inline int intel_opregion_setup(struct drm_i915_private *dev_priv) @@ -127,6 +129,11 @@ intel_opregion_get_edid(struct intel_connector *connector) return NULL; } +static inline bool intel_opregion_headless_sku(struct drm_i915_private *i915) +{ + return false; +} + #endif /* CONFIG_ACPI */ #endif From patchwork Fri Jun 10 08:54:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hogander, Jouni" X-Patchwork-Id: 12877002 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 38862CCA47E for ; Fri, 10 Jun 2022 08:55:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 554A61135C9; Fri, 10 Jun 2022 08:55:02 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2C29C113242 for ; Fri, 10 Jun 2022 08:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654851301; x=1686387301; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4Kai+ByUobP7LucdPUEOGdT36FM0i/B/X24y/bqFsDs=; b=Dsi9P+gx2KXoxLw9LelpdmhBJvql+jI0i7yMpUv2CQQ8R8eWGQdVYfo8 hqpqt+FGz26jkqgB2P4n6hdLzFlMmRuONotst85rPwwd5pM65zjOaZTpJ nedHjzSPtf1XsDNznEjBqBmGIZExSBDvrTDe+/KXzv48uQ+GO+wLLi6ki HGq+LEDUmIcAmb6K677TVcyk6K46Bcj1Xxq+nJ+piOZTSBSg8rxrR6JmP aJEUNu8s33MrCvPG2mCDktpcg7YigRoFmbnB4HCQsyY8GZXdXgFqQvD1J lYC/8sADNcMBzlzQqIHtAzT6iwSqqU70WyIx/D7cIuEqJQwmYuWa7W77X g==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278367848" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="278367848" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:55:00 -0700 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="586105744" Received: from seamusk-mobl2.ger.corp.intel.com (HELO jhogande-mobl1.ger.corp.intel.com) ([10.249.39.102]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:54:59 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Jun 2022 11:54:28 +0300 Message-Id: <20220610085429.52935-3-jouni.hogander@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610085429.52935-1-jouni.hogander@intel.com> References: <20220610085429.52935-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH v3 2/3] drm/i915: Do not start connector polling if display is disabled 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: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Currently we are starting connector polling if display is disabled using disable_display module parameter. Polling is just returning always "not connected" state. This can be optimized by not starting polling at all. Signed-off-by: Jouni Högander Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c index 8204126d17f9..5f8b4f481cff 100644 --- a/drivers/gpu/drm/i915/display/intel_hotplug.c +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c @@ -668,7 +668,8 @@ static void i915_hpd_poll_init_work(struct work_struct *work) */ void intel_hpd_poll_enable(struct drm_i915_private *dev_priv) { - if (!HAS_DISPLAY(dev_priv)) + if (!HAS_DISPLAY(dev_priv) || + !INTEL_DISPLAY_ENABLED(dev_priv)) return; WRITE_ONCE(dev_priv->hotplug.poll_enabled, true); From patchwork Fri Jun 10 08:54:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hogander, Jouni" X-Patchwork-Id: 12877003 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 627E8C433EF for ; Fri, 10 Jun 2022 08:55:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F2C9C113242; Fri, 10 Jun 2022 08:55:04 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A7F911A306 for ; Fri, 10 Jun 2022 08:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654851303; x=1686387303; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tVAVLQGPK4D4x/rfdieo3QLGhnrvuVt5pBpmYLIceG4=; b=LUfXI+ut/yZpI1sdH2SrrIepF7MtES9vlPuA4PvnFT/msyb/oRmYOWjG TzX6VOadibqHAtKH85+31GTMizPu2Qwbep40Lqx5TJY32clkGO4XRF+yK y1uI2tMSJrKE0Zk7PEEjOogY4Erc9haID9o51Fk6ofoHsu5nTmj6dpbeP 42JUzbEoCvhtp7fJG4Tkx5UlgTw3/t27Lhx6aHRab7Tdwz0WA+pyCU+/4 En7xmiCxcAhOCU/aWQWXu1Iryq/3lumXANXDo3kTFomFsRVx0AIv7L/eB sKFDqnJCp7NTLYEnfe9FSfrAyFCJ/5LbfONZc6FJbgYGTsibrJgBgRxnm w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="278367859" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="278367859" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:55:03 -0700 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="586105757" Received: from seamusk-mobl2.ger.corp.intel.com (HELO jhogande-mobl1.ger.corp.intel.com) ([10.249.39.102]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 01:55:01 -0700 From: =?utf-8?q?Jouni_H=C3=B6gander?= To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Jun 2022 11:54:29 +0300 Message-Id: <20220610085429.52935-4-jouni.hogander@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610085429.52935-1-jouni.hogander@intel.com> References: <20220610085429.52935-1-jouni.hogander@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH v3 3/3] drm/i915: Do not start connector polling on headless sku 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: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Connector polling is waking up the polled device. Polling is unnecessary if our device is known to not have display. Fix this and save some power by disabling starting connector polling when we are having headless sku. Use information from opregion. v2: Move headless sku check into INTEL_DISPLAY_ENABLED macro Signed-off-by: Jouni Högander Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/i915_drv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 9805c6e6d4da..a5bc6a774c5a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1342,7 +1342,9 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, /* Only valid when HAS_DISPLAY() is true */ #define INTEL_DISPLAY_ENABLED(dev_priv) \ - (drm_WARN_ON(&(dev_priv)->drm, !HAS_DISPLAY(dev_priv)), !(dev_priv)->params.disable_display) + (drm_WARN_ON(&(dev_priv)->drm, !HAS_DISPLAY(dev_priv)), \ + !(dev_priv)->params.disable_display && \ + !intel_opregion_headless_sku(dev_priv)) #define HAS_GUC_DEPRIVILEGE(dev_priv) \ (INTEL_INFO(dev_priv)->has_guc_deprivilege)