diff options
author | Eric Anholt <eric@anholt.net> | 2015-11-30 18:55:13 (GMT) |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-12-08 04:01:48 (GMT) |
commit | 10028c5ab107d3765c7fc282b6c45324d1602155 (patch) | |
tree | 1491595bbf4ae97bbcee9b87ab3ae5648c6a9a16 /include/drm | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) | |
download | linux-10028c5ab107d3765c7fc282b6c45324d1602155.tar.xz |
drm: Create a driver hook for allocating GEM object structs.
The CMA helpers had no way for a driver to extend the struct with its
own fields. Since the CMA helpers are mostly "Allocate a
drm_gem_cma_object, then fill in a few fields", it's hard to write as
pure helpers without passing in a driver callback for the allocate
step.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drmP.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 0b921ae..22ff162 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -580,6 +580,13 @@ struct drm_driver { int (*gem_open_object) (struct drm_gem_object *, struct drm_file *); void (*gem_close_object) (struct drm_gem_object *, struct drm_file *); + /** + * Hook for allocating the GEM object struct, for use by core + * helpers. + */ + struct drm_gem_object *(*gem_create_object)(struct drm_device *dev, + size_t size); + /* prime: */ /* export handle -> fd (see drm_gem_prime_handle_to_fd() helper) */ int (*prime_handle_to_fd)(struct drm_device *dev, struct drm_file *file_priv, |