1. 26 2月, 2016 2 次提交
  2. 18 2月, 2016 1 次提交
  3. 06 2月, 2016 1 次提交
    • S
      drm/i915/bxt: Check BIOS RC6 setup before enabling RC6 · 274008e8
      Sagar Arun Kamble 提交于
      RC6 setup is shared between BIOS and Driver. BIOS sets up subset of RC6
      setup registers. If those are not setup Driver should not enable RC6.
      For implementing this, driver can check RC_CTRL0 and RC_CTRL1 values
      to know if BIOS has enabled HW/SW RC6.
      This will also enable user to control RC6 using BIOS settings alone.
      RC6 related instability can be avoided by disabling via BIOS settings
      till driver fixes it.
      
      v2: Had placed logic in gen8 function by mistake. Fixed it.
      Ensuring RPM is not enabled in case BIOS disabled RC6.
      
      v3: Need to disable RPM if RC6 is disabled due to BIOS settings. (Daniel)
      Runtime PM enabling happens before gen9_enable_rc6.
      Moved the updation of enable_rc6 parameter in intel_uncore_sanitize.
      
      v4: Added elaborate check for BIOS RC6 setup. Prepared check_pctx for bxt.
          (Imre)
      
      v5: Caching reserved stolen base and size in the driver private data.
          Reorganized RC6 setup check. Moved from gen9_enable_rc6 to
          intel_uncore_sanitize. (Imre)
      
      v6: Rebasing on the patch submitted by Imre that moves gem_init_stolen
          earlier in the load.
      
      v7: Removed PWRCTX_MAXCNT_VCSUNIT1 check as it applies to SKL. (Imre)
      
      v8: Fixed formatting and checkpatch issues. Fixed functional issue where
          RC6 ctx size check was missing. (Imre)
      
      Cc: Imre Deak <imre.deak@intel.com>
      Signed-off-by: NSagar Arun Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1454697809-22113-1-git-send-email-sagar.a.kamble@intel.com
      274008e8
  4. 29 1月, 2016 1 次提交
  5. 18 1月, 2016 1 次提交
    • T
      drm/i915: Do not call API requiring struct_mutex where it is not available · ca82580c
      Tvrtko Ursulin 提交于
      LRC code was calling GEM API like i915_gem_obj_ggtt_offset from
      places where the struct_mutex cannot be grabbed (irq handlers).
      
      To avoid that this patch caches some interesting bits and values
      in the engine and context structures.
      
      Some usages are also removed where they are not needed like a
      few asserts which are either impossible or have been checked
      already during engine initialization.
      
      Side benefit is also that interrupt handlers and command
      submission stop evaluating invariant conditionals, like what
      Gen we are running on, on every interrupt and every command
      submitted.
      
      This patch deals with logical ring context id and descriptors
      while subsequent patches will deal with the remaining issues.
      
      v2:
       * Cache the VMA instead of the address. (Chris Wilson)
       * Incorporate Dave Gordon's good comments and function name.
      
      v3:
       * Extract ctx descriptor template to a function and group
         functions dealing with ctx descriptor & co together near
         top of the file. (Dave Gordon)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452870629-13830-1-git-send-email-tvrtko.ursulin@linux.intel.com
      ca82580c
  6. 10 12月, 2015 1 次提交
  7. 19 11月, 2015 2 次提交
  8. 06 10月, 2015 1 次提交
    • M
      drm/i915: prevent out of range pt in the PDE macros (take 3) · 24dfd073
      Michel Thierry 提交于
      We tried to fix this in commit fdc454c1 ("drm/i915: Prevent out of
      range pt in gen6_for_each_pde").
      
      But the static analyzer still complains that, just before we break due
      to "iter < I915_PDES", we do "pt = (pd)->page_table[iter]" with an
      iter value that is bigger than I915_PDES. Of course, this isn't really
      a problem since no one uses pt outside the macro. Still, every single
      new usage of the macro will create a new issue for us to mark as a
      false positive.
      
      Also, Paulo re-started the discussion a while ago [1], but didn't end up
      implemented.
      
      In order to "solve" this "problem", this patch takes the ideas from
      Chris and Dave, but that check would change the desired behavior of the
      code, because the object (for example pdp->page_directory[iter]) can be
      null during init/alloc, and C would take this as false, breaking the for
      loop immediately.
      
      This has been already verified with "static analysis tools".
      
      [1]http://lists.freedesktop.org/archives/intel-gfx/2015-June/068548.html
      
      v2: Make it a single statement, while preventing the common subexpression
      elimination (Chris)
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Dave Gordon <david.s.gordon@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      24dfd073
  9. 23 9月, 2015 3 次提交
  10. 15 8月, 2015 6 次提交
    • M
      drm/i915/gtt: Allow >= 4GB offsets in X86_32 · 088e0df4
      Michel Thierry 提交于
      Similar to commit c44ef60e ("drm/i915/gtt:
      Allow >= 4GB sizes for vm"), i915_gem_obj_offset and i915_gem_obj_ggtt_offset
      return an unsigned long, which in only 4-bytes long in 32-bit kernels.
      
      Change return type (and other related offset variables) to u64.
      
      Since Global GTT is always limited to 4GB, this change would not be required
      in i915_gem_obj_ggtt_offset, but this is done for consistency.
      
      v2: Remove unnecessary offset variable in do_pin, as we already have
          vma->node.start (Chris).
          Update GGTT offset too (Tvrtko).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      088e0df4
    • M
      drm/i915/gen8: Initialize PDPs and PML4 · 69ab76fd
      Michel Thierry 提交于
      Similar to PDs, while setting up a page directory pointer, make all entries
      of the pdp point to the scratch pd before mapping (and make all its entries
      point to the scratch page); this is to be safe in case of out of bound
      access or  proactive prefetch.
      
      Also add a scratch pdp, which the PML4 entries point to.
      
      v2: Handle scratch_pdp allocation failure correctly, and keep
      initialize_px functions together (Akash)
      v3: Rebase after Mika's ppgtt cleanup / scratch merge patch series. Rely on
      the added macros to initialize the pdps.
      v4: Rebase after final merged version of Mika's ppgtt/scratch patches
      (and removed commit message part related to v3).
      v5: Update commit message to also mention PML4 table initialization and
      the new scratch pdp (Akash).
      Suggested-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      69ab76fd
    • M
      drm/i915/gen8: implement alloc/free for 4lvl · 762d9936
      Michel Thierry 提交于
      PML4 has no special attributes, and there will always be a PML4.
      So simply initialize it at creation, and destroy it at the end.
      
      The code for 4lvl is able to call into the existing 3lvl page table code
      to handle all of the lower levels.
      
      v2: Return something at the end of gen8_alloc_va_range_4lvl to keep the
      compiler happy. And define ret only in one place.
      Updated gen8_ppgtt_unmap_pages and gen8_ppgtt_free to handle 4lvl.
      v3: Use i915_dma_unmap_single instead of pci API. Fix a
      couple of incorrect checks when unmapping pdp and pd pages (Akash).
      v4: Call __pdp_fini also for 32b PPGTT. Clean up alloc_pdp param list.
      v5: Prevent (harmless) out of range access in gen8_for_each_pml4e.
      v6: Simplify alloc_vma_range_4lvl and gen8_ppgtt_init_common error
      paths. (Akash)
      v7: Rebase, s/gen8_ppgtt_free_*/gen8_ppgtt_cleanup_*/.
      v8: Change location of pml4_init/fini. It will make next patches
      cleaner.
      v9: Rebase after Mika's ppgtt cleanup / scratch merge patch series, while
      trying to reuse as much as possible for pdp alloc. pml4_init/fini
      replaced by setup/cleanup_px macros.
      v10: Rebase after Mika's merged ppgtt cleanup patch series.
      v11: Rebase after final merged version of Mika's ppgtt/scratch
      patches.
      v12: Fix pdpe start value in trace (Akash)
      v13: Define all 4lvl functions in this patch directly, instead of
      previous patches, add i915_page_directory_pointer_entry_alloc here,
      use test_bit to detect when pdp is already allocated (Akash).
      v14: Move pdp allocation into a new gen8_ppgtt_alloc_page_dirpointers
      funtion, as we do for pds and pts; move pd and pdp setup functions to
      this patch (Akash).
      v15: Added kfree(pdp) from previous patch to this (Akash).
      
      Cc: Akash Goel <akash.goel@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      762d9936
    • M
      drm/i915/gen8: Add PML4 structure · 81ba8aef
      Michel Thierry 提交于
      Introduces the Page Map Level 4 (PML4), ie. the new top level structure
      of the page tables.
      
      To facilitate testing, 48b mode will be available on Broadwell and
      GEN9+, when i915.enable_ppgtt = 3.
      
      v2: Remove unnecessary CONFIG_X86_64 checks, ppgtt code is already
      32/64-bit safe (Chris).
      v3: Add goto free_scratch in temp 48-bit mode init code (Akash).
      v4: kfree the pdp until the 4lvl alloc/free patch (Akash).
      v5: Postpone 48-bit code in sanitize_enable_ppgtt (Akash).
      v6: Keep _insert_pte_entries changes outside this patch (Akash).
      
      Cc: Akash Goel <akash.goel@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      81ba8aef
    • M
      drm/i915/gen8: Make pdp allocation more dynamic · 6ac18502
      Michel Thierry 提交于
      This transitional patch doesn't do much for the existing code. However,
      it should make upcoming patches to use the full 48b address space a bit
      easier.
      
      32-bit ppgtt uses just 4 PDPs, while 48-bit ppgtt will have up-to 512;
      this patch prepares the existing functions to query the right number of pdps
      at run-time. This also means that used_pdpes should also be allocated during
      ppgtt_init, as the bitmap size will depend on the ppgtt address range
      selected.
      
      v2: Renamed  pdp_free to be similar to  pd/pt (unmap_and_free_pdp).
      v3: To facilitate testing, 48b mode will be available on Broadwell and
      GEN9+, when i915.enable_ppgtt = 3.
      v4: Rebase after s/page_tables/page_table/, added extra information
      about 4-level page table formats and use IS_ENABLED macro.
      v5: Check CONFIG_X86_64 instead of CONFIG_64BIT.
      v6: Rebase after Mika's ppgtt cleanup / scratch merge patch series, and
      follow
      his nomenclature in pdp functions (there is no alloc_pdp yet).
      v7: Rebase after merged version of Mika's ppgtt cleanup patch series.
      v8: Rebase after final merged version of Mika's ppgtt/scratch patches.
      v9: Introduce PML4 (and 48-bit checks) until next patch (Akash).
      v10: Also use test_bit to detect when pd/pt are already allocated (Akash)
      
      Cc: Akash Goel <akash.goel@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v2+)
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      [danvet: Amend commit message as suggested by Michel.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6ac18502
    • M
      drm/i915: Remove unnecessary gen8_clamp_pd · 09120d4e
      Michel Thierry 提交于
      gen8_clamp_pd clamps to the next page directory boundary, but the macro
      gen8_for_each_pde already has a check to stop at the page directory
      boundary.
      
      Furthermore, i915_pte_count also restricts to the next page table
      boundary.
      
      v2: Rebase after Mika's ppgtt cleanup / scratch merge patch series.
      Suggested-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: N"Akash Goel" <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      09120d4e
  11. 26 6月, 2015 6 次提交
  12. 24 6月, 2015 1 次提交
  13. 23 6月, 2015 3 次提交
  14. 08 5月, 2015 2 次提交
  15. 24 4月, 2015 1 次提交
  16. 20 4月, 2015 2 次提交
  17. 10 4月, 2015 5 次提交
  18. 27 3月, 2015 1 次提交
    • J
      drm/i915: Compare GGTT view structs instead of types · 9abc4648
      Joonas Lahtinen 提交于
      To allow for views where the view type is not defined by the view type only,
      like it is in stereo or rotated 90 degree view, change the semantic to require
      the whole view structure for comparison when we match a GGTT view.
      
      This allows including parameters like offset to be included in the view which
      is useful for eg. partial views.
      
      v3:
      - Rely on ggtt_view type being 0 for non-GGTT vma's, which equals to
        I915_GGTT_VIEW_NORMAL. (Daniel Vetter)
      - Do not use potentially slower comparison when we only want to know if
        something is or is not a normal view.
      - Rebase on top of rotated view patches. Add rotated view singleton.
      - If one view is missing in comparison they're equal only if both are missing.
      
      v4:
      - Use comparison helper in obj_to_ggtt_view too. (Tvrtko Ursulin)
      - Do WARN_ON if one view is NULL. (Tvrtko Ursulin)
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9abc4648