* @ptr: object pointer, used to generate unique ID
* @type: object type
*
- * LOCKING:
- *
* Create a unique identifier based on @ptr in @dev's identifier space. Used
* for tracking modes, CRTCs and connectors.
*
* @dev: DRM device
* @id: ID to free
*
- * LOCKING:
- * Caller must hold DRM mode_config lock.
- *
* Free @id from @dev's unique identifier pool.
*/
static void drm_mode_object_put(struct drm_device *dev,
* drm_framebuffer_init - initialize a framebuffer
* @dev: DRM device
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Allocates an ID for the framebuffer's parent mode object, sets its mode
* functions & device file and adds it to the master fd list.
*
/**
* drm_framebuffer_unreference - unref a framebuffer
- *
- * LOCKING:
- * Caller must hold mode config lock.
*/
void drm_framebuffer_unreference(struct drm_framebuffer *fb)
{
struct drm_device *dev = fb->dev;
DRM_DEBUG("FB ID: %d\n", fb->base.id);
- WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
+ WARN_ON(!drm_modeset_is_locked(dev));
kref_put(&fb->refcount, drm_framebuffer_free);
}
EXPORT_SYMBOL(drm_framebuffer_unreference);
* drm_framebuffer_cleanup - remove a framebuffer object
* @fb: framebuffer to remove
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Scans all the CRTCs in @dev's mode_config. If they're using @fb, removes
* it, setting it to NULL.
*/
void drm_framebuffer_cleanup(struct drm_framebuffer *fb)
{
struct drm_device *dev = fb->dev;
+
/*
* This could be moved to drm_framebuffer_remove(), but for
* debugging is nice to keep around the list of fb's that are
* drm_framebuffer_remove - remove and unreference a framebuffer object
* @fb: framebuffer to remove
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Scans all the CRTCs and planes in @dev's mode_config. If they're
* using @fb, removes it, setting it to NULL.
*/
struct drm_mode_set set;
int ret;
+ WARN_ON(!drm_modeset_is_locked(dev));
+
/* remove from any CRTC */
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
if (crtc->fb == fb) {
* @crtc: CRTC object to init
* @funcs: callbacks for the new CRTC
*
- * LOCKING:
- * Takes mode_config lock.
- *
* Inits a new object created as base part of an driver crtc object.
*
* RETURNS:
* drm_crtc_cleanup - Cleans up the core crtc usage.
* @crtc: CRTC to cleanup
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Cleanup @crtc. Removes from drm modesetting space
* does NOT free object, caller does that.
*/
* @connector: connector the new mode
* @mode: mode data
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Add @mode to @connector's mode list for later use.
*/
void drm_mode_probed_add(struct drm_connector *connector,
* @connector: connector list to modify
* @mode: mode to remove
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Remove @mode from @connector's mode list, then free it.
*/
void drm_mode_remove(struct drm_connector *connector,
* @funcs: callbacks for this connector
* @name: user visible name of the connector
*
- * LOCKING:
- * Takes mode config lock.
- *
* Initialises a preallocated connector. Connectors should be
* subclassed as part of driver connector objects.
*
* drm_connector_cleanup - cleans up an initialised connector
* @connector: connector to cleanup
*
- * LOCKING:
- * Takes mode config lock.
- *
* Cleans up the connector but doesn't free the object.
*/
void drm_connector_cleanup(struct drm_connector *connector)
list_for_each_entry_safe(mode, t, &connector->user_modes, head)
drm_mode_remove(connector, mode);
- mutex_lock(&dev->mode_config.mutex);
drm_mode_object_put(dev, &connector->base);
list_del(&connector->head);
dev->mode_config.num_connector--;
- mutex_unlock(&dev->mode_config.mutex);
}
EXPORT_SYMBOL(drm_connector_cleanup);
* drm_mode_create - create a new display mode
* @dev: DRM device
*
- * LOCKING:
- * Caller must hold DRM mode_config lock.
- *
* Create a new drm_display_mode, give it an ID, and return it.
*
* RETURNS:
* @dev: DRM device
* @mode: mode to remove
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Free @mode's unique identifier, then free it.
*/
void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode)
* drm_mode_config_init - initialize DRM mode_configuration structure
* @dev: DRM device
*
- * LOCKING:
- * None, should happen single threaded at init time.
- *
* Initialize @dev's mode_config structure, used for tracking the graphics
* configuration of @dev.
+ *
+ * Since this initializes the modeset locks, no locking is possible. Which is no
+ * problem, since this should happen single threaded at init time. It is the
+ * driver's problem to ensure this guarantee.
+ *
*/
void drm_mode_config_init(struct drm_device *dev)
{
* drm_mode_config_cleanup - free up DRM mode_config info
* @dev: DRM device
*
- * LOCKING:
- * Caller must hold mode config lock.
- *
* Free up all the connectors and CRTCs associated with this DRM device, then
* free up the framebuffers and associated buffer objects.
*
+ * Note that since this /should/ happen single-threaded at driver/device
+ * teardown time, no locking is required. It's the driver's job to ensure that
+ * this guarantee actually holds true.
+ *
* FIXME: cleanup any dangling user buffer objects too
*/
void drm_mode_config_cleanup(struct drm_device *dev)
* @out: drm_mode_modeinfo struct to return to the user
* @in: drm_display_mode to use
*
- * LOCKING:
- * None.
- *
* Convert a drm_display_mode into a drm_mode_modeinfo structure to return to
* the user.
*/
* @out: drm_display_mode to return to the user
* @in: drm_mode_modeinfo to use
*
- * LOCKING:
- * None.
- *
* Convert a drm_mode_modeinfo into a drm_display_mode structure to return to
* the caller.
*
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Construct a set of configuration description structures and return
* them to the user, including CRTC, connector and framebuffer configuration.
*
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Construct a CRTC configuration structure to return to the user.
*
* Called by the user via ioctl.
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Construct a connector configuration structure to return to the user.
*
* Called by the user via ioctl.
* @data: ioctl data
* @file_priv: DRM file info
*
- * LOCKING:
- * Takes mode config lock.
- *
* Return an plane count and set of IDs.
*/
int drm_mode_getplane_res(struct drm_device *dev, void *data,
* @data: ioctl data
* @file_priv: DRM file info
*
- * LOCKING:
- * Takes mode config lock.
- *
* Return plane info, including formats supported, gamma size, any
* current fb, etc.
*/
* @data: ioctl data*
* @file_prive: DRM file info
*
- * LOCKING:
- * Takes mode config lock.
- *
* Set plane info, including placement, fb, scaling, and other factors.
* Or pass a NULL fb to disable.
*/
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Build a new CRTC configuration based on user request.
*
* Called by the user via ioctl.
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Add a new FB to the specified CRTC, given a user request.
*
* Called by the user via ioctl.
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Add a new FB to the specified CRTC, given a user request with format.
*
* Called by the user via ioctl.
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Remove the FB specified by the user.
*
* Called by the user via ioctl.
* @cmd: cmd from ioctl
* @arg: arg from ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Lookup the FB given its ID and return info about it.
*
* Called by the user via ioctl.
* drm_fb_release - remove and free the FBs on this file
* @filp: file * from the ioctl
*
- * LOCKING:
- * Takes mode config lock.
- *
* Destroy all the FBs associated with @filp.
*
* Called by the user via ioctl.