drm/radeon: don't allow device to be opened if powered down
authorDave Airlie <airlied@redhat.com>
Wed, 22 Sep 2010 02:31:46 +0000 (12:31 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 22 Sep 2010 02:32:46 +0000 (12:32 +1000)
If the switcheroo has switched the device off, don't let X open it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_kms.c

index 5eee3c41d124bf49fbd5dfbc7264fb062699e961..8fbbe1c6ebbda854f7bf9dc9f76ae1c4eefdafc5 100644 (file)
@@ -203,6 +203,10 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
  */
 int radeon_driver_firstopen_kms(struct drm_device *dev)
 {
+       struct radeon_device *rdev = dev->dev_private;
+
+       if (rdev->powered_down)
+               return -EINVAL;
        return 0;
 }