1. 25 11月, 2015 1 次提交
  2. 24 11月, 2015 3 次提交
  3. 19 11月, 2015 1 次提交
  4. 18 11月, 2015 2 次提交
  5. 17 11月, 2015 2 次提交
    • V
      drm/i915: Don't clobber the addfb2 ioctl params · 76dc3769
      Ville Syrjälä 提交于
      We try to convert the old way of of specifying fb tiling (obj->tiling)
      into the new fb modifiers. We store the result in the passed in mode_cmd
      structure. But that structure comes directly from the addfb2 ioctl, and
      gets copied back out to userspace, which means we're clobbering the
      modifiers that the user provided (all 0 since the DRM_MODE_FB_MODIFIERS
      flag wasn't even set by the user). Hence if the user reuses the struct
      for another addfb2, the ioctl will be rejected since it's now asking for
      some modifiers w/o the flag set.
      
      Fix the problem by making a copy of the user provided structure. We can
      play any games we want with the copy.
      
      IGT-Version: 1.12-git (x86_64) (Linux: 4.4.0-rc1-stereo+ x86_64)
      ...
      Subtest basic-X-tiled: SUCCESS (0.001s)
      Test assertion failure function pitch_tests, file kms_addfb_basic.c:167:
      Failed assertion: drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0
      Last errno: 22, Invalid argument
      Stack trace:
        #0 [__igt_fail_assert+0x101]
        #1 [pitch_tests+0x619]
        #2 [__real_main426+0x2f]
        #3 [main+0x23]
        #4 [__libc_start_main+0xf0]
        #5 [_start+0x29]
        #6 [<unknown>+0x29]
        Subtest framebuffer-vs-set-tiling failed.
        **** DEBUG ****
        Test assertion failure function pitch_tests, file kms_addfb_basic.c:167:
        Failed assertion: drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0
        Last errno: 22, Invalid argument
        ****  END  ****
        Subtest framebuffer-vs-set-tiling: FAIL (0.003s)
        ...
      
      IGT-Version: 1.12-git (x86_64) (Linux: 4.4.0-rc1-stereo+ x86_64)
      Subtest framebuffer-vs-set-tiling: SUCCESS (0.000s)
      
      Cc: stable@vger.kernel.org # v4.1+
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Fixes: 2a80eada ("drm/i915: Add fb format modifier support")
      Testcase: igt/kms_addfb_basic/clobbered-modifier
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1447261890-3960-1-git-send-email-ville.syrjala@linux.intel.com
      76dc3769
    • M
      drm/i915: Clear intel_crtc->atomic before updating it. · ba8af3e5
      Maarten Lankhorst 提交于
      If an atomic update fails intel_crtc->atomic may have have some values left
      from the last atomic check. One example is atomic->wait_for_vblank,
      which results in spurious errors in kms_flip.
      
      [ 1551.892708] ------------[ cut here ]------------
      [ 1551.892721] WARNING: CPU: 3 PID: 4179 at ../drivers/gpu/drm/drm_irq.c:1199 drm_wait_one_vblank+0x197/0x1a0 [drm]()
      [ 1551.892722] vblank not available on crtc 2, ret=-22
      [ 1551.892751] Modules linked in: snd_hda_intel i915 drm_kms_helper drm
      intel_gtt i2c_algo_bit cfbfillrect syscopyarea cfbimgblt sysfillrect
      sysimgblt fb_sys_fops cfbcopyarea agpgart cfg80211 binfmt_misc
      snd_hda_codec_hdmi intel_rapl iosf_mbi x86_pkg_temp_thermal coretemp
      kvm_intel snd_hda_codec_realtek kvm snd_hda_codec_generic iTCO_wdt
      aesni_intel aes_x86_64 glue_helper lrw snd_hda_codec gf128mul
      ablk_helper cryptd snd_hwdep psmouse snd_hda_core pcspkr snd_pcm
      snd_timer snd lpc_ich i2c_i801 mfd_core soundcore wmi evdev [last
      unloaded: drm]
      [ 1551.892753] CPU: 3 PID: 4179 Comm: kms_pipe_crc_ba Tainted: G     U  W       4.3.0-reg+ #6
      [ 1551.892754] Hardware name:                  /DZ77BH-55K, BIOS BHZ7710H.86A.0100.2013.0517.0942 05/17/2013
      [ 1551.892758]  ffffffffa03128d8 ffff8800cec73890 ffffffff812c0f3c ffff8800cec738d8
      [ 1551.892760]  ffff8800cec738c8 ffffffff8104ff36 ffff880116ae2290 0000000000000002
      [ 1551.892762]  ffff8800d39fcda0 ffff8800d038b4d0 ffff8800d42b5550 ffff8800cec73928
      [ 1551.892763] Call Trace:
      [ 1551.892768]  [<ffffffff812c0f3c>] dump_stack+0x4e/0x82
      [ 1551.892771]  [<ffffffff8104ff36>] warn_slowpath_common+0x86/0xc0
      [ 1551.892773]  [<ffffffff8104ffbc>] warn_slowpath_fmt+0x4c/0x50
      [ 1551.892781]  [<ffffffffa02e6708>] ? drm_vblank_get+0x78/0xd0 [drm]
      [ 1551.892787]  [<ffffffffa02e6d47>] drm_wait_one_vblank+0x197/0x1a0 [drm]
      [ 1551.892813]  [<ffffffffa03d052f>] intel_post_plane_update+0xef/0x120 [i915]
      [ 1551.892832]  [<ffffffffa03d11d2>] intel_atomic_commit+0x4c2/0x1600 [i915]
      [ 1551.892862]  [<ffffffffa02ff0c7>] ? drm_atomic_check_only+0x147/0x5e0 [drm]
      [ 1551.892872]  [<ffffffffa02feeb7>] ? drm_atomic_add_affected_connectors+0x27/0xf0 [drm]
      [ 1551.892881]  [<ffffffffa02ff597>] drm_atomic_commit+0x37/0x60 [drm]
      [ 1551.892887]  [<ffffffffa034301a>] restore_fbdev_mode+0x28a/0x2c0 [drm_kms_helper]
      [ 1551.892895]  [<ffffffffa0345253>] drm_fb_helper_restore_fbdev_mode_unlocked+0x33/0x80 [drm_kms_helper]
      [ 1551.892900]  [<ffffffffa03452cd>] drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper]
      [ 1551.892920]  [<ffffffffa03e7a9a>] intel_fbdev_set_par+0x1a/0x60 [i915]
      [ 1551.892923]  [<ffffffff8131a5a7>] fb_set_var+0x1a7/0x3f0
      [ 1551.892927]  [<ffffffff8109732f>] ? trace_hardirqs_on_caller+0x12f/0x1c0
      [ 1551.892931]  [<ffffffff81314f32>] fbcon_blank+0x212/0x2f0
      [ 1551.892935]  [<ffffffff81373f4a>] do_unblank_screen+0xba/0x1d0
      [ 1551.892937]  [<ffffffff8136b725>] vt_ioctl+0x13d5/0x1450
      [ 1551.892940]  [<ffffffff8107cdd1>] ? preempt_count_sub+0x41/0x50
      [ 1551.892943]  [<ffffffff8135d8a3>] tty_ioctl+0x423/0xe30
      [ 1551.892947]  [<ffffffff8119f721>] do_vfs_ioctl+0x301/0x560
      [ 1551.892949]  [<ffffffff8119b1e3>] ? putname+0x53/0x60
      [ 1551.892952]  [<ffffffff811ab376>] ? __fget_light+0x66/0x90
      [ 1551.892955]  [<ffffffff8119f9f9>] SyS_ioctl+0x79/0x90
      [ 1551.892958]  [<ffffffff81552e97>] entry_SYSCALL_64_fastpath+0x12/0x6f
      [ 1551.892961] ---[ end trace 3e764d4b6628c91c ]---
      
      Testcase: kms_flip
      Reported-and-tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Cc: stable@vger.kernel.org #v4.3
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NDaniel Stone <daniels@collabora.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/5649C2BA.6080300@mblankhorst.nl
      ba8af3e5
  6. 16 11月, 2015 4 次提交
  7. 07 11月, 2015 3 次提交
    • M
      mm, fs: introduce mapping_gfp_constraint() · c62d2555
      Michal Hocko 提交于
      There are many places which use mapping_gfp_mask to restrict a more
      generic gfp mask which would be used for allocations which are not
      directly related to the page cache but they are performed in the same
      context.
      
      Let's introduce a helper function which makes the restriction explicit and
      easier to track.  This patch doesn't introduce any functional changes.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NMichal Hocko <mhocko@suse.com>
      Suggested-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c62d2555
    • M
      mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM · 71baba4b
      Mel Gorman 提交于
      __GFP_WAIT was used to signal that the caller was in atomic context and
      could not sleep.  Now it is possible to distinguish between true atomic
      context and callers that are not willing to sleep.  The latter should
      clear __GFP_DIRECT_RECLAIM so kswapd will still wake.  As clearing
      __GFP_WAIT behaves differently, there is a risk that people will clear the
      wrong flags.  This patch renames __GFP_WAIT to __GFP_RECLAIM to clearly
      indicate what it does -- setting it allows all reclaim activity, clearing
      them prevents it.
      
      [akpm@linux-foundation.org: fix build]
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Christoph Lameter <cl@linux.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Vitaly Wool <vitalywool@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      71baba4b
    • M
      mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep... · d0164adc
      Mel Gorman 提交于
      mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd
      
      __GFP_WAIT has been used to identify atomic context in callers that hold
      spinlocks or are in interrupts.  They are expected to be high priority and
      have access one of two watermarks lower than "min" which can be referred
      to as the "atomic reserve".  __GFP_HIGH users get access to the first
      lower watermark and can be called the "high priority reserve".
      
      Over time, callers had a requirement to not block when fallback options
      were available.  Some have abused __GFP_WAIT leading to a situation where
      an optimisitic allocation with a fallback option can access atomic
      reserves.
      
      This patch uses __GFP_ATOMIC to identify callers that are truely atomic,
      cannot sleep and have no alternative.  High priority users continue to use
      __GFP_HIGH.  __GFP_DIRECT_RECLAIM identifies callers that can sleep and
      are willing to enter direct reclaim.  __GFP_KSWAPD_RECLAIM to identify
      callers that want to wake kswapd for background reclaim.  __GFP_WAIT is
      redefined as a caller that is willing to enter direct reclaim and wake
      kswapd for background reclaim.
      
      This patch then converts a number of sites
      
      o __GFP_ATOMIC is used by callers that are high priority and have memory
        pools for those requests. GFP_ATOMIC uses this flag.
      
      o Callers that have a limited mempool to guarantee forward progress clear
        __GFP_DIRECT_RECLAIM but keep __GFP_KSWAPD_RECLAIM. bio allocations fall
        into this category where kswapd will still be woken but atomic reserves
        are not used as there is a one-entry mempool to guarantee progress.
      
      o Callers that are checking if they are non-blocking should use the
        helper gfpflags_allow_blocking() where possible. This is because
        checking for __GFP_WAIT as was done historically now can trigger false
        positives. Some exceptions like dm-crypt.c exist where the code intent
        is clearer if __GFP_DIRECT_RECLAIM is used instead of the helper due to
        flag manipulations.
      
      o Callers that built their own GFP flags instead of starting with GFP_KERNEL
        and friends now also need to specify __GFP_KSWAPD_RECLAIM.
      
      The first key hazard to watch out for is callers that removed __GFP_WAIT
      and was depending on access to atomic reserves for inconspicuous reasons.
      In some cases it may be appropriate for them to use __GFP_HIGH.
      
      The second key hazard is callers that assembled their own combination of
      GFP flags instead of starting with something like GFP_KERNEL.  They may
      now wish to specify __GFP_KSWAPD_RECLAIM.  It's almost certainly harmless
      if it's missed in most cases as other activity will wake kswapd.
      Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Vitaly Wool <vitalywool@gmail.com>
      Cc: Rik van Riel <riel@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d0164adc
  8. 06 11月, 2015 2 次提交
  9. 05 11月, 2015 2 次提交
  10. 04 11月, 2015 1 次提交
    • D
      drm/i915: Fix locking around GuC firmware load · bf248ca1
      Daniel Stone 提交于
      The GuC firmware load requires struct_mutex to create a GEM object,
      but this collides badly with request_firmware. Move struct_mutex
      locking down into the loader itself, so we don't hold it across the
      entire load process, including request_firmware.
      
      [   20.451400] ======================================================
      [   20.451420] [ INFO: possible circular locking dependency detected ]
      [   20.451441] 4.3.0-rc5+ #1 Tainted: G        W
      [   20.451457] -------------------------------------------------------
      [   20.451477] plymouthd/371 is trying to acquire lock:
      [   20.451494]  (&dev->struct_mutex){+.+.+.}, at: [<ffffffffa0093c62>]
      drm_gem_mmap+0x112/0x290 [drm]
      [   20.451538]
                     but task is already holding lock:
      [   20.451557]  (&mm->mmap_sem){++++++}, at: [<ffffffff811fd9ac>]
      vm_mmap_pgoff+0x8c/0xf0
      [   20.451591]
                     which lock already depends on the new lock.
      
      [   20.451617]
                     the existing dependency chain (in reverse order) is:
      [   20.451640]
                     -> #3 (&mm->mmap_sem){++++++}:
      [   20.451661]        [<ffffffff8110644e>] lock_acquire+0xce/0x1c0
      [   20.451683]        [<ffffffff8120ec9a>] __might_fault+0x7a/0xa0
      [   20.451705]        [<ffffffff8127e34e>] filldir+0x9e/0x130
      [   20.451726]        [<ffffffff81295b86>] dcache_readdir+0x186/0x230
      [   20.451748]        [<ffffffff8127e117>] iterate_dir+0x97/0x130
      [   20.451769]        [<ffffffff8127e66a>] SyS_getdents+0x9a/0x130
      [   20.451790]        [<ffffffff8184f2f2>] entry_SYSCALL_64_fastpath+0x12/0x76
      [   20.451829]
                     -> #2 (&sb->s_type->i_mutex_key#2){+.+.+.}:
      [   20.451852]        [<ffffffff8110644e>] lock_acquire+0xce/0x1c0
      [   20.451872]        [<ffffffff8184b516>] mutex_lock_nested+0x86/0x400
      [   20.451893]        [<ffffffff81277790>] walk_component+0x1d0/0x2a0
      [   20.451914]        [<ffffffff812779f0>] link_path_walk+0x190/0x5a0
      [   20.451935]        [<ffffffff8127803b>] path_openat+0xab/0x1260
      [   20.451955]        [<ffffffff8127a651>] do_filp_open+0x91/0x100
      [   20.451975]        [<ffffffff81267e67>] file_open_name+0xf7/0x150
      [   20.451995]        [<ffffffff81267ef3>] filp_open+0x33/0x60
      [   20.452014]        [<ffffffff8157e1e7>] _request_firmware+0x277/0x880
      [   20.452038]        [<ffffffff8157e9e4>] request_firmware_work_func+0x34/0x80
      [   20.452060]        [<ffffffff810c7020>] process_one_work+0x230/0x680
      [   20.452082]        [<ffffffff810c74be>] worker_thread+0x4e/0x450
      [   20.452102]        [<ffffffff810ce511>] kthread+0x101/0x120
      [   20.452121]        [<ffffffff8184f66f>] ret_from_fork+0x3f/0x70
      [   20.452140]
                     -> #1 (umhelper_sem){++++.+}:
      [   20.452159]        [<ffffffff8110644e>] lock_acquire+0xce/0x1c0
      [   20.452178]        [<ffffffff8184c5c1>] down_read+0x51/0xa0
      [   20.452197]        [<ffffffff810c203b>]
      usermodehelper_read_trylock+0x5b/0x130
      [   20.452221]        [<ffffffff8157e147>] _request_firmware+0x1d7/0x880
      [   20.452242]        [<ffffffff8157e821>] request_firmware+0x31/0x50
      [   20.452262]        [<ffffffffa01b54a4>]
      intel_guc_ucode_init+0xf4/0x400 [i915]
      [   20.452305]        [<ffffffffa0213913>] i915_driver_load+0xd63/0x16e0 [i915]
      [   20.452343]        [<ffffffffa00987d9>] drm_dev_register+0xa9/0xc0 [drm]
      [   20.452369]        [<ffffffffa009ae3d>] drm_get_pci_dev+0x8d/0x1e0 [drm]
      [   20.452396]        [<ffffffffa01521e4>] i915_pci_probe+0x34/0x50 [i915]
      [   20.452421]        [<ffffffff81464675>] local_pci_probe+0x45/0xa0
      [   20.452443]        [<ffffffff81465a6d>] pci_device_probe+0xfd/0x140
      [   20.452464]        [<ffffffff8156a2e4>] driver_probe_device+0x224/0x480
      [   20.452486]        [<ffffffff8156a5c8>] __driver_attach+0x88/0x90
      [   20.452505]        [<ffffffff81567cf3>] bus_for_each_dev+0x73/0xc0
      [   20.452526]        [<ffffffff81569a7e>] driver_attach+0x1e/0x20
      [   20.452546]        [<ffffffff815695ae>] bus_add_driver+0x1ee/0x280
      [   20.452566]        [<ffffffff8156b100>] driver_register+0x60/0xe0
      [   20.453197]        [<ffffffff81464050>] __pci_register_driver+0x60/0x70
      [   20.453845]        [<ffffffffa009b070>] drm_pci_init+0xe0/0x110 [drm]
      [   20.454497]        [<ffffffffa027f092>] 0xffffffffa027f092
      [   20.455156]        [<ffffffff81002123>] do_one_initcall+0xb3/0x200
      [   20.455796]        [<ffffffff811d8c01>] do_init_module+0x5f/0x1e7
      [   20.456434]        [<ffffffff8114c4e6>] load_module+0x2126/0x27d0
      [   20.457071]        [<ffffffff8114cdf9>] SyS_finit_module+0xb9/0xf0
      [   20.457738]        [<ffffffff8184f2f2>] entry_SYSCALL_64_fastpath+0x12/0x76
      [   20.458370]
                     -> #0 (&dev->struct_mutex){+.+.+.}:
      [   20.459773]        [<ffffffff8110584f>] __lock_acquire+0x191f/0x1ba0
      [   20.460451]        [<ffffffff8110644e>] lock_acquire+0xce/0x1c0
      [   20.461074]        [<ffffffffa0093c88>] drm_gem_mmap+0x138/0x290 [drm]
      [   20.461693]        [<ffffffff8121a5ec>] mmap_region+0x3ec/0x670
      [   20.462298]        [<ffffffff8121abb2>] do_mmap+0x342/0x420
      [   20.462901]        [<ffffffff811fd9d2>] vm_mmap_pgoff+0xb2/0xf0
      [   20.463532]        [<ffffffff81218f62>] SyS_mmap_pgoff+0x1f2/0x290
      [   20.464118]        [<ffffffff8102187b>] SyS_mmap+0x1b/0x30
      [   20.464702]        [<ffffffff8184f2f2>] entry_SYSCALL_64_fastpath+0x12/0x76
      [   20.465289]
                     other info that might help us debug this:
      
      [   20.467179] Chain exists of:
                       &dev->struct_mutex --> &sb->s_type->i_mutex_key#2 -->
      &mm->mmap_sem
      
      [   20.468928]  Possible unsafe locking scenario:
      
      [   20.470161]        CPU0                    CPU1
      [   20.470745]        ----                    ----
      [   20.471325]   lock(&mm->mmap_sem);
      [   20.471902]                                lock(&sb->s_type->i_mutex_key#2);
      [   20.472538]                                lock(&mm->mmap_sem);
      [   20.473118]   lock(&dev->struct_mutex);
      [   20.473704]
                      *** DEADLOCK ***
      Signed-off-by: NDaniel Stone <daniels@collabora.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      bf248ca1
  11. 02 11月, 2015 2 次提交
  12. 29 10月, 2015 1 次提交
  13. 27 10月, 2015 1 次提交
  14. 22 10月, 2015 1 次提交
  15. 19 10月, 2015 1 次提交
  16. 16 10月, 2015 3 次提交
  17. 15 10月, 2015 3 次提交
  18. 14 10月, 2015 4 次提交
  19. 13 10月, 2015 3 次提交
    • M
      drm/i915: Move skl/bxt gt specific workarounds to ring init · 9c4cbf82
      Mika Kuoppala 提交于
      Some registers are, naturally, lost in gpu reset/suspend cycle.
      And some registers, for example in display domain, are not subject
      to gpu reset so they retain their contents.
      
      As hang recovery triggers a reset, recoverable gpu hang can currently
      flush out essential workarounds and cause havoc later on.
      
      When register GEN8_GARBNTL is missing the WaEnableGapsTsvCreditFix:skl,
      it can cause random system hangs [1]. This workaround was added in:
      commit 245d9667 ("drm/i915:skl: Add WaEnableGapsTsvCreditFix")
      But another set of system hangs were observed and the failure pattern
      indicated that there was random gpu hang preceding the system hang [2].
      This lead to the realization that we lose this workaround and BDW_SCRATCH1
      on reset.
      
      Add these workarounds setup in display init to skl/bxt ring init
      where LRI workarounds are also setup. This way their setup is not
      dependent on display side init.
      
      References: [1] https://bugs.freedesktop.org/show_bug.cgi?id=90854
      References: [2] https://bugs.freedesktop.org/show_bug.cgi?id=92315Reported-by: NTomi Sarvela <tomix.p.sarvela@intel.com>
      Cc: Tomi Sarvela <tomix.p.sarvela@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: NTomi Sarvela <tomix.p.sarvela@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9c4cbf82
    • C
      drm/i915: Deny wrapping an userptr into a framebuffer · cc917ab4
      Chris Wilson 提交于
      Pinning a userptr onto the hardware raises interesting questions about
      the lifetime of such a surface as the framebuffer extends that life
      beyond the client's address space. That is the hardware will need to
      keep scanning out from the backing storage even after the client wants
      to remap its address space. As the hardware pins the backing storage,
      the userptr becomes invalid and this raises a WARN when the clients
      tries to unmap its address space. The situation can be even more
      complicated when the buffer is passed between processes, between a
      client and display server, where the lifetime and hardware access is
      even more confusing. Deny it.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: stable@vger.kernel.org
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      cc917ab4
    • V
      drm/i915: Enable DPLL VGA mode before P1/P2 divider write · c2b63374
      Ville Syrjälä 提交于
      Apparently writing the DPLL register P1/P2 divider fields won't trigger
      an actual change in the DPLL output unless VGA mode is enabled for
      prior to the register write that changes the P1/P2 dividers. The write
      with the new P1/P2 divider can itself disable VGA mode again without
      problems.
      
      I tested the behaviour on my 946GZ, and when manually frobbing the
      register with the display on, the behaviour is very clear. However I
      can't explain why this machine actually works. The P1/P2 divider
      changes caused by normal modesets do seem to make it through to the
      hardware somehow since I get a stable picture on the monitor with
      any resolution. Maybe it's the "three times for luck" stuff that
      somehow masks the problem, or something.
      
      But apparently there are machines (eg. Nick Bowler's G45) where that
      isn't the case and we fail to get the correct clock from the DPLL.
      
      Things used to work because we enabled VGA mode for disabled DPLLs,
      so when re-enabling the DPLL VGA mode was enabled just prior to the
      first register write, and hence the P1/P2 change went through without
      a hitch. That got changed in
      
      b8afb911 drm/i915: Keep GMCH DPLL VGA mode always disabled
      
      in the name of consistency. In order to keep the consistency part,
      leave VGA mode disabled for disabled DPLLs, but turn it on just prior
      to updating the P1/P2 dividers to make sure the hardware picks up
      on the new values.
      
      Cc: Nick Bowler <nbowler@draconx.ca>
      Reported-by: NNick Bowler <nbowler@draconx.ca>
      Tested-by: NNick Bowler <nbowler@draconx.ca>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      c2b63374