mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: John Keeping <john@metanate.com>
Cc: Mark yao <mark.yao@rock-chips.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] drm/atomic-helper: Export framebuffer_changed()
Date: Thu, 14 Jan 2016 15:56:35 +0100	[thread overview]
Message-ID: <20160114145635.GF19130@phenom.ffwll.local> (raw)
In-Reply-To: <55e84a6ee82c0fbd796bb67a630781daa5bdcae0.1452782114.git.john@metanate.com>

On Thu, Jan 14, 2016 at 02:39:40PM +0000, John Keeping wrote:
> The Rockchip driver cannot use drm_atomic_helper_wait_for_vblanks()
> because it has hardware counters for neither vblanks nor scanlines.
> 
> In order to simplify re-implementing the functionality for this driver,
> export the framebuffer_changed() helper so it can be reused.
> 
> Signed-off-by: John Keeping <john@metanate.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> And since I don't
expect anyone else to need this anytime soon probably best you just pull
this in through rockchip trees.

Cheers, Daniel

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 24 ++++++++++++++++++++----
>  include/drm/drm_atomic_helper.h     |  4 ++++
>  2 files changed, 24 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 268d37f..7449293 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -948,9 +948,23 @@ static void wait_for_fences(struct drm_device *dev,
>  	}
>  }
>  
> -static bool framebuffer_changed(struct drm_device *dev,
> -				struct drm_atomic_state *old_state,
> -				struct drm_crtc *crtc)
> +/**
> + * drm_atomic_helper_framebuffer_changed - check if framebuffer has changed
> + * @dev: DRM device
> + * @old_state: atomic state object with old state structures
> + * @crtc: DRM crtc
> + *
> + * Checks whether the framebuffer used for this CRTC changes as a result of
> + * the atomic update.  This is useful for drivers which cannot use
> + * drm_atomic_helper_wait_for_vblanks() and need to reimplement its
> + * functionality.
> + *
> + * Returns:
> + * true if the framebuffer changed.
> + */
> +bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev,
> +					   struct drm_atomic_state *old_state,
> +					   struct drm_crtc *crtc)
>  {
>  	struct drm_plane *plane;
>  	struct drm_plane_state *old_plane_state;
> @@ -967,6 +981,7 @@ static bool framebuffer_changed(struct drm_device *dev,
>  
>  	return false;
>  }
> +EXPORT_SYMBOL(drm_atomic_helper_framebuffer_changed);
>  
>  /**
>   * drm_atomic_helper_wait_for_vblanks - wait for vblank on crtcs
> @@ -1001,7 +1016,8 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
>  		if (old_state->legacy_cursor_update)
>  			continue;
>  
> -		if (!framebuffer_changed(dev, old_state, crtc))
> +		if (!drm_atomic_helper_framebuffer_changed(dev,
> +				old_state, crtc))
>  			continue;
>  
>  		ret = drm_crtc_vblank_get(crtc);
> diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
> index a286cce..74fce78 100644
> --- a/include/drm/drm_atomic_helper.h
> +++ b/include/drm/drm_atomic_helper.h
> @@ -42,6 +42,10 @@ int drm_atomic_helper_commit(struct drm_device *dev,
>  			     struct drm_atomic_state *state,
>  			     bool async);
>  
> +bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev,
> +					   struct drm_atomic_state *old_state,
> +					   struct drm_crtc *crtc);
> +
>  void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
>  					struct drm_atomic_state *old_state);
>  
> -- 
> 2.7.0.226.gfe986fe
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2016-01-14 14:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 12:53 [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping
2016-01-13 14:23 ` Daniel Vetter
2016-01-13 14:34   ` John Keeping
2016-01-13 15:40     ` Daniel Vetter
2016-01-13 15:55       ` John Keeping
2016-01-13 16:21         ` Daniel Vetter
2016-01-13 16:40           ` John Keeping
2016-01-13 17:19             ` Daniel Vetter
2016-01-13 17:39               ` John Keeping
2016-01-14  1:16                 ` Mark yao
2016-01-14  8:32                   ` Daniel Vetter
2016-01-14  8:46                     ` Mark yao
2016-01-14 14:20                       ` Daniel Vetter
2016-01-14 14:39                         ` [PATCH 0/3] drm/rockchip: fix cursor performance with atomic John Keeping
2016-01-19 10:46                           ` [PATCH v2 " John Keeping
2016-01-21  0:51                             ` Mark yao
2016-01-19 10:46                           ` [PATCH v2 1/3] drm/atomic-helper: Export framebuffer_changed() John Keeping
2016-01-19 11:03                             ` Daniel Vetter
2016-01-19 10:46                           ` [PATCH v2 2/3] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping
2016-01-19 10:47                           ` [PATCH v2 3/3] drm/rockchip: explain why we can't wait_for_vblanks John Keeping
2016-01-14 14:39                         ` [PATCH 1/3] drm/atomic-helper: Export framebuffer_changed() John Keeping
2016-01-14 14:56                           ` Daniel Vetter [this message]
2016-01-14 14:39                         ` [PATCH 2/3] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping
2016-01-14 14:39                         ` [PATCH 3/3] drm/rockchip: explain why we can't wait_for_vblanks John Keeping
2016-01-14 14:57                           ` Thierry Reding
2016-01-14 16:26                             ` John Keeping
2016-01-18  1:40                               ` Mark yao
2016-01-17 15:21 ` [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed Heiko Stuebner

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=20160114145635.GF19130@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john@metanate.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.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

Powered by JetHome