Re: [RFC 4/7] drm/i915/dsi: Helper to find dsi encoder in cmd mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 Oct 2019, Jani Nikula <jani.nikula@xxxxxxxxx> wrote:
> On Wed, 16 Oct 2019, "Kulkarni, Vandita" <vandita.kulkarni@xxxxxxxxx> wrote:
>>> -----Original Message-----
>>> From: Nikula, Jani <jani.nikula@xxxxxxxxx>
>>> Sent: Wednesday, October 16, 2019 12:51 AM
>>> To: Kulkarni, Vandita <vandita.kulkarni@xxxxxxxxx>; intel-
>>> gfx@xxxxxxxxxxxxxxxxxxxxx
>>> Cc: ville.syrjala@xxxxxxxxxxxxxxx; Shankar, Uma <uma.shankar@xxxxxxxxx>;
>>> Chauhan, Madhav <madhav.chauhan@xxxxxxxxx>; Kulkarni, Vandita
>>> <vandita.kulkarni@xxxxxxxxx>
>>> Subject: Re: [RFC 4/7] drm/i915/dsi: Helper to find dsi encoder in cmd mode
>>> 
>>> On Mon, 14 Oct 2019, Vandita Kulkarni <vandita.kulkarni@xxxxxxxxx> wrote:
>>> > From: Madhav Chauhan <madhav.chauhan@xxxxxxxxx>
>>> >
>>> > This patch adds a helper function to find encoder if DSI is operating
>>> > in command mode. This function will be used while enabling/disabling
>>> > TE interrupts for DSI.
>>> >
>>> > Signed-off-by: Madhav Chauhan <madhav.chauhan@xxxxxxxxx>
>>> > Signed-off-by: Vandita Kulkarni <vandita.kulkarni@xxxxxxxxx>
>>> > ---
>>> >  drivers/gpu/drm/i915/display/icl_dsi.c   | 17 +++++++++++++++++
>>> >  drivers/gpu/drm/i915/display/intel_dsi.h |  3 +++
>>> >  2 files changed, 20 insertions(+)
>>> >
>>> > diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c
>>> > b/drivers/gpu/drm/i915/display/icl_dsi.c
>>> > index 5dd9eebab6b1..877746416e52 100644
>>> > --- a/drivers/gpu/drm/i915/display/icl_dsi.c
>>> > +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
>>> > @@ -73,6 +73,23 @@ static enum transcoder
>>> dsi_port_to_transcoder(enum port port)
>>> >  		return TRANSCODER_DSI_1;
>>> >  }
>>> >
>>> > +struct intel_encoder *gen11_dsi_find_cmd_mode_encoder(struct
>>> > +intel_crtc *crtc) {
>>> > +	struct drm_device *dev = crtc->base.dev;
>>> > +	struct intel_encoder *encoder;
>>> > +	struct intel_dsi *intel_dsi;
>>> > +
>>> > +	for_each_encoder_on_crtc(dev, &crtc->base, encoder) {
>>> > +		if (encoder->type != INTEL_OUTPUT_DSI)
>>> > +			continue;
>>> > +		intel_dsi = enc_to_intel_dsi(&encoder->base);
>>> > +		if (intel_dsi->operation_mode ==
>>> INTEL_DSI_COMMAND_MODE)
>>> > +			return encoder;
>>> > +	}
>>> > +
>>> > +	return NULL;
>>> > +}
>>> 
>>> This may be a bit harsh, but everything that feels wrong about the following
>>> patches pretty much boils down to this function. It may get the job done,
>>> and I don't have a better suggestion on how to accomplish this right now.
>>> But it seems like we shouldn't have to do anything like this, and makes you
>>> feel like there's something wrong with the design.
>>> 
>>> It would be great to be able to handle this using crtc state, but alas the
>>> vblank enable hook only gets passed a struct drm_crtc *. (Patch 7 could
>>> easily switch to using crtc state, but need to also solve patch
>>> 5.)
>> .
>>> 
>>> I'll get back to you on this later, but in the mean time - Ville, do you have
>>> any ideas?
>>
>> Other option of adding in crtc_state, did you mean something like this
>> https://patchwork.freedesktop.org/patch/336178/ 
>> @Jani and @Ville  Please let me know your comments.
>
> The problem is that we don't have access to the crtc state in patch 5
> gen11_dsi_configure_te() because the call path is via drm_crtc_funcs and
> bdw_enable_vblank.

PS. I think moving some of this stuff to the crtc state is probably a
good thing no matter what. It's just that we *also* need some solution
to the problem in patch 5.


>
> BR,
> Jani.
>
>
>>
>> Thanks,
>> Vandita
>>> 
>>> 
>>> BR,
>>> Jani.
>>> 
>>> 
>>> > +
>>> >  static void wait_for_cmds_dispatched_to_panel(struct intel_encoder
>>> > *encoder)  {
>>> >  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); diff
>>> > --git a/drivers/gpu/drm/i915/display/intel_dsi.h
>>> > b/drivers/gpu/drm/i915/display/intel_dsi.h
>>> > index b15be5814599..071dad7ee04a 100644
>>> > --- a/drivers/gpu/drm/i915/display/intel_dsi.h
>>> > +++ b/drivers/gpu/drm/i915/display/intel_dsi.h
>>> > @@ -201,6 +201,9 @@ u32 bxt_dsi_get_pclk(struct intel_encoder
>>> *encoder,
>>> >  		     struct intel_crtc_state *config);  void
>>> > bxt_dsi_reset_clocks(struct intel_encoder *encoder, enum port port);
>>> >
>>> > +/* icl_dsi.c */
>>> > +struct intel_encoder *gen11_dsi_find_cmd_mode_encoder(struct
>>> > +intel_crtc *crtc);
>>> > +
>>> >  /* intel_dsi_vbt.c */
>>> >  bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id);
>>> > void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
>>> 
>>> --
>>> Jani Nikula, Intel Open Source Graphics Center

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux