*
* This function must be used by drivers as their &file_operations.release
* method. It frees any resources associated with the open file, and calls the
- * &drm_driver.preclose and &drm_driver.lastclose driver callbacks. If this is
- * the last open file for the DRM device also proceeds to call the
- * &drm_driver.lastclose driver callback.
+ * &drm_driver.postclose driver callback. If this is the last open file for the
+ * DRM device also proceeds to call the &drm_driver.lastclose driver callback.
*
* RETURNS:
*
list_del(&file_priv->lhead);
mutex_unlock(&dev->filelist_mutex);
- if (dev->driver->preclose)
+ if (drm_core_check_feature(dev, DRIVER_LEGACY) &&
+ dev->driver->preclose)
dev->driver->preclose(dev, file_priv);
/* ========================================================
*/
int (*open) (struct drm_device *, struct drm_file *);
- /**
- * @preclose:
- *
- * One of the driver callbacks when a new &struct drm_file is closed.
- * Useful for tearing down driver-private data structures allocated in
- * @open like buffer allocators, execution contexts or similar things.
- *
- * Since the display/modeset side of DRM can only be owned by exactly
- * one &struct drm_file (see &drm_file.is_master and &drm_device.master)
- * there should never be a need to tear down any modeset related
- * resources in this callback. Doing so would be a driver design bug.
- *
- * FIXME: It is not really clear why there's both @preclose and
- * @postclose. Without a really good reason, use @postclose only.
- */
- void (*preclose) (struct drm_device *, struct drm_file *file_priv);
-
/**
* @postclose:
*
* one &struct drm_file (see &drm_file.is_master and &drm_device.master)
* there should never be a need to tear down any modeset related
* resources in this callback. Doing so would be a driver design bug.
- *
- * FIXME: It is not really clear why there's both @preclose and
- * @postclose. Without a really good reason, use @postclose only.
*/
void (*postclose) (struct drm_device *, struct drm_file *);
* state changes, e.g. in conjunction with the :ref:`vga_switcheroo`
* infrastructure.
*
- * This is called after @preclose and @postclose have been called.
+ * This is called after @postclose hook has been called.
*
* NOTE:
*
/* List of devices hanging off this driver with stealth attach. */
struct list_head legacy_dev_list;
int (*firstopen) (struct drm_device *);
+ void (*preclose) (struct drm_device *, struct drm_file *file_priv);
int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
int (*dma_quiescent) (struct drm_device *);
int (*context_dtor) (struct drm_device *dev, int context);