diff options
author | Dave Airlie <airlied@redhat.com> | 2017-08-20 22:52:26 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-08-20 22:52:26 +0300 |
commit | 54e0aa649a5af99180369f9a0a2014f5d25bc264 (patch) | |
tree | 9e502f1f39c740ff7417e5078cbda6eedac1c572 /include/drm | |
parent | 8824c751eb61ebffb053c291199932845bac88b4 (diff) | |
parent | 0e8841ec7ee5b1ffe416c3be7743985b1896ec00 (diff) | |
download | linux-54e0aa649a5af99180369f9a0a2014f5d25bc264.tar.xz |
Merge tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc into drm-next
Cross-subsystem Changes:
- Add tinydrm to MAINTAINERS using -misc tree and Noralf as maintainer (Noralf)
Core Changes:
- Finish dumb_mmap_offset cleanup by removing gem_cma_dumb_map_offset() (Noralf)
- Add gem_framebuffer helper to facilitate removal of fb_cma cargo cult (Noralf)
Driver Changes:
- Various trivial patches
Cc: Noralf Trønnes <noralf@tronnes.org>
* tag 'drm-misc-next-2017-08-18' of git://anongit.freedesktop.org/git/drm-misc:
drm: udl: constify usb_device_id
drm/gma500: fix potential NULL pointer dereference dereference
drm/tinydrm: make function st7586_pipe_enable static
MAINTAINERS: Add drm/tinydrm maintainer entry
drm/vc4: Use drm_gem_fb_create()
drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
drm/fb-cma-helper: Use drm_gem_framebuffer_helper
drm: Add GEM backed framebuffer library
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_framebuffer.h | 7 | ||||
-rw-r--r-- | include/drm/drm_gem_framebuffer_helper.h | 37 |
2 files changed, 44 insertions, 0 deletions
diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h index 5244f059d23a..b6996ddb19d6 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 000000000000..db9cfa07235e --- /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 |