linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: dri-devel@lists.freedesktop.org
Cc: Mark Yao <mark.yao@rock-chips.com>,
	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: Sat, 31 Jan 2015 13:49:28 +0100	[thread overview]
Message-ID: <26349423.KqVQYq280G@diego> (raw)
In-Reply-To: <1422693698-21944-1-git-send-email-mark.yao@rock-chips.com>

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.


> +
> +	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 :-) ]


Heiko

  reply	other threads:[~2015-01-31 12:44 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 [this message]
2015-02-02  0:45   ` Mark yao
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=26349423.KqVQYq280G@diego \
    --to=heiko@sntech.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=djkurtz@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --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;
as well as URLs for NNTP newsgroup(s).