2005-04-16 15:20:36 -07:00
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-05-27 13:40:25 -06:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
drm: provide device-refcount
Lets not trick ourselves into thinking "drm_device" objects are not
ref-counted. That's just utterly stupid. We manage "drm_minor" objects on
each drm-device and each minor can have an unlimited number of open
handles. Each of these handles has the drm_minor (and thus the drm_device)
as private-data in the file-handle. Therefore, we may not destroy
"drm_device" until all these handles are closed.
It is *not* possible to reset all these pointers atomically and restrict
access to them, and this is *not* how this is done! Instead, we use
ref-counts to make sure the object is valid and not freed.
Note that we currently use "dev->open_count" for that, which is *exactly*
the same as a reference-count, just open coded. So this patch doesn't
change any semantics on DRM devices (well, this patch just introduces the
ref-count, anyway. Follow-up patches will replace open_count by it).
Also note that generic VFS revoke support could allow us to drop this
ref-count again. We could then just synchronously disable any fops->xy()
calls. However, this is not the case, yet, and no such patches are
in sight (and I seriously question the idea of dropping the ref-cnt
again).
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2014-01-29 10:21:36 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-02-02 19:37:46 +11:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-08-29 12:12:35 +02:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
2016-10-25 13:00:45 +01:00
|
|
|
|
2017-03-08 15:12:35 +01:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-12-24 11:46:01 -08:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-09 12:54:08 +03:00
|
|
|
|
2014-08-29 12:12:40 +02:00
|
|
|
|
2014-08-29 12:12:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-10-02 18:01:03 +01:00
|
|
|
|
2016-11-14 12:58:19 +01:00
|
|
|
|
2017-03-08 15:12:35 +01:00
|
|
|
|
2017-10-17 22:30:07 -06:00
|
|
|
|
2017-03-08 15:12:37 +01:00
|
|
|
|
2017-03-08 15:12:42 +01:00
|
|
|
|
2017-03-22 21:53:36 +01:00
|
|
|
|
2017-03-22 21:54:47 +01:00
|
|
|
|
2017-04-04 11:52:55 +02:00
|
|
|
|
2017-05-31 11:21:46 +02:00
|
|
|
|
|
|
|
|
|
2017-08-02 13:56:01 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-05-26 13:46:22 -04:00
|
|
|
|
|
|
|
|
|
2012-10-28 18:28:06 +01:00
|
|
|
|
2012-11-14 11:22:52 +01:00
|
|
|
|
2014-07-01 12:57:26 +02:00
|
|
|
|
2014-01-09 11:03:14 +01:00
|
|
|
|
2012-11-14 11:22:52 +01:00
|
|
|
|
2017-03-08 15:12:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-22 00:50:42 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-07 09:20:40 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-09-12 15:55:05 +10:00
|
|
|
|
2010-12-07 09:20:40 +10:00
|
|
|
|
2005-09-25 14:28:13 +10:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-03-23 13:28:33 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-12-15 03:16:38 +10:00
|
|
|
|
|
|
|
|
|
2012-01-05 09:55:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drm: fix potential dangling else problems in for_each_ macros
We have serious dangling else bugs waiting to happen in our for_each_
style macros with ifs. Consider, for example,
#define drm_for_each_plane_mask(plane, dev, plane_mask) \
list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
if ((plane_mask) & (1 << drm_plane_index(plane)))
If this is used in context:
if (condition)
drm_for_each_plane_mask(plane, dev, plane_mask);
else
foo();
foo() will be called for each plane *not* in plane_mask, if condition
holds, and not at all if condition doesn't hold.
Fix this by reversing the conditions in the macros, and adding an else
branch for the "for each" block, so that other if/else blocks can't
interfere. Provide a "for_each_if" helper macro to make it easier to get
this right.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1448392916-2281-1-git-send-email-jani.nikula@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-11-24 21:21:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|