]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge branch 'linux-4.12' of git://github.com/skeggsb/linux into drm-next
authorDave Airlie <airlied@redhat.com>
Wed, 8 Mar 2017 02:54:58 +0000 (12:54 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 8 Mar 2017 02:54:58 +0000 (12:54 +1000)
- Re-architecture of the code to handle proprietary fw, more abstracted
to support the multitude of differences that NVIDIA introduce
- Support in the said code for GP10x ACR and GR fw, giving acceleration
support \o/
- Fix for GTX 970 GPUs that are in an odd MMU configuration

* 'linux-4.12' of git://github.com/skeggsb/linux: (60 commits)
  drm/nouveau/fb/gf100-: rework ram detection
  drm/nouveau/fb/gm200: split ram implementation from gm107
  drm/nouveau/fb/gf108: split implementation from gf100
  drm/nouveau/fb/gf100-: modify constructors to allow more customisation
  drm/nouveau/kms/nv50: use drm core i2c-over-aux algorithm
  drm/nouveau/i2c/g94-: return REPLY_M value on reads
  drm/nouveau/i2c: modify aux interface to return length actually transferred
  drm/nouveau/gp10x: enable secboot and GR
  drm/nouveau/gr/gp102: initial support
  drm/nouveau/falcon: support for gp10x msgqueue
  drm/nouveau/secboot: add gp102/gp104/gp106/gp107 support
  drm/nouveau/secboot: put HS code loading code into own file
  drm/nouveau/secboot: support for r375 ACR
  drm/nouveau/secboot: support for r367 ACR
  drm/nouveau/secboot: support for r364 ACR
  drm/nouveau/secboot: workaround bug when starting SEC2 firmware
  drm/nouveau/secboot: support standard NVIDIA HS binaries
  drm/nouveau/secboot: support for unload blob bootloader
  drm/nouveau/secboot: let callers interpret return value of blobs
  drm/nouveau/secboot: support for different load and unload falcons
  ...

1  2 
drivers/gpu/drm/nouveau/nv50_display.c

index 16915c29ec52e7bbe27b8da38e1274771451be5e,b4a99aba4d65b46dce7f301dc8f3aa69455f8a00..7ad1ee580cf097de5d52bbde95a93ff970698d9e
@@@ -705,7 -705,7 +705,7 @@@ evo_wait(void *evoc, int nr
                                break;
                ) < 0) {
                        mutex_unlock(&dmac->lock);
 -                      printk(KERN_ERR "nouveau: evo channel stalled\n");
 +                      pr_err("nouveau: evo channel stalled\n");
                        return NULL;
                }
  
@@@ -723,18 -723,18 +723,18 @@@ evo_kick(u32 *push, void *evoc
        mutex_unlock(&dmac->lock);
  }
  
 -#define evo_mthd(p,m,s) do {                                                   \
 -      const u32 _m = (m), _s = (s);                                          \
 -      if (drm_debug & DRM_UT_KMS)                                            \
 -              printk(KERN_ERR "%04x %d %s\n", _m, _s, __func__);             \
 -      *((p)++) = ((_s << 18) | _m);                                          \
 +#define evo_mthd(p, m, s) do {                                                \
 +      const u32 _m = (m), _s = (s);                                   \
 +      if (drm_debug & DRM_UT_KMS)                                     \
 +              pr_err("%04x %d %s\n", _m, _s, __func__);               \
 +      *((p)++) = ((_s << 18) | _m);                                   \
  } while(0)
  
 -#define evo_data(p,d) do {                                                     \
 -      const u32 _d = (d);                                                    \
 -      if (drm_debug & DRM_UT_KMS)                                            \
 -              printk(KERN_ERR "\t%08x\n", _d);                               \
 -      *((p)++) = _d;                                                         \
 +#define evo_data(p, d) do {                                           \
 +      const u32 _d = (d);                                             \
 +      if (drm_debug & DRM_UT_KMS)                                     \
 +              pr_err("\t%08x\n", _d);                                 \
 +      *((p)++) = _d;                                                  \
  } while(0)
  
  /******************************************************************************
@@@ -831,8 -831,7 +831,8 @@@ nv50_wndw_atomic_check_release(struct n
  static int
  nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw,
                               struct nv50_wndw_atom *asyw,
 -                             struct nv50_head_atom *asyh)
 +                             struct nv50_head_atom *asyh,
 +                             u32 pflip_flags)
  {
        struct nouveau_framebuffer *fb = nouveau_framebuffer(asyw->state.fb);
        struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
        asyw->image.w = fb->base.width;
        asyw->image.h = fb->base.height;
        asyw->image.kind = (fb->nvbo->tile_flags & 0x0000ff00) >> 8;
 +
 +      asyw->interval = pflip_flags & DRM_MODE_PAGE_FLIP_ASYNC ? 0 : 1;
 +
        if (asyw->image.kind) {
                asyw->image.layout = 0;
                if (drm->client.device.info.chipset >= 0xc0)
@@@ -887,7 -883,6 +887,7 @@@ nv50_wndw_atomic_check(struct drm_plan
        struct nv50_head_atom *harm = NULL, *asyh = NULL;
        bool varm = false, asyv = false, asym = false;
        int ret;
 +      u32 pflip_flags = 0;
  
        NV_ATOMIC(drm, "%s atomic_check\n", plane->name);
        if (asyw->state.crtc) {
                        return PTR_ERR(asyh);
                asym = drm_atomic_crtc_needs_modeset(&asyh->state);
                asyv = asyh->state.active;
 +              pflip_flags = asyh->state.pageflip_flags;
        }
  
        if (armw->state.crtc) {
                        asyw->set.point = true;
  
                if (!varm || asym || armw->state.fb != asyw->state.fb) {
 -                      ret = nv50_wndw_atomic_check_acquire(wndw, asyw, asyh);
 +                      ret = nv50_wndw_atomic_check_acquire(
 +                                      wndw, asyw, asyh, pflip_flags);
                        if (ret)
                                return ret;
                }
@@@ -2226,6 -2219,77 +2226,6 @@@ nv50_head_help = 
        .atomic_check = nv50_head_atomic_check,
  };
  
 -/* This is identical to the version in the atomic helpers, except that
 - * it supports non-vblanked ("async") page flips.
 - */
 -static int
 -nv50_head_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
 -                  struct drm_pending_vblank_event *event, u32 flags)
 -{
 -      struct drm_plane *plane = crtc->primary;
 -      struct drm_atomic_state *state;
 -      struct drm_plane_state *plane_state;
 -      struct drm_crtc_state *crtc_state;
 -      int ret = 0;
 -
 -      state = drm_atomic_state_alloc(plane->dev);
 -      if (!state)
 -              return -ENOMEM;
 -
 -      state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc);
 -retry:
 -      crtc_state = drm_atomic_get_crtc_state(state, crtc);
 -      if (IS_ERR(crtc_state)) {
 -              ret = PTR_ERR(crtc_state);
 -              goto fail;
 -      }
 -      crtc_state->event = event;
 -
 -      plane_state = drm_atomic_get_plane_state(state, plane);
 -      if (IS_ERR(plane_state)) {
 -              ret = PTR_ERR(plane_state);
 -              goto fail;
 -      }
 -
 -      ret = drm_atomic_set_crtc_for_plane(plane_state, crtc);
 -      if (ret != 0)
 -              goto fail;
 -      drm_atomic_set_fb_for_plane(plane_state, fb);
 -
 -      /* Make sure we don't accidentally do a full modeset. */
 -      state->allow_modeset = false;
 -      if (!crtc_state->active) {
 -              DRM_DEBUG_ATOMIC("[CRTC:%d] disabled, rejecting legacy flip\n",
 -                               crtc->base.id);
 -              ret = -EINVAL;
 -              goto fail;
 -      }
 -
 -      if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
 -              nv50_wndw_atom(plane_state)->interval = 0;
 -
 -      ret = drm_atomic_nonblocking_commit(state);
 -fail:
 -      if (ret == -EDEADLK)
 -              goto backoff;
 -
 -      drm_atomic_state_put(state);
 -      return ret;
 -
 -backoff:
 -      drm_atomic_state_clear(state);
 -      drm_atomic_legacy_backoff(state);
 -
 -      /*
 -       * Someone might have exchanged the framebuffer while we dropped locks
 -       * in the backoff code. We need to fix up the fb refcount tracking the
 -       * core does for us.
 -       */
 -      plane->old_fb = plane->fb;
 -
 -      goto retry;
 -}
 -
  static int
  nv50_head_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
                    uint32_t size)
@@@ -2320,7 -2384,7 +2320,7 @@@ nv50_head_func = 
        .gamma_set = nv50_head_gamma_set,
        .destroy = nv50_head_destroy,
        .set_config = drm_atomic_helper_set_config,
 -      .page_flip = nv50_head_page_flip,
 +      .page_flip = drm_atomic_helper_page_flip,
        .set_property = drm_atomic_helper_crtc_set_property,
        .atomic_duplicate_state = nv50_head_atomic_duplicate_state,
        .atomic_destroy_state = nv50_head_atomic_destroy_state,
@@@ -3627,7 -3691,7 +3627,7 @@@ nv50_sor_create(struct drm_connector *c
                struct nvkm_i2c_aux *aux =
                        nvkm_i2c_aux_find(i2c, dcbe->i2c_index);
                if (aux) {
-                       nv_encoder->i2c = &aux->i2c;
+                       nv_encoder->i2c = &nv_connector->aux.ddc;
                        nv_encoder->aux = aux;
                }
  
@@@ -3777,6 -3841,7 +3777,7 @@@ nv50_pior_func = 
  static int
  nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
  {
+       struct nouveau_connector *nv_connector = nouveau_connector(connector);
        struct nouveau_drm *drm = nouveau_drm(connector->dev);
        struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
        struct nvkm_i2c_bus *bus = NULL;
                break;
        case DCB_OUTPUT_DP:
                aux  = nvkm_i2c_aux_find(i2c, NVKM_I2C_AUX_EXT(dcbe->extdev));
-               ddc  = aux ? &aux->i2c : NULL;
+               ddc  = aux ? &nv_connector->aux.ddc : NULL;
                type = DRM_MODE_ENCODER_TMDS;
                break;
        default: