@@ -266,8 +266,7 @@ static int drm_setup(struct drm_device * dev)
{
int ret;
- if (dev->driver->firstopen &&
- drm_core_check_feature(dev, DRIVER_LEGACY)) {
+ if (dev->driver->firstopen) {
ret = dev->driver->firstopen(dev);
if (ret != 0)
return ret;
@@ -236,7 +236,7 @@ struct drm_driver {
* to set/unset the VT into raw mode.
*
* Legacy drivers initialize the hardware in the @firstopen callback,
- * which isn't even called for modern drivers.
+ * modern drivers can use it for other purposes only.
*/
void (*lastclose) (struct drm_device *);
The firstopen DRM driver hook was initially used to perform hardware initialization, which is now considered legacy. Only a single user of firstopen remains at this point (savage). In some specific cases, non-legacy drivers may also need to implement these hooks. For instance on VC4, we need to allocate a 16 MiB buffer for the GPU. Because it's not required for fbcon, it's a waste to allocate it before userspace starts using the DRM device. Using firstopen and lastclose for this allocation seems like the best fit, so re-habilitate the hook to allow it to be called for non-legacy drivers. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> --- drivers/gpu/drm/drm_file.c | 3 +-- include/drm/drm_drv.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)