drm: Add GEM backed framebuffer library
Subsystems (22)
v3 cover drm: Add GEM backed framebuffer library
This adds helpers for drivers that don't subclass drm_framebuffer and are backed by drm_gem_object(s). drm_fb_cma_helper is converted to use the helpers.
This patchset is part of a process to add a shmem gem library like the cma library. The common parts between the two goes into core or helpers.
Noralf.
Changes since version 2:
- Expanded docs (Daniel)
- Add drm_gem_fbdev_fb_create() instead of exporting drm_gem_fb_alloc(). This function is used by drivers/helpers to create a drm_framebuffer for use with fbdev emulation.
- drm_gem_object_put_unlocked() is NULL tolerant (Joe Kniss)
- Rebase tinydrm patch on new st7586 driver
- Rebase arc and pl111 patches on 'drm: make drm_mode_config_func const'
Changes since version 1:
- Pushed the new functions out to the cma drivers, so I could clean up the cma library.
Noralf Trønnes (22):
drm: Add GEM backed framebuffer library drm/fb-cma-helper: Use drm_gem_framebuffer_helper drm/tinydrm: Use drm_gem_framebuffer_helper
drm/arc: Use drm_gem_fb_create()
drm/arm/hdlcd: Use drm_gem_fb_create()
drm/arm/mali: Use drm_gem_fb_create() drm/atmel-hlcdc: Use drm_gem_fb_create() drm/fsl-dcu: Use drm_gem_fb_create() drm/hisilicon/kirin: Use drm_gem_fb_create() drm/imx: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() drm/meson: Use drm_gem_fb_create()
drm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb() drm/rcar-du: Use drm_gem_fb_create()
drm/shmobile: Use drm_gem_fb_create()
drm/sti: Use drm_gem_fb_create()
drm/stm: Use drm_gem_fb_create()
drm/sun4i: Use drm_gem_fb_create()
drm/tilcdc: Use drm_gem_fb_create()
drm/vc4: Use drm_gem_fb_create()
drm/zte: Use drm_gem_fb_create()
drm/fb-cma-helper: Remove unused functions
Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/arc/arcpgu_drv.c | 3 +- drivers/gpu/drm/arm/hdlcd_drv.c | 3 +- drivers/gpu/drm/arm/malidp_drv.c | 3 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 1 + drivers/gpu/drm/drm_fb_cma_helper.c | 248 +++------------------ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 ++++++++++++++++++++++++ drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 3 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +- drivers/gpu/drm/imx/imx-drm-core.c | 3 +- drivers/gpu/drm/imx/ipuv3-plane.c | 3 +- drivers/gpu/drm/meson/meson_drv.c | 3 +- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 5 +- drivers/gpu/drm/pl111/pl111_display.c | 3 +- drivers/gpu/drm/pl111/pl111_drv.c | 3 +- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 3 +- drivers/gpu/drm/shmobile/shmob_drm_kms.c | 3 +- drivers/gpu/drm/sti/sti_drv.c | 3 +- drivers/gpu/drm/stm/drv.c | 3 +- drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 3 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 3 +- drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 5 +- drivers/gpu/drm/tinydrm/mipi-dbi.c | 5 +- drivers/gpu/drm/tinydrm/repaper.c | 5 +- drivers/gpu/drm/tinydrm/st7586.c | 5 +- drivers/gpu/drm/vc4/vc4_kms.c | 3 +- drivers/gpu/drm/zte/zx_drm_drv.c | 3 +- include/drm/drm_fb_cma_helper.h | 13 -- include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 ++++ 33 files changed, 420 insertions(+), 264 deletions(-) create mode 100644 drivers/gpu/drm/drm_gem_framebuffer_helper.c create mode 100644 include/drm/drm_gem_framebuffer_helper.h
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 1/22 drm: Add GEM backed framebuffer library
This library provides helpers for drivers that don't subclass drm_framebuffer and are backed by drm_gem_object. The code is taken from drm_fb_cma_helper.
--- Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 +++++++++++++++++++++++++++ include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 ++++ 5 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/drm_gem_framebuffer_helper.c create mode 100644 include/drm/drm_gem_framebuffer_helper.h
Documentation/gpu/drm-kms-helpers.rst +9 -0
@@ -296,3 +296,12 @@ Auxiliary Modeset Helpers .. kernel-doc:: drivers/gpu/drm/drm_modeset_helper.c :export: + +Framebuffer GEM Helper Reference +================================ + +.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c + :doc: overview + +.. kernel-doc:: drivers/gpu/drm/drm_gem_framebuffer_helper.c + :export:
drivers/gpu/drm/Makefile +1 -1
@@ -33,7 +33,7 @@ drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \ drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o \ drm_kms_helper_common.o drm_dp_dual_mode_helper.o \ drm_simple_kms_helper.o drm_modeset_helper.o \ - drm_scdc_helper.o + drm_scdc_helper.o drm_gem_framebuffer_helper.o drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o drm_kms_helper-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +283 -0
283 lines not on this page · raw message
include/drm/drm_framebuffer.h +7 -0
@@ -190,6 +190,13 @@ struct drm_framebuffer {* @filp_head: Placed on &drm_file.fbs, protected by &drm_file.fbs_lock. */ struct list_head filp_head; +/** +* @obj: GEM objects backing the framebuffer, one per plane (optional). +* +* This is used by the GEM framebuffer helpers, see e.g. +* drm_gem_fb_create(). +*/ +struct drm_gem_object *obj[4 ]; };#define obj_to_fb (x) container_of(x, struct drm_framebuffer, base)
include/drm/drm_gem_framebuffer_helper.h new file +37 -0
@@ -0,0 +1,37 @@ +#ifndef __DRM_GEM_FB_HELPER_H__ +#define __DRM_GEM_FB_HELPER_H__ + +struct drm_device ; +struct drm_file ; +struct drm_fb_helper_surface_size ; +struct drm_framebuffer ; +struct drm_framebuffer_funcs ; +struct drm_gem_object ; +struct drm_mode_fb_cmd2 ; +struct drm_plane ; +struct drm_plane_state ; + +struct drm_gem_object *drm_gem_fb_get_obj (struct drm_framebuffer *fb, +unsigned int plane); +void drm_gem_fb_destroy (struct drm_framebuffer *fb); +int drm_gem_fb_create_handle (struct drm_framebuffer *fb,struct drm_file *file, +unsigned int *handle); + +struct drm_framebuffer * +drm_gem_fb_create_with_funcs (struct drm_device *dev,struct drm_file *file, +const struct drm_mode_fb_cmd2 *mode_cmd, +const struct drm_framebuffer_funcs *funcs); +struct drm_framebuffer * +drm_gem_fb_create (struct drm_device *dev,struct drm_file *file, +const struct drm_mode_fb_cmd2 *mode_cmd); + +int drm_gem_fb_prepare_fb (struct drm_plane *plane, +struct drm_plane_state *state); + +struct drm_framebuffer * +drm_gem_fbdev_fb_create (struct drm_device *dev, +struct drm_fb_helper_surface_size *sizes, +unsigned int pitch_align,struct drm_gem_object *obj, +const struct drm_framebuffer_funcs *funcs); + +#endif
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 6 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>
Quoted 7 lines
---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structure
grammar nit: "its"
Other than that,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedDen 16.08.2017 19.24, skrev Eric Anholt:
Quoted 14 lines
Quoted 4 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Quoted 8 lines
Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structure
Quoted 5 lines
grammar nit: "its"
Other than that,
Reviewed-by Eric Anholt <[email protected]>
Thanks, applied to drm-misc.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Noralf,
Quoted 15 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 14 lines
Quoted 13 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structure
Quoted 7 lines
Quoted 5 lines
grammar nit: "its"
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 18 lines
Hi Noralf,
Quoted 15 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 14 lines
Quoted 13 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structure
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
grammar nit: "its"
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
Sorry about the let down.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 45 lines · Noralf Trønnes
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 25 lines
Hi Noralf,
Quoted 21 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 19 lines
Quoted 7 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>Quoted 7 lines
---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structuregrammar nit: "its"
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
Quoted 4 lines
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
Sorry about the let down.
I think a follow up patch to address the review would be good.
On the "how long to wait for review" question we just discussed this a bit on irc, and I kinda would have merged it probably too. Perhaps pinged Laurent on irc since he's written/reviewed a bunch of cma patches. Aside: Being on irc would be good, makes it quicker to discuss stuff like this if you're around.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel,
Quoted 41 lines · On Wednesday 16 Aug 2017 23:06:30 Daniel Vetter wrote:
Quoted 40 lines · Noralf Trønnes
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 19 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Quoted 18 lines
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 17 lines
Quoted 6 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>Quoted 7 lines
---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structuregrammar nit: "its"
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
Quoted 6 lines
Quoted 1 line
Sorry about the let down.
I think a follow up patch to address the review would be good.
On the "how long to wait for review" question we just discussed this a bit on irc, and I kinda would have merged it probably too.
I think we've had a similar discussion before (but possibly in private, I'm not sure), and I believe that one week is a reasonable delay. That being said I understand what happened here, and I too get impatient to merge patches when I believe they're almost ready and just need one final ack.
Quoted 3 lines
Perhaps pinged Laurent on irc since he's written/reviewed a bunch of cma patches. Aside: Being on irc would be good, makes it quicker to discuss stuff like this if you're around.
Please, let's not expect developers to be available to discuss patches on IRC in the middle of the night ;-)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Laurent Pinchart
Quoted 3 lines · On Wednesday 16 Aug 2017 23:06:30 Daniel Vetter wrote:
Perhaps pinged Laurent on irc since he's written/reviewed a bunch of cma patches. Aside: Being on irc would be good, makes it quicker to discuss stuff like this if you're around.
Please, let's not expect developers to be available to discuss patches on IRC in the middle of the night ;-)
I never expect that, which is why there's an "if you're around" in my statement. But people are in all kinds of strange TZ, work this as a hobby or just have a unusual sleeping patter, so I stopped making any kind of assumptions about when someone's around and when not. And since Noralf just replied, he might have been around (or maybe not, which isn't a problem either).
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Den 16.08.2017 23.13, skrev Daniel Vetter:
Quoted 6 lines
Quoted 4 lines · Laurent Pinchart
Quoted 3 lines · On Wednesday 16 Aug 2017 23:06:30 Daniel Vetter wrote:
Perhaps pinged Laurent on irc since he's written/reviewed a bunch of cma patches. Aside: Being on irc would be good, makes it quicker to discuss stuff like this if you're around.
Quoted 8 lines
Quoted 2 lines
Please, let's not expect developers to be available to discuss patches on IRC in the middle of the night ;-)
I never expect that, which is why there's an "if you're around" in my statement. But people are in all kinds of strange TZ, work this as a hobby or just have a unusual sleeping patter, so I stopped making any kind of assumptions about when someone's around and when not. And since Noralf just replied, he might have been around (or maybe not, which isn't a problem either).
My way of working doesn't fit very well to participating on irc. I work on drm for an hour and then need to take a break for one or two hours due to an illness I have. So the offline nature of email is best suited for me.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Noralf,
Quoted 17 lines · On Wednesday 16 Aug 2017 23:31:23 Noralf Trønnes wrote:
Den 16.08.2017 23.13, skrev Daniel Vetter:
Quoted 9 lines · Laurent Pinchart
Quoted 7 lines · On Wednesday 16 Aug 2017 23:06:30 Daniel Vetter wrote:
Quoted 3 lines
Perhaps pinged Laurent on irc since he's written/reviewed a bunch of cma patches. Aside: Being on irc would be good, makes it quicker to discuss stuff like this if you're around.
Please, let's not expect developers to be available to discuss patches on IRC in the middle of the night ;-)
Quoted 6 lines
I never expect that, which is why there's an "if you're around" in my statement. But people are in all kinds of strange TZ, work this as a hobby or just have a unusual sleeping patter, so I stopped making any kind of assumptions about when someone's around and when not. And since Noralf just replied, he might have been around (or maybe not, which isn't a problem either).
Quoted 3 lines
My way of working doesn't fit very well to participating on irc. I work on drm for an hour and then need to take a break for one or two hours due to an illness I have. So the offline nature of email is best suited for me.
Everybody can decide how best to handle communication, but please know that you're not expected to reply on the spot on IRC. I often take several hours away from IRC during my work time to concentrate on other tasks.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Noralf,
Quoted 31 lines · On Wednesday 16 Aug 2017 23:03:36 Noralf Trønnes wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 19 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Quoted 18 lines
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 17 lines
Quoted 6 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>Quoted 7 lines
---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structuregrammar nit: "its"
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
Quoted 8 lines
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
There are always exceptions, or at least borderline cases, but I think that one week is a reasonable delay in the general case. If you're at v8 and your series has been acked by 10 people already it can be a different story. Or if you're fixing a security issue that has to get in a late -rc before the final kernel is released. Or lots of other cases probably.
Quoted 1 line
Sorry about the let down.
It's OK, I know it wasn't on purpose :-) Your reply is definitely appreciated.
Could you post a follow-up patch to fix the few issues I mentioned (at least the ones you agree with of course) ?
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Den 16.08.2017 23.08, skrev Laurent Pinchart:
Quoted 44 lines
Hi Noralf,
Quoted 27 lines · On Wednesday 16 Aug 2017 23:03:36 Noralf Trønnes wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 16 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Quoted 15 lines
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 14 lines
Quoted 13 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structureQuoted 8 lines
Quoted 6 lines
Quoted 5 lines
grammar nit: "its"
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
Quoted 8 lines
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
There are always exceptions, or at least borderline cases, but I think that one week is a reasonable delay in the general case. If you're at v8 and your series has been acked by 10 people already it can be a different story. Or if you're fixing a security issue that has to get in a late -rc before the final kernel is released. Or lots of other cases probably.
Quoted 6 lines
Quoted 1 line
Sorry about the let down.
It's OK, I know it wasn't on purpose :-) Your reply is definitely appreciated.
Could you post a follow-up patch to fix the few issues I mentioned (at least the ones you agree with of course) ?
Yes, I'll do that.
I suck at writing documentation, so when I need documentation for say an argument, I copy it from another function with the same argument. Not always pretty obviously, so I rely on help from reviewers to ensure proper english. Daniel has helped me many times to flesh out the docs.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Noralf,
Quoted 56 lines · On Wednesday 16 Aug 2017 23:24:50 Noralf Trønnes wrote:
Den 16.08.2017 23.08, skrev Laurent Pinchart:
Quoted 47 lines · On Wednesday 16 Aug 2017 23:03:36 Noralf Trønnes wrote:
Quoted 31 lines
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 19 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Quoted 18 lines
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 17 lines
Quoted 6 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>Quoted 7 lines
---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structuregrammar nit: "its"
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
Quoted 8 lines
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
There are always exceptions, or at least borderline cases, but I think that one week is a reasonable delay in the general case. If you're at v8 and your series has been acked by 10 people already it can be a different story. Or if you're fixing a security issue that has to get in a late -rc before the final kernel is released. Or lots of other cases probably.
Quoted 7 lines
Quoted 1 line
Sorry about the let down.
It's OK, I know it wasn't on purpose :-) Your reply is definitely appreciated.
Could you post a follow-up patch to fix the few issues I mentioned (at least the ones you agree with of course) ?
Quoted 6 lines
Yes, I'll do that.
I suck at writing documentation, so when I need documentation for say an argument, I copy it from another function with the same argument. Not always pretty obviously, so I rely on help from reviewers to ensure proper english. Daniel has helped me many times to flesh out the docs.
I know the feeling, it takes me at least 10 times longer to write documentation than to write code :-/ I try to comfort myself by thinking that I'm quick at writing code, not slow at writing documentation, but that doesn't always work :-)
I have found, however, than when you start writing a large block of documentation, after some time it speeds up. When your brain switches to documentation mode words come out faster. You could try filling up kerneldoc comments in one go at the end of the development (or, even better, at the start) and see how that works out for you.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 36 lines · Noralf Trønnes
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Quoted 18 lines
Hi Noralf,
Quoted 15 lines · On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Quoted 14 lines
Quoted 13 lines · Noralf Trønnes
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
+/**
+ *drm_gem_fb_destroy- Free GEM backed framebuffer
+ * @fb: DRM framebuffer
+ *
+ * Frees a GEM backed framebuffer with it's backing buffer(s) and the structureQuoted 8 lines
Quoted 6 lines
Quoted 5 lines
grammar nit: "its"
Other than that,
Reviewed-by Eric Anholt <[email protected]>Thanks, applied to drm-misc.
The patches were posted on Sunday. If you don't give at least a week to reviewers, I don't think they will keep bothering. I certainly won't.
Hi Laurent,
I actually didn't think there was much interest in this patchset since the first version of the patcheset was sent 31/7. Daniel gave me his rb if I fixed the docs a week ago. Instead of applying it directly I sent a new version to give Eric a chance to look at it since he showed interest in an rfc. So when I got his rb, I just applied.
Quoted 4 lines
All that being said, I do appreciate reviews since that improves the work. I will adapt to waiting a week if that's what's expected.
Sorry about the let down.
For what it's worth, I think the speed of merging was entirely appropriate in this case. It had been a week since the previous version, that got no replies except for danvet's. You're effectively just moving code and renaming some functions, and danvet and I had both replied positively.
As far as concerns about whether everyone gets to give their feedback go, my stance is: The great thing about git is that you can make changes to code even after a patch goes in.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Ni Noralf,
Thank you for the patch.
Quoted 15 lines · On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>--- Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 ++++++++++++++++++++++++ include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 ++++ 5 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/drm_gem_framebuffer_helper.c create mode 100644 include/drm/drm_gem_framebuffer_helper.h
[snip]
Quoted 6 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/drm_gem_framebuffer_helper.cnew file mode 100644 index 0000000..068a630drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +0
-0@@ -0,0 +1,283 @@
[snip]
Quoted 5 lines
+/**
+ * DOC: overview
+ *
+ * This library provides helpers for drivers that don't subclass
+ *&drm_framebufferand and use&drm_gem_objectfor their backing storage.
s/and and/and/
Quoted 4 lines
+ *
+ * Drivers without additional needs to validate framebuffers can simply use
+ *drm_gem_fb_create()and everything is wired up automatically. But all
+ * parts can be used individually.
A sentence should not start by "but". How about "Other drivers can use all parts independently." ?
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 42
Quoted 8 lines
+ */
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +7
-0+ +/** +* drm_gem_fb_get_obj() - Get GEM object for framebuffer +* @fb: The framebuffer +* @plane: Which plane +* +* Returns the GEM object for given framebuffer.
You might want to mention that no reference is taken on the GEM object.
Quoted 9 lines
+ */
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +8
-0+struct drm_gem_object *drm_gem_fb_get_obj (struct drm_framebuffer *fb, +unsigned int plane) +{ +if (plane >=4 ) +return NULL ; + +return fb->obj[plane]; +}
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 61
Quoted 10 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +10
-0+EXPORT_SYMBOL_GPL (drm_gem_fb_get_obj); + +static struct drm_framebuffer * +drm_gem_fb_alloc (struct drm_device *dev, +const struct drm_mode_fb_cmd2 *mode_cmd, +struct drm_gem_object **obj,unsigned int num_planes, +const struct drm_framebuffer_funcs *funcs) +{ +struct drm_framebuffer *fb; +int ret, i;
i is never negative, you can make it an unsigned int.
Quoted 16 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +16
-0+ + fb =kzalloc (sizeof (*fb),GFP_KERNEL ); +if (!fb) +return ERR_PTR (-ENOMEM ); + +drm_helper_mode_fill_fb_struct (dev, fb, mode_cmd); + +for (i =0 ; i < num_planes; i++) + fb->obj[i] = obj[i]; + + ret =drm_framebuffer_init (dev, fb, funcs); +if (ret) { +DRM_DEV_ERROR (dev->dev,"Failed to init framebuffer: %d\n" , + ret); +kfree (fb); +return ERR_PTR (ret);
drivers/gpu/drm/drm_gem_framebuffer_helper.c
Quoted 10 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +10
-0+ } + +return fb; +} + +/** +* drm_gem_fb_destroy - Free GEM backed framebuffer +* @fb: DRM framebuffer +* +* Frees a GEM backed framebuffer with it's backing buffer(s) and the
s/it's/its/
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 93
Quoted 7 lines
structure
+ * itself. Drivers can use this as their&drm_framebuffer_funcs->destroy
+ * callback.
+ */drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +3
-0+void drm_gem_fb_destroy (struct drm_framebuffer *fb) +{ +int i;
i is never negative, you can make it an unsigned int.
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 106
Quoted 13 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +13
-0+ +for (i =0 ; i <4 ; i++) +drm_gem_object_put_unlocked (fb->obj[i]); + +drm_framebuffer_cleanup (fb); +kfree (fb); +} +EXPORT_SYMBOL (drm_gem_fb_destroy); + +/** +* drm_gem_fb_create_handle - Create handle for GEM backed framebuffer +* @fb: DRM framebuffer +* @file: drm file
Why does the fb have a DRM and the file a drm ? :-) I would pick one and stick to it for the whole file.
Quoted 13 lines
+ * @handle: handle created
+ *
+ * Drivers can use this as their&drm_framebuffer_funcs->create_handle
+ * callback.
+ *
+ * Returns:
+ * 0 on success or a negative error code on failure.
+ */
+int drm_gem_fb_create_handle(structdrm_framebuffer*fb, structdrm_file*file,drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +3
-0+ unsigned int *handle) +{ +return drm_gem_handle_create (file, fb->obj[0 ], handle);
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 128
Quoted 10 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +10
-0+} +EXPORT_SYMBOL (drm_gem_fb_create_handle); + +/** +* drm_gem_fb_create_with_funcs() - helper function for the +* &drm_mode_config_funcs.fb_create +* callback +* @dev: DRM device +* @file: drm file for the ioctl call +* @mode_cmd: metadata from the userspace fb creation request
This looks like data to me, not metadata (data about the data). Same for the next function.
Quoted 8 lines
+ * @funcs: vtable to be used for the new framebuffer object
+ *
+ * This can be used to set&drm_framebuffer_funcsfor drivers that need the
+ * &drm_framebuffer_funcs.dirty callback. Usedrm_gem_fb_create()if you don't
+ * need to change&drm_framebuffer_funcs.
+ * The function does buffer size validation.
+ */
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 144
Quoted 9 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +9
-0+struct drm_framebuffer * +drm_gem_fb_create_with_funcs (struct drm_device *dev,struct drm_file *file, +const struct drm_mode_fb_cmd2 *mode_cmd, +const struct drm_framebuffer_funcs *funcs) +{ +const struct drm_format_info *info; +struct drm_gem_object *objs[4 ]; +struct drm_framebuffer *fb; +int ret, i;
i is never negative (except in the error path, but see below), you can make it an unsigned int.
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 157
Quoted 12 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +12
-0+ info =drm_get_format_info (dev, mode_cmd); +if (!info) +return ERR_PTR (-EINVAL ); + +for (i =0 ; i < info->num_planes; i++) { +unsigned int width = mode_cmd->width / (i ? info->hsub :1 ); +unsigned int height = mode_cmd->height / (i ? info->vsub :1 ); +unsigned int min_size; + + objs[i] =drm_gem_object_lookup (file, mode_cmd->handles[i]); +if (!objs[i]) { +DRM_DEV_ERROR (dev->dev,"Failed to lookup GEM\n" );
s/GEM/GEM object/ ?
As this is a condition that can easily be triggered by userspace I would make it a debug message, not an error message.
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 164
Quoted 7 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +7
-0+ ret = -ENOENT ; + goto err_gem_object_put; + } + + min_size = (height -1 ) * mode_cmd->pitches[i] + + width * info->cpp[i] + + mode_cmd->offsets[i];
That might be a bit of an overoptimization, I think I would have required the last line to match the pitch of the rest of the image, but it's too late to change that as the CMA FB helpers have the same check in place.
Quoted 8 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +8
-0+if (objs[i]->size < min_size) { +drm_gem_object_put_unlocked (objs[i]); + ret = -EINVAL ; + goto err_gem_object_put; + } + } + + fb =drm_gem_fb_alloc (dev, mode_cmd, objs, i, funcs);
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 183
Quoted 10 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +10
-0+if (IS_ERR (fb)) { + ret =PTR_ERR (fb); + goto err_gem_object_put; + } + +return fb; + +err_gem_object_put: +for (i--; i >=0 ; i--) +drm_gem_object_put_unlocked (objs[i]);
You can write this as
for (; i > 0; i--) drm_gem_object_put_unlocked(objs[i-1]);
to restrict i to positive values. Up to you.
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 192
Quoted 9 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +9
-0+ +return ERR_PTR (ret); +} +EXPORT_SYMBOL_GPL (drm_gem_fb_create_with_funcs); + +static const struct drm_framebuffer_funcs drm_gem_fb_funcs = { + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, +};
Nitpicking, I find it easier to navigate code when the ops structure is located right after the ops functions. You could just move this one one function up. Up to you.
Quoted 15 lines
+/**
+ *drm_gem_fb_create()- &drm_mode_config_funcs.fb_create callback function
+ * @dev: DRM device
+ * @file: drm file for the ioctl call
+ * @mode_cmd: metadata from the userspace fb creation request
+ *
+ * If your hardware has special alignment or pitch requirements these should be
+ * checked before calling this function. The function does buffer size
+ * validation. Usedrm_gem_fb_create_with_funcs()if you need to set
+ * &drm_framebuffer_funcs.dirty.
+ */drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +3
-0+struct drm_framebuffer * +drm_gem_fb_create (struct drm_device *dev,struct drm_file *file, +const struct drm_mode_fb_cmd2 *mode_cmd)
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 217
Quoted 10 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +10
-0+{ +return drm_gem_fb_create_with_funcs (dev, file, mode_cmd, + &drm_gem_fb_funcs); +} +EXPORT_SYMBOL_GPL (drm_gem_fb_create); + +/** +* drm_gem_fb_prepare_fb() - Prepare gem framebuffer +* @plane: Which plane +* @state: Plane state attach fence to
Good English that not be :-)
Quoted 4 lines
+ *
+ * This can be used as the &drm_plane_helper_funcs.prepare_fb hook.
+ *
+ * This function checks if the plane FB has an dma-buf attached, extracts
s/has an/has a/
Quoted 7 lines
+ * the exclusive fence and attaches it to plane state for the atomic helper
+ * to wait on.
+ *
+ * There is no need for &drm_plane_helper_funcs.cleanup_fb hook for simple
+ * gem based framebuffer drivers which have their buffers always pinned in
+ * memory.
+ */
drivers/gpu/drm/drm_gem_framebuffer_helper.c line 235
Quoted 7 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +7
-0+int drm_gem_fb_prepare_fb (struct drm_plane *plane, +struct drm_plane_state *state) +{ +struct dma_buf *dma_buf; +struct dma_fence *fence; + +if ((plane->state->fb == state->fb) || !state->fb)
No need for the inner parentheses.
Quoted 48 lines
drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +48
-0+return 0 ; + + dma_buf =drm_gem_fb_get_obj (state->fb,0 )->dma_buf; +if (dma_buf) { + fence =reservation_object_get_excl_rcu (dma_buf->resv); +drm_atomic_set_fence_for_plane (state, fence); + } + +return 0 ; +} +EXPORT_SYMBOL_GPL (drm_gem_fb_prepare_fb); + +/** +* drm_gem_fbdev_fb_create - Create a drm_framebuffer for fbdev emulation +* @dev: DRM device +* @sizes: fbdev size description +* @pitch_align: optional pitch alignment +* @obj: GEM object backing the framebuffer +* @funcs: vtable to be used for the new framebuffer object +* +* This function creates a framebuffer for use with fbdev emulation. +* +* Returns: +* Pointer to a drm_framebuffer on success or an error pointer on failure. +*/ +struct drm_framebuffer * +drm_gem_fbdev_fb_create (struct drm_device *dev, +struct drm_fb_helper_surface_size *sizes, +unsigned int pitch_align,struct drm_gem_object *obj, +const struct drm_framebuffer_funcs *funcs) +{ +struct drm_mode_fb_cmd2 mode_cmd = {0 }; + + mode_cmd.width = sizes->surface_width; + mode_cmd.height = sizes->surface_height; + mode_cmd.pitches[0 ] = sizes->surface_width * +DIV_ROUND_UP (sizes->surface_bpp,8 ); +if (pitch_align) + mode_cmd.pitches[0 ] =roundup (mode_cmd.pitches[0 ], + pitch_align); + mode_cmd.pixel_format =drm_mode_legacy_fb_format (sizes->surface_bpp, + sizes->surface_depth); +if (obj->size < mode_cmd.pitches[0 ] * mode_cmd.height) +return ERR_PTR (-EINVAL ); + +return drm_gem_fb_alloc (dev, &mode_cmd, &obj,1 , funcs); +} +EXPORT_SYMBOL (drm_gem_fbdev_fb_create);
[snip]
include/drm/drm_gem_framebuffer_helper.h line 6
Quoted 12 lines
(quoted diff) +0
-0
b/include/drm/drm_gem_framebuffer_helper.hnew file mode 100644 index 0000000..db9cfa0include/drm/drm_gem_framebuffer_helper.h new file +6
-0@@ -0,0 +1,37 @@ +#ifndef __DRM_GEM_FB_HELPER_H__ +#define __DRM_GEM_FB_HELPER_H__ + +struct drm_device ; +struct drm_file ; +struct drm_fb_helper_surface_size ;
Nitpicking, in alphabetical order drm_fb_helper_surface_size goes before drm_file.
Quoted 32 lines
include/drm/drm_gem_framebuffer_helper.h new file +11
-0+struct drm_framebuffer ; +struct drm_framebuffer_funcs ; +struct drm_gem_object ; +struct drm_mode_fb_cmd2 ; +struct drm_plane ; +struct drm_plane_state ; + +struct drm_gem_object *drm_gem_fb_get_obj (struct drm_framebuffer *fb, +unsigned int plane); +void drm_gem_fb_destroy (struct drm_framebuffer *fb); +int drm_gem_fb_create_handle(struct drm_framebuffer *fb, struct drm_file*file,
include/drm/drm_gem_framebuffer_helper.h new file +20
-0+ unsigned int *handle); + +struct drm_framebuffer * +drm_gem_fb_create_with_funcs (struct drm_device *dev,struct drm_file *file, +const struct drm_mode_fb_cmd2 *mode_cmd, +const struct drm_framebuffer_funcs *funcs); +struct drm_framebuffer * +drm_gem_fb_create (struct drm_device *dev,struct drm_file *file, +const struct drm_mode_fb_cmd2 *mode_cmd); + +int drm_gem_fb_prepare_fb (struct drm_plane *plane, +struct drm_plane_state *state); + +struct drm_framebuffer * +drm_gem_fbdev_fb_create (struct drm_device *dev, +struct drm_fb_helper_surface_size *sizes, +unsigned int pitch_align,struct drm_gem_object *obj, +const struct drm_framebuffer_funcs *funcs); + +#endif
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Noralf,
One additional comment.
Quoted 38 lines · On Wednesday 16 Aug 2017 23:37:54 Laurent Pinchart wrote:
Quoted 16 lines · On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 +++++++++++++++++++++ include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 ++++ 5 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/drm_gem_framebuffer_helper.c create mode 100644 include/drm/drm_gem_framebuffer_helper.h[snip]
Quoted 6 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/drm_gem_framebuffer_helper.cnew file mode 100644 index 0000000..068a630drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +0
-0@@ -0,0 +1,283 @@[snip]
Quoted 6 lines
+/**
+ * DOC: overview
+ *
+ * This library provides helpers for drivers that don't subclass
+ *&drm_framebufferand and use&drm_gem_objectfor their backing storage.s/and and/and/
Quoted 10 lines
Quoted 5 lines
+ *
+ * Drivers without additional needs to validate framebuffers can simply use
+ *drm_gem_fb_create()and everything is wired up automatically. But all
+ * parts can be used individually.A sentence should not start by "but". How about "Other drivers can use all parts independently." ?
Quoted 1 line
+ */
We now have the GEM CMA helpers, the GEM FB helpers and the FB CMA helper. It starts getting very confusing for driver authors. The overview documentation should explain how they all interact and which helpers a driver can/should use in the different cases.
[snip]
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Den 16.08.2017 22.50, skrev Laurent Pinchart:
Quoted 45 lines
Hi Noralf,
One additional comment.
Quoted 40 lines · On Wednesday 16 Aug 2017 23:37:54 Laurent Pinchart wrote:
Quoted 16 lines · On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 +++++++++++++++++++++ include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 ++++ 5 files changed, 337 insertions(+), 1 deletion(-)create mode 100644
drivers/gpu/drm/drm_gem_framebuffer_helper.ccreate mode 100644include/drm/drm_gem_framebuffer_helper.h[snip]
Quoted 6 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/drm_gem_framebuffer_helper.cnew file mode 100644 index 0000000..068a630drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +0
-0@@ -0,0 +1,283 @@[snip]
Quoted 6 lines
+/**
+ * DOC: overview
+ *
+ * This library provides helpers for drivers that don't subclass
+ *&drm_framebufferand and use&drm_gem_objectfor their backing storage.s/and and/and/
Quoted 5 lines
+ *
+ * Drivers without additional needs to validate framebuffers can simply use
+ *drm_gem_fb_create()and everything is wired up automatically. But all
+ * parts can be used individually.
Quoted 8 lines
Quoted 4 lines
A sentence should not start by "but". How about "Other drivers can use all parts independently." ?
Quoted 1 line
+ */
We now have the GEM CMA helpers, the GEM FB helpers and the FB CMA helper. It starts getting very confusing for driver authors. The overview documentation should explain how they all interact and which helpers a driver can/should use in the different cases.
Personally I rarely read the documentation, I just read the code, unless for complex codepaths, but they seldom have good documentation.
However documentation that ties things together, like you suggest, I also think is valuable. The problem is that it's difficult to write it, and that's probably why it's lacking almost everywhere. But I must say that Daniel really is persistent in trying to fix this.
The bottom line for me is that I'm not capable of writing such docs. I both lack the knowledge about the drm machinery and the skill to write for humans.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 59 lines · Noralf Trønnes
Den 16.08.2017 22.50, skrev Laurent Pinchart:
Quoted 45 lines
Hi Noralf,
One additional comment.
Quoted 40 lines · On Wednesday 16 Aug 2017 23:37:54 Laurent Pinchart wrote:
Quoted 16 lines · On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
This library provides helpers for drivers that don't subclass
drm_framebufferand are backed bydrm_gem_object. The code is taken fromdrm_fb_cma_helper.Signed-off-by Noralf Trønnes <[email protected]>Reviewed-by Daniel Vetter <[email protected]>---
Documentation/gpu/drm-kms-helpers.rst | 9 + drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 283 +++++++++++++++++++++ include/drm/drm_framebuffer.h | 7 + include/drm/drm_gem_framebuffer_helper.h | 37 ++++ 5 files changed, 337 insertions(+), 1 deletion(-)create mode 100644
drivers/gpu/drm/drm_gem_framebuffer_helper.ccreate mode 100644include/drm/drm_gem_framebuffer_helper.h[snip]
Quoted 6 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/drm_gem_framebuffer_helper.cnew file mode 100644 index 0000000..068a630drivers/gpu/drm/drm_gem_framebuffer_helper.c new file +0
-0@@ -0,0 +1,283 @@[snip]
Quoted 6 lines
+/**
+ * DOC: overview
+ *
+ * This library provides helpers for drivers that don't subclass
+ *&drm_framebufferand and use&drm_gem_objectfor their backing storage.s/and and/and/
Quoted 5 lines
+ *
+ * Drivers without additional needs to validate framebuffers can simply use
+ *drm_gem_fb_create()and everything is wired up automatically. But all
+ * parts can be used individually.Quoted 8 lines
Quoted 4 lines
A sentence should not start by "but". How about "Other drivers can use all parts independently." ?
Quoted 1 line
+ */
We now have the GEM CMA helpers, the GEM FB helpers and the FB CMA helper. It starts getting very confusing for driver authors. The overview documentation should explain how they all interact and which helpers a driver can/should use in the different cases.
Personally I rarely read the documentation, I just read the code, unless for complex codepaths, but they seldom have good documentation.
Quoted 8 lines
However documentation that ties things together, like you suggest, I also think is valuable. The problem is that it's difficult to write it, and that's probably why it's lacking almost everywhere. But I must say that Daniel really is persistent in trying to fix this.
The bottom line for me is that I'm not capable of writing such docs. I both lack the knowledge about the drm machinery and the skill to write for humans.
Yeah I've practically volunteered myself already to clean up the gem/prime docs after your cleanups have landed. In case I don't, please ping me about that. I'll call in requests for review in return :-) -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 2/22 drm/fb-cma-helper: Use drm_gem_framebuffer_helper
In reply to Noralf TrønnesUse the new drm_gem_framebuffer_helper who's code was copied from this helper.
--- drivers/gpu/drm/drm_fb_cma_helper.c | 181 ++++++------------------------------ 1 file changed, 30 insertions(+), 151 deletions(-)
drivers/gpu/drm/drm_fb_cma_helper.c +30 -151
@@ -18,27 +18,17 @@*/ #include <drm/drmP.h> -#include <drm/drm_atomic.h> -#include <drm/drm_crtc.h> #include <drm/drm_fb_helper.h> -#include <drm/drm_crtc_helper.h> +#include <drm/drm_framebuffer.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> -#include <linux/dma-buf.h> -#include <linux/dma-mapping.h> #include <linux/module.h> -#include <linux/reservation.h> #define DEFAULT_FBDEFIO_DELAY_MS 50 -struct drm_fb_cma { -struct drm_framebuffer fb; -struct drm_gem_cma_object *obj[4 ]; -}; -struct drm_fbdev_cma {struct drm_fb_helper fb_helper; -struct drm_fb_cma *fb;const struct drm_framebuffer_funcs *fb_funcs; };
@@ -90,69 +80,19 @@ static inline struct drm_fbdev_cma *to_fbdev_cma(struct drm_fb_helper *helper) return container_of(helper, struct drm_fbdev_cma, fb_helper); } -static inline struct drm_fb_cma *to_fb_cma (struct drm_framebuffer *fb) -{ - return container_of(fb, struct drm_fb_cma, fb); -} -void drm_fb_cma_destroy (struct drm_framebuffer *fb) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb); -int i; - -for (i =0 ; i <4 ; i++) { -if (fb_cma->obj[i]) -drm_gem_object_put_unlocked (&fb_cma->obj[i]->base); - } - -drm_framebuffer_cleanup (fb); -kfree (fb_cma); +drm_gem_fb_destroy (fb); }EXPORT_SYMBOL (drm_fb_cma_destroy);int drm_fb_cma_create_handle (struct drm_framebuffer *fb,struct drm_file *file_priv,unsigned int *handle) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb); - -return drm_gem_handle_create (file_priv, - &fb_cma->obj[0 ]->base, handle); +return drm_gem_fb_create_handle (fb, file_priv, handle); }EXPORT_SYMBOL (drm_fb_cma_create_handle); -static struct drm_framebuffer_funcs drm_fb_cma_funcs = { - .destroy = drm_fb_cma_destroy, - .create_handle = drm_fb_cma_create_handle, -}; - -static struct drm_fb_cma *drm_fb_cma_alloc (struct drm_device *dev, -const struct drm_mode_fb_cmd2 *mode_cmd, -struct drm_gem_cma_object **obj, -unsigned int num_planes,const struct drm_framebuffer_funcs *funcs) -{ -struct drm_fb_cma *fb_cma; -int ret; -int i; - - fb_cma =kzalloc (sizeof (*fb_cma),GFP_KERNEL ); -if (!fb_cma) -return ERR_PTR (-ENOMEM ); - -drm_helper_mode_fill_fb_struct (dev, &fb_cma->fb, mode_cmd); - -for (i =0 ; i < num_planes; i++) - fb_cma->obj[i] = obj[i]; - - ret =drm_framebuffer_init (dev, &fb_cma->fb, funcs); -if (ret) { -dev_err (dev->dev,"Failed to initialize framebuffer: %d\n" , ret); -kfree (fb_cma); -return ERR_PTR (ret); - } - -return fb_cma; -} -/** * drm_fb_cma_create_with_funcs() - helper function for the * &drm_mode_config_funcs.fb_create
@@ -170,53 +110,7 @@ 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, const struct drm_framebuffer_funcs *funcs) { - const struct drm_format_info *info; -struct drm_fb_cma *fb_cma; -struct drm_gem_cma_object *objs[4 ]; -struct drm_gem_object *obj; -int ret; -int i; - - info =drm_get_format_info (dev, mode_cmd); -if (!info) -return ERR_PTR (-EINVAL ); - -for (i =0 ; i < info->num_planes; i++) { -unsigned int width = mode_cmd->width / (i ? info->hsub :1 ); -unsigned int height = mode_cmd->height / (i ? info->vsub :1 ); -unsigned int min_size; - - obj =drm_gem_object_lookup (file_priv, mode_cmd->handles[i]); -if (!obj) { -dev_err (dev->dev,"Failed to lookup GEM object\n" ); - ret = -ENOENT ; - goto err_gem_object_put; - } - - min_size = (height -1 ) * mode_cmd->pitches[i] - + width * info->cpp[i] - + mode_cmd->offsets[i]; - -if (obj->size < min_size) { -drm_gem_object_put_unlocked (obj); - ret = -EINVAL ; - goto err_gem_object_put; - } - objs[i] =to_drm_gem_cma_obj (obj); - } - - 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_put; - } - -return &fb_cma->fb; - -err_gem_object_put: -for (i--; i >=0 ; i--) -drm_gem_object_put_unlocked (&objs[i]->base); -return ERR_PTR (ret); + return drm_gem_fb_create_with_funcs(dev, file_priv, mode_cmd, funcs); }EXPORT_SYMBOL_GPL (drm_fb_cma_create_with_funcs);
@@ -233,8 +127,7 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_create_with_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) { -return drm_fb_cma_create_with_funcs (dev, file_priv, mode_cmd, - &drm_fb_cma_funcs); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }EXPORT_SYMBOL_GPL (drm_fb_cma_create);
@@ -250,12 +143,14 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_create);struct drm_gem_cma_object *drm_fb_cma_get_gem_obj (struct drm_framebuffer *fb,unsigned int plane) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb); +struct drm_gem_object *gem; -if (plane >=4 ) + gem =drm_gem_fb_get_obj (fb, plane); +if (!gem)return NULL ; -return fb_cma->obj[plane]; +return to_drm_gem_cma_obj (gem); + }EXPORT_SYMBOL_GPL (drm_fb_cma_get_gem_obj);
@@ -272,13 +167,14 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, struct drm_plane_state *state, unsigned int plane) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb); +struct drm_gem_cma_object *obj;dma_addr_t paddr; -if (plane >=4 ) + obj =drm_fb_cma_get_gem_obj (fb, plane); +if (!obj)return 0 ; - paddr = fb_cma->obj[plane]->paddr + fb->offsets[plane]; + paddr = obj->paddr + fb->offsets[plane]; paddr += fb->format->cpp[plane] * (state->src_x >>16 ); paddr += fb->pitches[plane] * (state->src_y >>16 );
@@ -302,26 +198,13 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_addr);int drm_fb_cma_prepare_fb (struct drm_plane *plane,struct drm_plane_state *state) { -struct dma_buf *dma_buf; -struct dma_fence *fence; - -if ((plane->state->fb == state->fb) || !state->fb) -return 0 ; - - dma_buf =drm_fb_cma_get_gem_obj (state->fb,0 )->base.dma_buf; -if (dma_buf) { - fence =reservation_object_get_excl_rcu (dma_buf->resv); -drm_atomic_set_fence_for_plane (state, fence); - } - -return 0 ; +return drm_gem_fb_prepare_fb (plane, state); }EXPORT_SYMBOL_GPL (drm_fb_cma_prepare_fb);#ifdef CONFIG_DEBUG_FS static void drm_fb_cma_describe (struct drm_framebuffer *fb,struct seq_file *m) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb);int i; seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height,
@@ -330,7 +213,7 @@ static void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m)for (i =0 ; i < fb->format->num_planes; i++) {seq_printf (m," %d: offset=%d pitch=%d, obj: " , i, fb->offsets[i], fb->pitches[i]); -drm_gem_cma_describe (fb_cma->obj[i], m); +drm_gem_cma_describe (drm_fb_cma_get_gem_obj (fb, i), m); } }
@@ -431,7 +314,6 @@ drm_fbdev_cma_create(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) {struct drm_fbdev_cma *fbdev_cma =to_fbdev_cma (helper); -struct drm_mode_fb_cmd2 mode_cmd = {0 };struct drm_device *dev = helper->dev;struct drm_gem_cma_object *obj;struct drm_framebuffer *fb;
@@ -446,14 +328,7 @@ drm_fbdev_cma_create(struct drm_fb_helper *helper, sizes->surface_bpp); bytes_per_pixel =DIV_ROUND_UP (sizes->surface_bpp,8 ); - - mode_cmd.width = sizes->surface_width; - mode_cmd.height = sizes->surface_height; - mode_cmd.pitches[0 ] = sizes->surface_width * bytes_per_pixel; - mode_cmd.pixel_format =drm_mode_legacy_fb_format (sizes->surface_bpp, - sizes->surface_depth); - - size = mode_cmd.pitches[0 ] * mode_cmd.height; + size = sizes->surface_width * sizes->surface_height * bytes_per_pixel; obj =drm_gem_cma_create (dev, size);if (IS_ERR (obj))return -ENOMEM ;
@@ -464,15 +339,14 @@ drm_fbdev_cma_create(struct drm_fb_helper *helper, goto err_gem_free_object; } - fbdev_cma->fb =drm_fb_cma_alloc (dev, &mode_cmd, &obj,1 , - fbdev_cma->fb_funcs); -if (IS_ERR (fbdev_cma->fb)) { + fb =drm_gem_fbdev_fb_create (dev, sizes,0 , &obj->base, + fbdev_cma->fb_funcs); +if (IS_ERR (fb)) {dev_err (dev->dev,"Failed to allocate DRM framebuffer.\n" ); - ret =PTR_ERR (fbdev_cma->fb); + ret =PTR_ERR (fb); goto err_fb_info_destroy; } - fb = &fbdev_cma->fb->fb; helper->fb = fb; fbi->par = helper;
@@ -500,7 +374,7 @@ drm_fbdev_cma_create(struct drm_fb_helper *helper,return 0 ; err_cma_destroy: -drm_framebuffer_remove (&fbdev_cma->fb->fb); +drm_framebuffer_remove (fb); err_fb_info_destroy:drm_fb_helper_fini (helper); err_gem_free_object:
@@ -570,6 +444,11 @@ struct drm_fbdev_cma *drm_fbdev_cma_init_with_funcs(struct drm_device *dev, }EXPORT_SYMBOL_GPL (drm_fbdev_cma_init_with_funcs); +static const struct drm_framebuffer_funcs drm_fb_cma_funcs = { + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, +}; +/** * drm_fbdev_cma_init() - Allocate and initializes a drm_fbdev_cma struct * @dev: DRM device
@@ -597,8 +476,8 @@ void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma)if (fbdev_cma->fb_helper.fbdev)drm_fbdev_cma_defio_fini (fbdev_cma->fb_helper.fbdev); -if (fbdev_cma->fb) -drm_framebuffer_remove (&fbdev_cma->fb->fb); +if (fbdev_cma->fb_helper.fb) +drm_framebuffer_remove (fbdev_cma->fb_helper.fb);drm_fb_helper_fini (&fbdev_cma->fb_helper);kfree (fbdev_cma);
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 02/22] drm/fb-cma-helper: Use drm_gem_framebuffer_helper
Quoted 19 lines · Noralf Trønnes
Use the new
drm_gem_framebuffer_helperwho's code was copied from this helper.Signed-off-by Noralf Trønnes <[email protected]>--- drivers/gpu/drm/drm_fb_cma_helper.c | 181 ++++++------------------------------ 1 file changed, 30 insertions(+), 151 deletions(-)drivers/gpu/drm/drm_fb_cma_helper.c +1
-1@@ -250,12 +143,14 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_create);struct drm_gem_cma_object *drm_fb_cma_get_gem_obj (struct drm_framebuffer *fb,unsigned int plane) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb); +struct drm_gem_object *gem;
drivers/gpu/drm/drm_fb_cma_helper.c EXPORT_SYMBOL_GPL(drm_fb_cma_create); · line 154
Quoted 10 lines
drivers/gpu/drm/drm_fb_cma_helper.c +4
-2-if (plane >=4 ) + gem =drm_gem_fb_get_obj (fb, plane); +if (!gem)return NULL ; -return fb_cma->obj[plane]; +return to_drm_gem_cma_obj (gem); + }
Stray whitespace. Other than that,
Feel free to push vc4 and pl111 with this patch.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 02/22] drm/fb-cma-helper: Use drm_gem_framebuffer_helper
Den 16.08.2017 19.33, skrev Eric Anholt:
Quoted 32 lines
Quoted 18 lines · Noralf Trønnes
Use the new
drm_gem_framebuffer_helperwho's code was copied from this helper.Signed-off-by Noralf Trønnes <[email protected]>--- drivers/gpu/drm/drm_fb_cma_helper.c | 181 ++++++------------------------------ 1 file changed, 30 insertions(+), 151 deletions(-)drivers/gpu/drm/drm_fb_cma_helper.c +1
-1@@ -250,12 +143,14 @@ EXPORT_SYMBOL_GPL(drm_fb_cma_create);struct drm_gem_cma_object *drm_fb_cma_get_gem_obj (struct drm_framebuffer *fb,unsigned int plane) { -struct drm_fb_cma *fb_cma =to_fb_cma (fb); +struct drm_gem_object *gem;drivers/gpu/drm/drm_fb_cma_helper.c EXPORT_SYMBOL_GPL(drm_fb_cma_create); · line 154
Quoted 10 lines
drivers/gpu/drm/drm_fb_cma_helper.c +4
-2-if (plane >=4 ) + gem =drm_gem_fb_get_obj (fb, plane); +if (!gem)return NULL ; -return fb_cma->obj[plane]; +return to_drm_gem_cma_obj (gem); + }Stray whitespace. Other than that,
Quoted 3 lines
Reviewed-by Eric Anholt <[email protected]>Feel free to push vc4 and pl111 with this patch.
Thanks Eric, this patch, vc4 and pl111 applied to drm-misc.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 3/22 drm/tinydrm: Use drm_gem_framebuffer_helper
In reply to Noralf TrønnesUse drm_gem_framebuffer_helper directly instead of the cma library wrappers.
--- drivers/gpu/drm/tinydrm/core/tinydrm-core.c | 3 ++- drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 5 +++-- drivers/gpu/drm/tinydrm/mipi-dbi.c | 5 +++-- drivers/gpu/drm/tinydrm/repaper.c | 5 +++-- drivers/gpu/drm/tinydrm/st7586.c | 5 +++-- 5 files changed, 14 insertions(+), 9 deletions(-)
drivers/gpu/drm/tinydrm/core/tinydrm-core.c +2 -1
@@ -10,6 +10,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/tinydrm.h> #include <linux/device.h> #include <linux/dma-buf.h>
@@ -128,7 +129,7 @@ tinydrm_fb_create(struct drm_device *drm, struct drm_file *file_priv, {struct tinydrm_device *tdev = drm->dev_private; -return drm_fb_cma_create_with_funcs (drm, file_priv, mode_cmd, +return drm_gem_fb_create_with_funcs (drm, file_priv, mode_cmd, tdev->fb_funcs); }
drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +3 -2
@@ -9,6 +9,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_modes.h> #include <drm/tinydrm/tinydrm.h>
@@ -144,7 +145,7 @@ EXPORT_SYMBOL(tinydrm_display_pipe_update);* @pipe: Simple display pipe * @plane_state: Plane state * -* This function uses drm_fb_cma_prepare_fb() to check if the plane FB has an +* This function uses drm_gem_fb_prepare_fb() to check if the plane FB has an * dma-buf attached, extracts the exclusive fence and attaches it to plane * state for the atomic helper to wait on. Drivers can use this as their * &drm_simple_display_pipe_funcs->prepare_fb callback.
@@ -152,7 +153,7 @@ EXPORT_SYMBOL(tinydrm_display_pipe_update);int tinydrm_display_pipe_prepare_fb (struct drm_simple_display_pipe *pipe,struct drm_plane_state *plane_state) { -return drm_fb_cma_prepare_fb (&pipe->plane, plane_state); +return drm_gem_fb_prepare_fb (&pipe->plane, plane_state); }EXPORT_SYMBOL (tinydrm_display_pipe_prepare_fb);
drivers/gpu/drm/tinydrm/mipi-dbi.c +3 -2
@@ -9,6 +9,7 @@* (at your option) any later version. */ +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/mipi-dbi.h> #include <drm/tinydrm/tinydrm-helpers.h> #include <linux/debugfs.h>
@@ -253,8 +254,8 @@ static int mipi_dbi_fb_dirty(struct drm_framebuffer *fb, }static const struct drm_framebuffer_funcs mipi_dbi_fb_funcs = { - .destroy = drm_fb_cma_destroy, - .create_handle = drm_fb_cma_create_handle, + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, .dirty = mipi_dbi_fb_dirty, };
drivers/gpu/drm/tinydrm/repaper.c +3 -2
@@ -26,6 +26,7 @@#include <linux/spi/spi.h> #include <linux/thermal.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/tinydrm.h> #include <drm/tinydrm/tinydrm-helpers.h>
@@ -636,8 +637,8 @@ static int repaper_fb_dirty(struct drm_framebuffer *fb, }static const struct drm_framebuffer_funcs repaper_fb_funcs = { - .destroy = drm_fb_cma_destroy, - .create_handle = drm_fb_cma_create_handle, + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, .dirty = repaper_fb_dirty, };
drivers/gpu/drm/tinydrm/st7586.c +3 -2
@@ -17,6 +17,7 @@#include <linux/spi/spi.h> #include <video/mipi_display.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/tinydrm/mipi-dbi.h> #include <drm/tinydrm/tinydrm-helpers.h>
@@ -167,8 +168,8 @@ static int st7586_fb_dirty(struct drm_framebuffer *fb, }static const struct drm_framebuffer_funcs st7586_fb_funcs = { - .destroy = drm_fb_cma_destroy, - .create_handle = drm_fb_cma_create_handle, + .destroy = drm_gem_fb_destroy, + .create_handle = drm_gem_fb_create_handle, .dirty = st7586_fb_dirty, };
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 4/22 drm/arc: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/arc/arcpgu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/arc/arcpgu_drv.c +2 -1
@@ -18,6 +18,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_atomic_helper.h> #include <linux/of_reserved_mem.h>
@@ -32,7 +33,7 @@ static void arcpgu_fb_output_poll_changed(struct drm_device *dev) }static const struct drm_mode_config_funcs arcpgu_drm_modecfg_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = arcpgu_fb_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH v3 04/22] drm/arc: Use drm_gem_fb_create()
Hi Noralf,
Quoted 12 lines
-----Original Message-----
From: Noralf Trønnes [mailto:[email protected]]
Sent: Sunday, August 13, 2017 4:32 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Noralf Trønnes <[email protected]>
Subject: [PATCH v3 04/22] drm/arc: Usedrm_gem_fb_create()
Quoted 2 lines
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedRe: [PATCH v3 04/22] drm/arc: Use drm_gem_fb_create()
Den 28.08.2017 13.36, skrev Alexey Brodkin:
Quoted 14 lines
Hi Noralf,
Quoted 12 lines
-----Original Message-----
From: Noralf Trønnes [mailto:[email protected]]
Sent: Sunday, August 13, 2017 4:32 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Noralf Trønnes <[email protected]>
Subject: [PATCH v3 04/22] drm/arc: Usedrm_gem_fb_create()
Quoted 4 lines
Quoted 2 lines
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Acked-by Alexey Brodkin <[email protected]>
Thanks, applied to drm-misc.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 5/22 drm/arm/hdlcd: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/arm/hdlcd_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/arm/hdlcd_drv.c +2 -1
@@ -25,6 +25,7 @@#include <drm/drm_fb_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include "hdlcd_drv.h"
@@ -106,7 +107,7 @@ static void hdlcd_fb_output_poll_changed(struct drm_device *drm) }static const struct drm_mode_config_funcs hdlcd_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = hdlcd_fb_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 6/22 drm/arm/mali: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/arm/malidp_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_drv.c +2 -1
@@ -26,6 +26,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include "malidp_drv.h"
@@ -249,7 +250,7 @@ static const struct drm_mode_config_helper_funcs malidp_mode_config_helpers = { };static const struct drm_mode_config_funcs malidp_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = malidp_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 06/22] drm/arm/mali: Use drm_gem_fb_create()
Hi Noralf,
Quoted 4 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Liviu Dudau <[email protected]>
I was on holiday for 2+ weeks, so I have no idea if you still need this, but for hdlcd and malidp:
Thanks,
Liviu
Quoted 30 lines
Cc Brian Starkey <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>--- drivers/gpu/drm/arm/malidp_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/arm/malidp_drv.c +2
-1@@ -26,6 +26,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include "malidp_drv.h" @@ -249,7 +250,7 @@ static const struct drm_mode_config_helper_funcs malidp_mode_config_helpers = { };static const struct drm_mode_config_funcs malidp_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = malidp_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,Signature · 1 line
2.7.4
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develNoralf Trønnes
AppliedRe: [PATCH v3 06/22] drm/arm/mali: Use drm_gem_fb_create()
Den 25.08.2017 12.48, skrev Liviu Dudau:
Quoted 4 lines
Hi Noralf,
On Sun, Aug 13, 2017 at 03:31:49PM +0200, Noralf Trønnes wrote:
Quoted 8 lines
Quoted 4 lines
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Liviu Dudau <[email protected]>I was on holiday for 2+ weeks, so I have no idea if you still need this, but for hdlcd and malidp:
Acked-by Liviu Dudau <[email protected]>
Thanks, applied to drm-misc.
Noralf.
Quoted 25 lines
Thanks,
LiviuQuoted 21 lines
Cc Brian Starkey <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>--- drivers/gpu/drm/arm/malidp_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/arm/malidp_drv.c +1
-0@@ -26,6 +26,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include "malidp_drv.h" @@ -249,7 +250,7 @@ static const struct drm_mode_config_helper_funcs malidp_mode_config_helpers = { };
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/arm/malidp_drv.c +1
-1static const struct drm_mode_config_funcs malidp_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = malidp_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,Signature · 1 line
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 7/22 drm/atmel-hlcdc: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 -1
@@ -458,7 +458,7 @@ static irqreturn_t atmel_hlcdc_dc_irq_handler(int irq, void *data)static struct drm_framebuffer *atmel_hlcdc_fb_create (struct drm_device *dev,struct drm_file *file_priv,const struct drm_mode_fb_cmd2 *mode_cmd) { -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static void atmel_hlcdc_fb_output_poll_changed (struct drm_device *dev)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +1 -0
@@ -34,6 +34,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_panel.h> #include <drm/drm_plane_helper.h> #include <drm/drmP.h>
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 07/22] drm/atmel-hlcdc: Use drm_gem_fb_create()
Quoted 5 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Boris Brezillon <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
Quoted 23 lines
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-1@@ -458,7 +458,7 @@ static irqreturn_t atmel_hlcdc_dc_irq_handler(int irq, void *data)static struct drm_framebuffer *atmel_hlcdc_fb_create (struct drm_device *dev,struct drm_file *file_priv,const struct drm_mode_fb_cmd2 *mode_cmd) { -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static void atmel_hlcdc_fb_output_poll_changed (struct drm_device *dev)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +0
-0
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h line 40
Quoted 7 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +1
-0@@ -34,6 +34,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_panel.h> #include <drm/drm_plane_helper.h> #include <drm/drmP.h>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedRe: [PATCH v3 07/22] drm/atmel-hlcdc: Use drm_gem_fb_create()
Den 17.08.2017 09.25, skrev Boris Brezillon:
Quoted 9 lines
Quoted 5 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Boris Brezillon <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>Acked-by Boris Brezillon <[email protected]>
Thanks, applied to drm-misc.
Noralf.
Quoted 17 lines
Quoted 17 lines
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1
-1@@ -458,7 +458,7 @@ static irqreturn_t atmel_hlcdc_dc_irq_handler(int irq, void *data)static struct drm_framebuffer *atmel_hlcdc_fb_create (struct drm_device *dev,struct drm_file *file_priv,const struct drm_mode_fb_cmd2 *mode_cmd) { -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }
Quoted 14 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h line 40
Quoted 13 lines
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0
-0static void atmel_hlcdc_fb_output_poll_changed (struct drm_device *dev)drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +1
-0@@ -34,6 +34,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_panel.h> #include <drm/drm_plane_helper.h> #include <drm/drmP.h>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 8/22 drm/fsl-dcu: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c +2 -1
@@ -13,6 +13,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "fsl_dcu_drm_crtc.h" #include "fsl_dcu_drm_drv.h"
@@ -20,7 +21,7 @@static const struct drm_mode_config_funcs fsl_dcu_drm_mode_config_funcs = { .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, };int fsl_dcu_drm_modeset_init (struct fsl_dcu_drm_device *fsl_dev)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 9/22 drm/hisilicon/kirin: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +2 -1
@@ -22,6 +22,7 @@#include <drm/drmP.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_of.h>
@@ -56,7 +57,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev) }static const struct drm_mode_config_funcs kirin_drm_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = kirin_fbdev_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 10/22 drm/imx: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
In reply to Noralf Trønnesdrm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now, use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly.
--- drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/imx/imx-drm-core.c +2 -1
@@ -24,6 +24,7 @@#include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_plane_helper.h> #include <drm/drm_of.h>
@@ -105,7 +106,7 @@ static int imx_drm_atomic_check(struct drm_device *dev, }static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = imx_drm_output_poll_changed, .atomic_check = imx_drm_atomic_check, .atomic_commit = drm_atomic_helper_commit,
drivers/gpu/drm/imx/ipuv3-plane.c +2 -1
@@ -18,6 +18,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_plane_helper.h> #include "video/imx-ipu-v3.h"
@@ -661,7 +662,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = { - .prepare_fb = drm_fb_cma_prepare_fb, + .prepare_fb = drm_gem_fb_prepare_fb, .atomic_check = ipu_plane_atomic_check, .atomic_disable = ipu_plane_atomic_disable, .atomic_update = ipu_plane_atomic_update,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 10/22] drm/imx: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
Hi Noralf,
Quoted 47 lines · Noralf Trønnes
drm_fb_cma_create()anddrm_fb_cma_prepare_fb()are just wrappers now, usedrm_gem_fb_create()anddrm_gem_fb_prepare_fb()directly.Quoted 2 lines
Cc Philipp Zabel <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>---
drivers/gpu/drm/imx/imx-drm-core.c | 3 ++-
drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++-2 files changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/imx/imx-drm-core.c +1
-0@@ -24,6 +24,7 @@ #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_plane_helper.h> #include <drm/drm_of.h>@@ -105,7 +106,7 @@ static int imx_drm_atomic_check(struct drm_device *dev, }
static const structdrm_mode_config_funcsimx_drm_mode_config_funcs= {Quoted 5 lines
drivers/gpu/drm/imx/imx-drm-core.c +1
-1- .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create,.output_poll_changed =
imx_drm_output_poll_changed, .atomic_check =imx_drm_atomic_check, .atomic_commit =drm_atomic_helper_commit,drivers/gpu/drm/imx/ipuv3-plane.c +1
-0@@ -18,6 +18,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_plane_helper.h>
#include "video/imx-ipu-v3.h"drivers/gpu/drm/imx/ipuv3-plane.c +0
-0@@ -661,7 +662,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }
static const structdrm_plane_helper_funcsipu_plane_helper_funcs= {
Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/imx/ipuv3-plane.c +1
-1- .prepare_fb = drm_fb_cma_prepare_fb, + .prepare_fb = drm_gem_fb_prepare_fb,.atomic_check =
ipu_plane_atomic_check, .atomic_disable =ipu_plane_atomic_disable, .atomic_update =ipu_plane_atomic_update,
thanks
Philipp
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedRe: [PATCH v3 10/22] drm/imx: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
Den 11.09.2017 09.57, skrev Philipp Zabel:
Quoted 49 lines
Hi Noralf,
Quoted 46 lines · Noralf Trønnes
drm_fb_cma_create()anddrm_fb_cma_prepare_fb()are just wrappers now, usedrm_gem_fb_create()anddrm_gem_fb_prepare_fb()directly.Quoted 2 lines
Cc Philipp Zabel <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>--- drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/imx/imx-drm-core.c +1
-0@@ -24,6 +24,7 @@ #include <drm/drm_fb_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_plane_helper.h> #include <drm/drm_of.h>@@ -105,7 +106,7 @@ static int imx_drm_atomic_check(struct drm_device *dev, } static const struct drm_mode_config_funcs imx_drm_mode_config_funcs = { > - .fb_create = drm_fb_cma_create, > + .fb_create = drm_gem_fb_create, > .output_poll_changed = imx_drm_output_poll_changed, > .atomic_check = imx_drm_atomic_check,Quoted 1 line
.atomic_commit =
drm_atomic_helper_commit,drivers/gpu/drm/imx/ipuv3-plane.c +1
-0@@ -18,6 +18,7 @@ #include <drm/drm_atomic_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_plane_helper.h> #include "video/imx-ipu-v3.h"@@ -661,7 +662,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, }
Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/imx/ipuv3-plane.c +0
-0static const struct drm_plane_helper_funcs ipu_plane_helper_funcs = { > - .prepare_fb = drm_fb_cma_prepare_fb, > + .prepare_fb = drm_gem_fb_prepare_fb, > .atomic_check = ipu_plane_atomic_check, > .atomic_disable = ipu_plane_atomic_disable,Quoted 1 line
.atomic_update =
ipu_plane_atomic_update,Acked-by Philipp Zabel <[email protected]>
Thanks, applied to drm-misc.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 11/22 drm/meson: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/meson/meson_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_drv.c +2 -1
@@ -34,6 +34,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_plane_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_rect.h> #include <drm/drm_fb_helper.h>
@@ -78,7 +79,7 @@ static const struct drm_mode_config_funcs meson_mode_config_funcs = { .output_poll_changed = meson_fb_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, };static irqreturn_t meson_irq (int irq,void *arg)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 12/22 drm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
In reply to Noralf Trønnesdrm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now, use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly.
--- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/mxsfb/mxsfb_drv.c +3 -2
@@ -35,6 +35,7 @@#include <drm/drm_fb_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include <drm/drm_panel.h> #include <drm/drm_simple_kms_helper.h>
@@ -92,7 +93,7 @@ void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb) }static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, };
@@ -127,7 +128,7 @@ static void mxsfb_pipe_update(struct drm_simple_display_pipe *pipe,static int mxsfb_pipe_prepare_fb (struct drm_simple_display_pipe *pipe,struct drm_plane_state *plane_state) { -return drm_fb_cma_prepare_fb (&pipe->plane, plane_state); +return drm_gem_fb_prepare_fb (&pipe->plane, plane_state); }static struct drm_simple_display_pipe_funcs mxsfb_funcs = {
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 13/22 drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
In reply to Noralf Trønnesdrm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now, use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly.
--- drivers/gpu/drm/pl111/pl111_display.c | 3 ++- drivers/gpu/drm/pl111/pl111_drv.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/pl111/pl111_display.c +2 -1
@@ -23,6 +23,7 @@#include <drm/drmP.h> #include <drm/drm_panel.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include "pl111_drm.h"
@@ -274,7 +275,7 @@ void pl111_disable_vblank(struct drm_device *drm, unsigned int crtc)static int pl111_display_prepare_fb (struct drm_simple_display_pipe *pipe,struct drm_plane_state *plane_state) { -return drm_fb_cma_prepare_fb (&pipe->plane, plane_state); +return drm_gem_fb_prepare_fb (&pipe->plane, plane_state); }static const struct drm_simple_display_pipe_funcs pl111_display_funcs = {
drivers/gpu/drm/pl111/pl111_drv.c +2 -1
@@ -66,6 +66,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include "pl111_drm.h"
@@ -73,7 +74,7 @@#define DRIVER_DESC "DRM module for PL111"static const struct drm_mode_config_funcs mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, };
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 13/22] drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
Quoted 2 lines · Noralf Trønnes
drm_fb_cma_create()anddrm_fb_cma_prepare_fb()are just wrappers now, usedrm_gem_fb_create()anddrm_gem_fb_prepare_fb()directly.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 14/22 drm/rcar-du: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_kms.c +2 -1
@@ -18,6 +18,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <linux/of_graph.h> #include <linux/wait.h>
@@ -211,7 +212,7 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv, } } -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static void rcar_du_output_poll_changed (struct drm_device *dev)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 15/22 drm/shmobile: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/shmobile/shmob_drm_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/shmobile/shmob_drm_kms.c +2 -1
@@ -16,6 +16,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <video/sh_mobile_meram.h>
@@ -131,7 +132,7 @@ shmob_drm_fb_create(struct drm_device *dev, struct drm_file *file_priv, } } -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static const struct drm_mode_config_funcs shmob_drm_mode_config_funcs = {
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 16/22 drm/sti: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/sti/sti_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/sti/sti_drv.c +2 -1
@@ -16,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_of.h>
@@ -145,7 +146,7 @@ static void sti_output_poll_changed(struct drm_device *ddev) }static const struct drm_mode_config_funcs sti_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = sti_output_poll_changed, .atomic_check = sti_atomic_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 16/22] drm/sti: Use drm_gem_fb_create()
Hi Noralf,
Quoted 6 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Benjamin Gaignard <[email protected]>Cc Vincent Abriou <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/sti/sti_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/sti/sti_drv.c +1
-0@@ -16,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_of.h>
drivers/gpu/drm/sti/sti_drv.c static void sti_output_poll_changed(struct drm_device *ddev) · line 152
Quoted 8 lines
drivers/gpu/drm/sti/sti_drv.c +1
-1@@ -145,7 +146,7 @@ static void sti_output_poll_changed(struct drm_device *ddev) }static const struct drm_mode_config_funcs sti_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = sti_output_poll_changed, .atomic_check = sti_atomic_check, .atomic_commit = drm_atomic_helper_commit,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedRe: [PATCH v3 16/22] drm/sti: Use drm_gem_fb_create()
Den 21.08.2017 09.53, skrev Vincent ABRIOU:
Quoted 10 lines
Hi Noralf,
Quoted 6 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Benjamin Gaignard <[email protected]>Cc Vincent Abriou <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>Acked-by Vincent Abriou <[email protected]>
Thanks, applied to drm-misc.
Noralf.
Quoted 19 lines
Quoted 19 lines
--- drivers/gpu/drm/sti/sti_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/sti/sti_drv.c +1
-0@@ -16,6 +16,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_crtc_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_of.h> @@ -145,7 +146,7 @@ static void sti_output_poll_changed(struct drm_device *ddev) }
Quoted 7 lines
drivers/gpu/drm/sti/sti_drv.c static void sti_output_poll_changed(struct drm_device *ddev) · line 152
Quoted 7 lines
drivers/gpu/drm/sti/sti_drv.c +1
-1static const struct drm_mode_config_funcs sti_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = sti_output_poll_changed, .atomic_check = sti_atomic_check, .atomic_commit = drm_atomic_helper_commit,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 17/22 drm/stm: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/stm/drv.c +2 -1
@@ -17,6 +17,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "ltdc.h"
@@ -31,7 +32,7 @@ static void drv_output_poll_changed(struct drm_device *ddev) }static const struct drm_mode_config_funcs drv_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = drv_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 17/22] drm/stm: Use drm_gem_fb_create()
Hi Noralf,
Many thanks for your patchset (and sorry for this late reply due to summer holidays :-),
Quoted 8 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Vincent Abriou <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
Philippe :-)
Quoted 18 lines
--- drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/stm/drv.c +1
-0@@ -17,6 +17,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "ltdc.h"
drivers/gpu/drm/stm/drv.c static void drv_output_poll_changed(struct drm_device *ddev) · line 38
Quoted 8 lines
drivers/gpu/drm/stm/drv.c +1
-1@@ -31,7 +32,7 @@ static void drv_output_poll_changed(struct drm_device *ddev) }static const struct drm_mode_config_funcs drv_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = drv_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 17/22] drm/stm: Use drm_gem_fb_create()
Den 01.09.2017 13.28, skrev Philippe CORNU:
Quoted 8 lines
Hi Noralf,
Many thanks for your patchset (and sorry for this late reply due to summer holidays :-),Quoted 3 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.
Quoted 7 lines
Quoted 5 lines
Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Vincent Abriou <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>Acked-by Philippe Cornu <[email protected]>Tested-by Philippe Cornu <[email protected]>
Thanks for your testing Philippe, it's appreciated.
It's reassuring to see that someone else gets this to work as well :-) Applied to drm-misc.
Noralf.
Quoted 21 lines
Philippe :-)
Quoted 19 lines
--- drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/stm/drv.c +1
-0@@ -17,6 +17,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "ltdc.h" @@ -31,7 +32,7 @@ static void drv_output_poll_changed(struct drm_device *ddev) }
Quoted 7 lines
drivers/gpu/drm/stm/drv.c static void drv_output_poll_changed(struct drm_device *ddev) · line 38
Quoted 7 lines
drivers/gpu/drm/stm/drv.c +1
-1static const struct drm_mode_config_funcs drv_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = drv_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 17/22] drm/stm: Use drm_gem_fb_create()
Quoted 15 lines · Noralf Trønnes
Den 01.09.2017 13.28, skrev Philippe CORNU:
Quoted 13 lines
Hi Noralf,
Many thanks for your patchset (and sorry for this late reply due to summer holidays :-),Quoted 8 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Yannick Fertre <[email protected]>Cc Philippe Cornu <[email protected]>Cc Benjamin Gaignard <[email protected]>Cc Vincent Abriou <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
Quoted 6 lines
Quoted 2 lines
Acked-by Philippe Cornu <[email protected]>Tested-by Philippe Cornu <[email protected]>Thanks for your testing Philippe, it's appreciated.
It's reassuring to see that someone else gets this to work as well :-) Applied to drm-misc.
btw for testing, as long as it touches i915.ko, just cc the entire patch series (not just individual patches) to the intel-gfx mailing list, and our CI will crunch it for you. Atm that's about 15h of machine time we throw at each patch series.
-Daniel
Quoted 29 lines
Noralf.
Quoted 25 lines
Philippe :-)
Quoted 23 lines
--- drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/stm/drv.c +2
-1@@ -17,6 +17,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_fb_cma_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "ltdc.h" @@ -31,7 +32,7 @@ static void drv_output_poll_changed(struct drm_device *ddev) }static const struct drm_mode_config_funcs drv_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = drv_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 18/22 drm/sun4i: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_framebuffer.c +2 -1
@@ -12,6 +12,7 @@#include <drm/drm_atomic_helper.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drmP.h> #include "sun4i_drv.h"
@@ -28,7 +29,7 @@ static const struct drm_mode_config_funcs sun4i_de_mode_config_funcs = { .output_poll_changed = sun4i_de_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit, - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, };struct drm_fbdev_cma *sun4i_framebuffer_init (struct drm_device *drm)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 19/22 drm/tilcdc: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_drv.c +2 -1
@@ -23,6 +23,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "tilcdc_drv.h" #include "tilcdc_regs.h"
@@ -65,7 +66,7 @@ static struct of_device_id tilcdc_of_match[];static struct drm_framebuffer *tilcdc_fb_create (struct drm_device *dev,struct drm_file *file_priv,const struct drm_mode_fb_cmd2 *mode_cmd) { -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static void tilcdc_fb_output_poll_changed (struct drm_device *dev)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 19/22] drm/tilcdc: Use drm_gem_fb_create()
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 6 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
Quoted 18 lines
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/tilcdc/tilcdc_drv.c +1
-0@@ -23,6 +23,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "tilcdc_drv.h" #include "tilcdc_regs.h"
drivers/gpu/drm/tilcdc/tilcdc_drv.c static struct of_device_id tilcdc_of_match[]; · line 72
Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_drv.c +1
-1@@ -65,7 +66,7 @@ static struct of_device_id tilcdc_of_match[];static struct drm_framebuffer *tilcdc_fb_create (struct drm_device *dev,struct drm_file *file_priv,const struct drm_mode_fb_cmd2 *mode_cmd) { -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static void tilcdc_fb_output_poll_changed (struct drm_device *dev)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedRe: [PATCH v3 19/22] drm/tilcdc: Use drm_gem_fb_create()
Den 04.09.2017 09.59, skrev Jyri Sarha:
Quoted 10 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 6 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Jyri Sarha <[email protected]>Cc Tomi Valkeinen <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>Acked-by Jyri Sarha <[email protected]>
Thanks, applied to drm-misc.
Noralf.
Quoted 24 lines
Quoted 24 lines
--- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/tilcdc/tilcdc_drv.c +2
-1@@ -23,6 +23,7 @@#include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fb_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "tilcdc_drv.h" #include "tilcdc_regs.h" @@ -65,7 +66,7 @@ static struct of_device_id tilcdc_of_match[];static struct drm_framebuffer *tilcdc_fb_create (struct drm_device *dev,struct drm_file *file_priv,const struct drm_mode_fb_cmd2 *mode_cmd) { -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }
Quoted 4 lines
drivers/gpu/drm/tilcdc/tilcdc_drv.c static struct of_device_id tilcdc_of_match[]; · line 72
Quoted 2 lines
drivers/gpu/drm/tilcdc/tilcdc_drv.c +0
-0static void tilcdc_fb_output_poll_changed (struct drm_device *dev)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 20/22 drm/vc4: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/vc4/vc4_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/vc4/vc4_kms.c +2 -1
@@ -20,6 +20,7 @@#include <drm/drm_crtc_helper.h> #include <drm/drm_plane_helper.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include "vc4_drv.h" static void vc4_output_poll_changed (struct drm_device *dev)
@@ -189,7 +190,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, mode_cmd = &mode_cmd_local; } -return drm_fb_cma_create (dev, file_priv, mode_cmd); +return drm_gem_fb_create (dev, file_priv, mode_cmd); }static const struct drm_mode_config_funcs vc4_mode_funcs = {
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 20/22] drm/vc4: Use drm_gem_fb_create()
Quoted 2 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.
Looks like I should be using the default helper in place of vc4_prepare_fb(), too.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 21/22 drm/zte: Use drm_gem_fb_create()
In reply to Noralf Trønnesdrm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
--- drivers/gpu/drm/zte/zx_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/zte/zx_drm_drv.c +2 -1
@@ -22,6 +22,7 @@#include <drm/drm_fb_cma_helper.h> #include <drm/drm_fb_helper.h> #include <drm/drm_gem_cma_helper.h> +#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_of.h> #include <drm/drmP.h>
@@ -40,7 +41,7 @@ static void zx_drm_fb_output_poll_changed(struct drm_device *drm) }static const struct drm_mode_config_funcs zx_drm_mode_config_funcs = { - .fb_create = drm_fb_cma_create, + .fb_create = drm_gem_fb_create, .output_poll_changed = zx_drm_fb_output_poll_changed, .atomic_check = drm_atomic_helper_check, .atomic_commit = drm_atomic_helper_commit,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 21/22] drm/zte: Use drm_gem_fb_create()
Quoted 5 lines · Noralf Trønnes
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Shawn Guo <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Noralf Trønnes
AppliedRe: [PATCH v3 21/22] drm/zte: Use drm_gem_fb_create()
Den 17.08.2017 15.12, skrev Shawn Guo:
Quoted 7 lines · Noralf Trønnes
Quoted 5 lines
drm_fb_cma_create()is just a wrapper arounddrm_gem_fb_create()now, so use the function directly.Cc Shawn Guo <[email protected]>Signed-off-by Noralf Trønnes <[email protected]>Acked-by Shawn Guo <[email protected]>
Thanks, applied to drm-misc.
Noralf.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 22/22 drm/fb-cma-helper: Remove unused functions
In reply to Noralf TrønnesThe cma drivers use the drm_gem_framebuffer_helper functions now, so remove drm_fb_cma_destroy, drm_fb_cma_create_handle, drm_fb_cma_create_with_funcs, drm_fb_cma_create and drm_fb_cma_prepare_fb.
--- drivers/gpu/drm/drm_fb_cma_helper.c | 77 ++----------------------------------- include/drm/drm_fb_cma_helper.h | 13 ------- 2 files changed, 3 insertions(+), 87 deletions(-)
drivers/gpu/drm/drm_fb_cma_helper.c +3 -74
@@ -38,7 +38,7 @@ struct drm_fbdev_cma {* Provides helper functions for creating a cma (contiguous memory allocator) * backed framebuffer. * -* drm_fb_cma_create() is used in the &drm_mode_config_funcs.fb_create +* drm_gem_fb_create() is used in the &drm_mode_config_funcs.fb_create * callback function to create a cma backed framebuffer. * * An fbdev framebuffer backed by cma is also available by calling
@@ -61,8 +61,8 @@ struct drm_fbdev_cma {* } * * static struct drm_framebuffer_funcs driver_fb_funcs = { -* .destroy = drm_fb_cma_destroy, -* .create_handle = drm_fb_cma_create_handle, +* .destroy = drm_gem_fb_destroy, +* .create_handle = drm_gem_fb_create_handle, * .dirty = driver_fb_dirty, * }; *
@@ -80,57 +80,6 @@ static inline struct drm_fbdev_cma *to_fbdev_cma(struct drm_fb_helper *helper) return container_of(helper, struct drm_fbdev_cma, fb_helper); } -void drm_fb_cma_destroy (struct drm_framebuffer *fb) -{ -drm_gem_fb_destroy (fb); -} -EXPORT_SYMBOL (drm_fb_cma_destroy); - -int drm_fb_cma_create_handle (struct drm_framebuffer *fb, -struct drm_file *file_priv,unsigned int *handle) -{ -return drm_gem_fb_create_handle (fb, file_priv, handle); -} -EXPORT_SYMBOL (drm_fb_cma_create_handle); - -/** -* drm_fb_cma_create_with_funcs() - helper function for the -* &drm_mode_config_funcs.fb_create -* callback -* @dev: DRM device -* @file_priv: drm file for the ioctl call -* @mode_cmd: metadata from the userspace fb creation request -* @funcs: vtable to be used for the new framebuffer object -* -* This can be used to set &drm_framebuffer_funcs for drivers that need the -* &drm_framebuffer_funcs.dirty callback. Use drm_fb_cma_create() if you don't -* need to change &drm_framebuffer_funcs. -*/ -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, -const struct drm_framebuffer_funcs *funcs) -{ -return drm_gem_fb_create_with_funcs (dev, file_priv, mode_cmd, funcs); -} -EXPORT_SYMBOL_GPL (drm_fb_cma_create_with_funcs); - -/** -* drm_fb_cma_create() - &drm_mode_config_funcs.fb_create callback function -* @dev: DRM device -* @file_priv: drm file for the ioctl call -* @mode_cmd: metadata from the userspace fb creation request -* -* 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_gem_fb_create (dev, file_priv, mode_cmd); -} -EXPORT_SYMBOL_GPL (drm_fb_cma_create); -/** * drm_fb_cma_get_gem_obj() - Get CMA GEM object for framebuffer * @fb: The framebuffer
@@ -182,26 +131,6 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, }EXPORT_SYMBOL_GPL (drm_fb_cma_get_gem_addr); -/** -* drm_fb_cma_prepare_fb() - Prepare CMA framebuffer -* @plane: Which plane -* @state: Plane state attach fence to -* -* This should be set as the &struct drm_plane_helper_funcs.prepare_fb hook. -* -* This function checks if the plane FB has an dma-buf attached, extracts -* the exclusive fence and attaches it to plane state for the atomic helper -* to wait on. -* -* There is no need for cleanup_fb for CMA based framebuffer drivers. -*/ -int drm_fb_cma_prepare_fb (struct drm_plane *plane, -struct drm_plane_state *state) -{ -return drm_gem_fb_prepare_fb (plane, state); -} -EXPORT_SYMBOL_GPL (drm_fb_cma_prepare_fb); -#ifdef CONFIG_DEBUG_FS static void drm_fb_cma_describe (struct drm_framebuffer *fb,struct seq_file *m) {
include/drm/drm_fb_cma_helper.h +0 -13
@@ -28,16 +28,6 @@ void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, bool state);void drm_fbdev_cma_set_suspend_unlocked (struct drm_fbdev_cma *fbdev_cma,bool state); -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, -const 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); -struct drm_gem_cma_object *drm_fb_cma_get_gem_obj (struct drm_framebuffer *fb,unsigned int plane);
@@ -45,9 +35,6 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb,struct drm_plane_state *state, unsigned int plane); -int drm_fb_cma_prepare_fb (struct drm_plane *plane, -struct drm_plane_state *state); -#ifdef CONFIG_DEBUG_FS struct seq_file ;
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 22/22] drm/fb-cma-helper: Remove unused functions
Quoted 6 lines · Noralf Trønnes
The cma drivers use the
drm_gem_framebuffer_helperfunctions now, so removedrm_fb_cma_destroy,drm_fb_cma_create_handle,drm_fb_cma_create_with_funcs,drm_fb_cma_createanddrm_fb_cma_prepare_fb.Signed-off-by Noralf Trønnes <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel