diff options
author | Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> | 2018-07-11 23:01:47 -0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-07-12 08:47:44 +0200 |
commit | 559e50fd34d1c556d42016cbb9affce89cee9ea4 (patch) | |
tree | 696206e14e5076b430d9414291fe0b5b93e53e82 /drivers/gpu/drm/vkms/vkms_drv.h | |
parent | ae61f61fa802c829fa8d505587f9b337e63ea586 (diff) | |
download | linux-559e50fd34d1c556d42016cbb9affce89cee9ea4.tar.gz linux-559e50fd34d1c556d42016cbb9affce89cee9ea4.tar.bz2 linux-559e50fd34d1c556d42016cbb9affce89cee9ea4.zip |
drm/vkms: Add dumb operations
VKMS currently does not handle dumb data, and as a consequence, it does
not provide mechanisms for handling gem. This commit adds the necessary
support for gem object/handler and the dumb functions.
Changes since V1:
Daniel Vetter:
- Add dumb buffer support to the same patchset
Changes since V2:
Haneen:
- Add missing gem_free_object_unlocked callback to fix the warning
"Memory manager not clean during takedown"
Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/70b7becc91c6a323dbc15cb5fc912cbdfe4ef7d9.1531359228.git.rodrigosiqueiramelo@gmail.com
Diffstat (limited to 'drivers/gpu/drm/vkms/vkms_drv.h')
-rw-r--r-- | drivers/gpu/drm/vkms/vkms_drv.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h index b0f9d2e61a42..cce4694cafb9 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.h +++ b/drivers/gpu/drm/vkms/vkms_drv.h @@ -3,6 +3,7 @@ #include <drm/drmP.h> #include <drm/drm.h> +#include <drm/drm_gem.h> #include <drm/drm_encoder.h> static const u32 vkms_formats[] = { @@ -21,6 +22,12 @@ struct vkms_device { struct vkms_output output; }; +struct vkms_gem_object { + struct drm_gem_object gem; + struct mutex pages_lock; /* Page lock used in page fault handler */ + struct page **pages; +}; + int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, struct drm_plane *primary, struct drm_plane *cursor); @@ -28,4 +35,20 @@ int vkms_output_init(struct vkms_device *vkmsdev); struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev); +/* Gem stuff */ +struct drm_gem_object *vkms_gem_create(struct drm_device *dev, + struct drm_file *file, + u32 *handle, + u64 size); + +int vkms_gem_fault(struct vm_fault *vmf); + +int vkms_dumb_create(struct drm_file *file, struct drm_device *dev, + struct drm_mode_create_dumb *args); + +int vkms_dumb_map(struct drm_file *file, struct drm_device *dev, + u32 handle, u64 *offset); + +void vkms_gem_free_object(struct drm_gem_object *obj); + #endif /* _VKMS_DRV_H_ */ |