diff mbox series

[05/59] drm/prime: Make DRIVER_PRIME a no-op

Message ID 20190614203615.12639-6-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show
Series prime doc polish and ... a few cleanups | expand

Commit Message

Daniel Vetter June 14, 2019, 8:35 p.m. UTC
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.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_prime.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

Comments

Emil Velikov June 17, 2019, 5:53 p.m. UTC | #1
On 2019/06/14, Daniel Vetter wrote:
> 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.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/drm_prime.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
> index f08159a8b03a..78f6f10b2060 100644
> --- a/drivers/gpu/drm/drm_prime.c
> +++ b/drivers/gpu/drm/drm_prime.c
> @@ -47,8 +47,7 @@
>   * between applications, they can't be guessed like the globally unique GEM
>   * names.
>   *
> - * Drivers that support the PRIME API must set the DRIVER_PRIME bit in the
> - * &drm_driver.driver_features field, and implement the
> + * Drivers that support the PRIME API implement the
>   * &drm_driver.prime_handle_to_fd and &drm_driver.prime_fd_to_handle operations.
>   * GEM based drivers must use drm_gem_prime_handle_to_fd() an
>   * drm_gem_prime_fd_to_handle() to implement these. For GEM based drivers the
> @@ -361,9 +360,6 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
>  {
>  	struct drm_prime_handle *args = data;
>  
> -	if (!drm_core_check_feature(dev, DRIVER_PRIME))
> -		return -EOPNOTSUPP;
> -
>  	if (!dev->driver->prime_fd_to_handle)
>  		return -ENOSYS;
>  
Userspace will see a trivial change here EOPNOTSUPP vs ENOSYS. Although
I seriously doubt they had such fine-grained error checking and fallback
paths.

Please mention the changed return value in the commit message.

Thanks
Emil
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index f08159a8b03a..78f6f10b2060 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -47,8 +47,7 @@ 
  * between applications, they can't be guessed like the globally unique GEM
  * names.
  *
- * Drivers that support the PRIME API must set the DRIVER_PRIME bit in the
- * &drm_driver.driver_features field, and implement the
+ * Drivers that support the PRIME API implement the
  * &drm_driver.prime_handle_to_fd and &drm_driver.prime_fd_to_handle operations.
  * GEM based drivers must use drm_gem_prime_handle_to_fd() an
  * drm_gem_prime_fd_to_handle() to implement these. For GEM based drivers the
@@ -361,9 +360,6 @@  int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
 {
 	struct drm_prime_handle *args = data;
 
-	if (!drm_core_check_feature(dev, DRIVER_PRIME))
-		return -EOPNOTSUPP;
-
 	if (!dev->driver->prime_fd_to_handle)
 		return -ENOSYS;
 
@@ -512,9 +508,6 @@  int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
 {
 	struct drm_prime_handle *args = data;
 
-	if (!drm_core_check_feature(dev, DRIVER_PRIME))
-		return -EOPNOTSUPP;
-
 	if (!dev->driver->prime_handle_to_fd)
 		return -ENOSYS;