diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2021-11-30 10:52:55 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-12-02 11:12:39 +0100 |
commit | 4ff22f487f8c26b99cbe1678344595734c001a39 (patch) | |
tree | 02fd49b249e5a1e9d4242caa88668d91fdf65d72 /include | |
parent | 2696f9010d21aee60be06b2135806e11c79ded8b (diff) | |
download | linux-4ff22f487f8c26b99cbe1678344595734c001a39.tar.bz2 |
drm: Return error codes from struct drm_driver.gem_create_object
GEM helper libraries use struct drm_driver.gem_create_object to let
drivers override GEM object allocation. On failure, the call returns
NULL.
Change the semantics to make the calls return a pointer-encoded error.
This aligns the callback with its callers. Fixes the ingenic driver,
which already returns an error pointer.
Also update the callers to handle the involved types more strictly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Steven Price <steven.price@arm.com>
Acked-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20211130095255.26710-1-tzimmermann@suse.de
Diffstat (limited to 'include')
-rw-r--r-- | include/drm/drm_drv.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h index da0c836fe8e1..f6159acb8856 100644 --- a/include/drm/drm_drv.h +++ b/include/drm/drm_drv.h @@ -291,8 +291,9 @@ struct drm_driver { /** * @gem_create_object: constructor for gem objects * - * Hook for allocating the GEM object struct, for use by the CMA and - * SHMEM GEM helpers. + * Hook for allocating the GEM object struct, for use by the CMA + * and SHMEM GEM helpers. Returns a GEM object on success, or an + * ERR_PTR()-encoded error code otherwise. */ struct drm_gem_object *(*gem_create_object)(struct drm_device *dev, size_t size); |