Skip to content

Commit ee8375d

Browse files
committed
drm/prime: Make DRIVER_PRIME a no-op
Drivers must fill out the handle_to_fd and fd_to_handle hooks to enable export/import prime functionality already. The additional DRIVER_PRIME flag doesn't serve any real purpose, since the overall flag doesn't even tell you whether import or export or maybe even both is supported. Ditch it. This patch just makes it defunct, subsequent patches will remove it from all the drivers. Note this changes the userspace visible errno in some situations from EOPNOTSUPP to ENOSYS. Userspace already needs to treat both as "no prime support", so this should break anything. v2: Improve commit message as suggested by Emil Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-6-daniel.vetter@ffwll.ch
1 parent ae75f83 commit ee8375d

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎drivers/gpu/drm/drm_prime.c‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
* between applications, they can't be guessed like the globally unique GEM
4848
* names.
4949
*
50-
* Drivers that support the PRIME API must set the DRIVER_PRIME bit in the
51-
* &drm_driver.driver_features field, and implement the
50+
* Drivers that support the PRIME API implement the
5251
* &drm_driver.prime_handle_to_fd and &drm_driver.prime_fd_to_handle operations.
5352
* GEM based drivers must use drm_gem_prime_handle_to_fd() and
5453
* drm_gem_prime_fd_to_handle() to implement these. For GEM based drivers the
@@ -363,9 +362,6 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
363362
{
364363
struct drm_prime_handle *args = data;
365364

366-
if (!drm_core_check_feature(dev, DRIVER_PRIME))
367-
return -EOPNOTSUPP;
368-
369365
if (!dev->driver->prime_fd_to_handle)
370366
return -ENOSYS;
371367

@@ -514,9 +510,6 @@ int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
514510
{
515511
struct drm_prime_handle *args = data;
516512

517-
if (!drm_core_check_feature(dev, DRIVER_PRIME))
518-
return -EOPNOTSUPP;
519-
520513
if (!dev->driver->prime_handle_to_fd)
521514
return -ENOSYS;
522515

0 commit comments

Comments
 (0)