diff options
author | Dave Airlie <airlied@gmail.com> | 2014-08-07 23:30:53 +0200 |
---|---|---|
committer | Dave Airlie <airlied@gmail.com> | 2014-08-07 23:30:53 +0200 |
commit | 7963e9db1b1f842fdc53309baa8714d38e9f5681 (patch) | |
tree | 9829f2d38b6df9f5a07c349766e77b002cb34539 /include/drm/drmP.h | |
parent | Merge tag 'drm/tegra/for-3.17-rc1' of git://anongit.freedesktop.org/tegra/lin... (diff) | |
download | linux-7963e9db1b1f842fdc53309baa8714d38e9f5681.tar.xz linux-7963e9db1b1f842fdc53309baa8714d38e9f5681.zip |
Revert "drm: drop redundant drm_file->is_master"
This reverts commit 48ba813701eb14b3008edefef4a0789b328e278c.
Thanks to Chris:
"drm_file->is_master is not synomous with having drm_file->master ==
drm_file->minor->master. This is because drm_file->master is the same
for all drm_files of the same generation and so when there is a master,
every drm_file believes itself to be the master. Confusion ensues and
things go pear shaped when one file is closed and there is no master
anymore."
Conflicts:
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_stub.c
Diffstat (limited to '')
-rw-r--r-- | include/drm/drmP.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index a57646382086..a12fbbac373c 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -384,6 +384,8 @@ struct drm_prime_file_private { /** File private data */ struct drm_file { unsigned authenticated :1; + /* Whether we're master for a minor. Protected by master_mutex */ + unsigned is_master :1; /* true when the client has asked us to expose stereo 3D mode flags */ unsigned stereo_allowed :1; /* @@ -1020,7 +1022,7 @@ struct drm_device { /** \name Locks */ /*@{ */ struct mutex struct_mutex; /**< For others */ - struct mutex master_mutex; /**< For drm_minor::master */ + struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */ /*@} */ /** \name Usage Counters */ @@ -1158,21 +1160,6 @@ static inline bool drm_is_primary_client(const struct drm_file *file_priv) return file_priv->minor->type == DRM_MINOR_LEGACY; } -/** - * drm_is_master() - Check whether a DRM open-file is DRM-Master - * @file: DRM open-file context - * - * This checks whether a DRM open-file context is owner of the master context - * attached to it. If a file owns a master context, it's called DRM-Master. - * Per DRM device, only one such file can be DRM-Master at a time. - * - * Returns: True if the file is DRM-Master, otherwise false. - */ -static inline bool drm_is_master(const struct drm_file *file) -{ - return file->master && file->master == file->minor->master; -} - /******************************************************************/ /** \name Internal function definitions */ /*@{*/ |