1. 18 10月, 2012 1 次提交
    • C
      drm/i915: Allow DRM_ROOT_ONLY|DRM_MASTER to submit privileged batchbuffers · d7d4eedd
      Chris Wilson 提交于
      With the introduction of per-process GTT space, the hardware designers
      thought it wise to also limit the ability to write to MMIO space to only
      a "secure" batch buffer. The ability to rewrite registers is the only
      way to program the hardware to perform certain operations like scanline
      waits (required for tear-free windowed updates). So we either have a
      choice of adding an interface to perform those synchronized updates
      inside the kernel, or we permit certain processes the ability to write
      to the "safe" registers from within its command stream. This patch
      exposes the ability to submit a SECURE batch buffer to
      DRM_ROOT_ONLY|DRM_MASTER processes.
      
      v2: Haswell split up bit8 into a ppgtt bit (still bit8) and a security
      bit (bit 13, accidentally not set). Also add a comment explaining why
      secure batches need a global gtt binding.
      
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      [danvet: added hsw fixup.]
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d7d4eedd
  2. 20 9月, 2012 1 次提交
  3. 09 9月, 2012 1 次提交
  4. 24 8月, 2012 1 次提交
  5. 17 8月, 2012 2 次提交
  6. 10 8月, 2012 2 次提交
  7. 08 8月, 2012 1 次提交
    • C
      drm/i915: Add I915_GEM_PARAM_HAS_SEMAPHORES · 2fedbff9
      Chris Wilson 提交于
      Userspace tries to estimate the cost of ring switching based on whether
      the GPU and GEM supports semaphores. (If we have multiple rings and no
      semaphores, userspace assumes that the cost of switching rings between
      batches is exorbitant and will endeavour to keep the next batch on the
      active ring - as a coarse approximation to tracking both destination and
      source surfaces.) Currently userspace has to guess whether semaphores
      exist based on the chipset generation and the module parameter,
      i915.semaphores. This is a crude and inaccurate guess as the defaults
      internally depend upon other chipset features being enabled or disabled,
      nor does it extend well into the future. By exporting a HAS_SEMAPHORES
      parameter, we can easily query the driver and obtain an accurate answer.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2fedbff9
  8. 26 7月, 2012 2 次提交
    • C
      drm/i915: Export ability of changing cache levels to userspace · e6994aee
      Chris Wilson 提交于
      By selecting the cache level (essentially whether or not the CPU snoops
      any updates to the bo, and on more recent machines whether it resides
      inside the CPU's last-level-cache) a userspace driver is able to then
      manage all of its memory within buffer objects, if it so desires. This
      enables the userspace driver to accelerate uploads and more importantly
      downloads from the GPU and to able to mix CPU and GPU rendering/activity
      efficiently.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Added code comment about where we plan to stuff platform
      specific cacheing control bits in the ioctl struct.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e6994aee
    • B
      drm/i915: add register read IOCTL · c0c7babc
      Ben Widawsky 提交于
      The interface's immediate purpose is to do synchronous timestamp queries
      as required by GL_TIMESTAMP. The GPU has a register for reading the
      timestamp but because that would normally require root access through
      libpciaccess, the IOCTL can provide this service instead.
      
      Currently the implementation whitelists only the render ring timestamp
      register, because that is the only thing we need to expose at this time.
      
      v2: make size implicit based on the register offset
      Add a generation check
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Cc: Jacek Lawrynowicz <jacek.lawrynowicz@intel.com>
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      [danvet: fixup the ioctl numerb:]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c0c7babc
  9. 25 7月, 2012 1 次提交
    • D
      drm/i915: unbreak lastclose for failed driver init · e8aeaee7
      Daniel Vetter 提交于
      We now refuse to load on gen6+ if kms is not enabled:
      
      commit 26394d92
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Mon Mar 26 21:33:18 2012 +0200
      
          drm/i915: refuse to load on gen6+ without kms
      
      Which results in the drm core calling our lastclose function to clean
      up the mess, but that one is neatly broken for such failure cases
      since kms has been introduced in
      
      commit 79e53945
      Author: Jesse Barnes <jbarnes@virtuousgeek.org>
      Date:   Fri Nov 7 14:24:08 2008 -0800
      
          DRM: i915: add mode setting support
      Reported-and-tested-by: NPaulo Zanoni <przanoni@gmail.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e8aeaee7
  10. 05 7月, 2012 1 次提交
    • P
      drm/i915: get rid of dev_priv->info->has_pch_split · 45e6e3a1
      Paulo Zanoni 提交于
      Previously we had has_pch_split to tell us whether we had a PCH or not
      and we also had dev_priv->pch_type to tell us which kind of PCH it
      was, but it could only be used if we were 100% sure we did have a PCH.
      Now that PCH_NONE was added to dev_priv->pch_type we don't need
      has_pch_split anymore: we can just check for pch_type != PCH_NONE.
      
      The HAS_PCH_{IBX,CPT,LPT} macros use dev_priv->pch_type, so they can
      only be called after intel_detect_pch. The HAS_PCH_SPLIT macro looks
      at dev_priv->info->has_pch_split, which is available earlier.
      
      Since the goal is to implement HAS_PCH_SPLIT using dev_priv->pch_type
      instead of dev_priv->info->has_pch_split, we need to make sure that
      intel_detect_pch is called before any calls to HAS_PCH_SPLIT are made.
      So we moved the intel_detect_pch call to an earlier stage.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      45e6e3a1
  11. 04 7月, 2012 1 次提交
  12. 03 7月, 2012 1 次提交
    • D
      drm/i915: kick any firmware framebuffers before claiming the gtt · 9f846a16
      Daniel Vetter 提交于
      Especially vesafb likes to map everything as uc- (yikes), and if that
      mapping hangs around still while we try to map the gtt as wc the
      kernel will downgrade our request to uc-, resulting in abyssal
      performance.
      
      Unfortunately we can't do this as early as readon does (i.e. as the
      first thing we do when initializing the hw) because our fb/mmio space
      region moves around on a per-gen basis. So I've had to move it below
      the gtt initialization, but that seems to work, too. The important
      thing is that we do this before we set up the gtt wc mapping.
      
      Now an altogether different question is why people compile their
      kernels with vesafb enabled, but I guess making things just work isn't
      bad per se ...
      
      v2:
      - s/radeondrmfb/inteldrmfb/
      - fix up error handling
      
      v3: Kill #ifdef X86, this is Intel after all. Noticed by Ben Widawsky.
      
      v4: Jani Nikula complained about the pointless bool primary
      initialization.
      
      v5: Don't oops if we can't allocate, noticed by Chris Wilson.
      
      v6: Resolve conflicts with agp rework and fixup whitespace.
      
      This is commit e188719a in drm-next.
      
      Backport to 3.5 -fixes queue requested by Dave Airlie - due to grub
      using vesa on fedora their initrd seems to load vesafb before loading
      the real kms driver. So tons more people actually experience a
      dead-slow gpu. Hence also the Cc: stable.
      
      Cc: stable@vger.kernel.org
      Reported-and-tested-by: N"Kilarski, Bernard R" <bernard.r.kilarski@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      9f846a16
  13. 26 6月, 2012 1 次提交
  14. 20 6月, 2012 2 次提交
  15. 14 6月, 2012 2 次提交
    • B
      drm/i915/context: create & destroy ioctls · 84624813
      Ben Widawsky 提交于
      Add the interfaces to allow user space to create and destroy contexts.
      Contexts are destroyed automatically if the file descriptor for the dri
      device is closed.
      
      Following convention as usual here causes checkpatch warnings.
      
      v2: with is_initialized, no longer need to init at create
      drop the context switch on create (daniel)
      
      v3: Use interruptible lock (Chris)
      return -ENODEV in !GEM case (Chris)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      84624813
    • B
      drm/i915: preliminary context support · 254f965c
      Ben Widawsky 提交于
      Very basic code for context setup/destruction in the driver.
      
      Adds the file i915_gem_context.c This file implements HW context
      support. On gen5+ a HW context consists of an opaque GPU object which is
      referenced at times of context saves and restores.  With RC6 enabled,
      the context is also referenced as the GPU enters and exists from RC6
      (GPU has it's own internal power context, except on gen5).  Though
      something like a context does exist for the media ring, the code only
      supports contexts for the render ring.
      
      In software, there is a distinction between contexts created by the
      user, and the default HW context. The default HW context is used by GPU
      clients that do not request setup of their own hardware context. The
      default context's state is never restored to help prevent programming
      errors. This would happen if a client ran and piggy-backed off another
      clients GPU state.  The default context only exists to give the GPU some
      offset to load as the current to invoke a save of the context we
      actually care about. In fact, the code could likely be constructed,
      albeit in a more complicated fashion, to never use the default context,
      though that limits the driver's ability to swap out, and/or destroy
      other contexts.
      
      All other contexts are created as a request by the GPU client. These
      contexts store GPU state, and thus allow GPU clients to not re-emit
      state (and potentially query certain state) at any time. The kernel
      driver makes certain that the appropriate commands are inserted.
      
      There are 4 entry points into the contexts, init, fini, open, close.
      The names are self-explanatory except that init can be called during
      reset, and also during pm thaw/resume. As we expect our context to be
      preserved across these events, we do not reinitialize in this case.
      
      As Adam Jackson pointed out, The cutoff of 1MB where a HW context is
      considered too big is arbitrary. The reason for this is even though
      context sizes are increasing with every generation, they have yet to
      eclipse even 32k. If we somehow read back way more than that, it
      probably means BIOS has done something strange, or we're running on a
      platform that wasn't designed for this.
      
      v2: rename load/unload to init/fini (daniel)
      remove ILK support for get_size() (indirectly daniel)
      add HAS_HW_CONTEXTS macro to clarify supported platforms (daniel)
      added comments (Ben)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      254f965c
  16. 13 6月, 2012 3 次提交
    • D
      drm/i915: kick any firmware framebuffers before claiming the gtt · e188719a
      Daniel Vetter 提交于
      Especially vesafb likes to map everything as uc- (yikes), and if that
      mapping hangs around still while we try to map the gtt as wc the
      kernel will downgrade our request to uc-, resulting in abyssal
      performance.
      
      Unfortunately we can't do this as early as readon does (i.e. as the
      first thing we do when initializing the hw) because our fb/mmio space
      region moves around on a per-gen basis. So I've had to move it below
      the gtt initialization, but that seems to work, too. The important
      thing is that we do this before we set up the gtt wc mapping.
      
      Now an altogether different question is why people compile their
      kernels with vesafb enabled, but I guess making things just work isn't
      bad per se ...
      
      v2:
      - s/radeondrmfb/inteldrmfb/
      - fix up error handling
      
      v3: Kill #ifdef X86, this is Intel after all. Noticed by Ben Widawsky.
      
      v4: Jani Nikula complained about the pointless bool primary
      initialization.
      
      v5: Don't oops if we can't allocate, noticed by Chris Wilson.
      
      v6: Resolve conflicts with agp rework and fixup whitespace.
      Reported-and-tested-by: N"Kilarski, Bernard R" <bernard.r.kilarski@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e188719a
    • D
      drm/i915 + agp/intel-gtt: prep work for direct setup · 14be93dd
      Daniel Vetter 提交于
      To be able to directly set up the intel-gtt code from drm/i915 and
      avoid setting up the fake-agp driver we need to prepare a few things:
      - pass both the bridge and gpu pci_dev to the probe function and add
        code to handle the gpu pdev both being present (for drm/i915) and
        not present (fake agp).
      - add refcounting to the remove function so that unloading drm/i915
        doesn't kill the fake agp driver
      
      v2: Fix up the cleanup and refcount, noticed by Jani Nikula.
      Reviewed-by: NJani Nikula <jani.nikula@linux.intel.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      14be93dd
    • D
      drm/i915: stop using dev->agp->base · dd2757f8
      Daniel Vetter 提交于
      For that to work we need to export the base address of the gtt
      mmio window from intel-gtt. Also replace all other uses of
      dev->agp by values we already have at hand.
      Reviewed-by: NJani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dd2757f8
  17. 06 6月, 2012 1 次提交
  18. 25 5月, 2012 1 次提交
    • B
      drm/i915: wait render timeout ioctl · 23ba4fd0
      Ben Widawsky 提交于
      This helps implement GL_ARB_sync but stops short of allowing full blown
      sync objects. Finally we can use the new timed seqno waiting function
      to allow userspace to wait on a buffer object with a timeout. This
      implements that interface.
      
      The IOCTL will take as input a buffer object handle, and a timeout in
      nanoseconds (flags is currently optional but will likely be used for
      permutations of flush operations). Users may specify 0 nanoseconds to
      instantly check.
      
      The wait ioctl with a timeout of 0 reimplements the busy ioctl. With any
      non-zero timeout parameter the wait ioctl will wait for the given number
      of nanoseconds on an object becoming unbusy. Since the wait itself does
      so holding struct_mutex the object may become re-busied before this
      completes. A similar but shorter race condition exists in the busy
      ioctl.
      
      v2: ETIME/ERESTARTSYS instead of changing to EBUSY, and EGAIN (Chris)
      Flush the object from the gpu write domain (Chris + Daniel)
      Fix leaked refcount in good case (Chris)
      Naturally align ioctl struct (Chris)
      
      v3: Drop lock after getting seqno to avoid ugly dance (Chris)
      
      v4: check for 0 timeout after olr check to allow polling (Chris)
      
      v5: Updated the comment. (Chris)
      
      v6: Return -ETIME instead of -EBUSY when timeout_ns is 0 (Daniel)
      Fix the commit message comment to be less ugly (Ben)
      Add a warning to check the return timespec (Ben)
      
      v7: Use DRM_AUTH for the ioctl. (Eugeni)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      23ba4fd0
  19. 20 5月, 2012 1 次提交
  20. 13 5月, 2012 1 次提交
  21. 03 5月, 2012 13 次提交