diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2019-10-24 10:14:01 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2019-10-24 16:12:11 +0200 |
commit | 6542ad8918032a4af12b54d94f2822824777933e (patch) | |
tree | b67685c07ab8f110db88f41b54909b3f406ccb80 /include/drm/drm_gem_vram_helper.h | |
parent | 606be04724b6003bd00038c43eb9e1ae5e9c0993 (diff) |
drm/vram-helpers: Add helpers for prepare_fb() and cleanup_fb()
The new helpers pin and unpin a framebuffer's GEM VRAM objects during
plane updates. This should be sufficient for most drivers' implementation
of prepare_fb() and cleanup_fb().
v2:
* provide helpers for struct drm_simple_display_pipe_funcs
* rename plane-helper funcs
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191024081404.6978-2-tzimmermann@suse.de
Diffstat (limited to 'include/drm/drm_gem_vram_helper.h')
-rw-r--r-- | include/drm/drm_gem_vram_helper.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index b8ad4531ebb4..e040541a105f 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -13,6 +13,9 @@ #include <linux/kernel.h> /* for container_of() */ struct drm_mode_create_dumb; +struct drm_plane; +struct drm_plane_state; +struct drm_simple_display_pipe; struct drm_vram_mm_funcs; struct filp; struct vm_area_struct; @@ -124,6 +127,28 @@ int drm_gem_vram_driver_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset); +/* + * Helpers for struct drm_plane_helper_funcs + */ +int +drm_gem_vram_plane_helper_prepare_fb(struct drm_plane *plane, + struct drm_plane_state *new_state); +void +drm_gem_vram_plane_helper_cleanup_fb(struct drm_plane *plane, + struct drm_plane_state *old_state); + +/* + * Helpers for struct drm_simple_display_pipe_funcs + */ + +int drm_gem_vram_simple_display_pipe_prepare_fb( + struct drm_simple_display_pipe *pipe, + struct drm_plane_state *new_state); + +void drm_gem_vram_simple_display_pipe_cleanup_fb( + struct drm_simple_display_pipe *pipe, + struct drm_plane_state *old_state); + /** * define DRM_GEM_VRAM_DRIVER - default callback functions for \ &struct drm_driver |