Re: [PATCH v7 05/23] drm/i915/icl: Make common DSI functions available

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

 



On Tue, 16 Oct 2018, Madhav Chauhan <madhav.chauhan@xxxxxxxxx> wrote:
> On 10/15/2018 7:57 PM, Jani Nikula wrote:
>> From: Madhav Chauhan <madhav.chauhan@xxxxxxxxx>
>>
>> This patch moves couple of legacy DSI functions to header and common DSI
>> files so that they can be re-used by Gen11 DSI. No functional change.
>>
>> v2 by Jani:
>>   - Move intel_dsi_msleep() to intel_dsi_vbt.c
>
> This will be used by icl dsi as well and and delay is directly passed
> Shouldn't we have this inside intel_dsi.c??
> Or
> Because seq version from VBT is getting checked inside this function,
> so that is taking the precedence??

I had it in intel_dsi.c at first, but decided on intel_dsi_vbt.c instead
because it does have a dependency on the VBT. And I presume on ICL this
will be a NOP due to v3+ sequence.

BR,
Jani.




>
> Regards,
> Madhav
>
>> Signed-off-by: Madhav Chauhan <madhav.chauhan@xxxxxxxxx>
>> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
>> ---
>>   drivers/gpu/drm/i915/intel_dsi.h     | 11 +++++++++++
>>   drivers/gpu/drm/i915/intel_dsi_vbt.c | 11 +++++++++++
>>   drivers/gpu/drm/i915/vlv_dsi.c       | 21 ---------------------
>>   3 files changed, 22 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_dsi.h b/drivers/gpu/drm/i915/intel_dsi.h
>> index 0d911a4adfaa..d7c0c599b52d 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi.h
>> +++ b/drivers/gpu/drm/i915/intel_dsi.h
>> @@ -129,6 +129,16 @@ static inline struct intel_dsi *enc_to_intel_dsi(struct drm_encoder *encoder)
>>   	return container_of(encoder, struct intel_dsi, base.base);
>>   }
>>   
>> +static inline bool is_vid_mode(struct intel_dsi *intel_dsi)
>> +{
>> +	return intel_dsi->operation_mode == INTEL_DSI_VIDEO_MODE;
>> +}
>> +
>> +static inline bool is_cmd_mode(struct intel_dsi *intel_dsi)
>> +{
>> +	return intel_dsi->operation_mode == INTEL_DSI_COMMAND_MODE;
>> +}
>> +
>>   /* intel_dsi.c */
>>   int intel_dsi_bitrate(const struct intel_dsi *intel_dsi);
>>   int intel_dsi_tlpx_ns(const struct intel_dsi *intel_dsi);
>> @@ -162,5 +172,6 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id);
>>   int intel_dsi_vbt_get_modes(struct intel_dsi *intel_dsi);
>>   void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
>>   				 enum mipi_seq seq_id);
>> +void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec);
>>   
>>   #endif /* _INTEL_DSI_H */
>> diff --git a/drivers/gpu/drm/i915/intel_dsi_vbt.c b/drivers/gpu/drm/i915/intel_dsi_vbt.c
>> index b0d8548f0462..5e16b4c5f531 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi_vbt.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi_vbt.c
>> @@ -481,6 +481,17 @@ void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
>>   	}
>>   }
>>   
>> +void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec)
>> +{
>> +	struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
>> +
>> +	/* For v3 VBTs in vid-mode the delays are part of the VBT sequences */
>> +	if (is_vid_mode(intel_dsi) && dev_priv->vbt.dsi.seq_version >= 3)
>> +		return;
>> +
>> +	msleep(msec);
>> +}
>> +
>>   int intel_dsi_vbt_get_modes(struct intel_dsi *intel_dsi)
>>   {
>>   	struct intel_connector *connector = intel_dsi->attached_connector;
>> diff --git a/drivers/gpu/drm/i915/vlv_dsi.c b/drivers/gpu/drm/i915/vlv_dsi.c
>> index dbca30460a6b..ee0cd5d0bf91 100644
>> --- a/drivers/gpu/drm/i915/vlv_dsi.c
>> +++ b/drivers/gpu/drm/i915/vlv_dsi.c
>> @@ -290,16 +290,6 @@ static void band_gap_reset(struct drm_i915_private *dev_priv)
>>   	mutex_unlock(&dev_priv->sb_lock);
>>   }
>>   
>> -static inline bool is_vid_mode(struct intel_dsi *intel_dsi)
>> -{
>> -	return intel_dsi->operation_mode == INTEL_DSI_VIDEO_MODE;
>> -}
>> -
>> -static inline bool is_cmd_mode(struct intel_dsi *intel_dsi)
>> -{
>> -	return intel_dsi->operation_mode == INTEL_DSI_COMMAND_MODE;
>> -}
>> -
>>   static bool intel_dsi_compute_config(struct intel_encoder *encoder,
>>   				     struct intel_crtc_state *pipe_config,
>>   				     struct drm_connector_state *conn_state)
>> @@ -746,17 +736,6 @@ static void intel_dsi_prepare(struct intel_encoder *intel_encoder,
>>   			      const struct intel_crtc_state *pipe_config);
>>   static void intel_dsi_unprepare(struct intel_encoder *encoder);
>>   
>> -static void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec)
>> -{
>> -	struct drm_i915_private *dev_priv = to_i915(intel_dsi->base.base.dev);
>> -
>> -	/* For v3 VBTs in vid-mode the delays are part of the VBT sequences */
>> -	if (is_vid_mode(intel_dsi) && dev_priv->vbt.dsi.seq_version >= 3)
>> -		return;
>> -
>> -	msleep(msec);
>> -}
>> -
>>   /*
>>    * Panel enable/disable sequences from the VBT spec.
>>    *
>

-- 
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