[Intel-gfx] [PATCH 5/9] drm/i915: SHUTDOWN & Turn ON packets to be sent for both MIPI Ports in case of dual link Configuration

Shobhit Kumar shobhit.kumar at linux.intel.com
Thu Sep 25 14:54:16 CEST 2014


On Wednesday 24 September 2014 03:02 PM, Jani Nikula wrote:
> On Wed, 24 Sep 2014, Gaurav K Singh <gaurav.k.singh at intel.com> wrote:
>> Signed-off-by: Gaurav K Singh <gaurav.k.singh at intel.com>
>> Signed-off-by: Shobhit Kumar <shobhit.kumar at intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_dsi_cmd.c |   35 ++++++++++++++++++++++------------
>>   1 file changed, 23 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c
>> index eb698b1..a70656e 100644
>> --- a/drivers/gpu/drm/i915/intel_dsi_cmd.c
>> +++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c
>> @@ -394,6 +394,7 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs)
>>   	struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
>>   	enum pipe pipe = intel_crtc->pipe;
>>   	u32 mask;
>> +	int count = 1;
>>
>>   	/* XXX: pipe, hs */
>>   	if (hs)
>> @@ -401,18 +402,28 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs)
>>   	else
>>   		cmd |= DPI_LP_MODE;
>>
>> -	/* clear bit */
>> -	I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT);
>> -
>> -	/* XXX: old code skips write if control unchanged */
>> -	if (cmd == I915_READ(MIPI_DPI_CONTROL(pipe)))
>> -		DRM_ERROR("Same special packet %02x twice in a row.\n", cmd);
>> -
>> -	I915_WRITE(MIPI_DPI_CONTROL(pipe), cmd);
>> -
>> -	mask = SPL_PKT_SENT_INTERRUPT;
>> -	if (wait_for((I915_READ(MIPI_INTR_STAT(pipe)) & mask) == mask, 100))
>> -		DRM_ERROR("Video mode command 0x%08x send failed.\n", cmd);
>> +	if (intel_dsi->dual_link)
>> +		count = 2;
>> +
>> +	do {
>
> Please never use a do-while when a regular for loop will do.

Hmm, ok but reasoning ? Point here is that anyway we have to do once for 
first port and do..while helps maintain that simple flow

All other comments are valid. Thanks for them and will address them in 
next series after I update with more details in the commit messages. 
Guess that would have to be sometime next week now due to other 
priorities atm.

Regards
Shobhit



More information about the Intel-gfx mailing list