diff mbox

[3/4] drm: use drmIoctl everywhere

Message ID 1423654968-10553-3-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Feb. 11, 2015, 11:42 a.m. UTC
Well just core drm. All the other callers in there that still use
direct calls to ioctl have some custom retry logic already, so should
be good already.

freedreno/kgsl ahas all the other bare ioctl calls, dunnot what to do
about that.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 xf86drm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rob Clark Feb. 11, 2015, 12:21 p.m. UTC | #1
On Wed, Feb 11, 2015 at 6:42 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Well just core drm. All the other callers in there that still use
> direct calls to ioctl have some custom retry logic already, so should
> be good already.
>
> freedreno/kgsl ahas all the other bare ioctl calls, dunnot what to do
> about that.

fwiw, the freedreno/kgsl bare ioctls are actually against the non-drm
device file..  freedreno/msm is the stuff for the upstream drm/msm
driver.

background: downstream android kernel w/ kgsl kernel driver has this
shim drm driver which is really just for getting flink names + non drm
device for everything else.  It's kinda bonghits, really just exists
to give folks stuck w/ android drivers a fighting chance.  And due to
different versions of kgsl floating around on the many different
android kernel branches, odds are still pretty grim (which is why kgsl
backend is disabled by default)

I guess technically they could still use drmIoctl() but it seemed a bit strange

BR,
-R


> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  xf86drm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index fb673b58afb3..263d6835c29a 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -2543,12 +2543,12 @@ void drmCloseOnce(int fd)
>
>  int drmSetMaster(int fd)
>  {
> -       return ioctl(fd, DRM_IOCTL_SET_MASTER, 0);
> +       return drmIoctl(fd, DRM_IOCTL_SET_MASTER, 0);
>  }
>
>  int drmDropMaster(int fd)
>  {
> -       return ioctl(fd, DRM_IOCTL_DROP_MASTER, 0);
> +       return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, 0);
>  }
>
>  char *drmGetDeviceNameFromFd(int fd)
> --
> 2.1.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Emil Velikov Feb. 11, 2015, 1:13 p.m. UTC | #2
On 11 February 2015 at 11:42, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Well just core drm. All the other callers in there that still use
> direct calls to ioctl have some custom retry logic already, so should
> be good already.
>
Afaics intel/intel_bufmgr_gem.c has one instance, plus most of the tests.

> freedreno/kgsl ahas all the other bare ioctl calls, dunnot what to do
> about that.
>
s/ahas/has/ if you choose to keep this note.

> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>

-Emil
Daniel Vetter Feb. 11, 2015, 2:34 p.m. UTC | #3
On Wed, Feb 11, 2015 at 01:13:26PM +0000, Emil Velikov wrote:
> On 11 February 2015 at 11:42, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Well just core drm. All the other callers in there that still use
> > direct calls to ioctl have some custom retry logic already, so should
> > be good already.
> >
> Afaics intel/intel_bufmgr_gem.c has one instance, plus most of the tests.

That one is in set_tiling and because of a very peculiar retry semantics
of that specific ioctl. Don't ask ;-)
> 
> > freedreno/kgsl ahas all the other bare ioctl calls, dunnot what to do
> > about that.
> >
> s/ahas/has/ if you choose to keep this note.

Already reworded since kgsl is the blob library and so not a drm thing.

Thanks for your review.
-Daniel
> 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
> 
> -Emil
diff mbox

Patch

diff --git a/xf86drm.c b/xf86drm.c
index fb673b58afb3..263d6835c29a 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2543,12 +2543,12 @@  void drmCloseOnce(int fd)
 
 int drmSetMaster(int fd)
 {
-	return ioctl(fd, DRM_IOCTL_SET_MASTER, 0);
+	return drmIoctl(fd, DRM_IOCTL_SET_MASTER, 0);
 }
 
 int drmDropMaster(int fd)
 {
-	return ioctl(fd, DRM_IOCTL_DROP_MASTER, 0);
+	return drmIoctl(fd, DRM_IOCTL_DROP_MASTER, 0);
 }
 
 char *drmGetDeviceNameFromFd(int fd)