diff options
-rw-r--r-- | drivers/gpu/drm/drm_ioctl.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 15 | ||||
-rw-r--r-- | include/drm/drm.h | 3 |
3 files changed, 16 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 7f6912a16761..3617b4c4bb57 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c | |||
@@ -280,6 +280,9 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
280 | if (dev->driver->dumb_create) | 280 | if (dev->driver->dumb_create) |
281 | req->value = 1; | 281 | req->value = 1; |
282 | break; | 282 | break; |
283 | case DRM_CAP_HIGH_CRTC: | ||
284 | req->value = 1; | ||
285 | break; | ||
283 | default: | 286 | default: |
284 | return -EINVAL; | 287 | return -EINVAL; |
285 | } | 288 | } |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index a34ef97d3c81..741457bd1c46 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -1125,7 +1125,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, | |||
1125 | { | 1125 | { |
1126 | union drm_wait_vblank *vblwait = data; | 1126 | union drm_wait_vblank *vblwait = data; |
1127 | int ret = 0; | 1127 | int ret = 0; |
1128 | unsigned int flags, seq, crtc; | 1128 | unsigned int flags, seq, crtc, high_crtc; |
1129 | 1129 | ||
1130 | if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled)) | 1130 | if ((!drm_dev_to_irq(dev)) || (!dev->irq_enabled)) |
1131 | return -EINVAL; | 1131 | return -EINVAL; |
@@ -1134,16 +1134,21 @@ int drm_wait_vblank(struct drm_device *dev, void *data, | |||
1134 | return -EINVAL; | 1134 | return -EINVAL; |
1135 | 1135 | ||
1136 | if (vblwait->request.type & | 1136 | if (vblwait->request.type & |
1137 | ~(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK)) { | 1137 | ~(_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK | |
1138 | _DRM_VBLANK_HIGH_CRTC_MASK)) { | ||
1138 | DRM_ERROR("Unsupported type value 0x%x, supported mask 0x%x\n", | 1139 | DRM_ERROR("Unsupported type value 0x%x, supported mask 0x%x\n", |
1139 | vblwait->request.type, | 1140 | vblwait->request.type, |
1140 | (_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK)); | 1141 | (_DRM_VBLANK_TYPES_MASK | _DRM_VBLANK_FLAGS_MASK | |
1142 | _DRM_VBLANK_HIGH_CRTC_MASK)); | ||
1141 | return -EINVAL; | 1143 | return -EINVAL; |
1142 | } | 1144 | } |
1143 | 1145 | ||
1144 | flags = vblwait->request.type & _DRM_VBLANK_FLAGS_MASK; | 1146 | flags = vblwait->request.type & _DRM_VBLANK_FLAGS_MASK; |
1145 | crtc = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; | 1147 | high_crtc = (vblwait->request.type & _DRM_VBLANK_HIGH_CRTC_MASK); |
1146 | 1148 | if (high_crtc) | |
1149 | crtc = high_crtc >> _DRM_VBLANK_HIGH_CRTC_SHIFT; | ||
1150 | else | ||
1151 | crtc = flags & _DRM_VBLANK_SECONDARY ? 1 : 0; | ||
1147 | if (crtc >= dev->num_crtcs) | 1152 | if (crtc >= dev->num_crtcs) |
1148 | return -EINVAL; | 1153 | return -EINVAL; |
1149 | 1154 | ||
diff --git a/include/drm/drm.h b/include/drm/drm.h index 9ac431396176..99cd07433fab 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
@@ -469,6 +469,8 @@ enum drm_vblank_seq_type { | |||
469 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ | 469 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ |
470 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ | 470 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ |
471 | }; | 471 | }; |
472 | #define _DRM_VBLANK_HIGH_CRTC_SHIFT 16 | ||
473 | #define _DRM_VBLANK_HIGH_CRTC_MASK 0x001F0000 | ||
472 | 474 | ||
473 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) | 475 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) |
474 | #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ | 476 | #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ |
@@ -753,6 +755,7 @@ struct drm_event_vblank { | |||
753 | }; | 755 | }; |
754 | 756 | ||
755 | #define DRM_CAP_DUMB_BUFFER 0x1 | 757 | #define DRM_CAP_DUMB_BUFFER 0x1 |
758 | #define DRM_CAP_HIGH_CRTC 0x2 | ||
756 | 759 | ||
757 | /* typedef area */ | 760 | /* typedef area */ |
758 | #ifndef __KERNEL__ | 761 | #ifndef __KERNEL__ |