2005-04-16 15:20:36 -07:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-02 18:01:07 +01:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-09-20 08:32:59 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2013-02-27 17:04:08 -08:00
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2013-02-27 17:04:08 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 11:22:36 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
2015-06-23 11:22:36 +02:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2013-02-27 17:03:39 -08:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2014-07-23 09:01:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2014-07-23 09:01:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-23 09:01:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2014-07-23 09:01:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2009-02-02 16:55:46 +11:00
|
|
|
|
2007-07-11 16:53:40 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2005-08-05 22:11:22 +10:00
|
|
|
|
2007-11-05 12:50:58 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-08-05 22:11:22 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm: make DRM_UNLOCKED ioctls with their own mutex
drm_getclient, drm_getstats and drm_getmap (with a few minor
adjustments) do not need global mutex, so fix that and
make the said ioctls DRM_UNLOCKED. Details:
drm_getclient: the only thing that should be protected here
is dev->filelist and that is already protected everywhere with
dev->struct_mutex.
drm_getstats: there is no need for any mutex here because the
loop runs through quasi-static (set at load time only)
data, and the actual count access is done with atomic_read()
drm_getmap already uses dev->struct_mutex to protect
dev->maplist, which also used to protect the same structure
everywhere else except at three places:
* drm_getsarea, which doesn't grab *any* mutex before
touching dev->maplist (so no drm_global_mutex doesn't help
here either; different issue for a different patch).
However, drivers seem to call it only at
initialization time so it probably doesn't matter
* drm_master_destroy, which is called from drm_master_put,
which in turn is protected with dev->struct_mutex
everywhere else in drm module, so we are good here too.
* drm_getsareactx, which releases the dev->struct_mutex
too early, but this patch includes the fix for that.
v2: * incorporate comments received from Daniel Vetter
* include the (long) explanation above to make it clear what
we are doing (and why), also at Daniel Vetter's request
* tighten up mutex grab/release locations to only
encompass real critical sections, rather than some
random code around them
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-28 17:43:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-08-05 22:11:22 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2009-02-02 16:55:46 +11:00
|
|
|
|
2007-07-11 16:53:40 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
drm: 32/64-bit DRM ioctl compatibility patch
The patch is against a 2.6.11 kernel tree. I am running this with a
32-bit X server (compiled up from X.org CVS as of a couple of weeks
ago) and 32-bit DRI libraries and clients. All the userland stuff is
identical to what I am using under a 32-bit kernel on my G4 powerbook
(which is a 32-bit machine of course). I haven't tried compiling up a
64-bit X server or clients yet.
In the compatibility routines I have assumed that the kernel can
safely access user addresses after set_fs(KERNEL_DS). That is, where
an ioctl argument structure contains pointers to other structures, and
those other structures are already compatible between the 32-bit and
64-bit ABIs (i.e. they only contain things like chars, shorts or
ints), I just check the address with access_ok() and then pass it
through to the 64-bit ioctl code. I believe this approach may not
work on sparc64, but it does work on ppc64 and x86_64 at least.
One tricky area which may need to be revisited is the question of how
to handle the handles which we pass back to userspace to identify
mappings. These handles are generated in the ADDMAP ioctl and then
passed in as the offset value to mmap. However, offset values for
mmap seem to be generated in other ways as well, particularly for AGP
mappings.
The approach I have ended up with is to generate a fake 32-bit handle
only for _DRM_SHM mappings. The handles for other mappings (AGP, REG,
FB) are physical addresses which are already limited to 32 bits, and
generating fake handles for them created all sorts of problems in the
mmap/nopage code.
This patch has been updated to use the new compatibility ioctls.
From: Paul Mackerras <paulus@samba.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2005-06-23 21:29:18 +10:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-07-17 10:46:52 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-11 15:53:27 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-28 14:22:24 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-11-28 14:22:24 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2007-07-11 15:27:12 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-07-11 16:53:40 +10:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-03-24 12:23:04 -07:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2008-11-28 14:22:24 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-25 20:23:09 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-06-23 08:18:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2014-07-24 12:10:04 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2007-07-11 16:53:40 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-05-26 05:01:51 +10:00
|
|
|
|
2007-09-03 12:06:45 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
2009-03-24 12:23:04 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|