All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lee, Shawn C" <shawn.c.lee@intel.com>
To: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Cc: "Jani Nikula" <jani.nikula@linux.intel.com>,
	"Kulkarni, Vandita" <vandita.kulkarni@intel.com>,
	"Chiou, Cooper" <cooper.chiou@intel.com>,
	"Tseng, William" <william.tseng@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: Re: [Intel-gfx] [v4] drm/i915/dsi: do not register gmbus if it was reserved for MIPI display
Date: Tue, 5 Oct 2021 01:28:54 +0000	[thread overview]
Message-ID: <CO6PR11MB5651F70187C5EC143745DF03A3AF9@CO6PR11MB5651.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210923023316.17905-1-shawn.c.lee@intel.com>


Hi all, could you please share your comments for the latest patch? Thanks!

Best regards,
Shawn

>
>Gmbus driver would setup all Intel i2c GMBuses. But DDC bus may configured as gpio and reserved for MIPI driver to control panel power on/off sequence.
>
>Using i2c tool to communicate to peripherals via i2c interface reversed for gmbus(DDC). There will be some high/low pulse appear on DDC SCL and SDA (might be host sent out i2c slave address). MIPI panel would be impacted due to unexpected signal then caused abnormal display or shut down issue.
>
>v2: gmbus driver should not add i2c adapter for DDC interface
>    if LFP display was configured to support MIPI panel.
>v3: fix sparse warning
>v4: before gmbus driver add/delete/access i2c adapter would
>    call intel_gmbus_is_valid_pin() to know target adapter
>    is available or not. Avoid to access unexisting adapter.
>    Driver should check DSI status and pin's availability in
>    intel_gmbus_is_valid_pin().
>
>Cc: Jani Nikula <jani.nikula@linux.intel.com>
>Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
>Cc: Cooper Chiou <cooper.chiou@intel.com>
>Cc: William Tseng <william.tseng@intel.com>
>Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
>---
> drivers/gpu/drm/i915/display/intel_gmbus.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
>diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
>index ceb1bf8a8c3c..852e499e2e8c 100644
>--- a/drivers/gpu/drm/i915/display/intel_gmbus.c
>+++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
>@@ -118,11 +118,29 @@ static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *dev_priv,
> 		return &gmbus_pins[pin];
> }
> 
>+static bool intel_gmbus_ddc_reserve_for_mipi_dsi(struct drm_i915_private *dev_priv,
>+					     unsigned int pin)
>+{
>+	if (intel_bios_is_dsi_present(dev_priv, NULL)) {
>+		if (DISPLAY_VER(dev_priv) >= 11) {
>+			if ((pin == GMBUS_PIN_2_BXT && dev_priv->vbt.dsi.config->dual_link) ||
>+			     pin == GMBUS_PIN_1_BXT) {
>+				return true;
>+			}
>+		}
>+	}
>+
>+	return false;
>+}
>+
> bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
> 			      unsigned int pin)
> {
> 	unsigned int size;
> 
>+	if (intel_gmbus_ddc_reserve_for_mipi_dsi(dev_priv, pin))
>+		return false;
>+
> 	if (INTEL_PCH_TYPE(dev_priv) >= PCH_DG1)
> 		size = ARRAY_SIZE(gmbus_pins_dg1);
> 	else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP)
>--
>2.17.1
>

  reply	other threads:[~2021-10-05  1:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 10:21 [Intel-gfx] [PATCH] drm/i915/dsi: unregister gmbus if LFP display was MIPI panel Lee Shawn C
2021-09-16 10:32 ` Jani Nikula
2021-09-16 11:03   ` Lee, Shawn C
2021-09-16 11:12     ` Jani Nikula
2021-09-16 10:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-09-16 12:46 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-09-16 14:08 ` [Intel-gfx] [PATCH] drm/i915/dsi: do not register gmbus if it was reserved for MIPI display Lee Shawn C
2021-09-16 20:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: unregister gmbus if LFP display was MIPI panel (rev2) Patchwork
2021-09-16 20:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-09-16 21:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-17  0:43 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-09-17  4:35 ` [Intel-gfx] [PATCH] drm/i915/dsi: do not register gmbus if it was reserved for MIPI display Lee Shawn C
2021-09-17 10:59   ` Jani Nikula
2021-09-17 12:35     ` Lee, Shawn C
2021-09-17  4:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: unregister gmbus if LFP display was MIPI panel (rev3) Patchwork
2021-09-17  5:07 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-17  6:18 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-09-23  2:33 ` [Intel-gfx] [v4] drm/i915/dsi: do not register gmbus if it was reserved for MIPI display Lee Shawn C
2021-10-05  1:28   ` Lee, Shawn C [this message]
2021-09-23  3:01 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: unregister gmbus if LFP display was MIPI panel (rev4) Patchwork
2021-09-23  3:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-23  5:22 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR11MB5651F70187C5EC143745DF03A3AF9@CO6PR11MB5651.namprd11.prod.outlook.com \
    --to=shawn.c.lee@intel.com \
    --cc=20210923023316.17905-1-shawn.c.lee@intel.com \
    --cc=cooper.chiou@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=vandita.kulkarni@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    --cc=william.tseng@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.