drm: allow open of dynamic off devices.
authorDave Airlie <airlied@redhat.com>
Wed, 12 Sep 2012 05:55:05 +0000 (15:55 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 29 Aug 2013 03:30:38 +0000 (13:30 +1000)
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fops.c
include/drm/drmP.h

index 2d2401e9c5aea7d814430466e920857cdcfe1484..136c949307ba9fea4e1e334c0f67119e572007ba 100644 (file)
@@ -219,7 +219,7 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
                return -EBUSY;  /* No exclusive opens */
        if (!drm_cpu_valid())
                return -EINVAL;
-       if (dev->switch_power_state != DRM_SWITCH_POWER_ON)
+       if (dev->switch_power_state != DRM_SWITCH_POWER_ON && dev->switch_power_state != DRM_SWITCH_POWER_DYNAMIC_OFF)
                return -EINVAL;
 
        DRM_DEBUG("pid = %d, minor = %d\n", task_pid_nr(current), minor_id);
index 90833dccc91960918c9657fd4087b9594812b21f..0e3d51793b654ce1885913d4e0d43b3d452a3636 100644 (file)
@@ -1220,6 +1220,7 @@ struct drm_device {
 #define DRM_SWITCH_POWER_ON 0
 #define DRM_SWITCH_POWER_OFF 1
 #define DRM_SWITCH_POWER_CHANGING 2
+#define DRM_SWITCH_POWER_DYNAMIC_OFF 3
 
 static __inline__ int drm_core_check_feature(struct drm_device *dev,
                                             int feature)