1. 17 Dec, 2013 21 commits
  2. 16 Dec, 2013 3 commits
  3. 14 Dec, 2013 3 commits
  4. 13 Dec, 2013 4 commits
  5. 12 Dec, 2013 9 commits
    • Mika Kuoppala's avatar
      drm/i915: dont call irq_put when irq test is on · 168c3f21
      Mika Kuoppala authored
      If test is running, irq_get was not called so we should gain
      balance by not doing irq_put
      
      "So the rule is: if you access unlocked values, you use ACCESS_ONCE().
      You don't say "but it can't matter". Because you simply don't know."
      -- Linus
      
      v2: use local variable so it can't change during test (Chris)
      
      v3: update commit msg and use ACCESS_ONCE (Ville)
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      168c3f21
    • Ville Syrjälä's avatar
      drm/i915: Rework the FBC interval/stall stuff a bit · 993495ae
      Ville Syrjälä authored
      Don't touch DPFC_RECOMP_CTL on FBC2, use RMW to update
      the FBC_CONTROL on FBC1 to make it easier for people to
      experiment with different numbers. Also fix the interval
      mask for FBC1.
      
      v2: Rebased
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      993495ae
    • Ville Syrjälä's avatar
      drm/i915: Enable FBC for all mobile gen2 and gen3 platforms · fd70d52a
      Ville Syrjälä authored
      All mobile gen2 and gen3 chipsets should have FBC1, and the code
      should now handle them all. So just set has_fbc=true for all such
      chipsets.
      
      Note that fbc is still disabled by default for now.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      fd70d52a
    • Ville Syrjälä's avatar
      drm/i915: FBC_CONTROL2 is gen4 only · 159f9875
      Ville Syrjälä authored
      Gen2 and gen3 don't have the FBC_CONTROL2 register, so don't
      touch it.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      159f9875
    • Ville Syrjälä's avatar
      drm/i915: Gen2 FBC1 CFB pitch wants 32B units · 42a430f5
      Ville Syrjälä authored
      On gen2 the compressed frame buffer pitch is specified in 32B units
      rather than the 64B units used on gen3+.
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      42a430f5
    • Paulo Zanoni's avatar
      drm/i915: split intel_ddi_pll_mode_set in 2 pieces · 566b734a
      Paulo Zanoni authored
      The first piece, intel_ddi_pll_select, finds a PLL and assigns it to
      the CRTC, but doesn't write any register. It can also fail in case it
      doesn't find a PLL.
      
      The second piece, intel_ddi_pll_enable, uses the information stored by
      intel_ddi_pll_select to actually enable the PLL by writing to its
      register. This function can't fail. We also have some refcount sanity
      checks here.
      
      The idea is that one day we'll remove all the functions that touch
      registers from haswell_crtc_mode_set to haswell_crtc_enable, so we'll
      call intel_ddi_pll_select at haswell_crtc_mode_set and then call
      intel_ddi_pll_enable at haswell_crtc_enable. Since I'm already
      touching this code, let's take care of this particular split today.
      
      v2: - Clock on the debug message is in KHz
          - Add missing POSTING_READ
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      [danvet: Bikeshed comments.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      566b734a
    • Mika Kuoppala's avatar
      drm/i915: Fix timeout with missed interrupts in __wait_seqno · 47e9766d
      Mika Kuoppala authored
      Commit 094f9a54 ("drm/i915: Fix __wait_seqno to use true infinite
      timeouts") added support for __wait_seqno to detect missing interrupts and
      go around them by polling. As there is also timeout detection in
      __wait_seqno, the polling and timeout detection were done with the same
      timer.
      
      When there has been missed interrupts and polling is needed, the timer is
      set to trigger in (now + 1) jiffies in future, instead of the caller
      specified timeout.
      
      Now when io_schedule() returns, we calculate the jiffies left to timeout
      using the timer expiration value. As the current jiffies is now bound to be
      always equal or greater than the expiration value, the timeout_jiffies will
      become zero or negative and we return -ETIME to caller even tho the
      timeout was never reached.
      
      Fix this by decoupling timeout calculation from timer expiration.
      
      v2: Commit message with some sense in it (Chris Wilson)
      
      v3: add parenthesis on timeout_expire calculation
      
      v4: don't read jiffies without timeout (Chris Wilson)
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      47e9766d
    • Paulo Zanoni's avatar
      drm/i915: touch VGA MSR after we enable the power well · f9dcb0df
      Paulo Zanoni authored
      Fixes regression introduced by:
          commit bf51d5e2
          Author: Paulo Zanoni <paulo.r.zanoni at intel.com>
          Date:   Wed Jul 3 17:12:13 2013 -0300
              drm/i915: switch disable_power_well default value to 1
      
      The bug I'm seeing can be reproduced with:
        - Have vgacon configured/enabled
        - Make sure the power well gets disabled, then enabled. You can
          check this by seeing the messages print by hsw_set_power_well
        - Stop your display manager
        - echo 0 > /sys/class/vtconsole/vtcon1/bind
      
      I can easily reproduce this by blacklising snd_hda_intel and booting
      with eDP+HDMI.
      
      If you do this and then look at dmesg, you'll see we're printing
      infinite "Unclaimed register" messages. This is happening because
      we're stuck on an infinite loop inside console_unlock(), which is
      calling many functions from vgacon.c. And the code that's triggering
      the error messages is from vgacon_set_cursor_size().
      
      After we re-enable the power well, every time we read/write the VGA
      address 0x3d5 we get an "unclaimed register" interrupt (ERR_INT) and
      print error messages. If we write anything to the VGA MSR register (it
      doesn't really matter which value you write to bit 0), any
      reads/writes to 0x3d5 _don't_ trigger the "unclaimed register" errors
      anymore (even if MSR bit 0 is zero). So what happens with the current
      code is that when we unbind i915 and bind vgacon, we call
      console_unlock(). Function console_unlock() is responsible for
      printing any messages that were supposed to be print when the console
      was locked, so it calls the TTY layer, which calls the console layer,
      which calls vgacon to print the messages. At this point, vgacon
      eventually calls vgacon_set_cursor_size(), which touches 0x3d5, which
      triggers unclaimed register interrupts. The problem is that when we
      get these interrupts, we print the error messages, so we add more work
      to console_unlock(), which will try to print it again, and then call
      vgacon again, trigger a new interrupt, which will put more stuff to
      the buffer, and then we'll be stuck at console_unlock() forever.
      
      If you patch intel_uncore.c to not print anything when we detect
      unclaimed registers, we won't get into the console_unlock() infinite
      loop and the driver unbind will work just fine. We will still be
      getting interrupts every time vgacon touches those registers, but we
      will survive. This is a valid experiment, but IMHO it's not the real
      fix: if we don't print any error messages we will still keep getting
      the interrupts, and if we disable ERR_INT we won't get the interrupt
      anymore, but we will also stop getting all the other error interrupts.
      
      I talked about this problem with the HW engineer and his
      recommendation is "So don't do any VGA I/O or memory access while the
      power well is disabled, and make to re-program MSR after enabling the
      power well and before using VGA I/O or memory accesses.".
      
      Notice that this is just a partial fix to fd.o #67813. This fixes the
      case where the power well is already enabled when we unbind, not when
      it's disabled when we unbind.
      
      V2: - Rebase (first version was sent in September).
      V3: - Complete rewrite of the same fix: smaller implementation,
            improved commit message.
      
      Testcase: igt/drv_module_reload
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67813Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f9dcb0df
    • Paulo Zanoni's avatar
      drm/i915: extract hsw_power_well_post_{enable, disable} · d5e8fdc8
      Paulo Zanoni authored
      I want to add more code to the post_enable function.
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      d5e8fdc8