Home | History | Annotate | Line # | Download | only in amdgpu
      1  1.1  riastrad /*	$NetBSD: amdgpu_ioc32.c,v 1.3 2021/12/18 23:44:58 riastradh Exp $	*/
      2  1.1  riastrad 
      3  1.1  riastrad /**
      4  1.1  riastrad  * \file amdgpu_ioc32.c
      5  1.1  riastrad  *
      6  1.1  riastrad  * 32-bit ioctl compatibility routines for the AMDGPU DRM.
      7  1.1  riastrad  *
      8  1.1  riastrad  * \author Paul Mackerras <paulus (at) samba.org>
      9  1.1  riastrad  *
     10  1.1  riastrad  * Copyright (C) Paul Mackerras 2005
     11  1.1  riastrad  * All Rights Reserved.
     12  1.1  riastrad  *
     13  1.1  riastrad  * Permission is hereby granted, free of charge, to any person obtaining a
     14  1.1  riastrad  * copy of this software and associated documentation files (the "Software"),
     15  1.1  riastrad  * to deal in the Software without restriction, including without limitation
     16  1.1  riastrad  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     17  1.1  riastrad  * and/or sell copies of the Software, and to permit persons to whom the
     18  1.1  riastrad  * Software is furnished to do so, subject to the following conditions:
     19  1.1  riastrad  *
     20  1.1  riastrad  * The above copyright notice and this permission notice (including the next
     21  1.1  riastrad  * paragraph) shall be included in all copies or substantial portions of the
     22  1.1  riastrad  * Software.
     23  1.1  riastrad  *
     24  1.1  riastrad  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     25  1.1  riastrad  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     26  1.1  riastrad  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     27  1.1  riastrad  * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     28  1.1  riastrad  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     29  1.1  riastrad  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
     30  1.1  riastrad  * IN THE SOFTWARE.
     31  1.1  riastrad  */
     32  1.1  riastrad #include <sys/cdefs.h>
     33  1.1  riastrad __KERNEL_RCSID(0, "$NetBSD: amdgpu_ioc32.c,v 1.3 2021/12/18 23:44:58 riastradh Exp $");
     34  1.1  riastrad 
     35  1.1  riastrad #include <linux/compat.h>
     36  1.1  riastrad 
     37  1.1  riastrad #include <drm/amdgpu_drm.h>
     38  1.3  riastrad #include <drm/drm_ioctl.h>
     39  1.3  riastrad 
     40  1.1  riastrad #include "amdgpu_drv.h"
     41  1.1  riastrad 
     42  1.1  riastrad long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
     43  1.1  riastrad {
     44  1.1  riastrad 	unsigned int nr = DRM_IOCTL_NR(cmd);
     45  1.1  riastrad 	int ret;
     46  1.1  riastrad 
     47  1.1  riastrad 	if (nr < DRM_COMMAND_BASE)
     48  1.1  riastrad 		return drm_compat_ioctl(filp, cmd, arg);
     49  1.1  riastrad 
     50  1.1  riastrad 	ret = amdgpu_drm_ioctl(filp, cmd, arg);
     51  1.1  riastrad 
     52  1.1  riastrad 	return ret;
     53  1.1  riastrad }
     54