drm/nouveau/kms/nv50: remove code to support non-atomic dpms
authorBen Skeggs <bskeggs@redhat.com>
Fri, 4 Nov 2016 07:20:36 +0000 (17:20 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 7 Nov 2016 04:05:00 +0000 (14:05 +1000)
Made completely unreachable (and broken) by atomic commits.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nv50_display.c

index b69ba828d91640f20a2ce566462c12bf98e82298..790a9ac25844d1a9182122ba8168d8ef9085862b 100644 (file)
@@ -1117,43 +1117,6 @@ nouveau_connector_funcs_lvds = {
        .atomic_get_property = nouveau_conn_atomic_get_property,
 };
 
-static int
-nouveau_connector_dp_dpms(struct drm_connector *connector, int mode)
-{
-       struct nouveau_encoder *nv_encoder = NULL;
-
-       if (connector->encoder)
-               nv_encoder = nouveau_encoder(connector->encoder);
-       if (nv_encoder && nv_encoder->dcb &&
-           nv_encoder->dcb->type == DCB_OUTPUT_DP) {
-               if (mode == DRM_MODE_DPMS_ON) {
-                       u8 data = DP_SET_POWER_D0;
-                       nvkm_wraux(nv_encoder->aux, DP_SET_POWER, &data, 1);
-                       usleep_range(1000, 2000);
-               } else {
-                       u8 data = DP_SET_POWER_D3;
-                       nvkm_wraux(nv_encoder->aux, DP_SET_POWER, &data, 1);
-               }
-       }
-
-       return drm_helper_connector_dpms(connector, mode);
-}
-
-static const struct drm_connector_funcs
-nouveau_connector_funcs_dp = {
-       .dpms = nouveau_connector_dp_dpms,
-       .reset = nouveau_conn_reset,
-       .detect = nouveau_connector_detect,
-       .force = nouveau_connector_force,
-       .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = nouveau_connector_set_property,
-       .destroy = nouveau_connector_destroy,
-       .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state,
-       .atomic_destroy_state = nouveau_conn_atomic_destroy_state,
-       .atomic_set_property = nouveau_conn_atomic_set_property,
-       .atomic_get_property = nouveau_conn_atomic_get_property,
-};
-
 static int
 nouveau_connector_hotplug(struct nvif_notify *notify)
 {
@@ -1348,10 +1311,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
                        return ERR_PTR(ret);
                }
 
-               if (dev->mode_config.funcs->atomic_commit)
-                       funcs = &nouveau_connector_funcs;
-               else
-                       funcs = &nouveau_connector_funcs_dp;
+               funcs = &nouveau_connector_funcs;
                break;
        default:
                funcs = &nouveau_connector_funcs;
index c4ad9910c162a27c7cdf270f118036eff45fa81d..c6053486f1f668bca4165bf09301aba83dd2fb9a 100644 (file)
@@ -3116,42 +3116,8 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode)
                .base.hashm  = nv_encoder->dcb->hashm,
                .pwr.state = mode == DRM_MODE_DPMS_ON,
        };
-       struct {
-               struct nv50_disp_mthd_v1 base;
-               struct nv50_disp_sor_dp_pwr_v0 pwr;
-       } link = {
-               .base.version = 1,
-               .base.method = NV50_DISP_MTHD_V1_SOR_DP_PWR,
-               .base.hasht  = nv_encoder->dcb->hasht,
-               .base.hashm  = nv_encoder->dcb->hashm,
-               .pwr.state = mode == DRM_MODE_DPMS_ON,
-       };
-       struct drm_device *dev = encoder->dev;
-       struct drm_encoder *partner;
-
-       nv_encoder->last_dpms = mode;
 
-       list_for_each_entry(partner, &dev->mode_config.encoder_list, head) {
-               struct nouveau_encoder *nv_partner = nouveau_encoder(partner);
-
-               if (partner->encoder_type != DRM_MODE_ENCODER_TMDS)
-                       continue;
-
-               if (nv_partner != nv_encoder &&
-                   nv_partner->dcb->or == nv_encoder->dcb->or) {
-                       if (nv_partner->last_dpms == DRM_MODE_DPMS_ON)
-                               return;
-                       break;
-               }
-       }
-
-       if (nv_encoder->dcb->type == DCB_OUTPUT_DP) {
-               args.pwr.state = 1;
-               nvif_mthd(disp->disp, 0, &args, sizeof(args));
-               nvif_mthd(disp->disp, 0, &link, sizeof(link));
-       } else {
-               nvif_mthd(disp->disp, 0, &args, sizeof(args));
-       }
+       nvif_mthd(disp->disp, 0, &args, sizeof(args));
 }
 
 static void
@@ -3177,7 +3143,6 @@ nv50_sor_disable(struct drm_encoder *encoder)
        struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
        struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc);
 
-       nv_encoder->last_dpms = DRM_MODE_DPMS_OFF;
        nv_encoder->crtc = NULL;
 
        if (nv_crtc) {
@@ -3380,7 +3345,6 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
                return -ENOMEM;
        nv_encoder->dcb = dcbe;
        nv_encoder->or = ffs(dcbe->or) - 1;
-       nv_encoder->last_dpms = DRM_MODE_DPMS_OFF;
 
        encoder = to_drm_encoder(nv_encoder);
        encoder->possible_crtcs = dcbe->heads;
@@ -4126,15 +4090,9 @@ nv50_display_init(struct drm_device *dev)
                        struct nouveau_encoder *nv_encoder;
 
                        nv_encoder = nouveau_encoder(encoder);
-                       if (nv_encoder->dcb->type == DCB_OUTPUT_DP)
-                               nv_encoder->dcb->type = DCB_OUTPUT_EOL;
-
                        help = encoder->helper_private;
                        if (help && help->dpms)
                                help->dpms(encoder, DRM_MODE_DPMS_ON);
-
-                       if (nv_encoder->dcb->type == DCB_OUTPUT_EOL)
-                               nv_encoder->dcb->type = DCB_OUTPUT_DP;
                }
        }