aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 57cea01c4ffb..4c68f76993d8 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -80,6 +80,7 @@ static struct drm_prop_enum_list drm_dithering_mode_enum_list[] =
80{ 80{
81 { DRM_MODE_DITHERING_OFF, "Off" }, 81 { DRM_MODE_DITHERING_OFF, "Off" },
82 { DRM_MODE_DITHERING_ON, "On" }, 82 { DRM_MODE_DITHERING_ON, "On" },
83 { DRM_MODE_DITHERING_AUTO, "Automatic" },
83}; 84};
84 85
85/* 86/*
@@ -1126,7 +1127,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
1126 if (file_priv->master->minor->type == DRM_MINOR_CONTROL) { 1127 if (file_priv->master->minor->type == DRM_MINOR_CONTROL) {
1127 list_for_each_entry(crtc, &dev->mode_config.crtc_list, 1128 list_for_each_entry(crtc, &dev->mode_config.crtc_list,
1128 head) { 1129 head) {
1129 DRM_DEBUG_KMS("CRTC ID is %d\n", crtc->base.id); 1130 DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id);
1130 if (put_user(crtc->base.id, crtc_id + copied)) { 1131 if (put_user(crtc->base.id, crtc_id + copied)) {
1131 ret = -EFAULT; 1132 ret = -EFAULT;
1132 goto out; 1133 goto out;
@@ -1154,8 +1155,8 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
1154 list_for_each_entry(encoder, 1155 list_for_each_entry(encoder,
1155 &dev->mode_config.encoder_list, 1156 &dev->mode_config.encoder_list,
1156 head) { 1157 head) {
1157 DRM_DEBUG_KMS("ENCODER ID is %d\n", 1158 DRM_DEBUG_KMS("[ENCODER:%d:%s]\n", encoder->base.id,
1158 encoder->base.id); 1159 drm_get_encoder_name(encoder));
1159 if (put_user(encoder->base.id, encoder_id + 1160 if (put_user(encoder->base.id, encoder_id +
1160 copied)) { 1161 copied)) {
1161 ret = -EFAULT; 1162 ret = -EFAULT;
@@ -1185,8 +1186,9 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
1185 list_for_each_entry(connector, 1186 list_for_each_entry(connector,
1186 &dev->mode_config.connector_list, 1187 &dev->mode_config.connector_list,
1187 head) { 1188 head) {
1188 DRM_DEBUG_KMS("CONNECTOR ID is %d\n", 1189 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
1189 connector->base.id); 1190 connector->base.id,
1191 drm_get_connector_name(connector));
1190 if (put_user(connector->base.id, 1192 if (put_user(connector->base.id,
1191 connector_id + copied)) { 1193 connector_id + copied)) {
1192 ret = -EFAULT; 1194 ret = -EFAULT;
@@ -1209,7 +1211,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
1209 } 1211 }
1210 card_res->count_connectors = connector_count; 1212 card_res->count_connectors = connector_count;
1211 1213
1212 DRM_DEBUG_KMS("Counted %d %d %d\n", card_res->count_crtcs, 1214 DRM_DEBUG_KMS("CRTC[%d] CONNECTORS[%d] ENCODERS[%d]\n", card_res->count_crtcs,
1213 card_res->count_connectors, card_res->count_encoders); 1215 card_res->count_connectors, card_res->count_encoders);
1214 1216
1215out: 1217out:
@@ -1312,7 +1314,7 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
1312 1314
1313 memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo)); 1315 memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo));
1314 1316
1315 DRM_DEBUG_KMS("connector id %d:\n", out_resp->connector_id); 1317 DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id);
1316 1318
1317 mutex_lock(&dev->mode_config.mutex); 1319 mutex_lock(&dev->mode_config.mutex);
1318 1320
@@ -1493,6 +1495,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
1493 goto out; 1495 goto out;
1494 } 1496 }
1495 crtc = obj_to_crtc(obj); 1497 crtc = obj_to_crtc(obj);
1498 DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id);
1496 1499
1497 if (crtc_req->mode_valid) { 1500 if (crtc_req->mode_valid) {
1498 /* If we have a mode we need a framebuffer. */ 1501 /* If we have a mode we need a framebuffer. */
@@ -1569,6 +1572,9 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
1569 goto out; 1572 goto out;
1570 } 1573 }
1571 connector = obj_to_connector(obj); 1574 connector = obj_to_connector(obj);
1575 DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
1576 connector->base.id,
1577 drm_get_connector_name(connector));
1572 1578
1573 connector_set[i] = connector; 1579 connector_set[i] = connector;
1574 } 1580 }
@@ -1684,6 +1690,7 @@ int drm_mode_addfb(struct drm_device *dev,
1684 1690
1685 r->fb_id = fb->base.id; 1691 r->fb_id = fb->base.id;
1686 list_add(&fb->filp_head, &file_priv->fbs); 1692 list_add(&fb->filp_head, &file_priv->fbs);
1693 DRM_DEBUG_KMS("[FB:%d]\n", fb->base.id);
1687 1694
1688out: 1695out:
1689 mutex_unlock(&dev->mode_config.mutex); 1696 mutex_unlock(&dev->mode_config.mutex);
@@ -2610,6 +2617,15 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
2610 goto out; 2617 goto out;
2611 crtc = obj_to_crtc(obj); 2618 crtc = obj_to_crtc(obj);
2612 2619
2620 if (crtc->fb == NULL) {
2621 /* The framebuffer is currently unbound, presumably
2622 * due to a hotplug event, that userspace has not
2623 * yet discovered.
2624 */
2625 ret = -EBUSY;
2626 goto out;
2627 }
2628
2613 if (crtc->funcs->page_flip == NULL) 2629 if (crtc->funcs->page_flip == NULL)
2614 goto out; 2630 goto out;
2615 2631