Merge tag 'drm-next-2018-11-02' of git://anongit.freedesktop.org/drm/drm
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Nov 2018 17:58:20 +0000 (10:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Nov 2018 17:58:20 +0000 (10:58 -0700)
Pull drm fixes from Dave Airlie:
 "Pretty much a normal fixes pull pre-rc1, mostly amdgpu fixes, one i915
  link training regression fix, and a couple of minor panel/bridge fixes
  and a panel quirk"

* tag 'drm-next-2018-11-02' of git://anongit.freedesktop.org/drm/drm: (37 commits)
  drm/amdgpu: revert "enable gfxoff in non-sriov and stutter mode by default"
  drm/amd/pp: Print warning if od_sclk/mclk out of range
  drm/amd/pp: Fix pp_sclk/mclk_od not work on Vega10
  drm/amd/pp: Fix pp_sclk/mclk_od not work on smu7
  drm/amd/powerplay: no MGPU fan boost enablement on DPM disabled
  drm/amdgpu: Fix skipping hangged job reset during gpu recover.
  drm/amd/powerplay: revise Vega20 pptable version check
  drm/amd/display: set backlight level limit to 1
  drm/panel: simple: Innolux TV123WAM is actually P120ZDG-BF1
  dt-bindings: drm/panel: simple: Innolux TV123WAM is actually P120ZDG-BF1
  drm/bridge: ti-sn65dsi86: Remove the mystery delay
  drm/panel: simple: Add "no-hpd" delay for Innolux TV123WAM
  drm/panel: simple: Support panels with HPD where HPD isn't connected
  dt-bindings: drm/panel: simple: Add no-hpd property
  drm/edid: Add 6 bpc quirk for BOE panel.
  drm/amdgpu: fix reporting of failed msg sent to SMU (v2)
  drm/amdgpu: Fix compute ring 1.0.0 failure after reset
  drm/amdgpu: fix VM leaf walking
  drm/amdgpu: fix amdgpu_vm_fini
  drm/amd/powerplay: commonize the API for retrieving current clocks
  ...

1  2 
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/nouveau/dispnv50/disp.c

@@@ -308,6 -308,26 +308,26 @@@ update_connector_routing(struct drm_ato
                return 0;
        }
  
+       crtc_state = drm_atomic_get_new_crtc_state(state,
+                                                  new_connector_state->crtc);
+       /*
+        * For compatibility with legacy users, we want to make sure that
+        * we allow DPMS On->Off modesets on unregistered connectors. Modesets
+        * which would result in anything else must be considered invalid, to
+        * avoid turning on new displays on dead connectors.
+        *
+        * Since the connector can be unregistered at any point during an
+        * atomic check or commit, this is racy. But that's OK: all we care
+        * about is ensuring that userspace can't do anything but shut off the
+        * display on a connector that was destroyed after its been notified,
+        * not before.
+        */
+       if (drm_connector_is_unregistered(connector) && crtc_state->active) {
+               DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] is not registered\n",
+                                connector->base.id, connector->name);
+               return -EINVAL;
+       }
        funcs = connector->helper_private;
  
        if (funcs->atomic_best_encoder)
  
        set_best_encoder(state, new_connector_state, new_encoder);
  
-       crtc_state = drm_atomic_get_new_crtc_state(state, new_connector_state->crtc);
        crtc_state->connectors_changed = true;
  
        DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n",
@@@ -1409,16 -1428,15 +1428,16 @@@ EXPORT_SYMBOL(drm_atomic_helper_wait_fo
  void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev,
                                          struct drm_atomic_state *old_state)
  {
 -      struct drm_crtc_state *new_crtc_state;
        struct drm_crtc *crtc;
        int i;
  
 -      for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) {
 -              struct drm_crtc_commit *commit = new_crtc_state->commit;
 +      for (i = 0; i < dev->mode_config.num_crtc; i++) {
 +              struct drm_crtc_commit *commit = old_state->crtcs[i].commit;
                int ret;
  
 -              if (!commit)
 +              crtc = old_state->crtcs[i].ptr;
 +
 +              if (!crtc || !commit)
                        continue;
  
                ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ);
@@@ -1936,9 -1954,6 +1955,9 @@@ int drm_atomic_helper_setup_commit(stru
                drm_crtc_commit_get(commit);
  
                commit->abort_completion = true;
 +
 +              state->crtcs[i].commit = commit;
 +              drm_crtc_commit_get(commit);
        }
  
        for_each_oldnew_connector_in_state(state, conn, old_conn_state, new_conn_state, i) {
@@@ -113,15 -113,15 +113,18 @@@ static const struct edid_quirk 
        /* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
        { "AEO", 0, EDID_QUIRK_FORCE_6BPC },
  
 +      /* BOE model on HP Pavilion 15-n233sl reports 8 bpc, but is a 6 bpc panel */
 +      { "BOE", 0x78b, EDID_QUIRK_FORCE_6BPC },
 +
        /* CPT panel of Asus UX303LA reports 8 bpc, but is a 6 bpc panel */
        { "CPT", 0x17df, EDID_QUIRK_FORCE_6BPC },
  
        /* SDC panel of Lenovo B50-80 reports 8 bpc, but is a 6 bpc panel */
        { "SDC", 0x3652, EDID_QUIRK_FORCE_6BPC },
  
+       /* BOE model 0x0771 reports 8 bpc, but is a 6 bpc panel */
+       { "BOE", 0x0771, EDID_QUIRK_FORCE_6BPC },
        /* Belinea 10 15 55 */
        { "MAX", 1516, EDID_QUIRK_PREFER_LARGE_60 },
        { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 },
@@@ -4282,7 -4282,7 +4285,7 @@@ static void drm_parse_ycbcr420_deep_col
        struct drm_hdmi_info *hdmi = &connector->display_info.hdmi;
  
        dc_mask = db[7] & DRM_EDID_YCBCR420_DC_MASK;
 -      hdmi->y420_dc_modes |= dc_mask;
 +      hdmi->y420_dc_modes = dc_mask;
  }
  
  static void drm_parse_hdmi_forum_vsdb(struct drm_connector *connector,
@@@ -881,22 -881,16 +881,16 @@@ nv50_mstc_atomic_best_encoder(struct dr
  {
        struct nv50_head *head = nv50_head(connector_state->crtc);
        struct nv50_mstc *mstc = nv50_mstc(connector);
-       if (mstc->port) {
-               struct nv50_mstm *mstm = mstc->mstm;
-               return &mstm->msto[head->base.index]->encoder;
-       }
-       return NULL;
+       return &mstc->mstm->msto[head->base.index]->encoder;
  }
  
  static struct drm_encoder *
  nv50_mstc_best_encoder(struct drm_connector *connector)
  {
        struct nv50_mstc *mstc = nv50_mstc(connector);
-       if (mstc->port) {
-               struct nv50_mstm *mstm = mstc->mstm;
-               return &mstm->msto[0]->encoder;
-       }
-       return NULL;
+       return &mstc->mstm->msto[0]->encoder;
  }
  
  static enum drm_mode_status
@@@ -938,22 -932,9 +932,22 @@@ static enum drm_connector_statu
  nv50_mstc_detect(struct drm_connector *connector, bool force)
  {
        struct nv50_mstc *mstc = nv50_mstc(connector);
 +      enum drm_connector_status conn_status;
 +      int ret;
 +
        if (!mstc->port)
                return connector_status_disconnected;
 -      return drm_dp_mst_detect_port(connector, mstc->port->mgr, mstc->port);
 +
 +      ret = pm_runtime_get_sync(connector->dev->dev);
 +      if (ret < 0 && ret != -EACCES)
 +              return connector_status_disconnected;
 +
 +      conn_status = drm_dp_mst_detect_port(connector, mstc->port->mgr,
 +                                           mstc->port);
 +
 +      pm_runtime_mark_last_busy(connector->dev->dev);
 +      pm_runtime_put_autosuspend(connector->dev->dev);
 +      return conn_status;
  }
  
  static void