Merge branch 'linux-4.12' of git://github.com/skeggsb/linux into drm-next
authorDave Airlie <airlied@redhat.com>
Fri, 12 May 2017 04:25:22 +0000 (14:25 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 12 May 2017 04:25:22 +0000 (14:25 +1000)
Quite a few patches, but not much code changed:
- Fixes regression from atomic when only the source rect of a plane
changes (ie. xrandr --right-of)
- Fixes another issue where atomic changed behaviour underneath us,
potentially causing laggy cursor position updates
- Fixes for a bunch of races in thermal code, which lead to random
lockups for a lot of users

* 'linux-4.12' of git://github.com/skeggsb/linux:
  drm/nouveau/therm: remove ineffective workarounds for alarm bugs
  drm/nouveau/tmr: avoid processing completed alarms when adding a new one
  drm/nouveau/tmr: fix corruption of the pending list when rescheduling an alarm
  drm/nouveau/tmr: handle races with hw when updating the next alarm time
  drm/nouveau/tmr: ack interrupt before processing alarms
  drm/nouveau/core: fix static checker warning
  drm/nouveau/fb/ram/gf100-: remove 0x10f200 read
  drm/nouveau/kms/nv50: skip core channel cursor update on position-only changes
  drm/nouveau/kms/nv50: fix source-rect-only plane updates
  drm/nouveau/kms/nv50: remove pointless argument to window atomic_check_acquire()

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

@@@ -831,8 -831,7 +831,7 @@@ 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,
-                              u32 pflip_flags)
+                              struct nv50_head_atom *asyh)
  {
        struct nouveau_framebuffer *fb = nouveau_framebuffer(asyw->state.fb);
        struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
        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 (asyh->state.pageflip_flags & DRM_MODE_PAGE_FLIP_ASYNC)
+               asyw->interval = 0;
+       else
+               asyw->interval = 1;
  
        if (asyw->image.kind) {
                asyw->image.layout = 0;
@@@ -887,7 -889,6 +889,6 @@@ 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) {
                if (memcmp(&armw->point, &asyw->point, sizeof(asyw->point)))
                        asyw->set.point = true;
  
-               if (!varm || asym || armw->state.fb != asyw->state.fb) {
-                       ret = nv50_wndw_atomic_check_acquire(
-                                       wndw, asyw, asyh, pflip_flags);
-                       if (ret)
-                               return ret;
-               }
+               ret = nv50_wndw_atomic_check_acquire(wndw, asyw, asyh);
+               if (ret)
+                       return ret;
        } else
        if (varm) {
                nv50_wndw_atomic_check_release(wndw, asyw, harm);
@@@ -1122,9 -1119,13 +1119,13 @@@ static voi
  nv50_curs_prepare(struct nv50_wndw *wndw, struct nv50_head_atom *asyh,
                  struct nv50_wndw_atom *asyw)
  {
-       asyh->curs.handle = nv50_disp(wndw->plane.dev)->mast.base.vram.handle;
-       asyh->curs.offset = asyw->image.offset;
-       asyh->set.curs = asyh->curs.visible;
+       u32 handle = nv50_disp(wndw->plane.dev)->mast.base.vram.handle;
+       u32 offset = asyw->image.offset;
+       if (asyh->curs.handle != handle || asyh->curs.offset != offset) {
+               asyh->curs.handle = handle;
+               asyh->curs.offset = offset;
+               asyh->set.curs = asyh->curs.visible;
+       }
  }
  
  static void
@@@ -2210,16 -2211,25 +2211,16 @@@ nv50_head_lut_load(struct drm_crtc *crt
        }
  }
  
 -static int
 -nv50_head_mode_set_base_atomic(struct drm_crtc *crtc,
 -                             struct drm_framebuffer *fb, int x, int y,
 -                             enum mode_set_atomic state)
 -{
 -      WARN_ON(1);
 -      return 0;
 -}
 -
  static const struct drm_crtc_helper_funcs
  nv50_head_help = {
 -      .mode_set_base_atomic = nv50_head_mode_set_base_atomic,
        .load_lut = nv50_head_lut_load,
        .atomic_check = nv50_head_atomic_check,
  };
  
  static int
  nv50_head_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
 -                  uint32_t size)
 +                  uint32_t size,
 +                  struct drm_modeset_acquire_ctx *ctx)
  {
        struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
        u32 i;