dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Marek Vasut <marex@denx.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: simple_kms_helper: Add prepare_fb and cleanup_fb hooks
Date: Thu, 29 Sep 2016 11:39:39 +0200	[thread overview]
Message-ID: <20160929093939.GH25432@dvetter-linux.ger.corp.intel.com> (raw)
In-Reply-To: <20160926130152.9043-1-marex@denx.de>

On Mon, Sep 26, 2016 at 03:01:52PM +0200, Marek Vasut wrote:
> Add .prepare_fb and .cleanup_fb plane hooks into the drm_simple_kms.
> These can be used by drivers to call ie. the drm_fb_cma_setup_fence()
> helper.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Noralf Trønnes <noralf@tronnes.org>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: David Airlie <airlied@linux.ie>
> ---
>  drivers/gpu/drm/drm_simple_kms_helper.c | 26 ++++++++++++++++++++++++++
>  include/drm/drm_simple_kms_helper.h     | 18 ++++++++++++++++++
>  2 files changed, 44 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
> index 7b6d26e..7bae08c 100644
> --- a/drivers/gpu/drm/drm_simple_kms_helper.c
> +++ b/drivers/gpu/drm/drm_simple_kms_helper.c
> @@ -125,7 +125,33 @@ static void drm_simple_kms_plane_atomic_update(struct drm_plane *plane,
>  	pipe->funcs->update(pipe, pstate);
>  }
>  
> +static int drm_simple_kms_plane_prepare_fb(struct drm_plane *plane,
> +					   struct drm_plane_state *state)
> +{
> +	struct drm_simple_display_pipe *pipe;
> +
> +	pipe = container_of(plane, struct drm_simple_display_pipe, plane);
> +	if (!pipe->funcs || !pipe->funcs->prepare_fb)
> +		return 0;
> +
> +	return pipe->funcs->prepare_fb(pipe, state);
> +}
> +
> +static void drm_simple_kms_plane_cleanup_fb(struct drm_plane *plane,
> +					    struct drm_plane_state *state)
> +{
> +	struct drm_simple_display_pipe *pipe;
> +
> +	pipe = container_of(plane, struct drm_simple_display_pipe, plane);
> +	if (!pipe->funcs || !pipe->funcs->cleanup_fb)
> +		return;
> +
> +	pipe->funcs->cleanup_fb(pipe, state);
> +}
> +
>  static const struct drm_plane_helper_funcs drm_simple_kms_plane_helper_funcs = {
> +	.prepare_fb = drm_simple_kms_plane_prepare_fb,
> +	.cleanup_fb = drm_simple_kms_plane_cleanup_fb,
>  	.atomic_check = drm_simple_kms_plane_atomic_check,
>  	.atomic_update = drm_simple_kms_plane_atomic_update,
>  };
> diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h
> index 5d112f7..1f55488 100644
> --- a/include/drm/drm_simple_kms_helper.h
> +++ b/include/drm/drm_simple_kms_helper.h
> @@ -69,6 +69,24 @@ struct drm_simple_display_pipe_funcs {
>  	 */
>  	void (*update)(struct drm_simple_display_pipe *pipe,
>  		       struct drm_plane_state *plane_state);
> +
> +	/**
> +	 * @prepare_fb:
> +	 *
> +	 * Optional, calls drm_plane_helper_funcs->prepare_fb , refer to

s/calls/called by/.

> +	 * the documentation in drm_modeset_helper_vtables.h .

Please insert a direct link to the right structure using "struct
&drm_plane_helper_funcs". Please run

$ make htmldocs

to make sure it's all pretty and the links work.

Code itself lgtm.
-Daniel

> +	 */
> +	int (*prepare_fb)(struct drm_simple_display_pipe *pipe,
> +			  struct drm_plane_state *plane_state);
> +
> +	/**
> +	 * @cleanup_fb:
> +	 *
> +	 * Optional, calls drm_plane_helper_funcs->cleanup_fb , refer to
> +	 * the documentation in drm_modeset_helper_vtables.h .
> +	 */
> +	void (*cleanup_fb)(struct drm_simple_display_pipe *pipe,
> +			   struct drm_plane_state *plane_state);
>  };
>  
>  /**
> -- 
> 2.9.3
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-09-29  9:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-26 13:01 [PATCH] drm: simple_kms_helper: Add prepare_fb and cleanup_fb hooks Marek Vasut
2016-09-29  9:39 ` Daniel Vetter [this message]
2016-09-29 21:21   ` Marek Vasut

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=20160929093939.GH25432@dvetter-linux.ger.corp.intel.com \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=marex@denx.de \
    /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).