From 30f6570798f6c897df4f1f2c676d803728bfec27 Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Wed, 18 Jun 2014 17:52:32 +0100 Subject: drm/debugfs: add a "force" file per connector Add a file to debugfs for each connector to enable modification of the "force" connector attribute. This allows connectors to be enabled or disabled for testing and debugging purposes. v2: Add stricter value checking and clean up debugfs_entry if file creation fails in drm_debugfs_connector_add. (David Herrmann) Signed-off-by: Thomas Wood Reviewed-by: Alex Deucher Signed-off-by: Daniel Vetter --- include/drm/drmP.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8af71a8e2c00..57ecc421b19c 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1419,6 +1419,8 @@ extern int drm_debugfs_create_files(const struct drm_info_list *files, extern int drm_debugfs_remove_files(const struct drm_info_list *files, int count, struct drm_minor *minor); extern int drm_debugfs_cleanup(struct drm_minor *minor); +extern int drm_debugfs_connector_add(struct drm_connector *connector); +extern void drm_debugfs_connector_remove(struct drm_connector *connector); #else static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id, struct dentry *root) @@ -1443,6 +1445,15 @@ static inline int drm_debugfs_cleanup(struct drm_minor *minor) { return 0; } + +static inline int drm_debugfs_connector_add(struct drm_connector *connector) +{ + return 0; +} +static inline void drm_debugfs_connector_remove(struct drm_connector *connector) +{ +} + #endif /* Info file support */ -- cgit v1.2.3 From 0cdbe8ac696b5399327f972a1c91263c1a44f1d9 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 25 May 2014 12:59:47 +0200 Subject: drm/gem: remove misleading gfp parameter to get_pages() drm_gem_get_pages() currently allows passing a 'gfp' parameter that is passed to shmem combined with mapping_gfp_mask(). Given that the default mapping_gfp_mask() is GFP_HIGHUSER, it is _very_ unlikely that anyone will ever make use of that parameter. In fact, all drivers currently pass redundant flags or 0. This patch removes the 'gfp' parameter. The only reason to keep it is to remove flags like __GFP_WAIT. But in its current form, it can only be used to add flags. So to remove __GFP_WAIT, you'd have to drop it from the mapping_gfp_mask, which again is stupid as this mask is used by shmem-core for other allocations, too. If any driver ever requires that parameter, we can introduce a new helper that takes the raw 'gfp' parameter. The caller'd be responsible to combine it with mapping_gfp_mask() in a suitable way. The current drm_gem_get_pages() helper would then simply use mapping_gfp_mask() and call the new helper. This is what shmem_read_mapping_pages{_gfp,} does right now. Moreover, the gfp-zone flag-usage is not obvious: If you pass a modified zone, shmem core will WARN() or even BUG(). In other words, the following must be true for 'gfp' passed to shmem_read_mapping_pages_gfp(): gfp_zone(mapping_gfp_mask(mapping)) == gfp_zone(gfp) Add a comment to drm_gem_read_pages() explaining that constraint. Signed-off-by: David Herrmann --- include/drm/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8af71a8e2c00..57c07cd89a6a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1574,7 +1574,7 @@ void drm_gem_free_mmap_offset(struct drm_gem_object *obj); int drm_gem_create_mmap_offset(struct drm_gem_object *obj); int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size); -struct page **drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask); +struct page **drm_gem_get_pages(struct drm_gem_object *obj); void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages, bool dirty, bool accessed); -- cgit v1.2.3 From 6d6dfcfb883818b40b58bac61cc72cab428a7a03 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 16 Mar 2014 14:38:40 +0100 Subject: drm: enable render-nodes by default We introduced render-nodes about 1/2 year ago and no problems showed up. Remove the drm_rnodes argument and enable them by default now. Acked-by: Daniel Vetter Acked-by: Alex Deucher Signed-off-by: David Herrmann --- include/drm/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 57c07cd89a6a..dc74c971b992 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1395,7 +1395,6 @@ extern void drm_master_put(struct drm_master **master); extern void drm_put_dev(struct drm_device *dev); extern void drm_unplug_dev(struct drm_device *dev); extern unsigned int drm_debug; -extern unsigned int drm_rnodes; extern unsigned int drm_universal_planes; extern unsigned int drm_vblank_offdelay; -- cgit v1.2.3 From c7dbc6c9ae5c3baa3be755a228a349374d043b5b Mon Sep 17 00:00:00 2001 From: Matt Roper Date: Mon, 7 Jul 2014 11:19:57 -0700 Subject: drm: Remove command line guard for universal planes Universal planes are ready to leave 'experimental' state so drop the kernel command line parameter that we've been hiding them behind. Userspace clients that wish to receive universal planes will still need to opt-in by setting the appropriate capability bit, so this should have no impact on existing userspace. Signed-off-by: Matt Roper Signed-off-by: Dave Airlie --- include/drm/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index a1344793f4a9..9b6a445f8602 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1395,7 +1395,6 @@ extern void drm_master_put(struct drm_master **master); extern void drm_put_dev(struct drm_device *dev); extern void drm_unplug_dev(struct drm_device *dev); extern unsigned int drm_debug; -extern unsigned int drm_universal_planes; extern unsigned int drm_vblank_offdelay; extern unsigned int drm_timestamp_precision; -- cgit v1.2.3 From b008c0fc95140ca7aad65861a77f0338ce31e8b5 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Jul 2014 17:26:36 +0200 Subject: drm: remove unused "struct drm_freelist" This object is not used except for static fields in drm_bufs *cough*. Inline the watermark fields and drop the unused structure definition. Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter Signed-off-by: Dave Airlie --- include/drm/drmP.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 9b6a445f8602..335b7b8f5e7d 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -346,18 +346,6 @@ struct drm_waitlist { spinlock_t write_lock; }; -struct drm_freelist { - int initialized; /**< Freelist in use */ - atomic_t count; /**< Number of free buffers */ - struct drm_buf *next; /**< End pointer */ - - wait_queue_head_t waiting; /**< Processes waiting on free bufs */ - int low_mark; /**< Low water mark */ - int high_mark; /**< High water mark */ - atomic_t wfh; /**< If waiting for high mark */ - spinlock_t lock; -}; - typedef struct drm_dma_handle { dma_addr_t busaddr; void *vaddr; @@ -375,7 +363,8 @@ struct drm_buf_entry { int page_order; struct drm_dma_handle **seglist; - struct drm_freelist freelist; + int low_mark; /**< Low water mark */ + int high_mark; /**< High water mark */ }; /* Event queued up for userspace to read */ -- cgit v1.2.3 From 344f4b0f4c14a12206b05aa033f3174cefbd282f Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Jul 2014 17:26:37 +0200 Subject: drm: drop unused "struct drm_queue" This object is unused, drop it. Signed-off-by: David Herrmann Reviewed-by: Daniel Vetter Signed-off-by: Dave Airlie --- include/drm/drmP.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 335b7b8f5e7d..d3d9be6b83ef 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -430,23 +430,6 @@ struct drm_file { struct drm_prime_file_private prime; }; -/** Wait queue */ -struct drm_queue { - atomic_t use_count; /**< Outstanding uses (+1) */ - atomic_t finalization; /**< Finalization in progress */ - atomic_t block_count; /**< Count of processes waiting */ - atomic_t block_read; /**< Queue blocked for reads */ - wait_queue_head_t read_queue; /**< Processes waiting on block_read */ - atomic_t block_write; /**< Queue blocked for writes */ - wait_queue_head_t write_queue; /**< Processes waiting on block_write */ - atomic_t total_queued; /**< Total queued statistic */ - atomic_t total_flushed; /**< Total flushes statistic */ - atomic_t total_locks; /**< Total locks statistics */ - enum drm_ctx_flags flags; /**< Context preserving and 2D-only */ - struct drm_waitlist waitlist; /**< Pending buffers */ - wait_queue_head_t flush_queue; /**< Processes waiting until flush */ -}; - /** * Lock data. */ -- cgit v1.2.3 From 9f8d21ea276177547725a60cefc1b6da742f14d3 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Jul 2014 09:01:12 +0200 Subject: drm: extract legacy ctxbitmap flushing The ctxbitmap code is only used by legacy drivers so lets try to keep it as separated as possible. Furthermore, the locking is non-obvious and kinda weird with ctxlist_mutex *and* struct_mutex. Keeping all ctxbitmap access in one file is much easier to review and makes drm_release() more readable. Reviewed-by: Alex Deucher Reviewed-by: Daniel Vetter Signed-off-by: David Herrmann --- include/drm/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d3d9be6b83ef..80889982d196 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1242,6 +1242,7 @@ extern int drm_rmctx(struct drm_device *dev, void *data, extern int drm_ctxbitmap_init(struct drm_device *dev); extern void drm_ctxbitmap_cleanup(struct drm_device *dev); extern void drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle); +extern void drm_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file); extern int drm_setsareactx(struct drm_device *dev, void *data, struct drm_file *file_priv); -- cgit v1.2.3 From 48ba813701eb14b3008edefef4a0789b328e278c Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 22 Jul 2014 18:46:09 +0200 Subject: drm: drop redundant drm_file->is_master The drm_file->is_master field is redundant as it's equivalent to: drm_file->master && drm_file->master == drm_file->minor->master 1) "=>" Whenever we set drm_file->is_master, we also set: drm_file->minor->master = drm_file->master; Whenever we clear drm_file->is_master, we also call: drm_master_put(&drm_file->minor->master); which implicitly clears it to NULL. 2) "<=" minor->master cannot be set if it is non-NULL. Therefore, it stays as is unless a file drops it. If minor->master is NULL, it is only set by places that also adjust drm_file->is_master. Therefore, we can safely drop is_master and replace it by an inline helper that matches: drm_file->master && drm_file->master == drm_file->minor->master Reviewed-by: Alex Deucher Reviewed-by: Daniel Vetter Signed-off-by: David Herrmann --- include/drm/drmP.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 80889982d196..6ede53712d7b 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -387,8 +387,6 @@ struct drm_prime_file_private { struct drm_file { unsigned always_authenticated :1; 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; /* @@ -1034,7 +1032,7 @@ struct drm_device { /** \name Locks */ /*@{ */ struct mutex struct_mutex; /**< For others */ - struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */ + struct mutex master_mutex; /**< For drm_minor::master */ /*@} */ /** \name Usage Counters */ @@ -1172,6 +1170,21 @@ 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 */ /*@{*/ -- cgit v1.2.3 From 3cb01a980461506f9ec4e4e1dc2dab6314236fb7 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 22 Jul 2014 17:12:26 +0200 Subject: drm: don't de-authenticate clients on master-close If an active DRM-Master closes its device, we deauthenticate all clients on that master. However, if an inactive DRM-Master closes its device, we do nothing. This is quite inconsistent and breaks several scenarios: 1) If this was used as security mechanism, it fails horribly if a master closes a device while VT switched away. Furthermore, none of the few drivers using ->master_*() callbacks seems to require it, anyway. 2) If you spawn weston (or any other non-UMS compositor) in background while another compositor is active, both will get assigned to the same "drm_master" object. If the foreground compositor now exits, all clients of both the foreground AND background compositor will be de-authenticated leading to unexpected behavior. Stop this non-sense and keep clients authenticated. We don't do this when dropping DRM-Master (i.e., switching VTs) so don't do it on active-close either! Reviewed-by: Alex Deucher Reviewed-by: Daniel Vetter Signed-off-by: David Herrmann --- include/drm/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 6ede53712d7b..e67058cc527e 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -385,7 +385,6 @@ struct drm_prime_file_private { /** File private data */ struct drm_file { - unsigned always_authenticated :1; unsigned authenticated :1; /* true when the client has asked us to expose stereo 3D mode flags */ unsigned stereo_allowed :1; -- cgit v1.2.3 From 1b7199fe9840737397d335922033aa2c3cca92c6 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Jul 2014 12:29:56 +0200 Subject: drm: move module initialization to drm_stub.c Most of the new DRM management functions are nowadays in drm_stub.c. By moving the core module initialization to drm_stub.c we can make several global variables static and keep the stub-open helper local. The core files now look like this: drm_stub.c: Core management drm_drv.c: Ioctl dispatcher drm_ioctl.c: Actual ioctl backends drm_fops.c: Char-dev file-operations A follow-up patch will move what is left from drm_drv.c into drm_ioctl.c. Acked-by: Daniel Vetter Reviewed-by: Alex Deucher Signed-off-by: David Herrmann --- include/drm/drmP.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index e67058cc527e..c480b448ce65 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1199,7 +1199,6 @@ extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags); /* Device support (drm_fops.h) */ extern struct mutex drm_global_mutex; extern int drm_open(struct inode *inode, struct file *filp); -extern int drm_stub_open(struct inode *inode, struct file *filp); extern ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset); extern int drm_release(struct inode *inode, struct file *filp); @@ -1386,9 +1385,6 @@ extern unsigned int drm_timestamp_precision; extern unsigned int drm_timestamp_monotonic; extern struct class *drm_class; -extern struct dentry *drm_debugfs_root; - -extern struct idr drm_minors_idr; extern struct drm_local_map *drm_getsarea(struct drm_device *dev); -- cgit v1.2.3 From e17280758cc0b4f3d7065554006adcb87448f6c0 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 23 Jul 2014 11:38:38 +0200 Subject: drm: make sysfs device always available for minors For each minor we allocate a sysfs device as minor->kdev. Currently, this is allocated and registered in drm_minor_register(). This makes it impossible to add sysfs-attributes to the device before it is registered. Therefore, they are not added atomically, nor can we move device_add() *after* ->load() is called. This patch makes minor->kdev available early, but only adds the device during minor-registration. Note that the registration is still called before ->load() as debugfs needs to be split, too. This will be fixed in follow-ups. Reviewed-by: Daniel Vetter Reviewed-by: Alex Deucher Signed-off-by: David Herrmann --- include/drm/drmP.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c480b448ce65..458385ec15f3 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1502,9 +1502,8 @@ extern int drm_pci_set_unique(struct drm_device *dev, struct drm_sysfs_class; extern struct class *drm_sysfs_create(struct module *owner, char *name); extern void drm_sysfs_destroy(void); -extern int drm_sysfs_device_add(struct drm_minor *minor); +extern struct device *drm_sysfs_minor_alloc(struct drm_minor *minor); extern void drm_sysfs_hotplug_event(struct drm_device *dev); -extern void drm_sysfs_device_remove(struct drm_minor *minor); extern int drm_sysfs_connector_add(struct drm_connector *connector); extern void drm_sysfs_connector_remove(struct drm_connector *connector); -- cgit v1.2.3 From e7b96070dd9e51a8b16340411a8643d8c7d5a001 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Thu, 24 Jul 2014 12:10:04 +0200 Subject: drm: mark drm_context support as legacy This renames all drm-context helpers to drm_legacy_*() and moves the internal definitions into the new drm_legacy.h header. This header is local to DRM-core and drivers shouldn't access it. Reviewed-by: Daniel Vetter Signed-off-by: David Herrmann --- include/drm/drmP.h | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'include/drm/drmP.h') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 458385ec15f3..a57646382086 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -151,8 +151,6 @@ int drm_err(const char *func, const char *format, ...); also include looping detection. */ #define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */ -#define DRM_KERNEL_CONTEXT 0 /**< Change drm_resctx if changed */ -#define DRM_RESERVED_CONTEXTS 1 /**< Change drm_resctx if changed */ #define DRM_MAP_HASH_OFFSET 0x10000000 @@ -535,15 +533,6 @@ struct drm_map_list { struct drm_master *master; }; -/** - * Context handle list - */ -struct drm_ctx_list { - struct list_head head; /**< list head */ - drm_context_t handle; /**< context handle */ - struct drm_file *tag; /**< associated fd private data */ -}; - /* location of GART table */ #define DRM_ATI_GART_MAIN 1 #define DRM_ATI_GART_FB 2 @@ -1236,30 +1225,6 @@ extern int drm_setversion(struct drm_device *dev, void *data, extern int drm_noop(struct drm_device *dev, void *data, struct drm_file *file_priv); - /* Context IOCTL support (drm_context.h) */ -extern int drm_resctx(struct drm_device *dev, void *data, - struct drm_file *file_priv); -extern int drm_addctx(struct drm_device *dev, void *data, - struct drm_file *file_priv); -extern int drm_getctx(struct drm_device *dev, void *data, - struct drm_file *file_priv); -extern int drm_switchctx(struct drm_device *dev, void *data, - struct drm_file *file_priv); -extern int drm_newctx(struct drm_device *dev, void *data, - struct drm_file *file_priv); -extern int drm_rmctx(struct drm_device *dev, void *data, - struct drm_file *file_priv); - -extern int drm_ctxbitmap_init(struct drm_device *dev); -extern void drm_ctxbitmap_cleanup(struct drm_device *dev); -extern void drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle); -extern void drm_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file); - -extern int drm_setsareactx(struct drm_device *dev, void *data, - struct drm_file *file_priv); -extern int drm_getsareactx(struct drm_device *dev, void *data, - struct drm_file *file_priv); - /* Authentication IOCTL support (drm_auth.h) */ extern int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv); -- cgit v1.2.3 From 7963e9db1b1f842fdc53309baa8714d38e9f5681 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 8 Aug 2014 07:30:53 +1000 Subject: 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 --- include/drm/drmP.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'include/drm/drmP.h') 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 */ /*@{*/ -- cgit v1.2.3