All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Souza, Jose" <jose.souza@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Khor, Swee Aun" <swee.aun.khor@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/display: Trigger Modeset at boot for audio codec init
Date: Fri, 20 Mar 2020 06:19:37 +0000	[thread overview]
Message-ID: <E7C9878FBA1C6D42A1CA3F62AEB6945F82437F00@BGSMSX104.gar.corp.intel.com> (raw)
In-Reply-To: <469075d16551fe95e2fdadfd6ffd1538a8f3a657.camel@intel.com>



> -----Original Message-----
> From: Souza, Jose <jose.souza@intel.com>
> Sent: Friday, March 20, 2020 12:36 AM
> To: Shankar, Uma <uma.shankar@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: Khor, Swee Aun <swee.aun.khor@intel.com>
> Subject: Re: [Intel-gfx] [PATCH] drm/i915/display: Trigger Modeset at boot for audio
> codec init
> 
> On Wed, 2020-03-18 at 17:00 +0530, Uma Shankar wrote:
> > If external monitors are connected during boot up, driver uses the
> > same mode programmed by BIOS and avoids a full modeset.
> > This results in display audio codec left uninitialized and display
> > audio fails to work till user triggers a modeset.
> >
> > This patch fixes the same by triggering a modeset at boot.
> 
> We had the same issue for PSR, take a look to the fix:
> commit 33e059a2e4df454359f642f2235af39de9d3e914
> drm/i915/psr: Force PSR probe only after full initialization
> 
> Maybe make this even more generic.

Yeah this looks to dealing with almost a similar need. Thanks for pointing this out,
will try to come up with a generalized solution.

Regards,
Uma Shankar

> >
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> > Signed-off-by: SweeAun Khor <swee.aun.khor@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c     | 4 ++++
> >  drivers/gpu/drm/i915/display/intel_display.c | 8 ++++++++
> >  drivers/gpu/drm/i915/i915_drv.h              | 3 +++
> >  3 files changed, 15 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c
> > b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 73d0f4648c06..ba380afa73a6 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -3704,6 +3704,10 @@ static void intel_ddi_update_pipe(struct
> > intel_encoder *encoder,
> >  				  const struct intel_crtc_state
> > *crtc_state,
> >  				  const struct drm_connector_state
> > *conn_state)
> >  {
> > +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > +
> > +	/* Clear the bootflag */
> > +	dev_priv->bootflag = false;
> >
> >  	if (!intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
> >  		intel_ddi_update_pipe_dp(encoder, crtc_state, conn_state); diff
> > --git a/drivers/gpu/drm/i915/display/intel_display.c
> > b/drivers/gpu/drm/i915/display/intel_display.c
> > index 8f23c4d51c33..a1487539495f 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -14751,6 +14751,10 @@ static int intel_atomic_check(struct
> > drm_device *dev,
> >  		if (new_crtc_state->hw.mode.private_flags !=
> >  		    old_crtc_state->hw.mode.private_flags)
> >  			new_crtc_state->uapi.mode_changed = true;
> > +
> > +		/* Set mode_change to init audio code once at boot */
> > +		if (dev_priv->bootflag && new_crtc_state->hw.active)
> > +			new_crtc_state->uapi.mode_changed = true;
> >  	}
> >
> >  	ret = drm_atomic_helper_check_modeset(dev, &state->base); @@
> > -17655,11 +17659,15 @@ static void intel_update_fdi_pll_freq(struct
> > drm_i915_private *dev_priv)
> >
> >  static int intel_initial_commit(struct drm_device *dev)  {
> > +	struct drm_i915_private *dev_priv = to_i915(dev);
> >  	struct drm_atomic_state *state = NULL;
> >  	struct drm_modeset_acquire_ctx ctx;
> >  	struct intel_crtc *crtc;
> >  	int ret = 0;
> >
> > +	/* Set Flag to trigger modeset for audio codec init */
> > +	dev_priv->bootflag = true;
> > +
> >  	state = drm_atomic_state_alloc(dev);
> >  	if (!state)
> >  		return -ENOMEM;
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > b/drivers/gpu/drm/i915/i915_drv.h index a7ea1d855359..207196f9632b
> > 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1210,6 +1210,9 @@ struct drm_i915_private {
> >  	 * NOTE: This is the dri1/ums dungeon, don't add stuff here.
> > Your patch
> >  	 * will be rejected. Instead look for a better place.
> >  	 */
> > +
> > +	/* Flag to trigger modeset for Audio codec init once during
> > boot */
> > +	bool bootflag;
> >  };
> >
> >  static inline struct drm_i915_private *to_i915(const struct
> > drm_device *dev)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-20  6:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 11:30 [Intel-gfx] [PATCH] drm/i915/display: Trigger Modeset at boot for audio codec init Uma Shankar
2020-03-18 12:07 ` Anshuman Gupta
2020-03-18 14:02   ` Shankar, Uma
2020-03-18 12:15 ` Maarten Lankhorst
2020-03-18 14:37   ` Shankar, Uma
2020-03-19 12:11     ` Maarten Lankhorst
2020-03-18 12:23 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2020-03-19 19:05 ` [Intel-gfx] [PATCH] " Souza, Jose
2020-03-20  6:19   ` Shankar, Uma [this message]
2020-03-20 15:24     ` Ville Syrjälä
2020-03-20 16:54       ` Khor, Swee Aun
2020-03-23 14:29         ` Khor, Swee Aun
2020-03-24  5:56           ` Khor, Swee Aun
2020-03-26  7:25             ` Shankar, Uma
2020-03-24 18:38     ` Kai Vehmanen
2020-03-23 16:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: Trigger Modeset at boot for audio codec init (rev2) Patchwork
2020-03-23 17:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-24  0:01 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-03-24  6:11 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915/display: Trigger Modeset at boot for audio codec init (rev3) 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=E7C9878FBA1C6D42A1CA3F62AEB6945F82437F00@BGSMSX104.gar.corp.intel.com \
    --to=uma.shankar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=swee.aun.khor@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.