1. 08 6月, 2016 10 次提交
  2. 07 6月, 2016 5 次提交
  3. 06 6月, 2016 4 次提交
  4. 02 6月, 2016 2 次提交
  5. 01 6月, 2016 7 次提交
  6. 31 5月, 2016 1 次提交
    • L
      vga_switcheroo: Add helper for deferred probing · b00e5334
      Lukas Wunner 提交于
      So far we've got one condition when DRM drivers need to defer probing
      on a dual GPU system and it's coded separately into each of the relevant
      drivers. As suggested by Daniel Vetter, deduplicate that code in the
      drivers and move it to a new vga_switcheroo helper. This yields better
      encapsulation of concepts and lets us add further checks in a central
      place. (The existing check pertains to pre-retina MacBook Pros and an
      additional check is expected to be needed for retinas.)
      
      One might be tempted to check deferred probing conditions in
      vga_switcheroo_register_client(), but this is usually called fairly late
      during driver load. The GPU is fully brought up and ready for switching
      at that point. On boot the ->probe hook is potentially called dozens of
      times until it finally succeeds, and each time we'd repeat bringup and
      teardown of the GPU, lengthening boot time considerably and cluttering
      logfiles. A separate helper is therefore needed which can be called
      right at the beginning of the ->probe hook.
      
      Note that amdgpu currently does not call this helper as the AMD GPUs
      built into MacBook Pros are only supported by radeon so far.
      
      v2: This helper could eventually be used by audio clients as well,
          so rephrase kerneldoc to refer to "client" instead of "GPU"
          and move the single existing check in an if block specific
          to PCI_CLASS_DISPLAY_VGA devices. Move documentation on
          that check from kerneldoc to a comment. (Daniel Vetter)
      
      v3: Mandate in kerneldoc that registration of client shall only
          happen after calling this helper. (Daniel Vetter)
      
      v4: Rebase on 412c8f7d ("drm/radeon: Return -EPROBE_DEFER when
          amdkfd not loaded")
      
      v5: Some Optimus GPUs use PCI_CLASS_DISPLAY_3D, make sure those are
          matched as well. (Emil Velikov)
      
      v6: The if-condition referring to PCI_BASE_CLASS_DISPLAY may be
          considered a functional change. Move to a separate commit to
          keep this a pure refactoring change. (Emil Velikov, Jani Nikula)
      
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/575885fd440c2b13c3f19ddf44360cfbbff35f50.1464685538.git.lukas@wunner.de
      b00e5334
  7. 30 5月, 2016 7 次提交
  8. 27 5月, 2016 1 次提交
  9. 26 5月, 2016 2 次提交
    • A
      drm/i915: Fix NULL pointer deference when out of PLLs in IVB · bb143165
      Ander Conselvan de Oliveira 提交于
      In commit f9476a6c ("drm/i915: Refactor platform specifics out of
      intel_get_shared_dpll()"), the ibx_get_dpll() function lacked an error
      check, that can lead to a NULL pointer dereference when trying to enable
      three pipes.
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000068
      IP: [<ffffffffa0482275>] intel_reference_shared_dpll+0x15/0x100 [i915]
      PGD cec87067 PUD d30ce067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: snd_hda_intel i915 drm_kms_helper drm intel_gtt sch_fq_codel cfg80211 binfmt_misc i2c_algo_bit cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea intel_rapl iosf_mbi x86_pkg_temp_thermal coretemp agpgart kvm_intel snd_hda_codec_hdmi kvm iTCO_wdt snd_hda_codec_realtek snd_hda_codec_generic irqbypass aesni_intel aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd psmouse pcspkr snd_hda_codec i2c_i801 snd_hwdep snd_hda_core snd_pcm snd_timer lpc_ich mfd_core snd soundcore wmi evdev tpm_tis tpm [last unloaded: drm]
      CPU: 3 PID: 5810 Comm: kms_flip Tainted: G     U  W       4.6.0-test+ #3
      Hardware name:                  /DZ77BH-55K, BIOS BHZ7710H.86A.0100.2013.0517.0942 05/17/2013
      task: ffff8800d3908040 ti: ffff8801166c8000 task.ti: ffff8801166c8000
      RIP: 0010:[<ffffffffa0482275>]  [<ffffffffa0482275>] intel_reference_shared_dpll+0x15/0x100 [i915]
      RSP: 0018:ffff8801166cba60  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000002
      RDX: 0000000000000001 RSI: ffff8800d07f1bf8 RDI: 0000000000000000
      RBP: ffff8801166cba88 R08: 0000000000000002 R09: ffff8800d32e5698
      R10: 0000000000000001 R11: ffff8800cc89ac88 R12: ffff8800d07f1bf8
      R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      FS:  00007f4c3fc8d8c0(0000) GS:ffff88011bcc0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000068 CR3: 00000000d3b4c000 CR4: 00000000001406e0
      Stack:
       0000000000000000 ffff8800d07f1bf8 0000000000000000 ffff8800d04c0000
       0000000000000000 ffff8801166cbaa8 ffffffffa04823a7 ffff8800d07f1bf8
       ffff8800d32e5698 ffff8801166cbab8 ffffffffa04840cf ffff8801166cbaf0
      Call Trace:
       [<ffffffffa04823a7>] ibx_get_dpll+0x47/0xa0 [i915]
       [<ffffffffa04840cf>] intel_get_shared_dpll+0x1f/0x50 [i915]
       [<ffffffffa046d080>] ironlake_crtc_compute_clock+0x280/0x430 [i915]
       [<ffffffffa0472ac0>] intel_crtc_atomic_check+0x240/0x320 [i915]
       [<ffffffffa03da18e>] drm_atomic_helper_check_planes+0x14e/0x1d0 [drm_kms_helper]
       [<ffffffffa0474a0c>] intel_atomic_check+0x5dc/0x1110 [i915]
       [<ffffffffa029d3aa>] drm_atomic_check_only+0x14a/0x660 [drm]
       [<ffffffffa029d086>] ? drm_atomic_set_crtc_for_connector+0x96/0x100 [drm]
       [<ffffffffa029d8d7>] drm_atomic_commit+0x17/0x60 [drm]
       [<ffffffffa03dc3b7>] restore_fbdev_mode+0x237/0x260 [drm_kms_helper]
       [<ffffffffa029c65a>] ? drm_modeset_lock_all_ctx+0x9a/0xb0 [drm]
       [<ffffffffa03de9b3>] drm_fb_helper_restore_fbdev_mode_unlocked+0x33/0x80 [drm_kms_helper]
       [<ffffffffa03dea2d>] drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper]
       [<ffffffffa03de93a>] drm_fb_helper_hotplug_event+0xaa/0xf0 [drm_kms_helper]
       [<ffffffffa03de9d6>] drm_fb_helper_restore_fbdev_mode_unlocked+0x56/0x80 [drm_kms_helper]
       [<ffffffffa0490f72>] intel_fbdev_restore_mode+0x22/0x80 [i915]
       [<ffffffffa04ba45e>] i915_driver_lastclose+0xe/0x20 [i915]
       [<ffffffffa02810de>] drm_lastclose+0x2e/0x130 [drm]
       [<ffffffffa028148c>] drm_release+0x2ac/0x4b0 [drm]
       [<ffffffff811a6b2d>] __fput+0xed/0x1f0
       [<ffffffff811a6c6e>] ____fput+0xe/0x10
       [<ffffffff81079156>] task_work_run+0x76/0xb0
       [<ffffffff8105aaab>] do_exit+0x3ab/0xc60
       [<ffffffff810a145f>] ? trace_hardirqs_on_caller+0x12f/0x1c0
       [<ffffffff8105c67e>] do_group_exit+0x4e/0xc0
       [<ffffffff8105c704>] SyS_exit_group+0x14/0x20
       [<ffffffff8158bb25>] entry_SYSCALL_64_fastpath+0x18/0xa8
      Code: 14 80 48 8d 34 90 b8 01 00 00 00 d3 e0 09 04 b3 5b 41 5c 5d c3 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 49 89 fe 41 55 41 54 53 <44> 8b 67 68 48 89 f3 48 8b be 08 02 00 00 4c 8b 2e e8 15 9d fd
      RIP  [<ffffffffa0482275>] intel_reference_shared_dpll+0x15/0x100 [i915]
       RSP <ffff8801166cba60>
      CR2: 0000000000000068
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: drm-intel-fixes@lists.freedesktop.org
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Fixes: f9476a6c ("drm/i915: Refactor platform specifics out of intel_get_shared_dpll()")
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1463748426-5956-1-git-send-email-ander.conselvan.de.oliveira@intel.com
      bb143165
    • L
      drm/i915/ilk: Don't disable SSC source if it's in use · f165d283
      Lyude 提交于
      Thanks to Ville Syrjälä for pointing me towards the cause of this issue.
      
      Unfortunately one of the sideaffects of having the refclk for a DPLL set
      to SSC is that as long as it's set to SSC, the GPU will prevent us from
      powering down any of the pipes or transcoders using it. A couple of
      BIOSes enable SSC in both PCH_DREF_CONTROL and in the DPLL
      configurations. This causes issues on the first modeset, since we don't
      expect SSC to be left on and as a result, can't successfully power down
      the pipes or the transcoders using it. Here's an example from this Dell
      OptiPlex 990:
      
      [drm:intel_modeset_init] SSC enabled by BIOS, overriding VBT which says disabled
      [drm:intel_modeset_init] 2 display pipes available.
      [drm:intel_update_cdclk] Current CD clock rate: 400000 kHz
      [drm:intel_update_max_cdclk] Max CD clock rate: 400000 kHz
      [drm:intel_update_max_cdclk] Max dotclock rate: 360000 kHz
      vgaarb: device changed decodes: PCI:0000:00:02.0,olddecodes=io+mem,decodes=io+mem:owns=io+mem
      [drm:intel_crt_reset] crt adpa set to 0xf40000
      [drm:intel_dp_init_connector] Adding DP connector on port C
      [drm:intel_dp_aux_init] registering DPDDC-C bus for card0-DP-1
      [drm:ironlake_init_pch_refclk] has_panel 0 has_lvds 0 has_ck505 0
      [drm:ironlake_init_pch_refclk] Disabling SSC entirely
      … later we try committing the first modeset …
      [drm:intel_dump_pipe_config] [CRTC:26][modeset] config ffff88041b02e800 for pipe A
      [drm:intel_dump_pipe_config] cpu_transcoder: A
      …
      [drm:intel_dump_pipe_config] dpll_hw_state: dpll: 0xc4016001, dpll_md: 0x0, fp0: 0x20e08, fp1: 0x30d07
      [drm:intel_dump_pipe_config] planes on this crtc
      [drm:intel_dump_pipe_config] STANDARD PLANE:23 plane: 0.0 idx: 0 enabled
      [drm:intel_dump_pipe_config]     FB:42, fb = 800x600 format = 0x34325258
      [drm:intel_dump_pipe_config]     scaler:0 src (0, 0) 800x600 dst (0, 0) 800x600
      [drm:intel_dump_pipe_config] CURSOR PLANE:25 plane: 0.1 idx: 1 disabled, scaler_id = 0
      [drm:intel_dump_pipe_config] STANDARD PLANE:27 plane: 0.1 idx: 2 disabled, scaler_id = 0
      [drm:intel_get_shared_dpll] CRTC:26 allocated PCH DPLL A
      [drm:intel_get_shared_dpll] using PCH DPLL A for pipe A
      [drm:ilk_audio_codec_disable] Disable audio codec on port C, pipe A
      [drm:intel_disable_pipe] disabling pipe A
      ------------[ cut here ]------------
      WARNING: CPU: 1 PID: 130 at drivers/gpu/drm/i915/intel_display.c:1146 intel_disable_pipe+0x297/0x2d0 [i915]
      pipe_off wait timed out
      …
      ---[ end trace 94fc8aa03ae139e8 ]---
      [drm:intel_dp_link_down]
      [drm:ironlake_crtc_disable [i915]] *ERROR* failed to disable transcoder A
      
      Later modesets succeed since they reset the DPLL's configuration anyway,
      but this is enough to get stuck with a big fat warning in dmesg.
      
      A better solution would be to add refcounts for the SSC source, but for
      now leaving the source clock on should suffice.
      
      Changes since v3:
       - Move temp variable into loop
       - Move checks for using_ssc_source to after we've figured out has_ck505
       - Add using_ssc_source to debug output
      Changes since v2:
       - Fix debug output for when we disable the CPU source
      Changes since v1:
       - Leave the SSC source clock on instead of just shutting it off on all
         of the DPLL configurations.
      
      Cc: stable@vger.kernel.org
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NLyude <cpaul@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1464199863-9397-1-git-send-email-cpaul@redhat.com
      f165d283
  10. 25 5月, 2016 1 次提交