aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2016-11-04 03:20:36 -0400
committerBen Skeggs <bskeggs@redhat.com>2016-11-06 23:05:00 -0500
commit8896ceef78265fe6ecd5bd3eaa441ecd0a3af160 (patch)
treee5f42eb180b2edf980925792ece8e10c904d6188
parentf7aa20e83338b95666604404c6390cc8597b3147 (diff)
drm/nouveau/kms/nv50: remove code to support non-atomic dpms
Made completely unreachable (and broken) by atomic commits. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c42
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c44
2 files changed, 2 insertions, 84 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index b69ba828d916..790a9ac25844 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -1118,43 +1118,6 @@ nouveau_connector_funcs_lvds = {
1118}; 1118};
1119 1119
1120static int 1120static int
1121nouveau_connector_dp_dpms(struct drm_connector *connector, int mode)
1122{
1123 struct nouveau_encoder *nv_encoder = NULL;
1124
1125 if (connector->encoder)
1126 nv_encoder = nouveau_encoder(connector->encoder);
1127 if (nv_encoder && nv_encoder->dcb &&
1128 nv_encoder->dcb->type == DCB_OUTPUT_DP) {
1129 if (mode == DRM_MODE_DPMS_ON) {
1130 u8 data = DP_SET_POWER_D0;
1131 nvkm_wraux(nv_encoder->aux, DP_SET_POWER, &data, 1);
1132 usleep_range(1000, 2000);
1133 } else {
1134 u8 data = DP_SET_POWER_D3;
1135 nvkm_wraux(nv_encoder->aux, DP_SET_POWER, &data, 1);
1136 }
1137 }
1138
1139 return drm_helper_connector_dpms(connector, mode);
1140}
1141
1142static const struct drm_connector_funcs
1143nouveau_connector_funcs_dp = {
1144 .dpms = nouveau_connector_dp_dpms,
1145 .reset = nouveau_conn_reset,
1146 .detect = nouveau_connector_detect,
1147 .force = nouveau_connector_force,
1148 .fill_modes = drm_helper_probe_single_connector_modes,
1149 .set_property = nouveau_connector_set_property,
1150 .destroy = nouveau_connector_destroy,
1151 .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state,
1152 .atomic_destroy_state = nouveau_conn_atomic_destroy_state,
1153 .atomic_set_property = nouveau_conn_atomic_set_property,
1154 .atomic_get_property = nouveau_conn_atomic_get_property,
1155};
1156
1157static int
1158nouveau_connector_hotplug(struct nvif_notify *notify) 1121nouveau_connector_hotplug(struct nvif_notify *notify)
1159{ 1122{
1160 struct nouveau_connector *nv_connector = 1123 struct nouveau_connector *nv_connector =
@@ -1348,10 +1311,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
1348 return ERR_PTR(ret); 1311 return ERR_PTR(ret);
1349 } 1312 }
1350 1313
1351 if (dev->mode_config.funcs->atomic_commit) 1314 funcs = &nouveau_connector_funcs;
1352 funcs = &nouveau_connector_funcs;
1353 else
1354 funcs = &nouveau_connector_funcs_dp;
1355 break; 1315 break;
1356 default: 1316 default:
1357 funcs = &nouveau_connector_funcs; 1317 funcs = &nouveau_connector_funcs;
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index c4ad9910c162..c6053486f1f6 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -3116,42 +3116,8 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode)
3116 .base.hashm = nv_encoder->dcb->hashm, 3116 .base.hashm = nv_encoder->dcb->hashm,
3117 .pwr.state = mode == DRM_MODE_DPMS_ON, 3117 .pwr.state = mode == DRM_MODE_DPMS_ON,
3118 }; 3118 };
3119 struct {
3120 struct nv50_disp_mthd_v1 base;
3121 struct nv50_disp_sor_dp_pwr_v0 pwr;
3122 } link = {
3123 .base.version = 1,
3124 .base.method = NV50_DISP_MTHD_V1_SOR_DP_PWR,
3125 .base.hasht = nv_encoder->dcb->hasht,
3126 .base.hashm = nv_encoder->dcb->hashm,
3127 .pwr.state = mode == DRM_MODE_DPMS_ON,
3128 };
3129 struct drm_device *dev = encoder->dev;
3130 struct drm_encoder *partner;
3131
3132 nv_encoder->last_dpms = mode;
3133 3119
3134 list_for_each_entry(partner, &dev->mode_config.encoder_list, head) { 3120 nvif_mthd(disp->disp, 0, &args, sizeof(args));
3135 struct nouveau_encoder *nv_partner = nouveau_encoder(partner);
3136
3137 if (partner->encoder_type != DRM_MODE_ENCODER_TMDS)
3138 continue;
3139
3140 if (nv_partner != nv_encoder &&
3141 nv_partner->dcb->or == nv_encoder->dcb->or) {
3142 if (nv_partner->last_dpms == DRM_MODE_DPMS_ON)
3143 return;
3144 break;
3145 }
3146 }
3147
3148 if (nv_encoder->dcb->type == DCB_OUTPUT_DP) {
3149 args.pwr.state = 1;
3150 nvif_mthd(disp->disp, 0, &args, sizeof(args));
3151 nvif_mthd(disp->disp, 0, &link, sizeof(link));
3152 } else {
3153 nvif_mthd(disp->disp, 0, &args, sizeof(args));
3154 }
3155} 3121}
3156 3122
3157static void 3123static void
@@ -3177,7 +3143,6 @@ nv50_sor_disable(struct drm_encoder *encoder)
3177 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 3143 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
3178 struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc); 3144 struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc);
3179 3145
3180 nv_encoder->last_dpms = DRM_MODE_DPMS_OFF;
3181 nv_encoder->crtc = NULL; 3146 nv_encoder->crtc = NULL;
3182 3147
3183 if (nv_crtc) { 3148 if (nv_crtc) {
@@ -3380,7 +3345,6 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
3380 return -ENOMEM; 3345 return -ENOMEM;
3381 nv_encoder->dcb = dcbe; 3346 nv_encoder->dcb = dcbe;
3382 nv_encoder->or = ffs(dcbe->or) - 1; 3347 nv_encoder->or = ffs(dcbe->or) - 1;
3383 nv_encoder->last_dpms = DRM_MODE_DPMS_OFF;
3384 3348
3385 encoder = to_drm_encoder(nv_encoder); 3349 encoder = to_drm_encoder(nv_encoder);
3386 encoder->possible_crtcs = dcbe->heads; 3350 encoder->possible_crtcs = dcbe->heads;
@@ -4126,15 +4090,9 @@ nv50_display_init(struct drm_device *dev)
4126 struct nouveau_encoder *nv_encoder; 4090 struct nouveau_encoder *nv_encoder;
4127 4091
4128 nv_encoder = nouveau_encoder(encoder); 4092 nv_encoder = nouveau_encoder(encoder);
4129 if (nv_encoder->dcb->type == DCB_OUTPUT_DP)
4130 nv_encoder->dcb->type = DCB_OUTPUT_EOL;
4131
4132 help = encoder->helper_private; 4093 help = encoder->helper_private;
4133 if (help && help->dpms) 4094 if (help && help->dpms)
4134 help->dpms(encoder, DRM_MODE_DPMS_ON); 4095 help->dpms(encoder, DRM_MODE_DPMS_ON);
4135
4136 if (nv_encoder->dcb->type == DCB_OUTPUT_EOL)
4137 nv_encoder->dcb->type = DCB_OUTPUT_DP;
4138 } 4096 }
4139 } 4097 }
4140 4098