From patchwork Thu Jun 2 14:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 12867915 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 3A8B2C43334 for ; Thu, 2 Jun 2022 14:20:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A4A22112D42; Thu, 2 Jun 2022 14:20:34 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 11552112D43 for ; Thu, 2 Jun 2022 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654179633; x=1685715633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=O3z1JFc4TAEZwS/9bepzy82H7U4BJgQAWSILqHqFCLY=; b=WOwu/7pN2VEdO3bTQNJAw2KkDlIx4DtXUpFv6XhEpEBYZ6YCk+XAVZAt voddort/pnJdxoG3hU6KBgkgPR0jcFcoykhOnpON4wJSF3xrvr0ME+Zw6 ChE++LeEcq7+5uRopJ5+zCDbjNVhKz7le/8F1ceTbD/V4L9sYaF6WoLWy 5Ev3sojl4Z8hX8RFh91LZJdVXtbHXd903sYiYrG4ggXzNNBf64pU7F0pM vFk+4NCb851efFigakjyBB9A1109EQKdaLQaMIPZ8MBVoL7c8eVeN4NTK WwZdeZITxsIeOE2b0aY2f0nUB4Iiwys8iYctgXiVnLKJ38ipYa5lB/ftl A==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="339007276" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339007276" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 07:20:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="905007623" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by fmsmga005.fm.intel.com with ESMTP; 02 Jun 2022 07:20:30 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jun 2022 19:48:46 +0530 Message-Id: <20220602141850.21301-2-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220602141850.21301-1-animesh.manna@intel.com> References: <20220602141850.21301-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 1/5] drm/i915/bios: calculate drrs mode using panel index for dual LFP 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@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Dual LFP may have different panel and based on panel index respective 2 bits store the drrs mode info for each panel. So panel index is used for deriving drrs mode of the rspective panel. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/icl_dsi.c | 2 +- drivers/gpu/drm/i915/display/intel_bios.c | 45 +++++++++++++++++-- drivers/gpu/drm/i915/display/intel_bios.h | 3 +- drivers/gpu/drm/i915/display/intel_dp.c | 3 +- drivers/gpu/drm/i915/display/intel_lvds.c | 3 +- drivers/gpu/drm/i915/display/intel_sdvo.c | 2 +- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 4 ++ drivers/gpu/drm/i915/display/vlv_dsi.c | 2 +- 8 files changed, 52 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c index 3b5305c219ba..b3aa430abd03 100644 --- a/drivers/gpu/drm/i915/display/icl_dsi.c +++ b/drivers/gpu/drm/i915/display/icl_dsi.c @@ -2050,7 +2050,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv) /* attach connector to encoder */ intel_connector_attach_encoder(intel_connector, encoder); - intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL); + intel_bios_init_panel(dev_priv, intel_connector, NULL); mutex_lock(&dev->mode_config.mutex); intel_panel_add_vbt_lfp_fixed_mode(intel_connector); diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 337277ae3dae..78eaf6255599 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -747,7 +747,8 @@ static int get_panel_type(struct drm_i915_private *i915, static void parse_panel_options(struct drm_i915_private *i915, struct intel_panel *panel, - const struct edid *edid) + const struct edid *edid, + int panel_index) { const struct bdb_lvds_options *lvds_options; int panel_type; @@ -764,7 +765,7 @@ parse_panel_options(struct drm_i915_private *i915, panel->vbt.panel_type = panel_type; drrs_mode = (lvds_options->dps_panel_type_bits - >> (panel_type * 2)) & MODE_MASK; + >> (panel_index * 2)) & MODE_MASK; /* * VBT has static DRRS = 0 and seamless DRRS = 2. * The below piece of code is required to adjust vbt.drrs_type @@ -3069,13 +3070,49 @@ void intel_bios_init(struct drm_i915_private *i915) kfree(oprom_vbt); } +static int +get_lfp_panel_index(struct drm_i915_private *i915, int lfp_panel_instance) +{ + const struct bdb_lvds_options *lvds_options; + + lvds_options = find_section(i915, BDB_LVDS_OPTIONS); + if (!lvds_options) + return -1; + + switch (lfp_panel_instance) { + case 1: + return lvds_options->panel_type; + case 2: + return lvds_options->panel_type2; + default: + break; + } + + return -1; +} + void intel_bios_init_panel(struct drm_i915_private *i915, - struct intel_panel *panel, + struct intel_connector *intel_connector, const struct edid *edid) { + struct intel_panel *panel = &intel_connector->panel; + struct intel_encoder *encoder = intel_connector->encoder; + const struct intel_bios_encoder_data *devdata = i915->vbt.ports[encoder->port]; + int lfp_inst = 0, panel_index; + init_vbt_panel_defaults(panel); - parse_panel_options(i915, panel, edid); + if (devdata->child.handle == HANDLE_LFP_1) + lfp_inst = 1; + else if (devdata->child.handle == HANDLE_LFP_2) + lfp_inst = 2; + + if (lfp_inst == 0) + return; + + panel_index = get_lfp_panel_index(i915, lfp_inst); + + parse_panel_options(i915, panel, edid, panel_index); parse_generic_dtd(i915, panel); parse_lfp_data(i915, panel); parse_lfp_backlight(i915, panel); diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h index b112200ae0a0..e4c268495547 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.h +++ b/drivers/gpu/drm/i915/display/intel_bios.h @@ -37,6 +37,7 @@ struct edid; struct intel_bios_encoder_data; struct intel_crtc_state; struct intel_encoder; +struct intel_connector; struct intel_panel; enum port; @@ -233,7 +234,7 @@ struct mipi_pps_data { 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, + struct intel_connector *intel_connector, const struct edid *edid); void intel_bios_fini_panel(struct intel_panel *panel); void intel_bios_driver_remove(struct drm_i915_private *dev_priv); diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 1bc1f6458e81..3e9b4263e1bc 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5213,8 +5213,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, } intel_connector->edid = edid; - intel_bios_init_panel(dev_priv, &intel_connector->panel, - IS_ERR(edid) ? NULL : edid); + intel_bios_init_panel(dev_priv, intel_connector, IS_ERR(edid) ? NULL : edid); intel_panel_add_edid_fixed_modes(intel_connector, intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE); diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 595f03343939..2c60267f9d37 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -967,8 +967,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) } intel_connector->edid = edid; - intel_bios_init_panel(dev_priv, &intel_connector->panel, - IS_ERR(edid) ? NULL : edid); + intel_bios_init_panel(dev_priv, intel_connector, IS_ERR(edid) ? NULL : edid); /* Try EDID first */ intel_panel_add_edid_fixed_modes(intel_connector, diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index d9de2c4d67a7..3b7fe117bc5b 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -2901,7 +2901,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) goto err; - intel_bios_init_panel(i915, &intel_connector->panel, NULL); + intel_bios_init_panel(i915, intel_connector, NULL); /* * Fetch modes from VBT. For SDVO prefer the VBT mode since some diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h b/drivers/gpu/drm/i915/display/intel_vbt_defs.h index 4b98bab3b890..fbda64e3a34d 100644 --- a/drivers/gpu/drm/i915/display/intel_vbt_defs.h +++ b/drivers/gpu/drm/i915/display/intel_vbt_defs.h @@ -349,6 +349,10 @@ enum vbt_gmbus_ddi { #define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR13P5 6 #define BDB_230_VBT_DP_MAX_LINK_RATE_UHBR20 7 +/* VBT info for DUAL LFP */ +#define HANDLE_LFP_1 0x0008 +#define HANDLE_LFP_2 0x0080 + /* * The child device config, aka the display device data structure, provides a * description of a port and its configuration on the platform. diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c index abda0888c8d4..114e4f89f198 100644 --- a/drivers/gpu/drm/i915/display/vlv_dsi.c +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c @@ -1926,7 +1926,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) intel_dsi->panel_power_off_time = ktime_get_boottime(); - intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL); + intel_bios_init_panel(dev_priv, intel_connector, NULL); if (intel_connector->panel.vbt.dsi.config->dual_link) intel_dsi->ports = BIT(PORT_A) | BIT(PORT_C); From patchwork Thu Jun 2 14:18:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 12867916 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 6190CC43334 for ; Thu, 2 Jun 2022 14:20:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E602112D68; Thu, 2 Jun 2022 14:20:37 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05AA6112D55 for ; Thu, 2 Jun 2022 14:20: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=1654179636; x=1685715636; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pf3jo4wnCz4FFSh9rdXu4W6DnMRgGX2oHl5qNEPdXAI=; b=Yb1nMJzfbxLzcNTz38rm2W8jgkXTZDMzwX5XXyYpIp1dgyLiwTJHUazV AHa8jV0u/sDROeyO4E8ASHEo8CiPFWTlhckSZIcFZBiVLgFLfWZiBunYr scQrmqfdL3/65oV1GcWQl4itrOF1S34UG/hpWrHT5ym24mr7Sgq83IN+z ZsySIsy9JEog1f5RSliU0jUfqvi2ifB5iT4o8h8rDj4wvwiRM71b1NWFz 5r4Llb83OfxGX0RvCrhfzL6X9gzqRR0ilDqqOd6HFWtzHMkX2JGz0Efo9 ++WfO/Z2Uw6iWSqYlaDiUCt5x/sgGJpmeTjHH8+/LQLLFxXhkY3sCMbn0 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="339007286" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339007286" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 07:20:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="905007656" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by fmsmga005.fm.intel.com with ESMTP; 02 Jun 2022 07:20:33 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jun 2022 19:48:47 +0530 Message-Id: <20220602141850.21301-3-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220602141850.21301-1-animesh.manna@intel.com> References: <20220602141850.21301-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 2/5] drm/i915/display: Use panel index to parse panel timing for dual EDP 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@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" There will be separate entry for eack LFP in VBT. Panel index is used for deriving panel timing info of the respective panel. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_bios.c | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 78eaf6255599..943c5584f242 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -793,16 +793,16 @@ static void parse_lfp_panel_dtd(struct drm_i915_private *i915, struct intel_panel *panel, const struct bdb_lvds_lfp_data *lvds_lfp_data, - const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs) + const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs, + int panel_index) { const struct lvds_dvo_timing *panel_dvo_timing; const struct lvds_fp_timing *fp_timing; struct drm_display_mode *panel_fixed_mode; - int panel_type = panel->vbt.panel_type; panel_dvo_timing = get_lvds_dvo_timing(lvds_lfp_data, lvds_lfp_data_ptrs, - panel_type); + panel_index); panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); if (!panel_fixed_mode) @@ -818,7 +818,7 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915, fp_timing = get_lvds_fp_timing(lvds_lfp_data, lvds_lfp_data_ptrs, - panel_type); + panel_index); /* check the resolution, just to be sure */ if (fp_timing->x_res == panel_fixed_mode->hdisplay && @@ -832,7 +832,8 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915, static void parse_lfp_data(struct drm_i915_private *i915, - struct intel_panel *panel) + struct intel_panel *panel, + int panel_index) { const struct bdb_lvds_lfp_data *data; const struct bdb_lvds_lfp_data_tail *tail; @@ -848,7 +849,7 @@ parse_lfp_data(struct drm_i915_private *i915, return; if (!panel->vbt.lfp_lvds_vbt_mode) - parse_lfp_panel_dtd(i915, panel, data, ptrs); + parse_lfp_panel_dtd(i915, panel, data, ptrs, panel_index); tail = get_lfp_data_tail(data, ptrs); if (!tail) @@ -865,7 +866,8 @@ parse_lfp_data(struct drm_i915_private *i915, static void parse_generic_dtd(struct drm_i915_private *i915, - struct intel_panel *panel) + struct intel_panel *panel, + int panel_index) { const struct bdb_generic_dtd *generic_dtd; const struct generic_dtd_entry *dtd; @@ -900,14 +902,14 @@ parse_generic_dtd(struct drm_i915_private *i915, num_dtd = (get_blocksize(generic_dtd) - sizeof(struct bdb_generic_dtd)) / generic_dtd->gdtd_size; - if (panel->vbt.panel_type >= num_dtd) { + if (panel_index >= num_dtd) { drm_err(&i915->drm, "Panel type %d not found in table of %d DTD's\n", - panel->vbt.panel_type, num_dtd); + panel_index, num_dtd); return; } - dtd = &generic_dtd->dtd[panel->vbt.panel_type]; + dtd = &generic_dtd->dtd[panel_index]; panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); if (!panel_fixed_mode) @@ -3113,8 +3115,8 @@ void intel_bios_init_panel(struct drm_i915_private *i915, panel_index = get_lfp_panel_index(i915, lfp_inst); parse_panel_options(i915, panel, edid, panel_index); - parse_generic_dtd(i915, panel); - parse_lfp_data(i915, panel); + parse_generic_dtd(i915, panel, panel_index); + parse_lfp_data(i915, panel, panel_index); parse_lfp_backlight(i915, panel); parse_sdvo_panel_data(i915, panel); parse_panel_driver_features(i915, panel); From patchwork Thu Jun 2 14:18:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 12867917 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 A2645C433EF for ; Thu, 2 Jun 2022 14:20:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BEE1112D75; Thu, 2 Jun 2022 14:20:39 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 82DDF112D75 for ; Thu, 2 Jun 2022 14:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654179638; x=1685715638; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OgmCgf5VIrbafZ180BnrwAWZCNGG4nYVdLA4zdm2lvQ=; b=eAYuLK+NGiMuYHeOBxUdQrQXo2YscKneRFg5AR1KbQLXgCnVXq1V+Dik wSe25ht+w91ZVFhwcds7iOnl8WAvSpjXJxPzd+7fM+IGRbY4lQqZc/mRl Y+EZbQ6LCINmKz3igfNthuE5lk7SO1ldkGFt8IQADu9EkR5VDvcpgUgWa Ds78H5vm2kIHta/S0pyLMd7uoKdfO1pJ6I+4SKTWt/Rn+cTmNANY2XT7Q q+a9/2fzuu7agxurYYdJ3C5BHhvGnrSyAn/36fo9yc03yJASlp0krItSn PU4s2kTZW6OcEid/IHft8KV3CbMeAFef87wtYWn7kiHSN/OvaJfD4uGn4 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="339007293" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339007293" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 07:20:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="905007671" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by fmsmga005.fm.intel.com with ESMTP; 02 Jun 2022 07:20:36 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jun 2022 19:48:48 +0530 Message-Id: <20220602141850.21301-4-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220602141850.21301-1-animesh.manna@intel.com> References: <20220602141850.21301-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 3/5] drm/i915/display: Use panel index to parse lfp backlight 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@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" There will be separate entry of backlight info for each LFP in VBT. Panel index is used for deriving backlight info of the respective panel. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_bios.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 943c5584f242..34160dc6b092 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -957,11 +957,11 @@ parse_generic_dtd(struct drm_i915_private *i915, static void parse_lfp_backlight(struct drm_i915_private *i915, - struct intel_panel *panel) + struct intel_panel *panel, + int panel_index) { const struct bdb_lfp_backlight_data *backlight_data; const struct lfp_backlight_data_entry *entry; - int panel_type = panel->vbt.panel_type; u16 level; backlight_data = find_section(i915, BDB_LVDS_BACKLIGHT); @@ -975,7 +975,7 @@ parse_lfp_backlight(struct drm_i915_private *i915, return; } - entry = &backlight_data->data[panel_type]; + entry = &backlight_data->data[panel_index]; panel->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_PWM; if (!panel->vbt.backlight.present) { @@ -999,7 +999,7 @@ parse_lfp_backlight(struct drm_i915_private *i915, if (get_blocksize(backlight_data) >= exp_size) { const struct lfp_backlight_control_method *method; - method = &backlight_data->backlight_control[panel_type]; + method = &backlight_data->backlight_control[panel_index]; panel->vbt.backlight.type = method->type; panel->vbt.backlight.controller = method->controller; } @@ -1012,11 +1012,11 @@ parse_lfp_backlight(struct drm_i915_private *i915, u16 min_level; bool scale; - level = backlight_data->brightness_level[panel_type].level; - min_level = backlight_data->brightness_min_level[panel_type].level; + level = backlight_data->brightness_level[panel_index].level; + min_level = backlight_data->brightness_min_level[panel_index].level; if (i915->vbt.version >= 236) - scale = backlight_data->brightness_precision_bits[panel_type] == 16; + scale = backlight_data->brightness_precision_bits[panel_index] == 16; else scale = level > 255; @@ -1028,11 +1028,8 @@ parse_lfp_backlight(struct drm_i915_private *i915, level = 255; } panel->vbt.backlight.min_brightness = min_level; - - panel->vbt.backlight.brightness_precision_bits = - backlight_data->brightness_precision_bits[panel_type]; } else { - level = backlight_data->level[panel_type]; + level = backlight_data->level[panel_index]; panel->vbt.backlight.min_brightness = entry->min_brightness; } @@ -3117,7 +3114,7 @@ void intel_bios_init_panel(struct drm_i915_private *i915, parse_panel_options(i915, panel, edid, panel_index); parse_generic_dtd(i915, panel, panel_index); parse_lfp_data(i915, panel, panel_index); - parse_lfp_backlight(i915, panel); + parse_lfp_backlight(i915, panel, panel_index); parse_sdvo_panel_data(i915, panel); parse_panel_driver_features(i915, panel); parse_power_conservation_features(i915, panel); From patchwork Thu Jun 2 14:18:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 12867918 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 95125C433EF for ; Thu, 2 Jun 2022 14:20:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A3D8112D7D; Thu, 2 Jun 2022 14:20:43 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 764BE112D77 for ; Thu, 2 Jun 2022 14:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654179641; x=1685715641; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8wISFmGdZ8hD31kH5sLhZgRxV8fzd5Xm0Mui0I7fiB4=; b=Cl2ha9KpqvOZ64IKZrJYXhCeTvz31WbB6DhGqs8lMWWmA8tfVam2sFZH QD7Y3kKafWIi1dYqwDTA5D2zg7y5WDck1nBre1w7Q2Ffe9HKrwUaY40cR OebJGJkOPD0i2jccuFCX3xmWkteI8GANfyJAhYCncADxdu3GGiSWWCx7M 3FU5pL1s2ld7ttf6CltAQR2n4ZDBdFFRaydrKZ8Ywbi4linI7P2UlqcBu EiVSVeP52/iOgTQc0pG4lhYX7F5h1Lp7oohCVlryyRIUqBh6WXTJ470u/ FMBquz0Vewyqm+XPVnfzCN4nEt/li6Y+gNGUPC66GOTe++M+Fz9ydvI3S w==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="339007313" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339007313" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 07:20:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="905007706" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by fmsmga005.fm.intel.com with ESMTP; 02 Jun 2022 07:20:38 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jun 2022 19:48:49 +0530 Message-Id: <20220602141850.21301-5-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220602141850.21301-1-animesh.manna@intel.com> References: <20220602141850.21301-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 4/5] drm/i915/display: prepend connector name to the backlight 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@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Arun R Murthy With the enablement of dual eDP, there will have to exist two entries of backlight sysfs file. In order to avoid sysfs file name duplication, the file names are prepended with the connector name. Signed-off-by: Arun R Murthy --- drivers/gpu/drm/i915/display/intel_backlight.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 68513206a66a..211fa0f07239 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -967,6 +967,8 @@ int intel_backlight_device_register(struct intel_connector *connector) props.power = FB_BLANK_POWERDOWN; name = kstrdup("intel_backlight", GFP_KERNEL); + name = kasprintf(GFP_KERNEL, "%s.intel_backlight", + connector->base.name); if (!name) return -ENOMEM; From patchwork Thu Jun 2 14:18:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 12867919 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 669C9CCA478 for ; Thu, 2 Jun 2022 14:20:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3550112D7B; Thu, 2 Jun 2022 14:20:44 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id A3357112D7B for ; Thu, 2 Jun 2022 14:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654179643; x=1685715643; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=tCoRxhp/MVk8SlzUBx/oZGWT8r0ZZjVW77EuXBLnUFI=; b=dGWF52v1+yQmvELce/+DF5jiFaOaUc5gi7jl/MFjJ4btsCBSyQ8ZGX5q 1iy+scOBvtEJpD9FfqSmdjzlSdxbuoulsuajrbRDzzCRPxlTMjMkzLPco ICBpuuGLYzMlAzPr7j46dlLuodP/FXgSLM1zpoAJlmIqS+yy4UjEn3tHx 6p0zNbhj4cGKhBd8aOLn5RL3avDH2+KJVq38hC877w48ZOeFkmJIF7HEM eMb3YKl2Tl1zFJO1qseOrdE2uup8JK7JOReQnmxxjzMoWTmK2WRBsgwp6 flKM9gGQRPLYVxJG0qNcNBnArFIsmsGJRxRVpR7De61QRAFf1JuBIRkmi w==; X-IronPort-AV: E=McAfee;i="6400,9594,10365"; a="339007327" X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="339007327" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2022 07:20:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,271,1647327600"; d="scan'208";a="905007744" Received: from srr4-3-linux-101-amanna.iind.intel.com ([10.223.74.76]) by fmsmga005.fm.intel.com with ESMTP; 02 Jun 2022 07:20:41 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Thu, 2 Jun 2022 19:48:50 +0530 Message-Id: <20220602141850.21301-6-animesh.manna@intel.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220602141850.21301-1-animesh.manna@intel.com> References: <20220602141850.21301-1-animesh.manna@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 5/5] drm/i915/display/tgl+: Use PPS index from vbt 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@intel.com, Nischal Varide Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Nischal Varide Tigerlake and newer has two instances of PPS, to support up to two eDP panels. Signed-off-by: Nischal Varide Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/display/intel_pps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c index 1b21a341962f..52cb5be4e901 100644 --- a/drivers/gpu/drm/i915/display/intel_pps.c +++ b/drivers/gpu/drm/i915/display/intel_pps.c @@ -365,7 +365,8 @@ static void intel_pps_get_registers(struct intel_dp *intel_dp, memset(regs, 0, sizeof(*regs)); - if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) + if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv) || + DISPLAY_VER(dev_priv) >= 12) 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);