1. 21 10月, 2014 1 次提交
  2. 08 9月, 2014 1 次提交
    • C
      drm/i915: Evict CS TLBs between batches · c4d69da1
      Chris Wilson 提交于
      Running igt, I was encountering the invalid TLB bug on my 845g, despite
      that it was using the CS workaround. Examining the w/a buffer in the
      error state, showed that the copy from the user batch into the
      workaround itself was suffering from the invalid TLB bug (the first
      cacheline was broken with the first two words reversed). Time to try a
      fresh approach. This extends the workaround to write into each page of
      our scratch buffer in order to overflow the TLB and evict the invalid
      entries. This could be refined to only do so after we update the GTT,
      but for simplicity, we do it before each batch.
      
      I suspect this supersedes our current workaround, but for safety keep
      doing both.
      
      v2: The magic number shall be 2.
      
      This doesn't conclusively prove that it is the mythical TLB bug we've
      been trying to workaround for so long, that it requires touching a number
      of pages to prevent the corruption indicates to me that it is TLB
      related, but the corruption (the reversed cacheline) is more subtle than
      a TLB bug, where we would expect it to read the wrong page entirely.
      
      Oh well, it prevents a reliable hang for me and so probably for others
      as well.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      c4d69da1
  3. 03 9月, 2014 7 次提交
    • V
      drm/i915: Idle unused rings on gen2/3 during init/resume · 81e7f200
      Ville Syrjälä 提交于
      gen2/3 platforms have a boatload of rings we're not using. On my 830
      the BIOS/hw can leave some of those "active" after resume which will
      prevent c3 entry. The ring is apparently considered active whenever
      head != tail even if the ring is disabled.
      
      Disable and clear all such unused ringbuffers on init/resume.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      81e7f200
    • V
      drm/i915: Disable trickle feed for gen2/3 · 1038392b
      Ville Syrjälä 提交于
      My 830 is unhappy with trickle feed enabled. The symptom is that
      the image on the screen shifts a bit to right occasionally.
      
      The BIOS initially disables trickle feed, but it gets reset during
      suspend, so we need to re-disable it ourselves. Juse disable it
      always.
      
      Also disable it for all other gen2/3 platforms since we disable it
      for all more recent platforms as well (until HSW that is). At least
      my 855 doesn't seem to mind us doing this. I don't have gen3
      hardware to test that.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1038392b
    • D
      drm/i915/bdw: BDW Software Turbo · c76bb61a
      Daisy Sun 提交于
      BDW supports GT C0 residency reporting in constant time unit. Driver
      calculates GT utilization based on C0 residency and adjusts RP
      frequency up/down accordingly. For offscreen workload specificly,
      set frequency to RP0.
      
      Offscreen task is not restricted by frame rate, it can be
      executed as soon as possible. Transcoding and serilized workload
      between CPU and GPU both need high GT performance, RP0 is a good
      option in this case. RC6 will kick in to compensate power
      consumption when GT is not active.
      
      v2: Rebase on recent drm-intel-nightly
      v3: Add flip timerout monitor, when no flip is deteced within
      100ms, set frequency to RP0.
      Signed-off-by: NDaisy Sun <daisy.sun@intel.com>
      [torourke: rebased on latest and resolved conflict]
      Signed-off-by: NTom O'Rourke <Tom.O'Rourke@intel.com>
      Acked-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c76bb61a
    • V
      drm/i915: Populate mem_freq in init_gt_powerwave() · 2bb25c17
      Ville Syrjälä 提交于
      init_clock_gating() is too late to read out the mem_freq. We already
      want to print out the GPU MHz numbers before it's called. Move the
      mem_freq setup to init_gt_powersave().
      
      v2: Also kill the CHV_CZ_CLOCK_FREQ_MODE_* defines
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDeepak S <deepak.s@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2bb25c17
    • S
      drm/i915: Rename defines for selection of ddi buffer translation slot · c5fe6a06
      Sonika Jindal 提交于
      Renaming the HSW-specific macros for ddi buffer translation slot to denote the
      slot and not the vswing/pre-emph values as they are platform-dependent.
      
      This patch is based on top of the patch series for renaming the DP training
      vswing/pre-emph defines:
      http://lists.freedesktop.org/archives/intel-gfx/2014-August/050407.html
      
      v2: Creating single macro with argument for slot number (Damien)
      v3: Adding macro for num of translation entries (Damien)
      Signed-off-by: NSonika Jindal <sonika.jindal@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c5fe6a06
    • V
      drm/i915: Parametrize PANEL_PORT_SELECT_VLV · ad933b56
      Ville Syrjälä 提交于
      Passing the port as a parameter to PANEL_PORT_SELECT_VLV results in
      neater code. Sadly the PCH port select bits aren't suitable for the
      same treatment and the resulting macro would be much uglier, so
      leave those defines as is.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ad933b56
    • S
      drm/i915: Add 180 degree primary plane rotation support · 48404c1e
      Sonika Jindal 提交于
      Primary planes support 180 degree rotation. Expose the feature
      through rotation drm property.
      
      v2: Calculating linear/tiled offsets based on pipe source width and
      height. Added 180 degree rotation support in ironlake_update_plane.
      
      v3: Checking if CRTC is active before issueing update_plane. Added
      wait for vblank to make sure we dont overtake page flips. Disabling
      FBC since it does not work with rotated planes.
      
      v4: Updated rotation checks for pending flips, fbc disable. Creating
      rotation property only for Gen4 onwards. Property resetting as part
      of lastclose.
      
      v5: Resetting property in i915_driver_lastclose properly for planes
      and crtcs. Fixed linear offset calculation that was off by 1 w.r.t
      width in i9xx_update_plane and ironlake_update_plane. Removed tab
      based indentation and unnecessary braces in intel_crtc_set_property
      and intel_update_fbc. FBC and flip related checks should be done only
      for valid crtcs.
      
      v6: Minor nits in FBC disable checks for comments in intel_crtc_set_property
      and positioning the disable code in intel_update_fbc.
      
      v7: In case rotation property on inactive crtc is updated, we return
      successfully printing debug log as crtc is inactive and only property change
      is preserved.
      
      v8: update_plane is changed to update_primary_plane, crtc->fb is changed to
      crtc->primary->fb  and return value of update_primary_plane is ignored.
      
      v9: added rotation property to primary plane instead of crtc. Removing reset
      of rotation property from lastclose. rotation_property is moved to
      drm_mode_config, so drm layer will take care of resetting. Adding updation of
      fbc when rotation is set to 0. Allowing rotation only if value is
      different than old one.
      
      v10: Calling intel_primary_plane_setplane instead of update_primary_plane in
      set_property(Daniel).
      
      v11: Using same set_property function for both primary and sprite, Adding
      primary plane specific code in the same function (Matt).
      
      v12: Removing disabling/ enabling of fbc from set_property because it is done
      from intel_pipe_set_base. Other formatting
      
      v13: we need to call disable_fbc before changing the rotation to 180,
      disable_fbc from intel_pipe_set_base gets called very late, that will
      be used to re-enable fbc if rotation is set to 0 (Ville).
      
      Testcase: igt/kms_rotation_crc
      Signed-off-by: NUma Shankar <uma.shankar@intel.com>
      Signed-off-by: NSagar Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: NSonika Jindal <sonika.jindal@intel.com>
      [danvet: Add FIXME to explain why we need the open-coded update_fbc
      hunk to disable fbc when rotated 180 degree. And make checkpatch
      happier.]
      Acked-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      48404c1e
  4. 13 8月, 2014 1 次提交
  5. 12 8月, 2014 2 次提交
  6. 11 8月, 2014 1 次提交
    • O
      drm/i915/bdw: Populate LR contexts (somewhat) · 8670d6f9
      Oscar Mateo 提交于
      For the most part, logical ring context objects are similar to hardware
      contexts in that the backing object is meant to be opaque. There are
      some exceptions where we need to poke certain offsets of the object for
      initialization, updating the tail pointer or updating the PDPs.
      
      For our basic execlist implementation we'll only need our PPGTT PDs,
      and ringbuffer addresses in order to set up the context. With previous
      patches, we have both, so start prepping the context to be load.
      
      Before running a context for the first time you must populate some
      fields in the context object. These fields begin 1 PAGE + LRCA, ie. the
      first page (in 0 based counting) of the context  image. These same
      fields will be read and written to as contexts are saved and restored
      once the system is up and running.
      
      Many of these fields are completely reused from previous global
      registers: ringbuffer head/tail/control, context control matches some
      previous MI_SET_CONTEXT flags, and page directories. There are other
      fields which we don't touch which we may want in the future.
      
      v2: CTX_LRI_HEADER_0 is MI_LOAD_REGISTER_IMM(14) for render and (11)
      for other engines.
      
      v3: Several rebases and general changes to the code.
      
      v4: Squash with "Extract LR context object populating"
      Also, Damien's review comments:
      - Set the Force Posted bit on the LRI header, as the BSpec suggest we do.
      - Prevent warning when compiling a 32-bits kernel without HIGHMEM64.
      - Add a clarifying comment to the context population code.
      
      v5: Damien's review comments:
      - The third MI_LOAD_REGISTER_IMM in the context does not set Force Posted.
      - Remove dead code.
      
      v6: Add a note about the (presumed) differences between BDW and CHV state
      contexts. Also, Brad's review comments:
      - Use the _MASKED_BIT_ENABLE, upper_32_bits and lower_32_bits macros.
      - Be less magical about how we set the ring size in the context.
      
      Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com> (v2)
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8670d6f9
  7. 08 8月, 2014 14 次提交
  8. 07 8月, 2014 1 次提交
  9. 21 7月, 2014 1 次提交
  10. 12 7月, 2014 2 次提交
  11. 11 7月, 2014 4 次提交
  12. 10 7月, 2014 1 次提交
    • P
      drm/i915: fix D_COMP usage on BDW · 9ccd5aeb
      Paulo Zanoni 提交于
      On HSW, the D_COMP register can be accessed through the mailbox (read
      and write) or through MMIO on a MCHBAR offset (read only). On BDW, the
      access should be done through MMIO on another address. So to account
      for all these cases, create hsw_read_dcomp() with the correct
      implementation for reading, and also fix hsw_write_dcomp() to do the
      correct thing on BDW.
      
      With this patch, we can now get back from the PC8+ state on BDW. We
      were previously getting a black screen and lots of dmesg errors.
      Please notice that the bug only happens when you actually reach the
      PC8+ states, not when you only allow it.
      
      Testcase: igt/pm_rpm/rte
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9ccd5aeb
  13. 09 7月, 2014 2 次提交
  14. 08 7月, 2014 2 次提交
    • B
      drm/i915/bdw: implement semaphore wait · 5ee426ca
      Ben Widawsky 提交于
      Semaphore waits use a new instruction, MI_SEMAPHORE_WAIT. The seqno to
      wait on is all well defined by the table in the previous patch. There is
      nothing else different from previous GEN's semaphore synchronization
      code.
      
      v2: Update macros to not require the other ring's ring->id (Chris)
      
      v3: Add missing VCS2 gen8_ring_wait init besides
          s/ring_buffer/engine_cs (Rodrigo)
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5ee426ca
    • B
      drm/i915/bdw: implement semaphore signal · 3e78998a
      Ben Widawsky 提交于
      Semaphore signalling works similarly to previous GENs with the exception
      that the per ring mailboxes no longer exist. Instead you must define
      your own space, somewhere in the GTT.
      
      The comments in the code define the layout I've opted for, which should
      be fairly future proof. Ie. I tried to define offsets in abstract terms
      (NUM_RINGS, seqno size, etc).
      
      NOTE: If one wanted to move this to the HWSP they could. I've decided
      one 4k object would be easier to deal with, and provide potential wins
      with cache locality, but that's all speculative.
      
      v2: Update the macro to not need the other ring's ring->id (Chris)
      Update the comment to use the correct formula (Chris)
      
      v3: Move the macros the ringbuffer.h to prevent churn in next patch
      (Ville)
      
      v4: Fixed compilation rebase conflict
      commit 1ec9e26d
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Feb 14 14:01:11 2014 +0100
      
          drm/i915: Consolidate binding parameters into flags
      
      v5: VCS2 rebase
      Replace hweight_long with hweight32
      
      v6 (Rodrigo): * Add missed VC2 gen8 ring signal init
         	      * fixing conflicst on rebase
          	      * minor fixes on address table
      	      * remove WARN_ON
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      [danvet: s/BUG_ON/WARN_ON/]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3e78998a