Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -84
+1 -41
drivers/gpu/drm/nouveau/nouveau_connector.c
··· 1118 1118 }; 1119 1119 1120 1120 static int 1121 - nouveau_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 - 1142 - static const struct drm_connector_funcs 1143 - nouveau_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 - 1157 - static int 1158 1121 nouveau_connector_hotplug(struct nvif_notify *notify) 1159 1122 { 1160 1123 struct nouveau_connector *nv_connector = ··· 1311 1348 return ERR_PTR(ret); 1312 1349 } 1313 1350 1314 - if (dev->mode_config.funcs->atomic_commit) 1315 - funcs = &nouveau_connector_funcs; 1316 - else 1317 - funcs = &nouveau_connector_funcs_dp; 1351 + funcs = &nouveau_connector_funcs; 1318 1352 break; 1319 1353 default: 1320 1354 funcs = &nouveau_connector_funcs;
+1 -43
drivers/gpu/drm/nouveau/nv50_display.c
··· 3116 3116 .base.hashm = nv_encoder->dcb->hashm, 3117 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 3119 3132 - nv_encoder->last_dpms = mode; 3133 - 3134 - list_for_each_entry(partner, &dev->mode_config.encoder_list, head) { 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 - } 3120 + nvif_mthd(disp->disp, 0, &args, sizeof(args)); 3155 3121 } 3156 3122 3157 3123 static void ··· 3143 3177 struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); 3144 3178 struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc); 3145 3179 3146 - nv_encoder->last_dpms = DRM_MODE_DPMS_OFF; 3147 3180 nv_encoder->crtc = NULL; 3148 3181 3149 3182 if (nv_crtc) { ··· 3345 3380 return -ENOMEM; 3346 3381 nv_encoder->dcb = dcbe; 3347 3382 nv_encoder->or = ffs(dcbe->or) - 1; 3348 - nv_encoder->last_dpms = DRM_MODE_DPMS_OFF; 3349 3383 3350 3384 encoder = to_drm_encoder(nv_encoder); 3351 3385 encoder->possible_crtcs = dcbe->heads; ··· 4090 4126 struct nouveau_encoder *nv_encoder; 4091 4127 4092 4128 nv_encoder = nouveau_encoder(encoder); 4093 - if (nv_encoder->dcb->type == DCB_OUTPUT_DP) 4094 - nv_encoder->dcb->type = DCB_OUTPUT_EOL; 4095 - 4096 4129 help = encoder->helper_private; 4097 4130 if (help && help->dpms) 4098 4131 help->dpms(encoder, DRM_MODE_DPMS_ON); 4099 - 4100 - if (nv_encoder->dcb->type == DCB_OUTPUT_EOL) 4101 - nv_encoder->dcb->type = DCB_OUTPUT_DP; 4102 4132 } 4103 4133 } 4104 4134