1. 22 11月, 2012 2 次提交
  2. 12 11月, 2012 18 次提交
    • B
      drm/i915: Move the remaining gtt code · 26b1ff35
      Ben Widawsky 提交于
      It's pretty much all consolidated now that we've killed AGP. We can move
      the one outlier, and defines too.
      
      (Kill some unused defines in the process)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      26b1ff35
    • B
      drm/i915: flush system agent TLBs on SNB · 0f9b91c7
      Ben Widawsky 提交于
      This allows us to map the PTEs WC. I've not done thorough testing or
      performance measurements with this patch, but it should be decent.
      
      This is based on a patch from Jesse with the original commit message
      > I've only lightly tested this so far, but the corruption seems to be
      > gone if I write the GFX_FLSH_CNTL reg after binding an object.  This
      > register should control the TLB for the system agent, which is what CPU
      > mapped objects will go through.
      
      It has been updated for the new AGP-less code by me, and included with
      it is feedback from the original patch.
      
      v2: Updated to reflect paranoia on pte updates/register posting reads.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by [v1]: Jesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0f9b91c7
    • B
      drm/i915: Calculate correct stolen size for GEN7+ · 03752f5b
      Ben Widawsky 提交于
      This bug existed in the old code, but was easier to fix here in the
      rework. Unfortunately gen7 doesn't have a nice way to figure out the
      size and we must use a lookup table.
      
      As Jesse pointed out, there is some confusion in the docs about these
      definitions. We're picking the one which seems more accurate, but we
      really aren't certain.
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      03752f5b
    • B
      drm/i915: Stop using AGP layer for GEN6+ · e76e9aeb
      Ben Widawsky 提交于
      As a quick hack we make the old intel_gtt structure mutable so we can
      fool a bunch of the existing code which depends on elements in that data
      structure. We can/should try to remove this in a subsequent patch.
      
      This should preserve the old gtt init behavior which upon writing these
      patches seems incorrect. The next patch will fix these things.
      
      The one exception is VLV which doesn't have the preserved flush control
      write behavior. Since we want to do that for all GEN6+ stuff, we'll
      handle that in a later patch. Mainstream VLV support doesn't actually
      exist yet anyway.
      
      v2: Update the comment to remove the "voodoo"
      Check that the last pte written matches what we readback
      
      v3: actually kill cache_level_to_agp_type since most of the flags will
      disappear in an upcoming patch
      
      v4: v3 was actually not what we wanted (Daniel)
      Make the ggtt bind assertions better and stricter (Chris)
      Fix some uncaught errors at gtt init (Chris)
      Some other random stuff that Chris wanted
      
      v5: check for i==0 in gen6_ggtt_bind_object to shut up gcc (Ben)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by [v4]: Chris Wilson <chris@chris-wilson.co.uk>
      [danvet: Make the cache_level -> agp_flags conversion for pre-gen6 a
      tad more robust by mapping everything != CACHE_NONE to the cached agp
      flag - we have a 1:1 uncached mapping, but different modes of
      cacheable (at least on later generations). Suggested by Chris Wilson.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e76e9aeb
    • J
      drm/i915: TLB invalidation with MI_FLUSH_DW requires a post-sync op v3 · 9a289771
      Jesse Barnes 提交于
      So store into the scratch space of the HWS to make sure the invalidate
      occurs.
      
      v2: use GTT address space for store, clean up #defines (Chris)
      v3: use correct #define in blt ring flush (Chris)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1063252Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9a289771
    • J
      drm/i915: implement WaDisablePSDDualDispatchEnable on IVB & VLV · 12f3382b
      Jesse Barnes 提交于
      Workaround for dual port PS dispatch on GT1.
      
      v2: pull in register definition & offset handling
      v3: use IVB GT1 macro to get the right regs (Ben)
      v4: add for VLV too (Ben)
      v5: don't read the reg, it's masked so we'll only enable the one extra bit (Chris)
      v6: use a _GT2 suffix for the second reg (Chris)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      12f3382b
    • J
      drm/i915: implement WaDisableVLVClockGating_VBIIssue on VLV · 2d809570
      Jesse Barnes 提交于
      This allows us to get the right vblank interrupt frequency.
      
      v2: pull in register definition
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2d809570
    • J
      drm/i915: implement WaDisableDopClockGatingisable on VLV and IVB · 8ab43976
      Jesse Barnes 提交于
      v2: use correct register
      v3: remove extra hunks, pull in register definitions & offset check directly
      v4: add GT1 vs GT2 distinction for IVB portion (Ben)
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=50233Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8ab43976
    • J
      drm/i915: implement WaDisableL3CacheAging on VLV · d0cf5ead
      Jesse Barnes 提交于
      Needs to be set on every context restore as well, so set it as part of
      the initial state so we can save/restore it.  Note this removes the IVB
      workaround value from VLV and uses the default value, just adding in the
      L3 cache aging disable bit, since the IVB value is wrong for VLV.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NAntti Koskipää <antti.koskipaa@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d0cf5ead
    • P
      drm/i915: fix Haswell FDI link training code · 04945641
      Paulo Zanoni 提交于
      This commit makes hsw_fdi_link_train responsible for implementing
      everything described in the "Enable and train FDI" section from the
      Hawell CRT mode set sequence documentation. We completely rewrite
      hsw_fdi_link_train to match the documentation and we also call it in
      the right place.
      
      This patch was initially sent as a series of tiny patches fixing every
      little problem of the function, but since there were too many patches
      fixing the same function it got a little difficult to get the "big
      picture" of how the function would be in the end, so here we amended
      all the patches into a single big patch fixing the whole function.
      
      Problems we fixed:
      
        1 - Train Haswell FDI at the right time.
      
          We need to train the FDI before enabling the pipes and planes, so
          we're moving the call from lpt_pch_enable to haswell_crtc_enable
          directly.
      
          We are also removing ironlake_fdi_pll_enable since the PLL
          enablement on Haswell is completely different and is also done
          during the link training steps.
      
        2 - Use the right FDI_RX_CTL register on Haswell
      
          There is only one PCH transcoder, so it's always _FDI_RXA_CTL.
          Using "pipe" here is wrong.
      
        3 - Don't rely on DDI_BUF_CTL previous values
      
          Just set the bits we want, everything else is zero. Also
          POSTING_READ the register before sleeping.
      
        4 - Program the FDI RX TUSIZE register on hsw_fdi_link_train
      
          According to the mode set sequence documentation, this is the
          right place. According to the FDI_RX_TUSIZE register description,
          this is the value we should set.
      
          Also remove the code that sets this register from the old
          location: lpt_pch_enable.
      
        5 - Properly program FDI_RX_MISC pwrdn lane values on HSW
      
        6 - Wait only 35us for the FDI link training
      
          First we wait 30us for the FDI receiver lane calibration, then we
          wait 5us for the FDI auto training time.
      
        7 - Remove an useless indentation level on hsw_fdi_link_train
      
          We already "break" when the link training succeeds.
      
        8 - Disable FDI_RX_ENABLE, not FDI_RX_PLL_ENABLE
      
          When we fail the training.
      
        9 - Change Haswell FDI link training error messages
      
          We shouldn't call DRM_ERROR when still looping through voltage
          levels since this is expected and not really a failure. So in this
          commit we adjust the error path to only DRM_ERROR when we really
          fail after trying everything.
      
          While at it, replace DRM_DEBUG_DRIVER with DRM_DEBUG_KMS since
          it's what we use everywhere.
      
        10 - Try each voltage twice at hsw_fdi_link_train
      
          Now with Daniel Vetter's suggestion to use "/2" instead of ">>1".
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Applied tiny bikesheds:
      - mention in comment that we test each voltage/emphasis level twice
      - realing arguments of the only untouched reg write, it spilled over
        the 80 char limit ...]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      04945641
    • D
      drm/i915: implement WADP0ClockGatingDisable · ce40141f
      Daniel Vetter 提交于
      Found in Bspec vol4h South Display Engine Registers [CPT, PPT],
      section "5.3.1  TRANS_CHICKEN_1—Transcoder Chicken Bits 1"
      
      v2: Make it compile.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ce40141f
    • D
      drm/i915: CPT+ pch transcoder workaround · 23670b32
      Daniel Vetter 提交于
      We need to set the timing override chicken bit after fdi link training
      has completed and before we enable the transcoder. We also have to
      clear that bit again after disabling the pch transcoder.
      
      See "Graphics BSpec: vol4g North Display Engine Registers [IVB],
      Display Mode Set Sequence" and "Graphics BSpec: vol4h South Display
      Engine Registers [CPT, PPT], South Display Engine Transcoder and FDI
      Control, Transcoder Debug and DFT, TRANS_CHICKEN_2" bit 31:
      
      "Workaround : Enable the override prior to enabling the transcoder.
      Disable the override after disabling the transcoder."
      
      While at it, use the _PIPE macro for the other TRANS_DP register.
      
      v2: Keep the w/a as-is, but kill the original (but wrongly placed)
      workaround introduced in
      
      commit 3bcf603f
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Wed Jul 27 11:51:40 2011 -0700
      
          drm/i915: apply timing generator bug workaround on CPT and PPT
      
      and
      
      commit d4270e57
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Tue Oct 11 10:43:02 2011 -0700
      
          drm/i915: export a CPT mode set verification function
      
      Note that this old code has unconditionally set the w/a, which might
      explain why fdi link training sometimes silently fails, and especially
      why the auto-train did not seem to work properly.
      
      v3: Paulo Zanoni pointed out that this workaround is also required on
      the LPT PCH. And Arthur Ranyan confirmed that this workaround is
      requierd for all ports on the pch, not just DP: The important part
      is that the bit is set whenever the pch transcoder is enabled, and
      that it is _not_ set while the fdi link is trained. It is also
      important that the pch transcoder is fully disabled, i.e. we have to
      wait for bit 30 to clear before clearing the w/a bit.
      
      Hence move to workaround into enable/disable_transcoder, where the pch
      transcoder gets enabled/disabled.
      
      v4: Whitespace changes dropped.
      
      v5: Don't run the w/a on IBX, we only need it on CPT/PPT and LPT.
      
      v6:
      - resolve conflicts with Paulo's big hsw vga rework
      - s/!IBX/CPT since hsw paths are now all separate, and Paulo's patch
        to implement the equivalent w/a for LPT is already merged.
      
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Cc: Arthur Ranyan <arthur.j.runyan@intel.com>
      Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> (v5)
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v5)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      23670b32
    • V
    • V
      drm/i915: Fix display pixel format handling · 57779d06
      Ville Syrjälä 提交于
      Fix support for all RGB/BGR pixel formats (except the 16:16:16:16 float
      format).
      
      Fix intel_init_framebuffer() to match hardware and driver limitations:
      * RGB332 is not supported at all
      * CI8 is supported
      * XRGB1555 & co. are supported on Gen3 and earlier
      * XRGB210101010 & co. are supported from Gen4 onwards
      * BGR formats are supported from Gen4 onwards
      * YUV formats are supported from Gen5 onwards (driver limitation)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      57779d06
    • D
      drm/i915: implement WaDisableRenderCachePipelinedFlush · 4358a374
      Daniel Vetter 提交于
      Comment says for eaglelake/cantiga, but it's listed in the ilk table,
      too. So apply it to both.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4358a374
    • D
      drm/i915: Fix sprite offset on HSW · c54173a8
      Damien Lespiau 提交于
      HSW consolidates SPRTILEOFF and SPRLINOFF into a single SPROFFSET
      register.
      
      v2: Remove a useless level of indentation (Paulo Zanoni)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c54173a8
    • D
      drm/i915: Fix primary plane offset on HSW · bc1c91eb
      Damien Lespiau 提交于
      Haswell consolidates DSP_TILEOFF and DSP_LINOFF into DSP_OFFSET (aka
      PRI_OFFSET).
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bc1c91eb
    • D
      drm/i915: check fdi B/C lane sharing constraint · 01a415fd
      Daniel Vetter 提交于
      And properly toggle the chicken bit in the pch to enable/disable fdi C
      rx. If we don't set this bit correctly, the rx gets confused in link
      training, which can result in an fdi link that silently fails to train
      the link (since the corresponding register reports success). Note that
      both fdi link B and C can suffer when this bit is not set correctly.
      
      The code as-is has a few deficiencies:
      - We presume all pipes use the pch which is not the case for cpu edp.
      - We don't bother with disabling both pipes when we could make things
        work, e.g. when pipe B switched from 4 to 2 lanes due to a mode
        change, we don't bother updating the w/a bit.
      - It's ugly.
      
      All of these are because we compute ->fdi_lanes way too late, when
      we're already setting up individual pipes. We need to have this
      information in ->modeset_global_resources already, to set things up
      correctly. But that is a much larger reorg of the code.
      
      Note that we actually hit the 2 lanes limit in practice rather
      quickly: Even though the 1920x1200 mode native mode of my screen fits
      into 2 lanes, it needs 3 lanes for the 1920x1080 (since that somehow
      has much more blanking ...). Not obeying this restriction seems to
      results in cute-looking digital noise.
      
      v2: Only ever clear the chicken bit when both pipes are off.
      
      v3: Use the new ->modeset_global_resources callback.
      
      v4: Move the WARNs to the right place. Oh how I hate hacks.
      
      v5: Fix spelling, noticed by Paulo Zanoni.
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      01a415fd
  3. 26 10月, 2012 7 次提交
  4. 24 10月, 2012 1 次提交
    • D
      drm/i915: make edp panel power sequence setup more robust · 82ed61fa
      Daniel Vetter 提交于
      3 changes:
      - If a given value is unset, use the maximal limits from the eDP spec.
      - Write back the new values, since otherwise the panel power sequencing
        hw will not dtrt.
      - Revert the early bail-out in case the register values are unset.
      
      The last change reverts
      
      commit bfa3384a
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Tue Apr 10 11:58:04 2012 -0700
      
          drm/i915: check PPS regs for sanity when using eDP
      
      v2:
      - Unlock the PP regs as the very first thing. This is a required w/a
        for cpu eDP on port A, and generally a good idea.
      - Fixup the panel power control port selection bits.
      
      v3: Paulo Zanoni noticed that I've fumbled the computation of the spec
      limit values. Fix them up. We've also noticed that the t8/t9 values in
      the vbt/bios-programmed pp are much larger than any limits. My guess
      is that this is to conceal any backlight enable/disable delays. So by
      using the much shorter limits from the spec, which only concerns the
      sink, we risk that we might display before the backlight is fully on,
      or disable the output while the backlight still has afterglow. I've
      figured I don't care too much, since this will only happen when both
      the pp regs are not programmed, and the vbt tables don't contain
      anything useful.
      
      v4: Don't set the port selection bits on hsw/LPT, they don't exist any
      more.
      
      v5: Fixup spelling issues in comments, as noticed by Jesse Barnes.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Tested-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      82ed61fa
  5. 20 10月, 2012 1 次提交
    • D
      drm/i915: Consolidate ILK_DSPCLK_GATE and PCH_DSPCLK_GATE · 231e54f6
      Damien Lespiau 提交于
      Register 0x42020 was defined twice under the names PCH_DSPCLK_GATE_D and
      ILK_DSPCLK_GATE. This patch consolidate the 2 sets of defines in one.
      
      The transforms done are:
      
      PCH_DSPCLK_GATE_D    -> ILK_DSPCLK_GATE_D
      ILK_DSPCLK_GATE      -> ILK_DSPCLK_GATE_D
      
      DPARBUNIT_CLOCK_GATE_DISABLE -> ILK_DPARBUNIT_CLOCK_GATE_DISABLE
      ILK_DPARB_CLK_GATE           -> ILK_DPARBUNIT_CLOCK_GATE_DISABLE
      
      DPFDUNIT_CLOCK_GATE_DISABLE -> ILK_DPFDUNIT_CLOCK_GATE_DISABLE
      ILK_DPFD_CLK_GATE           -> ILK_DPFDUNIT_CLOCK_GATE_DISABLE
      ILK_CLK_FBC                 -> ILK_DPFDUNIT_CLOCK_GATE_DISABLE
      
      DPFCRUNIT_CLOCK_GATE_DISABLE -> ILK_DPFCRUNIT_CLOCK_GATE_DISABLE
      ILK_DPFC_DIS1                -> ILK_DPFCRUNIT_CLOCK_GATE_DISABLE
      
      DPFCUNIT_CLOCK_GATE_DISABLE -> ILK_DPFCUNIT_CLOCK_GATE_DISABLE
      ILK_DPFC_DIS2               -> ILK_DPFCUNIT_CLOCK_GATE_DISABLE
      
      We have a VHRUNIT_CLOCK_GATE_DISABLE define for the pre-ILK DSPCLK_GATE_D.
      Even if the same bit is used in ILK_DSPCLK_GATE_D, other bits in the
      register change, so I went with re-defining it, well more precisely rename
      IVB_VRHUNIT_CLK_GATE, which is not specific to IVB+. So:
      
      IVB_VRHUNIT_CLK_GATE       -> ILK_VHRUNIT_CLOCK_GATE_DISABLE
      VHRUNIT_CLOCK_GATE_DISABLE -> ILK_VHRUNIT_CLOCK_GATE_DISABLE (ILK+ code)
      
      This commit is only a renaming commit, further commits will clean up the
      logic.
      
      v2: Rename bit 5 and 7 to _ENABLE as setting them to 1 enables clock
          gating on their respective units, contrary to all of the other bits
          (Paulo Zanoni)
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      231e54f6
  6. 18 10月, 2012 4 次提交
  7. 16 10月, 2012 1 次提交
    • B
      drm/i915: Workaround to bump rc6 voltage to 450 · 31643d54
      Ben Widawsky 提交于
      BIOS should be setting the minimum voltage for rc6 to be 450mV. Old or
      buggy BIOSen may not be doing this, so we correct it for them. Ideally
      customers should update the BIOS as only it would know the optimal
      values for the platform, so we leave that fact as a DRM_ERROR for the
      user to see.
      
      Unfortunately this isn't fixing any of the issues it was targeted to
      fix, but it is documented that we must do it.
      
      CC: Jesse Barnes <jbarnes@virtuousgeek.org>
      CC: Matt Turner <mattst88@gmail.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      [danvet: bikeshedded loglevel of the "your bios is broken message" to
      debug.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      31643d54
  8. 12 10月, 2012 2 次提交
  9. 10 10月, 2012 4 次提交