From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs()
Date: Thu, 12 May 2016 16:47:17 +0300 [thread overview]
Message-ID: <2110406.8vuOB8d0uX@avalon> (raw)
In-Reply-To: <1463057606-1916-2-git-send-email-noralf@tronnes.org>
Hi Noralf,
Thank you for the patch.
On Thursday 12 May 2016 14:53:25 Noralf Trønnes wrote:
> Add drm_fb_cma_create_with_funcs() for drivers that need to set the
> dirty() callback.
>
> Cc: laurent.pinchart@ideasonboard.com
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
>
> Changes since v1:
> - Expand docs
>
> drivers/gpu/drm/drm_fb_cma_helper.c | 31 +++++++++++++++++++++++++------
> include/drm/drm_fb_cma_helper.h | 3 +++
> 2 files changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
> b/drivers/gpu/drm/drm_fb_cma_helper.c index 3165ac0..ede77c9 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -159,13 +159,17 @@ static struct drm_fb_cma *drm_fb_cma_alloc(struct
> drm_device *dev, }
>
> /**
> - * drm_fb_cma_create() - (struct drm_mode_config_funcs *)->fb_create
> callback function
> + * drm_fb_cma_create_with_funcs() - helper function for the
> + * &drm_mode_config_funcs ->fb_create
> + * callback function
> *
> - * If your hardware has special alignment or pitch requirements these
> should be
> - * checked before calling this function.
> + * This can be used to set &drm_framebuffer_funcs for drivers that need the
> + * dirty() callback. Use drm_fb_cma_create() if you don't need to change +
> * &drm_framebuffer_funcs.
> */
> -struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> - struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
> +struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device
> *dev,
> + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
> + struct drm_framebuffer_funcs *funcs)
Shouldn't the funcs argument be const ?
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> {
> struct drm_fb_cma *fb_cma;
> struct drm_gem_cma_object *objs[4];
> @@ -202,7 +206,7 @@ struct drm_framebuffer *drm_fb_cma_create(struct
> drm_device *dev, objs[i] = to_drm_gem_cma_obj(obj);
> }
>
> - fb_cma = drm_fb_cma_alloc(dev, mode_cmd, objs, i, &drm_fb_cma_funcs);
> + fb_cma = drm_fb_cma_alloc(dev, mode_cmd, objs, i, funcs);
> if (IS_ERR(fb_cma)) {
> ret = PTR_ERR(fb_cma);
> goto err_gem_object_unreference;
> @@ -215,6 +219,21 @@ err_gem_object_unreference:
> drm_gem_object_unreference_unlocked(&objs[i]->base);
> return ERR_PTR(ret);
> }
> +EXPORT_SYMBOL_GPL(drm_fb_cma_create_with_funcs);
> +
> +/**
> + * drm_fb_cma_create() - &drm_mode_config_funcs ->fb_create callback
> function
> + *
> + * If your hardware has special alignment or pitch requirements these
> should be
> + * checked before calling this function. Use drm_fb_cma_create_with_funcs()
> if
> + * you need to set &drm_framebuffer_funcs ->dirty.
> + */
> +struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
> +{
> + return drm_fb_cma_create_with_funcs(dev, file_priv, mode_cmd,
> + &drm_fb_cma_funcs);
> +}
> EXPORT_SYMBOL_GPL(drm_fb_cma_create);
>
> /**
> diff --git a/include/drm/drm_fb_cma_helper.h
> b/include/drm/drm_fb_cma_helper.h index c6d9c9c..1f9a8bc 100644
> --- a/include/drm/drm_fb_cma_helper.h
> +++ b/include/drm/drm_fb_cma_helper.h
> @@ -31,6 +31,9 @@ void drm_fb_cma_destroy(struct drm_framebuffer *fb);
> int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
> struct drm_file *file_priv, unsigned int *handle);
>
> +struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device
> *dev,
> + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
> + struct drm_framebuffer_funcs *funcs);
> struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs()
Date: Thu, 12 May 2016 16:47:17 +0300 [thread overview]
Message-ID: <2110406.8vuOB8d0uX@avalon> (raw)
In-Reply-To: <1463057606-1916-2-git-send-email-noralf@tronnes.org>
Hi Noralf,
Thank you for the patch.
On Thursday 12 May 2016 14:53:25 Noralf Trønnes wrote:
> Add drm_fb_cma_create_with_funcs() for drivers that need to set the
> dirty() callback.
>
> Cc: laurent.pinchart@ideasonboard.com
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
>
> Changes since v1:
> - Expand docs
>
> drivers/gpu/drm/drm_fb_cma_helper.c | 31 +++++++++++++++++++++++++------
> include/drm/drm_fb_cma_helper.h | 3 +++
> 2 files changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
> b/drivers/gpu/drm/drm_fb_cma_helper.c index 3165ac0..ede77c9 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -159,13 +159,17 @@ static struct drm_fb_cma *drm_fb_cma_alloc(struct
> drm_device *dev, }
>
> /**
> - * drm_fb_cma_create() - (struct drm_mode_config_funcs *)->fb_create
> callback function
> + * drm_fb_cma_create_with_funcs() - helper function for the
> + * &drm_mode_config_funcs ->fb_create
> + * callback function
> *
> - * If your hardware has special alignment or pitch requirements these
> should be
> - * checked before calling this function.
> + * This can be used to set &drm_framebuffer_funcs for drivers that need the
> + * dirty() callback. Use drm_fb_cma_create() if you don't need to change +
> * &drm_framebuffer_funcs.
> */
> -struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> - struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
> +struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device
> *dev,
> + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
> + struct drm_framebuffer_funcs *funcs)
Shouldn't the funcs argument be const ?
Apart from that,
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> {
> struct drm_fb_cma *fb_cma;
> struct drm_gem_cma_object *objs[4];
> @@ -202,7 +206,7 @@ struct drm_framebuffer *drm_fb_cma_create(struct
> drm_device *dev, objs[i] = to_drm_gem_cma_obj(obj);
> }
>
> - fb_cma = drm_fb_cma_alloc(dev, mode_cmd, objs, i, &drm_fb_cma_funcs);
> + fb_cma = drm_fb_cma_alloc(dev, mode_cmd, objs, i, funcs);
> if (IS_ERR(fb_cma)) {
> ret = PTR_ERR(fb_cma);
> goto err_gem_object_unreference;
> @@ -215,6 +219,21 @@ err_gem_object_unreference:
> drm_gem_object_unreference_unlocked(&objs[i]->base);
> return ERR_PTR(ret);
> }
> +EXPORT_SYMBOL_GPL(drm_fb_cma_create_with_funcs);
> +
> +/**
> + * drm_fb_cma_create() - &drm_mode_config_funcs ->fb_create callback
> function
> + *
> + * If your hardware has special alignment or pitch requirements these
> should be
> + * checked before calling this function. Use drm_fb_cma_create_with_funcs()
> if
> + * you need to set &drm_framebuffer_funcs ->dirty.
> + */
> +struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
> +{
> + return drm_fb_cma_create_with_funcs(dev, file_priv, mode_cmd,
> + &drm_fb_cma_funcs);
> +}
> EXPORT_SYMBOL_GPL(drm_fb_cma_create);
>
> /**
> diff --git a/include/drm/drm_fb_cma_helper.h
> b/include/drm/drm_fb_cma_helper.h index c6d9c9c..1f9a8bc 100644
> --- a/include/drm/drm_fb_cma_helper.h
> +++ b/include/drm/drm_fb_cma_helper.h
> @@ -31,6 +31,9 @@ void drm_fb_cma_destroy(struct drm_framebuffer *fb);
> int drm_fb_cma_create_handle(struct drm_framebuffer *fb,
> struct drm_file *file_priv, unsigned int *handle);
>
> +struct drm_framebuffer *drm_fb_cma_create_with_funcs(struct drm_device
> *dev,
> + struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd,
> + struct drm_framebuffer_funcs *funcs);
> struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
> struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2016-05-12 13:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 12:53 [PATCH v3 0/2] drm: Add various helpers for simple drivers Noralf Trønnes
2016-05-12 12:53 ` Noralf Trønnes
2016-05-12 12:53 ` [PATCH v3 1/2] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs() Noralf Trønnes
2016-05-12 12:53 ` Noralf Trønnes
2016-05-12 13:47 ` Laurent Pinchart [this message]
2016-05-12 13:47 ` Laurent Pinchart
2016-05-12 14:44 ` Noralf Trønnes
2016-05-12 14:44 ` Noralf Trønnes
2016-05-12 12:53 ` [PATCH v3 2/2] drm: Add helper for simple display pipeline Noralf Trønnes
2016-05-12 12:53 ` Noralf Trønnes
2016-05-12 15:32 ` Daniel Vetter
2016-05-12 15:32 ` Daniel Vetter
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=2110406.8vuOB8d0uX@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noralf@tronnes.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.