1. 29 10月, 2013 1 次提交
    • D
      drm/i915: Fix the PPT fdi lane bifurcate state handling on ivb · 1fbc0d78
      Daniel Vetter 提交于
      Originally I've thought that this is leftover hw state dirt from the
      BIOS. But after way too much helpless flailing around on my part I've
      noticed that the actual bug is when we change the state of an already
      active pipe.
      
      For example when we change the fdi lines from 2 to 3 without switching
      off outputs in-between we'll never see the crucial on->off transition
      in the ->modeset_global_resources hook the current logic relies on.
      
      Patch version 2 got this right by instead also checking whether the
      pipe is indeed active. But that in turn broke things when pipes have
      been turned off through dpms since the bifurcate enabling is done in
      the ->crtc_mode_set callback.
      
      To address this issues discussed with Ville in the patch review move
      the setting of the bifurcate bit into the ->crtc_enable hook. That way
      we won't wreak havoc with this state when userspace puts all other
      outputs into dpms off state. This also moves us forward with our
      overall goal to unify the modeset and dpms on paths (which we need to
      have to allow runtime pm in the dpms off state).
      
      Unfortunately this requires us to move the bifurcate helpers around a
      bit.
      
      Also update the commit message, I've misanalyzed the bug rather badly.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70507Tested-by: NJan-Michael Brummer <jan.brummer@tabos.org>
      Cc: stable@vger.kernel.org
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1fbc0d78
  2. 28 10月, 2013 1 次提交
  3. 11 10月, 2013 2 次提交
  4. 04 10月, 2013 1 次提交
    • C
      drm/i915: Only apply DPMS to the encoder if enabled · c9976dcf
      Chris Wilson 提交于
      The current test for an attached enabled encoder fails if we have
      multiple connectors aliased to the same encoder - both connectors
      believe they own the enabled encoder and so we attempt to both enable
      and disable DPMS on the encoder, leading to hilarity and an OOPs:
      
      [  354.803064] WARNING: CPU: 0 PID: 482 at
      /usr/src/linux/dist/3.11.2/drivers/gpu/drm/i915/intel_display.c:3869 intel_modeset_check_state+0x764/0x770 [i915]()
      [  354.803064] wrong connector dpms state
      [  354.803084] Modules linked in: nfsd auth_rpcgss oid_registry exportfs nfs lockd sunrpc xt_nat iptable_nat nf_nat_ipv4 nf_nat xt_limit xt_LOG xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT ipv6 xt_recent xt_conntrack nf_conntrack iptable_filter ip_tables x_tables snd_hda_codec_realtek snd_hda_codec_hdmi x86_pkg_temp_thermal snd_hda_intel coretemp kvm_intel snd_hda_codec i915 kvm snd_hwdep snd_pcm_oss snd_mixer_oss crc32_pclmul snd_pcm crc32c_intel e1000e intel_agp igb ghash_clmulni_intel intel_gtt aesni_intel cfbfillrect aes_x86_64 cfbimgblt lrw cfbcopyarea drm_kms_helper ptp video thermal processor gf128mul snd_page_alloc drm snd_timer glue_helper 8250_pci snd pps_core ablk_helper agpgart cryptd sg soundcore fan i2c_algo_bit sr_mod thermal_sys 8250 i2c_i801 serial_core
      hwmon cdrom i2c_core evdev button
      [  354.803086] CPU: 0 PID: 482 Comm: kworker/0:1 Not tainted 3.11.2 #1
      [  354.803087] Hardware name: Supermicro X10SAE/X10SAE, BIOS 1.00 05/03/2013 [  354.803091] Workqueue: events console_callback
      [  354.803092]  0000000000000009 ffff88023611db48 ffffffff814048ac ffff88023611db90
      [  354.803093]  ffff88023611db80 ffffffff8103d4e3 ffff880230d82800 ffff880230f9b800
      [  354.803094]  ffff880230f99000 ffff880230f99448 ffff8802351c0e00 ffff88023611dbe0
      [  354.803094] Call Trace:
      [  354.803098]  [<ffffffff814048ac>] dump_stack+0x54/0x8d
      [  354.803101]  [<ffffffff8103d4e3>] warn_slowpath_common+0x73/0x90
      [  354.803103]  [<ffffffff8103d547>] warn_slowpath_fmt+0x47/0x50
      [  354.803109]  [<ffffffffa089f1be>] ? intel_ddi_connector_get_hw_state+0x5e/0x110 [i915]
      [  354.803114]  [<ffffffffa0896974>] intel_modeset_check_state+0x764/0x770 [i915]
      [  354.803117]  [<ffffffffa08969bb>] intel_connector_dpms+0x3b/0x60 [i915]
      [  354.803120]  [<ffffffffa037e1d0>] drm_fb_helper_dpms.isra.11+0x120/0x160 [drm_kms_helper]
      [  354.803122]  [<ffffffffa037e24e>] drm_fb_helper_blank+0x3e/0x80 [drm_kms_helper]
      [  354.803123]  [<ffffffff812116c2>] fb_blank+0x52/0xc0
      [  354.803125]  [<ffffffff8121e04b>] fbcon_blank+0x21b/0x2d0
      [  354.803127]  [<ffffffff81062243>] ? update_rq_clock.part.74+0x13/0x30
      [  354.803129]  [<ffffffff81047486>] ? lock_timer_base.isra.30+0x26/0x50
      [  354.803130]  [<ffffffff810472b2>] ? internal_add_timer+0x12/0x40
      [  354.803131]  [<ffffffff81047f48>] ? mod_timer+0xf8/0x1c0
      [  354.803133]  [<ffffffff81266d61>] do_unblank_screen+0xa1/0x1c0
      [  354.803134]  [<ffffffff81268087>] poke_blanked_console+0xc7/0xd0
      [  354.803136]  [<ffffffff812681cf>] console_callback+0x13f/0x160
      [  354.803137]  [<ffffffff81053258>] process_one_work+0x148/0x3d0
      [  354.803138]  [<ffffffff81053f19>] worker_thread+0x119/0x3a0
      [  354.803140]  [<ffffffff81053e00>] ? manage_workers.isra.30+0x2a0/0x2a0
      [  354.803141]  [<ffffffff8105994b>] kthread+0xbb/0xc0
      [  354.803142]  [<ffffffff81059890>] ? kthread_create_on_node+0x120/0x120
      [  354.803144]  [<ffffffff8140b32c>] ret_from_fork+0x7c/0xb0
      [  354.803145]  [<ffffffff81059890>] ? kthread_create_on_node+0x120/0x120
      
      This regression goes back to the big modeset rework and the conversion
      to the new dpms helpers which started with:
      
      commit 5ab432ef
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Jun 30 08:59:56 2012 +0200
      
          drm/i915/hdmi: convert to encoder->disable/enable
      
      Fixes: igt/kms_flip/dpms-off-confusion
      Reported-and-tested-by: NWakko Warner <wakko@animx.eu.org>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68030
      Link:  http://lkml.kernel.org/r/20130928185023.GA21672@animx.eu.orgSigned-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@vger.kernel.org
      [danvet: Add regression citation, mention the igt testcase this fixes
      and slap a cc: stable on the patch.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c9976dcf
  5. 25 9月, 2013 1 次提交
    • D
      drm/i915: preserve pipe A quirk in i9xx_set_pipeconf · 67c72a12
      Daniel Vetter 提交于
      This regression has been introduced in
      
      commit 9f11a9e4
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jun 13 00:54:58 2013 +0200
      
          drm/i915: set up PIPECONF explicitly for i9xx/vlv platforms
      
      Ville brough up the idea that this is just the pipe A quirk gone
      wrong.
      
      Note that after resume the bios might or might not have enabled pipe A
      already.  We have a bit of magic to make sure that on resume we set up
      a decent mode for pipe A, but I fear if I just smash pipe A to always
      on we'd enable it in a bogus state and hang the hw. Hence the
      readback.
      
      v2: Clarify the logic a bit as suggested by Chris. Also amend the
      commit message to clarify why we don't unconditionally enable the
      pipe.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66462
      References: https://lkml.org/lkml/2013/8/26/238
      Cc: Meelis Roos <mroos@ut.ee>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Use |= instead of = as suggested by Chris.]
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      67c72a12
  6. 18 9月, 2013 2 次提交
  7. 10 9月, 2013 1 次提交
  8. 09 9月, 2013 1 次提交
  9. 07 9月, 2013 1 次提交
    • V
      drm/i915: Delay disabling of VGA memory until vgacon->fbcon handoff is done · 6e1b4fda
      Ville Syrjälä 提交于
      When transitioning away from vgacon the system tries to save the
      current contents of the VGA memory, so that it can be cleanly handed
      off to fbcon (or whatever comes afterwards).
      
      The recent change
      
       commit 81b5c7bc
       Author: Alex Williamson <alex.williamson@redhat.com>
       Date:   Wed Aug 28 09:39:08 2013 -0600
      
          i915: Update VGA arbiter support for newer devices
      
      caused i915 to disable VGA memory decode for the IGD when i915 is
      initializing. Unfortunately that happens before the vgacon->fbcon
      handoff so vgacon_save_screen() will read out all ones from the
      VGA memory.
      
      After the handoff fbcon will inherit the bogus state from vgacon,
      and pre-fills the fb with matching contents. The end result is
      a white rectangle in the top left corner of the screen, the size
      of which matches the now inactive VGA console.
      
      To remedy the situation delay the disabling of VGA memory until
      the vgacon->fbcon handoff has happened.
      
      Also rename i915_enable_vga to i915_enable_vga_mem to make
      the relationship between these functions clearer.
      
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6e1b4fda
  10. 06 9月, 2013 1 次提交
  11. 04 9月, 2013 4 次提交
  12. 30 8月, 2013 1 次提交
  13. 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
  14. 22 8月, 2013 4 次提交
  15. 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
  16. 10 8月, 2013 2 次提交
  17. 09 8月, 2013 3 次提交
  18. 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
  19. 06 8月, 2013 4 次提交
  20. 05 8月, 2013 1 次提交