linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: Sean Paul <sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org>
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 05/14] drm/msm/dpu: enable master-slave encoders explicitly
Date: Fri, 31 Aug 2018 12:16:46 -0700	[thread overview]
Message-ID: <3c3232c852b8f3a17955322c8ec3fbd8@codeaurora.org> (raw)
In-Reply-To: <20180830162439.GI188300@art_vandelay>

On 2018-08-30 09:24, Sean Paul wrote:
> On Tue, Aug 28, 2018 at 05:39:54PM -0700, Jeykumar Sankaran wrote:
>> Identify slave-master encoders during initialization and enable
>> the encoders explicitly as the current logic has redundant and
>> ambiguous loops.
> 
> Please include a "Changes in vX" section so I don't need to figure it 
> out
> myself.
> 
Since I split these clean up changes into a new series, I was not sure
how to handle the versioning. With "changes in v4" log, Should I also
change the prefix labeling to [PATCH v4 05/14]? A couple of changes
are also introduced in this series.

Thanks,
Jeykumar S.

>> 
>> Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
>> ---
>>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 46
> ++++++++++-------------------
>>  1 file changed, 15 insertions(+), 31 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> index 991b22c..b223bd2 100644
>> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
>> @@ -180,6 +180,7 @@ struct dpu_encoder_virt {
>>  	unsigned int num_phys_encs;
>>  	struct dpu_encoder_phys *phys_encs[MAX_PHYS_ENCODERS_PER_VIRTUAL];
>>  	struct dpu_encoder_phys *cur_master;
>> +	struct dpu_encoder_phys *cur_slave;
>>  	struct dpu_hw_pingpong *hw_pp[MAX_CHANNELS_PER_ENC];
>> 
>>  	bool intfs_swapped;
>> @@ -1141,7 +1142,8 @@ void dpu_encoder_virt_restore(struct drm_encoder
> *drm_enc)
>>  static void dpu_encoder_virt_enable(struct drm_encoder *drm_enc)
>>  {
>>  	struct dpu_encoder_virt *dpu_enc = NULL;
>> -	int i, ret = 0;
>> +	struct dpu_encoder_phys *phys  = NULL;
>> +	int ret = 0;
>>  	struct drm_display_mode *cur_mode = NULL;
>> 
>>  	if (!drm_enc) {
>> @@ -1154,21 +1156,14 @@ static void dpu_encoder_virt_enable(struct
> drm_encoder *drm_enc)
>>  	trace_dpu_enc_enable(DRMID(drm_enc), cur_mode->hdisplay,
>>  			     cur_mode->vdisplay);
>> 
>> -	dpu_enc->cur_master = NULL;
>> -	for (i = 0; i < dpu_enc->num_phys_encs; i++) {
>> -		struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
>> +	/* always enable slave encoder before master */
>> +	phys = dpu_enc->cur_slave;
> 
> I think this variable makes things less readable. It made sense in the
> loop since
> you're indented an extra level and they're obfuscated anyways, but 
> since
> they're
> explicit now, could you please just use dpu_enc->cur_slave/master
> directly?
> 
> With this nit and the added changelog in the commit addressed,
> 
> Reviewed-by: Sean Paul <seanpaul@chromium.org>
> 
> 
>> +	if (phys && phys->ops.enable)
>> +		phys->ops.enable(phys);
>> 
>> -		if (phys && phys->ops.is_master &&
> phys->ops.is_master(phys)) {
>> -			DPU_DEBUG_ENC(dpu_enc, "master is now idx %d\n",
> i);
>> -			dpu_enc->cur_master = phys;
>> -			break;
>> -		}
>> -	}
>> -
>> -	if (!dpu_enc->cur_master) {
>> -		DPU_ERROR("virt encoder has no master! num_phys %d\n", i);
>> -		return;
>> -	}
>> +	phys = dpu_enc->cur_master;
>> +	if (phys && phys->ops.enable)
>> +		phys->ops.enable(phys);
>> 
>>  	ret = dpu_encoder_resource_control(drm_enc,
> DPU_ENC_RC_EVENT_KICKOFF);
>>  	if (ret) {
>> @@ -1177,21 +1172,6 @@ static void dpu_encoder_virt_enable(struct
> drm_encoder *drm_enc)
>>  		return;
>>  	}
>> 
>> -	for (i = 0; i < dpu_enc->num_phys_encs; i++) {
>> -		struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
>> -
>> -		if (!phys)
>> -			continue;
>> -
>> -		if (phys != dpu_enc->cur_master) {
>> -			if (phys->ops.enable)
>> -				phys->ops.enable(phys);
>> -		}
>> -	}
>> -
>> -	if (dpu_enc->cur_master->ops.enable)
>> -		dpu_enc->cur_master->ops.enable(dpu_enc->cur_master);
>> -
>>  	_dpu_encoder_virt_enable_helper(drm_enc);
>>  }
>> 
>> @@ -2062,6 +2042,11 @@ static int dpu_encoder_virt_add_phys_encs(
>>  		++dpu_enc->num_phys_encs;
>>  	}
>> 
>> +	if (params->split_role == ENC_ROLE_SLAVE)
>> +		dpu_enc->cur_slave = enc;
>> +	else
>> +		dpu_enc->cur_master = enc;
>> +
>>  	return 0;
>>  }
>> 
>> @@ -2228,7 +2213,6 @@ int dpu_encoder_setup(struct drm_device *dev,
> struct drm_encoder *enc,
>>  	if (ret)
>>  		goto fail;
>> 
>> -	dpu_enc->cur_master = NULL;
>>  	spin_lock_init(&dpu_enc->enc_spinlock);
>> 
>>  	atomic_set(&dpu_enc->frame_done_timeout, 0);
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
> Forum,
>> a Linux Foundation Collaborative Project
>> 

-- 
Jeykumar S
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno

  reply	other threads:[~2018-08-31 19:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29  0:39 [PATCH 00/14] clean up DPU for RM refactor Jeykumar Sankaran
2018-08-29  0:39 ` [PATCH 01/14] drm/msm/dpu: remove debugfs support for misr Jeykumar Sankaran
     [not found]   ` <1535503203-22054-2-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-30 16:15     ` Sean Paul
     [not found] ` <1535503203-22054-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-29  0:39   ` [PATCH 02/14] drm/msm/dpu: remove scalar config definitions Jeykumar Sankaran
2018-08-29  0:39   ` [PATCH 03/14] drm/msm/dpu: remove resource pool manager Jeykumar Sankaran
2018-08-29  0:39   ` [PATCH 04/14] drm/msm/dpu: remove ping pong split topology variables Jeykumar Sankaran
2018-08-29  0:39   ` [PATCH 05/14] drm/msm/dpu: enable master-slave encoders explicitly Jeykumar Sankaran
2018-08-30 16:24     ` Sean Paul
2018-08-31 19:16       ` Jeykumar Sankaran [this message]
     [not found]         ` <3c3232c852b8f3a17955322c8ec3fbd8-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 20:12           ` Sean Paul
2018-08-29  0:39   ` [PATCH 06/14] drm/msm/dpu: use kms stored hw mdp block Jeykumar Sankaran
2018-08-29  0:39   ` [PATCH 07/14] drm/msm/dpu: iterate for assigned hw ctl in virtual encoder Jeykumar Sankaran
     [not found]     ` <1535503203-22054-8-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-30 16:28       ` Sean Paul
2018-08-29  0:39   ` [PATCH 08/14] drm/msm/dpu: avoid querying for hw intf before assignment Jeykumar Sankaran
     [not found]     ` <1535503203-22054-9-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-30 16:39       ` Sean Paul
2018-08-29  0:39   ` [PATCH 09/14] drm/msm/dpu: make crtc get_mixer_width helper static Jeykumar Sankaran
2018-08-31 14:40     ` Sean Paul
2018-08-29  0:39   ` [PATCH 10/14] drm/msm/dpu: move hw resource tracking to crtc state Jeykumar Sankaran
2018-08-31 14:56     ` Sean Paul
2018-08-31 19:22       ` Jeykumar Sankaran
     [not found]         ` <b09b0a69d6b72ae170c0b02f6acfb9d5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 20:13           ` Sean Paul
2018-09-04 22:36       ` Jeykumar Sankaran
2018-08-29  0:40   ` [PATCH 11/14] drm/msm/dpu: rename hw_ctl to lm_ctl Jeykumar Sankaran
2018-08-31 15:54     ` Sean Paul
2018-08-29  0:40   ` [PATCH 12/14] drm/msm/dpu: remove topology name Jeykumar Sankaran
     [not found]     ` <1535503203-22054-13-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 16:08       ` Sean Paul
2018-09-04 23:03         ` Jeykumar Sankaran
     [not found]           ` <6e6b8dd4bbc3343c82b3e093db23b6f5-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-09-05 13:33             ` Sean Paul
2018-08-29  0:40   ` [PATCH 13/14] drm/msm/dpu: remove display H_TILE from encoder Jeykumar Sankaran
2018-08-31 16:10     ` Sean Paul
2018-08-29  0:40   ` [PATCH 14/14] drm/msm/dpu: remove cdm block support from resource manager Jeykumar Sankaran
     [not found]     ` <1535503203-22054-15-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-08-31 16:12       ` Sean Paul

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=3c3232c852b8f3a17955322c8ec3fbd8@codeaurora.org \
    --to=jsanka-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org \
    --cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).