1. 15 2月, 2016 2 次提交
  2. 12 2月, 2016 1 次提交
  3. 25 1月, 2016 1 次提交
  4. 21 12月, 2015 1 次提交
    • M
      drm/fb-helper: Use proper plane mask for fb cleanup · 7118fd9b
      Matt Roper 提交于
      pan_display_atomic() calls drm_atomic_clean_old_fb() to sanitize the
      legacy FB fields (plane->fb and plane->old_fb).  However it was building
      the plane mask to pass to this function incorrectly (the bitwise OR was
      using plane indices rather than plane masks).  The end result was that
      sometimes the legacy pointers would become out of sync with the atomic
      pointers.  If another operation tried to re-set the same FB onto the
      plane, we might end up with the pointers back in sync, but improper
      reference counts, which would eventually lead to system crashes when we
      accessed a pointer to a prematurely-destroyed FB.
      
      The cause here was a very subtle bug introduced in commit:
      
              commit 07d3bad6
              Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
              Date:   Wed Nov 11 11:29:11 2015 +0100
      
                  drm/core: Fix old_fb handling in pan_display_atomic.
      
      I found the crashes were most easily reproduced (on i915 at least) by
      starting X and then VT switching to a VT that wasn't running a console
      instance...the sequence of vt/fbcon entries that happen in that case
      trigger a reference count mismatch and crash the system.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93313Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7118fd9b
  5. 17 11月, 2015 2 次提交
  6. 19 10月, 2015 2 次提交
  7. 02 10月, 2015 1 次提交
  8. 25 9月, 2015 1 次提交
    • M
      drm/fbdev: Update legacy plane->fb refcounting for atomic restore · 94284037
      Matt Roper 提交于
      Starting with commit
      
              commit 28cc504e
              Author: Rob Clark <robdclark@gmail.com>
              Date:   Tue Aug 25 15:36:00 2015 -0400
      
                  drm/i915: enable atomic fb-helper
      
      I've been seeing some panics on i915 when the DRM master shuts down that appear
      to be caused by using an already-freed framebuffer (i.e., we're unexpectedly
      dropping our initial FB's reference count to 0 and freeing it, which causes a
      crash when we try to restore it later).  Digging deeper, the state FB
      refcounting is working as expected, but we seem to be missing proper
      refcounting on the legacy plane->fb pointers in the new atomic fbdev code.
      
      Tracking plane->old_fb and then doing a ref/unref at the end of the
      fbdev restore like we do in the legacy ioctl's ensures we don't miscount
      references on plane->fb and avoids the panics.
      
      v2 from Daniel:
      
      Really do what the atomic ioctl does:
      - Also update plane->fb and plane->crtc.
      - Clear out plane->old_fb on failures too.
      
      v3: git add everything. Oops.
      
      v4: Also clear old_fb in all other failure paths, spotted by David.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: intel-gfx@lists.freedesktop.org
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: Matt Roper <matthew.d.roper@intel.com> (v1)
      Reviewd-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      94284037
  9. 17 9月, 2015 2 次提交
  10. 08 9月, 2015 2 次提交
  11. 11 8月, 2015 1 次提交
    • M
      drm/core: Set mode to NULL when connectors in a set drops to 0. · cebbb739
      Maarten Lankhorst 提交于
      Without this when a MST connector is removed drm_atomic_helper_set_config
      can complain about set->mode && !set->num_connectors.
      
      ------------[ cut here ]------------
      WARNING: CPU: 2 PID: 2403 at drivers/gpu/drm/drm_atomic_helper.c:1673 drm_atomic_helper_set_config+0x22e/0x420()
      CPU: 2 PID: 2403 Comm: kms_flip Not tainted 4.2.0-rc5 #4233
      Hardware name: NUC5i7RYB, BIOS RYBDWi35.86A.0246.2015.0309.1355 03/09/2015
       ffffffff81ac75e8 ffff88004e4ffbf8 ffffffff81714c34 0000000080000000
       0000000000000000 ffff88004e4ffc38 ffffffff8107bf81 ffff88004e4ffc48
       ffff8800d8ca0690 ffff8800d8d7a080 ffff8800d8cc2290 ffff8800d07bc9f0
      Call Trace:
       [<ffffffff81714c34>] dump_stack+0x4f/0x7b
       [<ffffffff8107bf81>] warn_slowpath_common+0x81/0xc0
       [<ffffffff8107c065>] warn_slowpath_null+0x15/0x20
       [<ffffffff813d9e3e>] drm_atomic_helper_set_config+0x22e/0x420
       [<ffffffff813da174>] ? drm_atomic_helper_plane_set_property+0x84/0xc0
       [<ffffffff813ee101>] drm_mode_set_config_internal+0x61/0x100
       [<ffffffff813dc4ed>] restore_fbdev_mode+0xbd/0xe0
       [<ffffffff813de1e4>] drm_fb_helper_restore_fbdev_mode_unlocked+0x24/0x70
       [<ffffffffc0123d11>] intel_fbdev_restore_mode+0x21/0x80 [i915]
       [<ffffffffc014bf69>] i915_driver_lastclose+0x9/0x10 [i915]
       [<ffffffff813e2429>] drm_lastclose+0x29/0x130
       [<ffffffff813e2844>] drm_release+0x314/0x500
       [<ffffffff81194795>] __fput+0xe5/0x1f0
       [<ffffffff811948d9>] ____fput+0x9/0x10
       [<ffffffff810968d8>] task_work_run+0x88/0xb0
       [<ffffffff8107d53f>] do_exit+0x37f/0xa90
       [<ffffffff8127e258>] ? selinux_file_ioctl+0x48/0xc0
       [<ffffffff81277dfe>] ? security_file_ioctl+0x3e/0x60
       [<ffffffff8107ec80>] do_group_exit+0x40/0xa0
       [<ffffffff8107ecef>] SyS_exit_group+0xf/0x10
       [<ffffffff8171bdd7>] entry_SYSCALL_64_fastpath+0x12/0x6a
      ---[ end trace 0daf358c49351567 ]---
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cebbb739
  12. 06 8月, 2015 9 次提交
  13. 22 7月, 2015 2 次提交
    • D
      drm/fbdev-helper: Grab mode_config.mutex in drm_fb_helper_single_add_all_connectors · 169faeca
      Daniel Vetter 提交于
      This is now truly only duct-tape to keep locking checks happy since
      calling this function when hpd or polling are already enabled is a
      bug. The fbdev helper can't cope with hotplug changes yet at this
      point, only after that.
      
      Otoh a bit more robustness in this function can't hurt, and with this
      fbdev can actually cope with hotplug changes. And it's also more
      consistent with the connector hotadd/remove dp mst needs to do.
      Therefore document this as new official behavior.
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      169faeca
    • D
      drm: Add modeset object iterators · 6295d607
      Daniel Vetter 提交于
      And roll them out across drm_* files. The point here isn't code
      prettification (it helps with that too) but that some of these lists
      aren't static any more. And having macros will gives us a convenient
      place to put locking checks into.
      
      I didn't add an iterator for props since that's only used by a
      list_for_each_entry_safe in the driver teardown code.
      
      Search&replace was done with the below cocci spatch. Note that there's
      a bunch more places that didn't match and which would need some manual
      changes, but I've intentially left these out for this mostly automated
      patch.
      
      iterator name drm_for_each_crtc;
      struct drm_crtc *crtc;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
      + drm_for_each_crtc (crtc, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_encoder;
      struct drm_encoder *encoder;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
      + drm_for_each_encoder (encoder, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_fb;
      struct drm_framebuffer *fb;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
      + drm_for_each_fb (fb, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_connector;
      struct drm_connector *connector;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
      + drm_for_each_connector (connector, dev) {
      ...
      }
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      6295d607
  14. 16 7月, 2015 1 次提交
  15. 08 4月, 2015 1 次提交
  16. 23 3月, 2015 1 次提交
  17. 12 3月, 2015 2 次提交
  18. 30 1月, 2015 1 次提交
  19. 21 1月, 2015 2 次提交
    • T
      drm/fb-helper: Propagate errors from initial config failure · 01934c2a
      Thierry Reding 提交于
      Make drm_fb_helper_initial_config() return an int rather than a bool so
      that the error can be properly propagated. While at it, update drivers
      to propagate errors further rather than just ignore them.
      
      v2:
      - cirrus: No cleanup is required, the top-level cirrus_driver_load()
        will do it as part of cirrus_driver_unload() in its cleanup path.
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      [danvet: Squash in simplification patch from kbuild.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      01934c2a
    • R
      drm: fb helper should avoid sleeping in panic context · 9aa609e1
      Rui Wang 提交于
      There are still some places in the fb helper that need to avoid
      sleeping in panic context. Here's an example:
      
      [   65.615496] bad: scheduling from the idle thread!
      [   65.620747] CPU: 92 PID: 0 Comm: swapper/92 Tainted: G   M        E  3.18.0-rc4-7-default+ #20
      
      [   65.630364] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS
      BRHSXSD1.86B.0056.R01.1409242327 09/24/2014
      [   65.641923]  ffff88087f693d80 ffff88087f689878 ffffffff81566db9 0000000000000000
      [   65.650226]  ffff88087f693d80 ffff88087f689898 ffffffff810871ff ffff88046eb3e0d0
      [   65.658527]  ffff88087f693d80 ffff88087f6898c8 ffffffff8107c1fa 000000017f6898b8
      [   65.666830] Call Trace:
      [   65.669557]  <#MC>  [<ffffffff81566db9>] dump_stack+0x46/0x58
      [   65.675994]  [<ffffffff810871ff>] dequeue_task_idle+0x2f/0x40
      [   65.682412]  [<ffffffff8107c1fa>] dequeue_task+0x5a/0x80
      [   65.688345]  [<ffffffff810804f3>] deactivate_task+0x23/0x30
      [   65.694569]  [<ffffffff81569050>] __schedule+0x580/0x7f0
      [   65.700502]  [<ffffffff81569739>] schedule_preempt_disabled+0x29/0x70
      [   65.707696]  [<ffffffff8156abb6>] __ww_mutex_lock_slowpath+0xb8/0x162
      [   65.714891]  [<ffffffff8156acb3>] __ww_mutex_lock+0x53/0x85
      [   65.721125]  [<ffffffffa00b3a5d>] drm_modeset_lock+0x3d/0x110 [drm]
      [   65.728132]  [<ffffffffa00b3c2a>] __drm_modeset_lock_all+0x8a/0x120 [drm]
      [   65.735721]  [<ffffffffa00b3cd0>] drm_modeset_lock_all+0x10/0x30 [drm]
      [   65.743015]  [<ffffffffa01af8bf>] drm_fb_helper_pan_display+0x2f/0xf0 [drm_kms_helper]
      [   65.751857]  [<ffffffff8132bd21>] fb_pan_display+0xd1/0x1a0
      [   65.758081]  [<ffffffff81326010>] bit_update_start+0x20/0x50
      [   65.764400]  [<ffffffff813259f2>] fbcon_switch+0x3a2/0x550
      [   65.770528]  [<ffffffff813a01c9>] redraw_screen+0x189/0x240
      [   65.776750]  [<ffffffff81322f8a>] fbcon_blank+0x20a/0x2d0
      [   65.782778]  [<ffffffff8137d359>] ? erst_writer+0x209/0x330
      [   65.789002]  [<ffffffff810ba2f3>] ? internal_add_timer+0x63/0x80
      [   65.795710]  [<ffffffff810bc137>] ? mod_timer+0x127/0x1e0
      [   65.801740]  [<ffffffff813a0cd8>] do_unblank_screen+0xa8/0x1d0
      [   65.808255]  [<ffffffff813a0e10>] unblank_screen+0x10/0x20
      [   65.814381]  [<ffffffff812ca0d9>] bust_spinlocks+0x19/0x40
      [   65.820508]  [<ffffffff81561ca7>] panic+0x106/0x1f5
      [   65.825955]  [<ffffffff8102336c>] mce_panic+0x2ac/0x2e0
      [   65.831789]  [<ffffffff812c796a>] ? delay_tsc+0x4a/0x80
      [   65.837625]  [<ffffffff81024e1f>] do_machine_check+0xbaf/0xbf0
      [   65.844138]  [<ffffffff813365d7>] ? intel_idle+0xc7/0x150
      [   65.850166]  [<ffffffff8156f03f>] machine_check+0x1f/0x30
      [   65.856195]  [<ffffffff813365d7>] ? intel_idle+0xc7/0x150
      [   65.862222]  <<EOE>>  [<ffffffff814283d5>] cpuidle_enter_state+0x55/0x170
      [   65.869823]  [<ffffffff814285a7>] cpuidle_enter+0x17/0x20
      [   65.875852]  [<ffffffff81097b08>] cpu_startup_entry+0x2d8/0x370
      [   65.882467]  [<ffffffff8102fe29>] start_secondary+0x159/0x180
      
      There's __drm_modeset_lock_all() which Daniel Vetter introduced for this
      purpose. We can leverage that without reinventing anything. This patch
      works with the latest kernel.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Tested-by: NTony Luck <tony.luck@intel.com>
      Signed-off-by: NRui Wang <rui.y.wang@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      9aa609e1
  20. 09 12月, 2014 2 次提交
  21. 04 11月, 2014 1 次提交
  22. 20 8月, 2014 1 次提交
    • T
      drm: fix plane rotation when restoring fbdev configuration · 3a5f87c2
      Thomas Wood 提交于
      Make sure plane rotation is reset correctly when restoring the fbdev
      configuration by using drm_mode_plane_set_obj_prop which calls the
      driver's set_property callback.
      
      The rotation reset feature was introduced in commit 9783de20 (drm:
      Resetting rotation property) and the callback issue was originally
      addressed in a previous version of the patch, but the fix was not
      present in the final version.
      
      v2: Fix documentation warning
          Add some more details to the commit message (Daniel Vetter)
      
      Testcase: igt/kms_rotation_crc
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82236
      Cc: Sonika Jindal <sonika.jindal@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThomas Wood <thomas.wood@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3a5f87c2
  23. 15 8月, 2014 1 次提交
    • D
      drm: Use the type of the array element when reallocating · 14f476fa
      Damien Lespiau 提交于
      Static analysers find it 'suspicious', that we're trying to allocate memory for
      elements of size sizeof(struct drm_fb_helper_connector) when the array is
      defined as struct drm_fb_helper_connector **.
      
      Use sizeof(struct drm_fb_helper_connector *) instead.
      
      Note that the structure being defined as:
      
      struct drm_fb_helper_connector {
      	struct drm_connector *connector;
      };
      
      This was still doing the right thing, but may not in the future if
      additional fields are added.
      
      Cc: Todd Previte <tprevite@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      14f476fa