From patchwork Tue Nov 8 21:18:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13036863 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 DD0C6C4332F for ; Tue, 8 Nov 2022 21:23:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0DA410E51E; Tue, 8 Nov 2022 21:23:15 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id E94AF10E51B for ; Tue, 8 Nov 2022 21:23:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667942592; x=1699478592; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wsVFKpE5z+PcGlAdSM+pnjqwj3ECEUy30/TSnrFgz0M=; b=a2DAnlOzCxP5WruTi2fBc2EeaKdGpoYMlJp8+KG7fNAO3vuDQ4HM//7/ oZ7QN9iY6SUVwz+ypRXqS+qsjLS9CuwJ58glxuFCaJA1vwxE0FOK6ehn4 22mcru3+QbS81iUH1SeAFCpnevX+Li1jq3tWmHnd3kwGwHNZZH1m0Wonu OTlVnDZwn0s61P8DEB97tZHvJATMwBzrlf6IumweqMbxgVteHZTTIub8I dYCIdLWTUgAp14X4xmUVEhftzmB5PVcrxeupymgXdaAzhZdQVj4lMKu+u eQ2RuUk+O0cGzekxvEOWgkslVLyXF/zy7YmE2D3+YjXNu5M4OsrXqwvrm g==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="298330711" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="298330711" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 13:23:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="761638504" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="761638504" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orsmga004.jf.intel.com with ESMTP; 08 Nov 2022 13:23:10 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Nov 2022 02:48:20 +0530 Message-Id: <20221108211822.28048-1-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/3] drm/i915/pps: Add get_pps_idx() hook as part of pps_get_register() cleanup 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" Simplified pps_get_register() which use get_pps_idx() hook to derive the pps instance and get_pps_idx() will be initialized at pps_init(). v1: Initial version. Got r-b from Jani. v2: Corrected unintentional change around memset() call. [Jani] Cc: Jani Nikula Cc: Ville Syrjälä Cc: Uma Shankar Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_pps.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index c6abaaa46e17..87163ef32983 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1698,6 +1698,7 @@ struct intel_dp { u8 (*preemph_max)(struct intel_dp *intel_dp); u8 (*voltage_max)(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state); + int (*get_pps_idx)(struct intel_dp *intel_dp); /* Displayport compliance testing */ struct intel_dp_compliance compliance; diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index 22f5e08d396b..3949fb449353 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -366,11 +366,8 @@ static void intel_pps_get_registers(struct intel_dp *intel_dp, int pps_idx = 0; memset(regs, 0, sizeof(*regs)); - - if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) - pps_idx = bxt_power_sequencer_idx(intel_dp); - else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) - pps_idx = vlv_power_sequencer_pipe(intel_dp); + if (intel_dp->get_pps_idx) + pps_idx = intel_dp->get_pps_idx(intel_dp); regs->pp_ctrl = PP_CONTROL(pps_idx); regs->pp_stat = PP_STATUS(pps_idx); @@ -1433,6 +1430,13 @@ void intel_pps_init(struct intel_dp *intel_dp) intel_dp->pps.initializing = true; INIT_DELAYED_WORK(&intel_dp->pps.panel_vdd_work, edp_panel_vdd_work); + if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) + intel_dp->get_pps_idx = bxt_power_sequencer_idx; + else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) + intel_dp->get_pps_idx = vlv_power_sequencer_pipe; + else + intel_dp->get_pps_idx = NULL; + pps_init_timestamps(intel_dp); with_intel_pps_lock(intel_dp, wakeref) { From patchwork Tue Nov 8 21:18:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13036864 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 9760EC4332F for ; Tue, 8 Nov 2022 21:23:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6F0C10E51B; Tue, 8 Nov 2022 21:23:18 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B93610E51E for ; Tue, 8 Nov 2022 21:23:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667942595; x=1699478595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uD7UCPTcwPHT5K8gMbfuspoqunrWfKn5j197NAlAb3I=; b=VRbMTTTXu6qbL5cSz1kqtaWQ1MaTwdG4egZdDKpGFv8aqys5Nywy6KXi RrmD2HzSt9o5Ja5lKO66y3ZtE9EGtRrGWR3iGvglKraFa5RDh/vulB3Nt NvdIkp3CLWD12Gyc8jZMOS1ceyHADoMiZ4Y2BUVMX50vkFMAvv0VCxSr3 MQ8YuxBxuTcRzW266y1jUg6AmhpurG5aZ/E2KkaYPw2hEN/rs+Yt3uD7T EBOXGFlRAOwY07obxu6Yz8ZVmVZPJbHIhjrHwt4+IsNvVlo8kZFGZbJJq rg4lkySoSzGk0Jw7lquZKr6W0FlImPOyCgdUZ4SmCfEeXym297aoZh9v/ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="298330720" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208,223";a="298330720" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 13:23:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="761638517" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208,223";a="761638517" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orsmga004.jf.intel.com with ESMTP; 08 Nov 2022 13:23:13 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Nov 2022 02:48:21 +0530 Message-Id: <20221108211822.28048-2-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221108211822.28048-1-animesh.manna@intel.com> References: <20221108211822.28048-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/3] drm/i915/pps: Enable 2nd pps for dual EDP scenario 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" From display gen12 onwards to support dual EDP two instances of pps added. Currently backlight controller and pps instance can be mapped together for a specific panel. Extended support for gen12 for dual EDP usage. v1: Iniital revision v2: Called intel_bios_panel_init w/o PNPID before intel_pps_init. [Jani] Cc: Jani Nikula Cc: Ville Syrjälä Cc: Uma Shankar Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_bios.c | 7 ------- drivers/gpu/drm/i915/display/intel_bios.h | 7 +++++++ drivers/gpu/drm/i915/display/intel_dp.c | 9 ++++++--- drivers/gpu/drm/i915/display/intel_pps.c | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index c2987f2c2b2e..fca44be9bab8 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -706,13 +706,6 @@ static int fallback_get_panel_type(struct drm_i915_private *i915, return 0; } -enum panel_type { - PANEL_TYPE_OPREGION, - PANEL_TYPE_VBT, - PANEL_TYPE_PNPID, - PANEL_TYPE_FALLBACK, -}; - static int get_panel_type(struct drm_i915_private *i915, const struct intel_bios_encoder_data *devdata, const struct edid *edid) diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h index e375405a7828..da01b13260ae 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.h +++ b/drivers/gpu/drm/i915/display/intel_bios.h @@ -231,6 +231,13 @@ struct mipi_pps_data { u16 panel_power_cycle_delay; } __packed; +enum panel_type { + PANEL_TYPE_OPREGION, + PANEL_TYPE_VBT, + PANEL_TYPE_PNPID, + PANEL_TYPE_FALLBACK, +}; + void intel_bios_init(struct drm_i915_private *dev_priv); void intel_bios_init_panel(struct drm_i915_private *dev_priv, struct intel_panel *panel, diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 7400d6b4c587..08ece347f7cb 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5254,6 +5254,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, return false; } + intel_bios_init_panel(dev_priv, &intel_connector->panel, + encoder->devdata, NULL); + intel_pps_init(intel_dp); /* Cache DPCD and EDID for edp. */ @@ -5288,9 +5291,9 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, edid = ERR_PTR(-ENOENT); } intel_connector->edid = edid; - - intel_bios_init_panel(dev_priv, &intel_connector->panel, - encoder->devdata, IS_ERR(edid) ? NULL : edid); + if (intel_connector->panel.vbt.panel_type == PANEL_TYPE_FALLBACK) + intel_bios_init_panel(dev_priv, &intel_connector->panel, + encoder->devdata, IS_ERR(edid) ? NULL : edid); intel_panel_add_edid_fixed_modes(intel_connector, true); diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index 3949fb449353..0975e49f8d03 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -1430,7 +1430,7 @@ void intel_pps_init(struct intel_dp *intel_dp) intel_dp->pps.initializing = true; INIT_DELAYED_WORK(&intel_dp->pps.panel_vdd_work, edp_panel_vdd_work); - if (IS_GEMINILAKE(i915) || IS_BROXTON(i915)) + if (IS_GEMINILAKE(i915) || IS_BROXTON(i915) || DISPLAY_VER(i915) >= 12) intel_dp->get_pps_idx = bxt_power_sequencer_idx; else if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) intel_dp->get_pps_idx = vlv_power_sequencer_pipe; From patchwork Tue Nov 8 21:18:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 13036865 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 CD27DC4332F for ; Tue, 8 Nov 2022 21:23:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0BEB10E51F; Tue, 8 Nov 2022 21:23:24 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id C82B310E51B for ; Tue, 8 Nov 2022 21:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667942597; x=1699478597; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/QNvTI3KowzbfLLdW05fTDrj0Iz1PuAUtyQvnYwIWck=; b=YfzXBfkH7+epJpXtX5NUlvk/q3MKIA13FJIbqTi/wVZckLjbfvkDSQRG y0hMqr/JPvxYi5PvfX7c38q+EYiyY6z2Yo2JIh4/xt0G7cDobKS0S6vv2 /B9lS6FSboLsx8TNkw+4+lKx14AdyRkwhIGte1hYkURpdDJYUdrWfcS6K OzHkkMaxOY3zW/p6+fCwCfQBNfRZNWYEfeXuwaLl6hEeL2DqUGDVaTndU T9I9LCde1p5qKxSljgovl04fpe7xPxowCFkzcqYA5oBYO//sw91hSlbQC Fyq6zSrbWQeCs355p3gJ6yoQeYOoW4cjPhu8v50yo7pHtQ7ywaQVx8biC g==; X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="298330723" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="298330723" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 13:23:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10525"; a="761638537" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="761638537" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by orsmga004.jf.intel.com with ESMTP; 08 Nov 2022 13:23:15 -0800 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Nov 2022 02:48:22 +0530 Message-Id: <20221108211822.28048-3-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221108211822.28048-1-animesh.manna@intel.com> References: <20221108211822.28048-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] drm/i915/edp: Fix warning as vdd went down without driver knowledge 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" Kernel warning triggered as vdd went down after certain time during aux transfer in connector init sequence. To solve the kernel warning adjust power domain and vdd wakeref count. Currently issue seen on ADL so add the above adjustment part of ADL platform check, if needed will extend for future platform. Cc: Jani Nikula Cc: Ville Syrjälä Cc: Uma Shankar Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_pps.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index 0975e49f8d03..1857bbcc6fd4 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -587,8 +587,15 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp) cancel_delayed_work(&intel_dp->pps.panel_vdd_work); intel_dp->pps.want_panel_vdd = true; - if (edp_have_panel_vdd(intel_dp)) + if (edp_have_panel_vdd(intel_dp)) { return need_to_disable; + } else { + if ((IS_ALDERLAKE_S(dev_priv) || IS_ALDERLAKE_P(dev_priv)) && + intel_dp->pps.vdd_wakeref) + intel_display_power_put(dev_priv, + intel_aux_power_domain(dig_port), + fetch_and_zero(&intel_dp->pps.vdd_wakeref)); + } drm_WARN_ON(&dev_priv->drm, intel_dp->pps.vdd_wakeref); intel_dp->pps.vdd_wakeref = intel_display_power_get(dev_priv,