- patches.arch/x86_mce_intel_decode_physical_address.patch:
[linux-flexiantxendom0-3.2.10.git] / drivers / gpu / drm / radeon / radeon_kms.c
index c633319..0406835 100644 (file)
@@ -98,11 +98,15 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 {
        struct radeon_device *rdev = dev->dev_private;
        struct drm_radeon_info *info;
+       struct radeon_mode_info *minfo = &rdev->mode_info;
        uint32_t *value_ptr;
        uint32_t value;
+       struct drm_crtc *crtc;
+       int i, found;
 
        info = data;
        value_ptr = (uint32_t *)((unsigned long)info->value);
+       value = *value_ptr;
        switch (info->request) {
        case RADEON_INFO_DEVICE_ID:
                value = dev->pci_device;
@@ -116,6 +120,20 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
        case RADEON_INFO_ACCEL_WORKING:
                value = rdev->accel_working;
                break;
+       case RADEON_INFO_CRTC_FROM_ID:
+               for (i = 0, found = 0; i < rdev->num_crtc; i++) {
+                       crtc = (struct drm_crtc *)minfo->crtcs[i];
+                       if (crtc && crtc->base.id == value) {
+                               value = i;
+                               found = 1;
+                               break;
+                       }
+               }
+               if (!found) {
+                       DRM_DEBUG("unknown crtc id %d\n", value);
+                       return -EINVAL;
+               }
+               break;
        default:
                DRM_DEBUG("Invalid request %d\n", info->request);
                return -EINVAL;