From: "Noralf Trønnes" <noralf@tronnes.org>
To: dri-devel@lists.freedesktop.org
Cc: daniel@ffwll.ch, treding@nvidia.com,
linux-kernel@vger.kernel.org,
"Noralf Trønnes" <noralf@tronnes.org>,
laurent.pinchart@ideasonboard.com
Subject: [PATCH 1/4] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs()
Date: Thu, 5 May 2016 15:24:31 +0200 [thread overview]
Message-ID: <1462454674-2246-2-git-send-email-noralf@tronnes.org> (raw)
In-Reply-To: <1462454674-2246-1-git-send-email-noralf@tronnes.org>
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>
---
drivers/gpu/drm/drm_fb_cma_helper.c | 29 +++++++++++++++++++++++------
include/drm/drm_fb_cma_helper.h | 3 +++
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c
index 086f600..7165209 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -161,13 +161,16 @@ 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.
*/
-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)
{
struct drm_fb_cma *fb_cma;
struct drm_gem_cma_object *objs[4];
@@ -204,7 +207,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;
@@ -217,6 +220,20 @@ 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.
+ */
+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);
--
2.2.2
next prev parent reply other threads:[~2016-05-05 13:24 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-05 13:24 [PATCH 0/4] drm: Add various helpers for simple drivers Noralf Trønnes
2016-05-05 13:24 ` Noralf Trønnes [this message]
2016-05-05 16:27 ` [PATCH 1/4] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs() Daniel Vetter
2016-05-06 13:01 ` Noralf Trønnes
2016-05-06 13:13 ` Daniel Vetter
2016-05-05 13:24 ` [PATCH 2/4] drm: Make drm_encoder_helper_funcs optional Noralf Trønnes
2016-05-05 16:23 ` Daniel Vetter
2016-05-09 19:19 ` Noralf Trønnes
2016-05-10 6:53 ` Daniel Vetter
2016-05-05 13:24 ` [PATCH 3/4] drm: Add helper for simple display pipeline Noralf Trønnes
2016-05-05 16:45 ` Daniel Vetter
2016-05-09 14:46 ` Daniel Vetter
2016-05-09 18:37 ` Noralf Trønnes
2016-05-10 6:59 ` Daniel Vetter
2016-05-10 22:36 ` Daniel Vetter
2016-05-05 13:24 ` [PATCH 4/4] drm/panel: Add helper for simple panel connector Noralf Trønnes
2016-05-05 17:03 ` Daniel Vetter
2016-05-06 13:39 ` Noralf Trønnes
2016-05-06 14:01 ` Thierry Reding
2016-05-06 14:07 ` Daniel Vetter
2016-05-06 14:03 ` Thierry Reding
2016-05-06 14:08 ` Daniel Vetter
2016-05-06 14:15 ` Thierry Reding
2016-05-06 14:34 ` Noralf Trønnes
2016-05-06 14:41 ` Daniel Vetter
2016-05-06 14:43 ` Thierry Reding
2016-05-06 19:45 ` Noralf Trønnes
2016-05-07 9:59 ` Daniel Vetter
2016-05-07 12:46 ` Noralf Trønnes
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=1462454674-2246-2-git-send-email-noralf@tronnes.org \
--to=noralf@tronnes.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=treding@nvidia.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).