]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
Merge remote-tracking branch 'airlied/drm-core-next' into drm-intel-next-queued
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 8 May 2012 11:39:59 +0000 (13:39 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 8 May 2012 11:39:59 +0000 (13:39 +0200)
Backmerge of drm-next to resolve a few ugly conflicts and to get a few
fixes from 3.4-rc6 (which drm-next has already merged). Note that this
merge also restricts the stencil cache lra evict policy workaround to
snb (as it should) - I had to frob the code anyway because the
CM0_MASK_SHIFT define died in the masked bit cleanups.

We need the backmerge to get Paulo Zanoni's infoframe regression fix
for gm45 - further bugfixes from him touch the same area and would
needlessly conflict.

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1  2 
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/intel_sdvo.c

Simple merge
index a46ed26464f4d7f994b7b988382fc4163d205c32,c77bfa9ad34019cfcaf2c68b0f731c9d3f9210b9..206b9bbe6979d9c491c7e84832f68adc317ce09a
@@@ -1116,11 -1116,11 +1116,17 @@@ i915_gem_do_execbuffer(struct drm_devic
                        return -EINVAL;
                }
  
 +              if (INTEL_INFO(dev)->gen >= 5) {
 +                      DRM_DEBUG("clip rectangles are only valid on pre-gen5\n");
 +                      return -EINVAL;
 +              }
 +
+               if (args->num_cliprects > UINT_MAX / sizeof(*cliprects)) {
+                       DRM_DEBUG("execbuf with %u cliprects\n",
+                                 args->num_cliprects);
+                       return -EINVAL;
+               }
++
                cliprects = kmalloc(args->num_cliprects * sizeof(*cliprects),
                                    GFP_KERNEL);
                if (cliprects == NULL) {
index e20f8042fddd6ab54bc9cd81bf65f8080741ae91,8c239f2d6bcd3dd0035aab62098257f84ca5d2ca..6b4139064f9c48d0de9b8e799553347b8c581417
@@@ -5849,15 -5793,21 +5854,21 @@@ static int intel_gen6_queue_flip(struc
        if (ret)
                goto err_unpin;
  
 -      OUT_RING(MI_DISPLAY_FLIP |
 -               MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
 -      OUT_RING(fb->pitches[0] | obj->tiling_mode);
 -      OUT_RING(obj->gtt_offset);
 +      intel_ring_emit(ring, MI_DISPLAY_FLIP |
 +                      MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
 +      intel_ring_emit(ring, fb->pitches[0] | obj->tiling_mode);
 +      intel_ring_emit(ring, obj->gtt_offset);
  
-       pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
+       /* Contrary to the suggestions in the documentation,
+        * "Enable Panel Fitter" does not seem to be required when page
+        * flipping with a non-native mode, and worse causes a normal
+        * modeset to fail.
+        * pf = I915_READ(PF_CTL(intel_crtc->pipe)) & PF_ENABLE;
+        */
+       pf = 0;
        pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
 -      OUT_RING(pf | pipesrc);
 -      ADVANCE_LP_RING();
 +      intel_ring_emit(ring, pf | pipesrc);
 +      intel_ring_advance(ring);
        return 0;
  
  err_unpin:
Simple merge
Simple merge
index 3aabe8dfe5c5495a7e0c49b1e1dd8a7caadc127b,b5ef7c145ee5af4a00a1f38d8c66b9c9a4e7bbc0..b59b6d5b75833e37e204da899c4dda2f65a9bf2d
@@@ -414,9 -415,19 +414,19 @@@ static int init_render_ring(struct inte
                        return ret;
        }
  
 -      if (INTEL_INFO(dev)->gen >= 6) {
 -              I915_WRITE(INSTPM,
 -                         INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
 -
++      if (IS_GEN6(dev)) {
+               /* From the Sandybridge PRM, volume 1 part 3, page 24:
+                * "If this bit is set, STCunit will have LRA as replacement
+                *  policy. [...] This bit must be reset.  LRA replacement
+                *  policy is not supported."
+                */
+               I915_WRITE(CACHE_MODE_0,
 -                         CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT);
++                         _MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
+       }
 +      if (INTEL_INFO(dev)->gen >= 6)
 +              I915_WRITE(INSTPM, _MASKED_BIT_ENABLE(INSTPM_FORCE_ORDERING));
 +
        return ret;
  }
  
index 9b3a5f999ad7baf43076d4f91c395e0ba3e3fc7a,3d9dfa57130bf3b20fb4c37158f9f1724f9eb94e..7d3f238e826562050c6fcb1771d765f7f1ad0e55
@@@ -745,21 -745,26 +745,26 @@@ static void intel_sdvo_get_dtd_from_mod
        uint16_t width, height;
        uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len;
        uint16_t h_sync_offset, v_sync_offset;
+       int mode_clock;
  
 -      width = mode->crtc_hdisplay;
 -      height = mode->crtc_vdisplay;
 +      width = mode->hdisplay;
 +      height = mode->vdisplay;
  
        /* do some mode translations */
 -      h_blank_len = mode->crtc_hblank_end - mode->crtc_hblank_start;
 -      h_sync_len = mode->crtc_hsync_end - mode->crtc_hsync_start;
 +      h_blank_len = mode->htotal - mode->hdisplay;
 +      h_sync_len = mode->hsync_end - mode->hsync_start;
  
 -      v_blank_len = mode->crtc_vblank_end - mode->crtc_vblank_start;
 -      v_sync_len = mode->crtc_vsync_end - mode->crtc_vsync_start;
 +      v_blank_len = mode->vtotal - mode->vdisplay;
 +      v_sync_len = mode->vsync_end - mode->vsync_start;
  
 -      h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start;
 -      v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start;
 +      h_sync_offset = mode->hsync_start - mode->hdisplay;
 +      v_sync_offset = mode->vsync_start - mode->vdisplay;
  
-       dtd->part1.clock = mode->clock / 10;
+       mode_clock = mode->clock;
+       mode_clock /= intel_mode_get_pixel_multiplier(mode) ?: 1;
+       mode_clock /= 10;
+       dtd->part1.clock = mode_clock;
        dtd->part1.h_active = width & 0xff;
        dtd->part1.h_blank = h_blank_len & 0xff;
        dtd->part1.h_high = (((width >> 8) & 0xf) << 4) |