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
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch --- 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
diff --git a/Documentation/gpu/drm-kms-helpers.rst b/Documentation/gpu/drm-kms-helpers.rst index 7c5e254..13dd237 100644 --- a/Documentation/gpu/drm-kms-helpers.rst +++ b/Documentation/gpu/drm-kms-helpers.rst @@ -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: diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 24a066e..a8acc19 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -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 diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c new file mode 100644 index 0000000..068a630 --- /dev/null +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -0,0 +1,283 @@ +/* + * drm gem framebuffer helper functions + * + * Copyright (C) 2017 Noralf Trønnes + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include <linux/dma-buf.h> +#include <linux/dma-fence.h> +#include <linux/reservation.h> +#include <linux/slab.h> + +#include <drm/drmP.h> +#include <drm/drm_atomic.h> +#include <drm/drm_fb_helper.h> +#include <drm/drm_fourcc.h> +#include <drm/drm_framebuffer.h> +#include <drm/drm_gem.h> +#include <drm/drm_gem_framebuffer_helper.h> +#include <drm/drm_modeset_helper.h> + +/** + * DOC: overview + * + * This library provides helpers for drivers that don't subclass + * &drm_framebuffer and and use &drm_gem_object for their backing storage. + * + * 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. + */ + +/** + * drm_gem_fb_get_obj() - Get GEM object for framebuffer + * @fb: The framebuffer + * @plane: Which plane + * + * Returns the GEM object for given framebuffer. + */ +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]; +} +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; + + 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); + } + + 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 structure + * itself. Drivers can use this as their &drm_framebuffer_funcs->destroy + * callback. + */ +void drm_gem_fb_destroy(struct drm_framebuffer *fb) +{ + int i; + + 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 + * @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(struct drm_framebuffer *fb, struct drm_file *file, + unsigned int *handle) +{ + return drm_gem_handle_create(file, fb->obj[0], handle); +} +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 + * @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_gem_fb_create() if you don't + * need to change &drm_framebuffer_funcs. + * The function does buffer size validation. + */ +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; + + 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"); + ret = -ENOENT; + goto err_gem_object_put; + } + + min_size = (height - 1) * mode_cmd->pitches[i] + + width * info->cpp[i] + + mode_cmd->offsets[i]; + + 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); + 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]); + + 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, +}; + +/** + * 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. Use drm_gem_fb_create_with_funcs() if you need to set + * &drm_framebuffer_funcs.dirty. + */ +struct drm_framebuffer * +drm_gem_fb_create(struct drm_device *dev, struct drm_file *file, + const struct drm_mode_fb_cmd2 *mode_cmd) +{ + 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 + * + * 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 + * 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. + */ +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) + 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); diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h index 5244f05..b6996dd 100644 --- a/include/drm/drm_framebuffer.h +++ b/include/drm/drm_framebuffer.h @@ -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) diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h new file mode 100644 index 0000000..db9cfa0 --- /dev/null +++ b/include/drm/drm_gem_framebuffer_helper.h @@ -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
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
Thanks, applied to drm-misc.
Noralf.
Hi Noralf,
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Hi Noralf,
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
On Wed, Aug 16, 2017 at 11:03 PM, Noralf Trønnes noralf@tronnes.org wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Hi Noralf,
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
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
Hi Daniel,
On Wednesday 16 Aug 2017 23:06:30 Daniel Vetter wrote:
On Wed, Aug 16, 2017 at 11:03 PM, Noralf Trønnes noralf@tronnes.org wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
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.
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 ;-)
On Wed, Aug 16, 2017 at 11:11 PM, Laurent Pinchart laurent.pinchart@ideasonboard.com wrote:
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
Den 16.08.2017 23.13, skrev Daniel Vetter:
On Wed, Aug 16, 2017 at 11:11 PM, Laurent Pinchart laurent.pinchart@ideasonboard.com wrote:
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).
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.
Hi Noralf,
On Wednesday 16 Aug 2017 23:31:23 Noralf Trønnes wrote:
Den 16.08.2017 23.13, skrev Daniel Vetter:
On Wed, Aug 16, 2017 at 11:11 PM, Laurent Pinchart wrote:
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).
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.
Hi Noralf,
On Wednesday 16 Aug 2017 23:03:36 Noralf Trønnes wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
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.
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) ?
Den 16.08.2017 23.08, skrev Laurent Pinchart:
Hi Noralf,
On Wednesday 16 Aug 2017 23:03:36 Noralf Trønnes wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
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.
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.
Hi Noralf,
On Wednesday 16 Aug 2017 23:24:50 Noralf Trønnes wrote:
Den 16.08.2017 23.08, skrev Laurent Pinchart:
On Wednesday 16 Aug 2017 23:03:36 Noralf Trønnes wrote:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes: > 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. > > Signed-off-by: Noralf Trønnes noralf@tronnes.org > Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch > --- > +/** > + * 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
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.
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.
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.
Noralf Trønnes noralf@tronnes.org writes:
Den 16.08.2017 22.39, skrev Laurent Pinchart:
Hi Noralf,
On Wednesday 16 Aug 2017 21:52:02 Noralf Trønnes wrote:
Den 16.08.2017 19.24, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
+/**
- 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,
Reviewed-by: Eric Anholt eric@anholt.net
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.
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.
Ni Noralf,
Thank you for the patch.
On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
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]
diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c new file mode 100644 index 0000000..068a630 --- /dev/null +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -0,0 +1,283 @@
[snip]
+/**
- DOC: overview
- This library provides helpers for drivers that don't subclass
- &drm_framebuffer and and use &drm_gem_object for their backing storage.
s/and and/and/
- 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." ?
- */
+/**
- 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.
- */
+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];
+} +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.
- 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);
- }
- 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/
structure
- itself. Drivers can use this as their &drm_framebuffer_funcs->destroy
- callback.
- */
+void drm_gem_fb_destroy(struct drm_framebuffer *fb) +{
- int i;
i is never negative, you can make it an unsigned int.
- 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.
- @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(struct drm_framebuffer *fb, struct drm_file *file,
unsigned int *handle)
+{
- return drm_gem_handle_create(file, fb->obj[0], handle);
+} +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.
- @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_gem_fb_create() if you
don't
- need to change &drm_framebuffer_funcs.
- The function does buffer size validation.
- */
+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.
- 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.
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.
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);
- 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.
- 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.
+/**
- 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. Use drm_gem_fb_create_with_funcs() if you need to set
- &drm_framebuffer_funcs.dirty.
- */
+struct drm_framebuffer * +drm_gem_fb_create(struct drm_device *dev, struct drm_file *file,
const struct drm_mode_fb_cmd2 *mode_cmd)
+{
- 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 :-)
- 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/
- 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.
- */
+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.
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]
diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h new file mode 100644 index 0000000..db9cfa0 --- /dev/null +++ b/include/drm/drm_gem_framebuffer_helper.h @@ -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.
+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
Hi Noralf,
One additional comment.
On Wednesday 16 Aug 2017 23:37:54 Laurent Pinchart wrote:
On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
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]
diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c new file mode 100644 index 0000000..068a630 --- /dev/null +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -0,0 +1,283 @@
[snip]
+/**
- DOC: overview
- This library provides helpers for drivers that don't subclass
- &drm_framebuffer and and use &drm_gem_object for their backing
storage.
s/and and/and/
- 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." ?
- */
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]
Den 16.08.2017 22.50, skrev Laurent Pinchart:
Hi Noralf,
One additional comment.
On Wednesday 16 Aug 2017 23:37:54 Laurent Pinchart wrote:
On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
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]
diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c new file mode 100644 index 0000000..068a630 --- /dev/null +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -0,0 +1,283 @@
[snip]
+/**
- DOC: overview
- This library provides helpers for drivers that don't subclass
- &drm_framebuffer and and use &drm_gem_object for their backing
storage.
s/and and/and/
- 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." ?
- */
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.
On Sat, Aug 19, 2017 at 04:46:30PM +0200, Noralf Trønnes wrote:
Den 16.08.2017 22.50, skrev Laurent Pinchart:
Hi Noralf,
One additional comment.
On Wednesday 16 Aug 2017 23:37:54 Laurent Pinchart wrote:
On Sunday 13 Aug 2017 15:31:44 Noralf Trønnes wrote:
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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org Reviewed-by: Daniel Vetter daniel.vetter@ffwll.ch
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]
diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c new file mode 100644 index 0000000..068a630 --- /dev/null +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -0,0 +1,283 @@
[snip]
+/**
- DOC: overview
- This library provides helpers for drivers that don't subclass
- &drm_framebuffer and and use &drm_gem_object for their backing
storage.
s/and and/and/
- 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." ?
- */
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.
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
Use the new drm_gem_framebuffer_helper who's code was copied from this helper.
Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/drm_fb_cma_helper.c | 181 ++++++------------------------------ 1 file changed, 30 insertions(+), 151 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index ade319d..e1befee 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -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);
Noralf Trønnes noralf@tronnes.org writes:
Use the new drm_gem_framebuffer_helper who's code was copied from this helper.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_fb_cma_helper.c | 181 ++++++------------------------------ 1 file changed, 30 insertions(+), 151 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index ade319d..e1befee 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -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);
}
Stray whitespace. Other than that,
Reviewed-by: Eric Anholt eric@anholt.net
Feel free to push vc4 and pl111 with this patch.
Den 16.08.2017 19.33, skrev Eric Anholt:
Noralf Trønnes noralf@tronnes.org writes:
Use the new drm_gem_framebuffer_helper who's code was copied from this helper.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/drm_fb_cma_helper.c | 181 ++++++------------------------------ 1 file changed, 30 insertions(+), 151 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index ade319d..e1befee 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -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);
- }
Stray whitespace. Other than that,
Reviewed-by: Eric Anholt eric@anholt.net
Feel free to push vc4 and pl111 with this patch.
Thanks Eric, this patch, vc4 and pl111 applied to drm-misc.
Noralf.
Use drm_gem_framebuffer_helper directly instead of the cma library wrappers.
Signed-off-by: Noralf Trønnes noralf@tronnes.org --- 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(-)
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c index 551709e..1a8a57c 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-core.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-core.c @@ -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); }
diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c index 177e9d8..fc447c9 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c @@ -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);
diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 2caeabc..63831ab 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -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, };
diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 30dc97b..0b7a9be 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c @@ -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, };
diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index 1b39d3f..51270dd 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c @@ -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, };
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Alexey Brodkin abrodkin@synopsys.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/arc/arcpgu_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c index f75c341..0e7867b 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -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,
Hi Noralf,
-----Original Message----- From: Noralf Trønnes [mailto:noralf@tronnes.org] Sent: Sunday, August 13, 2017 4:32 PM To: dri-devel@lists.freedesktop.org Cc: daniel.vetter@ffwll.ch; Alexey.Brodkin@synopsys.com; alison.wang@freescale.com; benjamin.gaignard@linaro.org; boris.brezillon@free-electrons.com; brian.starkey@arm.com; puck.chen@hisilicon.com; eric@anholt.net; jsarha@ti.com; laurent.pinchart@ideasonboard.com; liviu.dudau@arm.com; marex@denx.de; maxime.ripard@free-electrons.com; narmstrong@baylibre.com; philippe.cornu@st.com; p.zabel@pengutronix.de; zourongrong@gmail.com; shawnguo@kernel.org; stefan@agner.ch; tomi.valkeinen@ti.com; vincent.abriou@st.com; z.liuxinliang@hisilicon.com; kong.kongxinwei@hisilicon.com; yannick.fertre@st.com; Noralf Trønnes noralf@tronnes.org Subject: [PATCH v3 04/22] drm/arc: Use drm_gem_fb_create()
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Acked-by: Alexey Brodkin abrodkin@synopsys.com
Den 28.08.2017 13.36, skrev Alexey Brodkin:
Hi Noralf,
-----Original Message----- From: Noralf Trønnes [mailto:noralf@tronnes.org] Sent: Sunday, August 13, 2017 4:32 PM To: dri-devel@lists.freedesktop.org Cc: daniel.vetter@ffwll.ch; Alexey.Brodkin@synopsys.com; alison.wang@freescale.com; benjamin.gaignard@linaro.org; boris.brezillon@free-electrons.com; brian.starkey@arm.com; puck.chen@hisilicon.com; eric@anholt.net; jsarha@ti.com; laurent.pinchart@ideasonboard.com; liviu.dudau@arm.com; marex@denx.de; maxime.ripard@free-electrons.com; narmstrong@baylibre.com; philippe.cornu@st.com; p.zabel@pengutronix.de; zourongrong@gmail.com; shawnguo@kernel.org; stefan@agner.ch; tomi.valkeinen@ti.com; vincent.abriou@st.com; z.liuxinliang@hisilicon.com; kong.kongxinwei@hisilicon.com; yannick.fertre@st.com; Noralf Trønnes noralf@tronnes.org Subject: [PATCH v3 04/22] drm/arc: Use drm_gem_fb_create()
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Acked-by: Alexey Brodkin abrodkin@synopsys.com
Thanks, applied to drm-misc.
Noralf.
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Liviu Dudau liviu.dudau@arm.com Cc: Brian Starkey brian.starkey@arm.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/arm/hdlcd_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index f9bda7b..764d0c8 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -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,
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Liviu Dudau liviu.dudau@arm.com Cc: Brian Starkey brian.starkey@arm.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/arm/malidp_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 1a57cc2..b894466 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -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,
Hi Noralf,
On Sun, Aug 13, 2017 at 03:31:49PM +0200, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Liviu Dudau liviu.dudau@arm.com
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 liviu.dudau@arm.com
Thanks, Liviu
Cc: Brian Starkey brian.starkey@arm.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/arm/malidp_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 1a57cc2..b894466 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -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,
-- 2.7.4
Den 25.08.2017 12.48, skrev Liviu Dudau:
Hi Noralf,
On Sun, Aug 13, 2017 at 03:31:49PM +0200, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Liviu Dudau liviu.dudau@arm.com
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 liviu.dudau@arm.com
Thanks, applied to drm-misc.
Noralf.
Thanks, Liviu
Cc: Brian Starkey brian.starkey@arm.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/arm/malidp_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 1a57cc2..b894466 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -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,
-- 2.7.4
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Boris Brezillon boris.brezillon@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- 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(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 74d66e1..c6e8061 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -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) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index 4237b04..6833ee2 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -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>
Le Sun, 13 Aug 2017 15:31:50 +0200, Noralf Trønnes noralf@tronnes.org a écrit :
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Boris Brezillon boris.brezillon@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Boris Brezillon boris.brezillon@free-electrons.com
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(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 74d66e1..c6e8061 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -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) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index 4237b04..6833ee2 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -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>
Den 17.08.2017 09.25, skrev Boris Brezillon:
Le Sun, 13 Aug 2017 15:31:50 +0200, Noralf Trønnes noralf@tronnes.org a écrit :
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Boris Brezillon boris.brezillon@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Boris Brezillon boris.brezillon@free-electrons.com
Thanks, applied to drm-misc.
Noralf.
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(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index 74d66e1..c6e8061 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -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)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h index 4237b04..6833ee2 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h @@ -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>
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Stefan Agner stefan@agner.ch Cc: Alison Wang alison.wang@freescale.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c index d9d6cc1..ddc68e4 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c @@ -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)
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Xinliang Liu z.liuxinliang@hisilicon.com Cc: Rongrong Zou zourongrong@gmail.com Cc: Xinwei Kong kong.kongxinwei@hisilicon.com Cc: Chen Feng puck.chen@hisilicon.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index 79fcce7..7a06d3b 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -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,
drm_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.
Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index f91cb72..93c7e3f 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -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, diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index debde2d..82e1c50 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -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,
Hi Noralf,
On Sun, 2017-08-13 at 15:31 +0200, Noralf Trønnes wrote:
drm_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.
Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index f91cb72..93c7e3f 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -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,
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index debde2d..82e1c50 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -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,
Acked-by: Philipp Zabel p.zabel@pengutronix.de
thanks Philipp
Den 11.09.2017 09.57, skrev Philipp Zabel:
Hi Noralf,
On Sun, 2017-08-13 at 15:31 +0200, Noralf Trønnes wrote:
drm_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.
Cc: Philipp Zabel p.zabel@pengutronix.de Signed-off-by: Noralf Trønnes noralf@tronnes.org
drivers/gpu/drm/imx/imx-drm-core.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index f91cb72..93c7e3f 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -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,
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index debde2d..82e1c50 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -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,
Acked-by: Philipp Zabel p.zabel@pengutronix.de
Thanks, applied to drm-misc.
Noralf.
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Neil Armstrong narmstrong@baylibre.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/meson/meson_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index 5375e6d..5eaf9a4 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -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)
drm_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.
Cc: Marek Vasut marex@denx.de Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index 93c38eb..91a4579 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -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 = {
drm_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.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/pl111/pl111_display.c | 3 ++- drivers/gpu/drm/pl111/pl111_drv.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c index f0139fa..b58c988 100644 --- a/drivers/gpu/drm/pl111/pl111_display.c +++ b/drivers/gpu/drm/pl111/pl111_display.c @@ -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 = { diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 0ea3ca8..581c452 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -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, };
Noralf Trønnes noralf@tronnes.org writes:
drm_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.
Reviewed-by: Eric Anholt eric@anholt.net
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 5d681ea..de0691a 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -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)
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/shmobile/shmob_drm_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_kms.c b/drivers/gpu/drm/shmobile/shmob_drm_kms.c index 388a0fc..d36919b 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_kms.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_kms.c @@ -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 = {
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/sti/sti_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 1700c54..9e93431 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -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,
Hi Noralf,
On 08/13/2017 03:31 PM, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Vincent Abriou vincent.abriou@st.com
drivers/gpu/drm/sti/sti_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 1700c54..9e93431 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -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,
Den 21.08.2017 09.53, skrev Vincent ABRIOU:
Hi Noralf,
On 08/13/2017 03:31 PM, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Vincent Abriou vincent.abriou@st.com
Thanks, applied to drm-misc.
Noralf.
drivers/gpu/drm/sti/sti_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 1700c54..9e93431 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -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,
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Yannick Fertre yannick.fertre@st.com Cc: Philippe Cornu philippe.cornu@st.com Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index b333b37..c857663 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -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,
Hi Noralf, Many thanks for your patchset (and sorry for this late reply due to summer holidays :-),
On 08/13/2017 03:32 PM, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Yannick Fertre yannick.fertre@st.com Cc: Philippe Cornu philippe.cornu@st.com Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Philippe Cornu philippe.cornu@st.com Tested-by: Philippe Cornu philippe.cornu@st.com
Philippe :-)
drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index b333b37..c857663 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -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,
Den 01.09.2017 13.28, skrev Philippe CORNU:
Hi Noralf, Many thanks for your patchset (and sorry for this late reply due to summer holidays :-),
On 08/13/2017 03:32 PM, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Yannick Fertre yannick.fertre@st.com Cc: Philippe Cornu philippe.cornu@st.com Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Philippe Cornu philippe.cornu@st.com Tested-by: Philippe Cornu philippe.cornu@st.com
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.
Philippe :-)
drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index b333b37..c857663 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -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,
On Sat, Sep 02, 2017 at 02:45:36PM +0200, Noralf Trønnes wrote:
Den 01.09.2017 13.28, skrev Philippe CORNU:
Hi Noralf, Many thanks for your patchset (and sorry for this late reply due to summer holidays :-),
On 08/13/2017 03:32 PM, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Yannick Fertre yannick.fertre@st.com Cc: Philippe Cornu philippe.cornu@st.com Cc: Benjamin Gaignard benjamin.gaignard@linaro.org Cc: Vincent Abriou vincent.abriou@st.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Philippe Cornu philippe.cornu@st.com Tested-by: Philippe Cornu philippe.cornu@st.com
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
Noralf.
Philippe :-)
drivers/gpu/drm/stm/drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c index b333b37..c857663 100644 --- a/drivers/gpu/drm/stm/drv.c +++ b/drivers/gpu/drm/stm/drv.c @@ -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,
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Maxime Ripard maxime.ripard@free-electrons.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c index 9872e0f..2992f0a 100644 --- a/drivers/gpu/drm/sun4i/sun4i_framebuffer.c +++ b/drivers/gpu/drm/sun4i/sun4i_framebuffer.c @@ -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)
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Jyri Sarha jsarha@ti.com Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index b0d70f9..146ac9a 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -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)
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
On 08/13/17 16:32, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Jyri Sarha jsarha@ti.com Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Jyri Sarha jsarha@ti.com
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index b0d70f9..146ac9a 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -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)
Den 04.09.2017 09.59, skrev Jyri Sarha:
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
On 08/13/17 16:32, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Jyri Sarha jsarha@ti.com Cc: Tomi Valkeinen tomi.valkeinen@ti.com Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Jyri Sarha jsarha@ti.com
Thanks, applied to drm-misc.
Noralf.
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index b0d70f9..146ac9a 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -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)
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Eric Anholt eric@anholt.net Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/vc4/vc4_kms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index dfe7554..50c4959 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -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 = {
Noralf Trønnes noralf@tronnes.org writes:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Reviewed-by: Eric Anholt eric@anholt.net
Looks like I should be using the default helper in place of vc4_prepare_fb(), too.
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Shawn Guo shawnguo@kernel.org Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/zte/zx_drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index 4524482..e8b8266 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -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,
On Sun, Aug 13, 2017 at 03:32:04PM +0200, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Shawn Guo shawnguo@kernel.org Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Shawn Guo shawnguo@kernel.org
Den 17.08.2017 15.12, skrev Shawn Guo:
On Sun, Aug 13, 2017 at 03:32:04PM +0200, Noralf Trønnes wrote:
drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now, so use the function directly.
Cc: Shawn Guo shawnguo@kernel.org Signed-off-by: Noralf Trønnes noralf@tronnes.org
Acked-by: Shawn Guo shawnguo@kernel.org
Thanks, applied to drm-misc.
Noralf.
The 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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org --- drivers/gpu/drm/drm_fb_cma_helper.c | 77 ++----------------------------------- include/drm/drm_fb_cma_helper.h | 13 ------- 2 files changed, 3 insertions(+), 87 deletions(-)
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index e1befee..1a06b97 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -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) { diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h index a323781..023f052 100644 --- a/include/drm/drm_fb_cma_helper.h +++ b/include/drm/drm_fb_cma_helper.h @@ -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;
Noralf Trønnes noralf@tronnes.org writes:
The 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.
Signed-off-by: Noralf Trønnes noralf@tronnes.org
Reviewed-by: Eric Anholt eric@anholt.net
dri-devel@lists.freedesktop.org