1. 13 9月, 2013 3 次提交
  2. 10 9月, 2013 3 次提交
    • C
      drm/i915: Write RING_TAIL once per-request · 09246732
      Chris Wilson 提交于
      Ignoring the legacy DRI1 code, and a couple of special cases (to be
      discussed later), all access to the ring is mediated through requests.
      The first write to a ring will grab a seqno and mark the ring as having
      an outstanding_lazy_request. Either through explicitly adding a request
      after an execbuffer or through an implicit wait (either by the CPU or by
      a semaphore), that sequence of writes will be terminated with a request.
      So we can ellide all the intervening writes to the tail register and
      send the entire command stream to the GPU at once. This will reduce the
      number of *serialising* writes to the tail register by a factor or 3-5
      times (depending upon architecture and number of workarounds, context
      switches, etc involved). This becomes even more noticeable when the
      register write is overloaded with a number of debugging tools. The
      astute reader will wonder if it is then possible to overflow the ring
      with a single command. It is not. When we start a command sequence to
      the ring, we check for available space and issue a wait in case we have
      not. The ring wait will in this case be forced to flush the outstanding
      register write and then poll the ACTHD for sufficient space to continue.
      
      The exception to the rule where everything is inside a request are a few
      initialisation cases where we may want to write GPU commands via the CS
      before userspace wakes up and page flips.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      09246732
    • V
      drm/i915: Call intel_update_watermarks() in specific place during modeset · f37fcc2a
      Ville Syrjälä 提交于
      Make the call to intel_update_watermarks() just once or twice during
      modeset. Ideally it should happen independently when each plane gets
      enabled/disabled, but for now it seems better to keep it in central
      place. We can improve things when we get all the planes sorted out
      in a better way.
      
      When enabling set up the watermarks just before the pipe is enabled.
      And when disabling we need to wait until we've marked the crtc as
      inactive, as otherwise intel_crtc_active() would still think the pipe
      is enabled and the computed watermarks would reflect that.
      
      v2: Pimp up the commit message a bit
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f37fcc2a
    • V
      drm/i915: Pass crtc to intel_update_watermarks() · 46ba614c
      Ville Syrjälä 提交于
      Passing the appropriate crtc to intel_update_watermarks() should help
      in avoiding needless work in the future.
      
      v2: Avoid clash with internal 'crtc' variable in some wm functions
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      46ba614c
  3. 05 9月, 2013 1 次提交
  4. 04 9月, 2013 10 次提交
  5. 30 8月, 2013 1 次提交
  6. 23 8月, 2013 6 次提交
    • D
      drm/i915: Use POSTING_READ in lcpll code · 35d8f2eb
      Daniel Vetter 提交于
      If we don't use the return value of a mmio read our coding style is to
      use the POSTING_READ macro. This avoids cluttering the mmio traces.
      
      While at it add the missing posting read in the lcpll enable function
      that Paulo spotted.
      
      v2: Drop the _NOTRACE changes, tracing such wait_for loops in the modeset
      code might actually be rather useful!
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      35d8f2eb
    • P
      drm/i915: add i915.pc8_timeout function · 90058745
      Paulo Zanoni 提交于
      We currently only enter PC8+ after all its required conditions are
      met, there's no rendering, and we stay like that for at least 5
      seconds.
      
      I chose "5 seconds" because this value is conservative and won't make
      us enter/leave PC8+ thousands of times after the screen is off: some
      desktop environments have applications that wake up and do rendering
      every 1-3 seconds, even when the screen is off and the machine is
      completely idle.
      
      But when I was testing my PC8+ patches I set the default value to
      100ms so I could use the bad-behaving desktop environments to
      stress-test my patches. I also thought it would be a good idea to ask
      our power management team to test different values, but I'm pretty
      sure they would ask me for an easy way to change the timeout. So to
      help these 2 cases I decided to create an option that would make it
      easier to change the default value. I also expect people making
      specific products that use our driver could try to find the perfect
      timeout for them.
      
      Anyway, fixing the bad-behaving applications will always lead to
      better power savings than just changing the timeout value: you need to
      stop waking the Kernel, not quickly put it back to sleep again after
      you wake it for nothing. Bad sleep leads to bad mood!
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      90058745
    • P
      drm/i915: allow package C8+ states on Haswell (disabled) · c67a470b
      Paulo Zanoni 提交于
      This patch allows PC8+ states on Haswell. These states can only be
      reached when all the display outputs are disabled, and they allow some
      more power savings.
      
      The fact that the graphics device is allowing PC8+ doesn't mean that
      the machine will actually enter PC8+: all the other devices also need
      to allow PC8+.
      
      For now this option is disabled by default. You need i915.allow_pc8=1
      if you want it.
      
      This patch adds a big comment inside i915_drv.h explaining how it
      works and how it tracks things. Read it.
      
      v2: (this is not really v2, many previous versions were already sent,
           but they had different names)
          - Use the new functions to enable/disable GTIMR and GEN6_PMIMR
          - Rename almost all variables and functions to names suggested by
            Chris
          - More WARNs on the IRQ handling code
          - Also disable PC8 when there's GPU work to do (thanks to Ben for
            the help on this), so apps can run caster
          - Enable PC8 on a delayed work function that is delayed for 5
            seconds. This makes sure we only enable PC8+ if we're really
            idle
          - Make sure we're not in PC8+ when suspending
      v3: - WARN if IRQs are disabled on __wait_seqno
          - Replace some DRM_ERRORs with WARNs
          - Fix calls to restore GT and PM interrupts
          - Use intel_mark_busy instead of intel_ring_advance to disable PC8
      v4: - Use the force_wake, Luke!
      v5: - Remove the "IIR is not zero" WARNs
          - Move the force_wake chunk to its own patch
          - Only restore what's missing from RC6, not everything
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c67a470b
    • P
      drm/i915: fix SDEIMR assertion when disabling LCPLL · bd633a7c
      Paulo Zanoni 提交于
      This was causing WARNs in one machine, so instead of trying to guess
      exactly which hotplug bits should exist, just do the test on the
      non-HPD bits. We don't care about the state of the hotplug bits, we
      just care about the others, that need to be 1.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bd633a7c
    • P
      drm/i915: grab force_wake when restoring LCPLL · 215733fa
      Paulo Zanoni 提交于
      If LCPLL is disabled, there's a chance we might be in package C8 state
      or deeper, and we'll get a hard hang when restoring LCPLL (also, a red
      led lights up on my motherboard). So grab the force_wake, which will
      get us out of RC6 and, as a consequence, out of PC8+ (since we need
      RC6 to get into PC8+).
      
      Note: Discussions with hw designers are still ongoing what exactly
      goes boom here. But I think we can go ahead and just merge this little
      hack for now until it's clear what we actually need.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Add small note about the current state of the discussion
      around this hack.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      215733fa
    • J
      drm/i915: make IVB FDI training match spec v3 · 139ccd3f
      Jesse Barnes 提交于
      The existing code was trying different vswing and preemphasis settings
      in the wrong place, and wasn't trying them enough.  So add a loop to
      walk through them, properly disabling FDI TX and RX in between if a
      failure is detected.
      
      v2: remove unneeded reg writes, add delays around bit lock checks (Jesse)
      v3: fix TX and RX disable per spec (Paulo)
          fix delays per spec (Paulo)
          make RX symbol lock check match TX bit lock check (Paulo)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51983Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      139ccd3f
  7. 22 8月, 2013 4 次提交
  8. 15 8月, 2013 1 次提交
    • C
      drm/i915: Don't deref pipe->cpu_transcoder in the hangcheck code · 63b66e5b
      Chris Wilson 提交于
      If we get an error event really early in the driver setup sequence,
      which gen3 is especially prone to with various display GTT faults we
      Oops. So try to avoid this.
      
      Additionally with Haswell the transcoders are a separate bank of
      registers from the pipes (4 transcoders, 3 pipes). In event of an
      error, we want to be sure we have a complete and accurate picture of
      the machine state, so record all the transcoders in addition to all
      the active pipes.
      
      This regression has been introduced in
      
      commit 702e7a56
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Tue Oct 23 18:29:59 2012 -0200
      
          drm/i915: convert PIPECONF to use transcoder instead of pipe
      
      Based on the patch "drm/i915: Dump all transcoder registers on error"
      from Chris Wilson:
      
      v2: Rebase so that we don't try to be clever and try to figure out the
      cpu transcoder from hw state. That exercise should be done when we
      analyze the error state offline.
      
      The actual bugfix is to not call intel_pipe_to_cpu_transcoder in the
      error state capture code in case the pipes aren't fully set up yet.
      
      v3: Simplifiy the err->num_transcoders computation a bit. While at it
      make the error capture stuff save on systems without a display block.
      
      v4: Fix fail, spotted by Jani.
      
      v5: Completely new commit message, cc: stable.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Damien Lespiau <damien.lespiau@intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60021
      Cc: stable@vger.kernel.org
      Tested-by: NDustin King <daking@rescomp.stanford.edu>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      63b66e5b
  9. 10 8月, 2013 2 次提交
  10. 09 8月, 2013 3 次提交
  11. 07 8月, 2013 2 次提交
    • V
      drm/i915: Don't call encoder's get_config unless encoder is active · 3eaba51c
      Ville Syrjälä 提交于
      The SDVO code tries to compare the encoder's and crtc's idea of the
      pixel_multiplier. Normally they have to match, but when transitioning
      to DPMS off, we turn off the pipe before reading out the pipe_config,
      so the pixel_multiplier in the pipe_config will be 0, whereas the
      encoder will still have its pixel_multiplier set to whatever value we
      were using when the display was active. This leads to a warning
      from intel_modeset_check_state().
      
      WARNING: CPU: 1 PID: 2846 at drivers/gpu/drm/i915/intel_sdvo.c:1378 intel_sdvo_get_config+0x158/0x160()
      SDVO pixel multiplier mismatch, port: 0, encoder: 1
      Modules linked in: snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep
      CPU: 1 PID: 2846 Comm: Xorg Not tainted 3.11.0-rc3-00208-gbe1e8d7-dirty #19
      Hardware name: Apple Computer, Inc. Macmini1,1/Mac-F4208EC8, BIOS  MM11.88Z.0055.B03.0604071521 04/07/06
       00000000 00000000 ef0afa54 c1597bbb c1737ea4 ef0afa84 c10392ca c1737e6c
       ef0afab0 00000b1e c1737ea4 00000562 c12dfbe8 c12dfbe8 ef0afb14 00000000
       f697ec00 ef0afa9c c103936e 00000009 ef0afa94 c1737e6c ef0afab0 ef0afadc
      Call Trace:
       [<c1597bbb>] dump_stack+0x41/0x56
       [<c10392ca>] warn_slowpath_common+0x7a/0xa0
       [<c103936e>] warn_slowpath_fmt+0x2e/0x30
       [<c12dfbe8>] intel_sdvo_get_config+0x158/0x160
       [<c12c3220>] check_crtc_state+0x1e0/0xb10
       [<c12cdc7d>] intel_modeset_check_state+0x29d/0x7c0
       [<c12dfe5c>] intel_sdvo_dpms+0x5c/0xa0
       [<c12985de>] drm_mode_obj_set_property_ioctl+0x40e/0x420
       [<c1298625>] drm_mode_connector_property_set_ioctl+0x35/0x40
       [<c1289294>] drm_ioctl+0x3e4/0x540
       [<c10fc1a2>] do_vfs_ioctl+0x72/0x570
       [<c10fc72f>] SyS_ioctl+0x8f/0xa0
       [<c159b7fa>] sysenter_do_call+0x12/0x22
      ---[ end trace 7ce940aff1366d60 ]---
      
      Fix the problem by skipping the encoder get_config() function for
      inactive encoders.
      Tested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3eaba51c
    • C
      drm/i915: Export intel_framebuffer_fini · ddfe1567
      Chris Wilson 提交于
      Rather than open-code the teardown of a framebuffer, export the routine
      from intel_display.c. This then make intel_fbdev symmetric in its use of
      the common intel_framebuffer routines to initialise and clean up the
      struct intel_framebuffer. (And new features need only be added in one
      location!)
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ddfe1567
  12. 06 8月, 2013 4 次提交