public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: "Heiko Stübner" <heiko@sntech.de>, dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Rob Clark <robdclark@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Daniel Kurtz <djkurtz@chromium.org>,
	linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: Re: [PATCH] drm/rockchip: vop: power off until vop standby take effect
Date: Mon, 02 Feb 2015 08:45:04 +0800	[thread overview]
Message-ID: <54CEC890.8040701@rock-chips.com> (raw)
In-Reply-To: <26349423.KqVQYq280G@diego>

On 2015年01月31日 20:49, Heiko Stübner wrote:
> Hi Mark,
>
> Am Samstag, 31. Januar 2015, 16:41:38 schrieb Mark Yao:
>> Vop standby will take effect end of current frame,
>> if dsp_hold_valid_irq happen, it means vop standby complete.
>>
>> we must wait standby complete when we want to disable aclk,
>> if not, memory bus maybe dead.
>>
>> Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
>> ---
>>   drivers/gpu/drm/rockchip/rockchip_drm_vop.c |   76
>> ++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 13
>> deletions(-)
>>
>> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index fb25836..47ea61f 100644
>> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
>> @@ -89,6 +89,7 @@ struct vop {
>>   	/* mutex vsync_ work */
>>   	struct mutex vsync_mutex;
>>   	bool vsync_work_pending;
>> +	struct completion dsp_hold_completion;
>>
>>   	const struct vop_data *data;
>>
>> @@ -382,6 +383,34 @@ static bool is_alpha_support(uint32_t format)
>>   	}
>>   }
>>
>> +static void vop_dsp_hold_valid_irq_enable(struct vop *vop)
>> +{
>> +	unsigned long flags;
>> +
>> +	BUG_ON(!vop->is_enabled);
> BUG_ON is generally not well liked in general error handling - i.e. in the
> 	 !vop->is_enabled
> bad things may happen, but this may not always be the case. And BUG_ON
> effectively kills the machine.
>
> You could simply use a WARN_ON, so people see that something really strange is
> going on but can still try to recover things.
Right, got it.
>
>> +
>> +	spin_lock_irqsave(&vop->irq_lock, flags);
>> +
>> +	vop_mask_write(vop, INTR_CTRL0, DSP_HOLD_VALID_INTR_MASK,
>> +		       DSP_HOLD_VALID_INTR_EN(1));
>> +
>> +	spin_unlock_irqrestore(&vop->irq_lock, flags);
>> +}
>> +
>> +static void vop_dsp_hold_valid_irq_disable(struct vop *vop)
>> +{
>> +	unsigned long flags;
>> +
>> +	BUG_ON(!vop->is_enabled);
> same here
>
>> +
>> +	spin_lock_irqsave(&vop->irq_lock, flags);
>> +
>> +	vop_mask_write(vop, INTR_CTRL0, DSP_HOLD_VALID_INTR_MASK,
>> +		       DSP_HOLD_VALID_INTR_EN(0));
>> +
>> +	spin_unlock_irqrestore(&vop->irq_lock, flags);
>> +}
>> +
>>   static void vop_enable(struct drm_crtc *crtc)
>>   {
>>   	struct vop *vop = to_vop(crtc);
>
> except the above
> Reviewed-by: Heiko Stuebner <heiko@sntech.de>
>
> [but take it with a grain of salt, as I'm still new to drm-land :-) ]
Good, I saw your drm patches, I'm interested in those, very good.

Mark
>
> Heiko
>
>
>



  reply	other threads:[~2015-02-02  0:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31  8:41 [PATCH] drm/rockchip: vop: power off until vop standby take effect Mark Yao
2015-01-31 12:49 ` Heiko Stübner
2015-02-02  0:45   ` Mark yao [this message]
2015-02-02  2:07 ` Daniel Kurtz
2015-02-02  2:30   ` Mark yao
2015-02-02  7:53     ` Daniel Vetter
2015-02-04  3:38       ` Mark yao
2015-02-04  3:48         ` Daniel Kurtz
2015-02-04  3:56           ` Mark yao

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=54CEC890.8040701@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robdclark@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox