1. 12 Dec, 2013 8 commits
    • 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
    • Paulo Zanoni's avatar
      drm/i915: remove i915_disable_vga_mem declaration · b6646074
      Paulo Zanoni authored
      It was supposed to have been killed on the same commit that killed the
      function, e1264ebe, but I guess the
      intel_drv.h reorganization accidentally brought it back.
      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>
      b6646074
  2. 11 Dec, 2013 16 commits
  3. 10 Dec, 2013 14 commits
  4. 09 Dec, 2013 2 commits
    • Deepak S's avatar
      drm/i915: Remove duplicate intel_uncore_forcewake_reset. · c461562e
      Deepak S authored
      Since early sanitize and uncore sanitize are called one after the other,
      I think, we can remove second forcewake reset which was are calling
      twice in both the functions.
      
      Note that this is merge fallout between
      
      commit ef46e0d2
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Nov 16 16:00:09 2013 +0100
      
          drm/i915: restore the early forcewake cleanup
      
      and
      
      commit 521198a2
      Author: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Date:   Fri Aug 23 16:52:30 2013 +0300
      
          drm/i915: sanitize forcewake registers on reset
      Signed-off-by: default avatarDeepak S <deepak.s@intel.com>
      [danvet: Explain how this came to be.]
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      c461562e
    • Daniel Vetter's avatar
      Merge tag 'v3.13-rc3' into drm-intel-next-queued · f7698ba7
      Daniel Vetter authored
      Linux 3.13-rc3
      
      I need a backmerge for two reasons:
      - For merging the ppgtt patches from Ben I need to pull in the bdw
        support.
      - We now have duplicated calls to intel_uncore_forcewake_reset in the
        setup code to due 2 different patches merged into -next and 3.13.
        The conflict is silen so I need the merge to be able to apply
        Deepak's fixup patch.
      
      Conflicts:
      	drivers/gpu/drm/i915/intel_display.c
      
      Trivial conflict, it doesn't even show up in the merge diff.
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      f7698ba7