1. 29 1月, 2016 3 次提交
    • V
      drm/i915: Fix NULL plane->fb oops on SKL · 2850cfdd
      Ville Syrjälä 提交于
      In this atomic age, we can't trust the plane->fb pointer anymore.
      It might get update too late. Instead we are supposed to use the
      plane_state->fb pointer instead. Let's do that in
      intel_plane_obj_offset() and avoid problems from dereferencing the
      potentially stale plane->fb pointer.
      
      Paulo found this with 'kms_frontbuffer_tracking --show-hidden --run-subtest nop-1p-rte'
      but it can be reproduced with just plain old kms_setplane.
      
      I was too lazy to bisect this, so not sure exactly when it broke. The
      most obvious candidate
      commit ce7f1728 ("drm/i915: Fix i915_ggtt_view_equal to handle rotation correctly")
      was actually still fine, so it must have broken some time after that.
      
      Here's the resulting fireworks:
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffffa02d2d9a>] intel_fill_fb_ggtt_view+0x1b/0x15a [i915]
      PGD 8a5f6067 PUD 8a5f5067 PMD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm intel_gtt agpgart netconsole mousedev hid_generic psmouse usbhid atkbd libps2 coretemp hwmon efi_pstore intel_rapl iosf_mbi x86_pkg_temp_thermal efivars pcspkr e1000e sdhci_pci ptp pps_core sdhci i2c_i801 mmc_core i2c_hid hid i8042 serio evdev sch_fq_codel ip_tables x_tables ipv6 autofs4
      CPU: 1 PID: 260 Comm: kms_plane Not tainted 4.4.0-skl+ #171
      Hardware name: Intel Corporation Skylake Client platform/Skylake Y LPDDR3 RVP3, BIOS SKLSE2R1.R00.B104.B00.1511030553 11/03/2015
      task: ffff88008bde2d80 ti: ffff88008a6ec000 task.ti: ffff88008a6ec000
      RIP: 0010:[<ffffffffa02d2d9a>]  [<ffffffffa02d2d9a>] intel_fill_fb_ggtt_view+0x1b/0x15a [i915]
      RSP: 0018:ffff88008a6efa10  EFLAGS: 00010086
      RAX: 0000000000000001 RBX: ffff8801674f4240 RCX: 0000000000000014
      RDX: ffff88008a7440c0 RSI: 0000000000000000 RDI: ffff88008a6efa40
      RBP: ffff88008a6efa30 R08: ffff88008bde3598 R09: 0000000000000001
      R10: ffff88008b782000 R11: 0000000000000000 R12: 0000000000000000
      R13: ffff88008a7440c0 R14: 0000000000000000 R15: ffff88008a7449c0
      FS:  00007fa0c07a28c0(0000) GS:ffff88016ec40000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 000000008a6ff000 CR4: 00000000003406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Stack:
       ffff8801674f4240 0000000000000000 ffff88008a7440c0 0000000000000000
       ffff88008a6efaa0 ffffffffa02daf25 ffffffff814ec80e 0000000000070298
       ffff8800850d0000 ffff88008a6efaa0 ffffffffa02c49c2 0000000000000002
      Call Trace:
       [<ffffffffa02daf25>] intel_plane_obj_offset+0x2d/0xa9 [i915]
       [<ffffffff814ec80e>] ? _raw_spin_unlock_irqrestore+0x4b/0x60
       [<ffffffffa02c49c2>] ? gen9_write32+0x2e8/0x3b8 [i915]
       [<ffffffffa02eecfc>] skl_update_plane+0x203/0x4c5 [i915]
       [<ffffffffa02ca1ab>] intel_plane_atomic_update+0x53/0x6a [i915]
       [<ffffffffa02494a4>] drm_atomic_helper_commit_planes_on_crtc+0x142/0x1d5 [drm_kms_helper]
       [<ffffffffa02de44b>] intel_atomic_commit+0x1262/0x1350 [i915]
       [<ffffffffa024a0ee>] ? __drm_atomic_helper_crtc_duplicate_state+0x2f/0x41 [drm_kms_helper]
       [<ffffffffa01ef089>] ? drm_atomic_check_only+0x3e3/0x552 [drm]
       [<ffffffffa01ef245>] drm_atomic_commit+0x4d/0x52 [drm]
       [<ffffffffa024996b>] drm_atomic_helper_update_plane+0xcb/0x118 [drm_kms_helper]
       [<ffffffffa01e42e8>] __setplane_internal+0x1c8/0x224 [drm]
       [<ffffffffa01e477f>] drm_mode_setplane+0x14e/0x172 [drm]
       [<ffffffffa01d8117>] drm_ioctl+0x265/0x3ad [drm]
       [<ffffffffa01e4631>] ? drm_mode_cursor_common+0x158/0x158 [drm]
       [<ffffffff810d00ab>] ? current_kernel_time64+0x5e/0x98
       [<ffffffff810a76ea>] ? trace_hardirqs_on_caller+0x17a/0x196
       [<ffffffff8119880f>] do_vfs_ioctl+0x42b/0x4ea
       [<ffffffff811a2b72>] ? __fget_light+0x4d/0x71
       [<ffffffff81198911>] SyS_ioctl+0x43/0x61
       [<ffffffff814ed057>] entry_SYSCALL_64_fastpath+0x12/0x6f
      
      Cc: drm-intel-fixes@lists.freedesktop.org
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Testcase: igt/kms_plane
      Reported-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1453220597-28973-1-git-send-email-ville.syrjala@linux.intel.comReviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      (cherry picked from commit e7941294)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      2850cfdd
    • V
      drm/i915: Don't reject primary plane windowing with color keying enabled on SKL+ · 6f94b6dd
      Ville Syrjälä 提交于
      On SKL+ plane scaling is mutually exclusive with color keying. The code
      check for this, but during some refactoring the code got changed to
      also reject primary plane windowing when color keying is used. There is
      no such restriction in the hardware, so restore the original logic.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Fixes: 061e4b8d ("drm/i915: clean up atomic plane check functions, v2.")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452883613-28549-1-git-send-email-ville.syrjala@linux.intel.com
      Cc: stable@vger.kernel.org
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      (cherry picked from commit 693bdc28)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      6f94b6dd
    • J
      drm/i915/dp: fall back to 18 bpp when sink capability is unknown · 5efd4076
      Jani Nikula 提交于
      Per DP spec, the source device should fall back to 18 bpp, VESA range
      RGB when the sink capability is unknown. Fix the color depth
      clamping. 18 bpp color depth should ensure full color range in automatic
      mode.
      
      The clamping has been HDMI specific since its introduction in
      
      commit 996a2239
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Apr 19 11:24:34 2013 +0200
      
          drm/i915: Disable high-bpc on pre-1.4 EDID screens
      
      Cc: stable@vger.kernel.org
      Reported-and-tested-by: NDihan Wickremasuriya <nayomal@gmail.com>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=105331Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1452695720-7076-1-git-send-email-jani.nikula@intel.com
      (cherry picked from commit 013dd9e0)
      5efd4076
  2. 13 1月, 2016 2 次提交
  3. 06 1月, 2016 1 次提交
  4. 05 1月, 2016 1 次提交
  5. 23 12月, 2015 1 次提交
  6. 22 12月, 2015 4 次提交
  7. 18 12月, 2015 1 次提交
  8. 16 12月, 2015 1 次提交
  9. 15 12月, 2015 2 次提交
  10. 11 12月, 2015 2 次提交
    • V
      drm: Pass 'name' to drm_universal_plane_init() · b0b3b795
      Ville Syrjälä 提交于
      Done with coccinelle for the most part. It choked on
      msm/mdp/mdp5/mdp5_plane.c like so:
      "BAD:!!!!!  enum drm_plane_type type;"
      No idea how to deal with that, so I just fixed that up
      by hand.
      
      Also it thinks '...' is part of the semantic patch, so I put an
      'int DOTDOTDOT' placeholder in its place and got rid of it with
      sed afterwards.
      
      I didn't convert drm_plane_init() since passing the varargs through
      would mean either cpp macros or va_list, and I figured we don't
      care about these legacy functions enough to warrant the extra pain.
      
      @@
      typedef uint32_t;
      identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
      @@
       int drm_universal_plane_init(struct drm_device *dev,
                                    struct drm_plane *plane,
                                    unsigned long possible_crtcs,
                                    const struct drm_plane_funcs *funcs,
                                    const uint32_t *formats,
                                    unsigned int format_count,
                                    enum drm_plane_type type
      +                             ,const char *name, int DOTDOTDOT
                                    )
      { ... }
      
      @@
      identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
      @@
       int drm_universal_plane_init(struct drm_device *dev,
                                    struct drm_plane *plane,
                                    unsigned long possible_crtcs,
                                    const struct drm_plane_funcs *funcs,
                                    const uint32_t *formats,
                                    unsigned int format_count,
                                    enum drm_plane_type type
      +                             ,const char *name, int DOTDOTDOT
                                    );
      
      @@
      expression E1, E2, E3, E4, E5, E6, E7;
      @@
       drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7
      +                         ,NULL
                                )
      
      v2: Split crtc and plane changes apart
          Pass NUL for no-name instead of ""
          Leave drm_plane_init() alone
      v3: Add ', or NULL...' to @name kernel doc (Jani)
          Annotate the function with __printf() attribute (Jani)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
      b0b3b795
    • V
      drm: Pass 'name' to drm_crtc_init_with_planes() · f9882876
      Ville Syrjälä 提交于
      Done with coccinelle for the most part. However, it thinks '...' is
      part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
      in its place and got rid of it with sed afterwards.
      
      I didn't convert drm_crtc_init() since passing the varargs through
      would mean either cpp macros or va_list, and I figured we don't
      care about these legacy functions enough to warrant the extra pain.
      
      @@
      identifier dev, crtc, primary, cursor, funcs;
      @@
       int drm_crtc_init_with_planes(struct drm_device *dev,
                                     struct drm_crtc *crtc,
                                     struct drm_plane *primary, struct drm_plane *cursor,
                                     const struct drm_crtc_funcs *funcs
      +                              ,const char *name, int DOTDOTDOT
                                     )
      { ... }
      
      @@
      identifier dev, crtc, primary, cursor, funcs;
      @@
       int drm_crtc_init_with_planes(struct drm_device *dev,
                                     struct drm_crtc *crtc,
                                     struct drm_plane *primary, struct drm_plane *cursor,
                                     const struct drm_crtc_funcs *funcs
      +                              ,const char *name, int DOTDOTDOT
                                     );
      
      @@
      expression E1, E2, E3, E4, E5;
      @@
       drm_crtc_init_with_planes(E1, E2, E3, E4, E5
      +                          ,NULL
                                 )
      
      v2: Split crtc and plane changes apart
          Pass NULL for no-name instead of ""
          Leave drm_crtc_init() alone
      v3: Add ', or NULL...' to @name kernel doc (Jani)
          Annotate the function with __printf() attribute (Jani)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
      f9882876
  11. 10 12月, 2015 4 次提交
  12. 08 12月, 2015 5 次提交
  13. 07 12月, 2015 4 次提交
  14. 03 12月, 2015 6 次提交
    • M
      drm/i915: Handle cdclk limits on broadwell. · 63ba534e
      Maarten Lankhorst 提交于
      As the comment indicates this can only fail gracefully when
      called from compute_config. Fortunately this is now what's happening,
      so the fixme can be removed and the DRM_ERROR downgraded.
      
      Link: http://patchwork.freedesktop.org/patch/msgid/1448360945-5723-3-git-send-email-maarten.lankhorst@linux.intel.comSigned-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      63ba534e
    • A
      i915: wait for fence in prepare_plane_fb · 3c28ff22
      Alex Goins 提交于
      In intel_prepare_plane_fb, if fb is backed by dma-buf, wait for exclusive
      fence
      
      v2: First commit
      v3: Remove object_name_lock acquire
          Move wait from intel_atomic_commit() to intel_prepare_plane_fb()
      v4: Wait only on exclusive fences, interruptible with no timeout
      v5: Style tweaks to more closely match rest of file
      v6: Properly handle interrupted waits
      v7: No change
      v8: No change
      
      Link: https://patchwork.kernel.org/patch/7704181/Signed-off-by: NAlex Goins <agoins@nvidia.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      3c28ff22
    • A
      i915: wait for fence in mmio_flip_work_func · fd8e058a
      Alex Goins 提交于
      If a buffer is backed by dmabuf, wait on its reservation object's exclusive
      fence before flipping.
      
      v2: First commit
      v3: Remove object_name_lock acquire
      v4: Move wait ahead of mark_page_flip_active
          Use crtc->primary->fb to get GEM object instead of pending_flip_obj
          use_mmio_flip() return true when exclusive fence is attached
          Wait only on exclusive fences, interruptible with no timeout
      v5: Move wait from do_mmio_flip to mmio_flip_work_func
          Style tweaks to more closely match rest of file
      v6: Change back to unintteruptible wait to match __i915_wait_request due to
          inability to properly handle interrupted wait.
          Warn on error code from waiting.
      v7: No change
      v8: Test for !reservation_object_signaled_rcu(test_all=FALSE) instead of
          obj->base.dma_buf->resv->fence_excl
      
      Link: https://patchwork.kernel.org/patch/7704181/Signed-off-by: NAlex Goins <agoins@nvidia.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      fd8e058a
    • P
      drm/i915: introduce intel_fbc_{enable,disable} · d029bcad
      Paulo Zanoni 提交于
      The goal is to call FBC enable/disable only once per modeset, while
      activate/deactivate/update will be called multiple times.
      
      The enable() function will be responsible for deciding if a CRTC will
      have FBC on it and then it will "lock" FBC on this CRTC: it won't be
      possible to change FBC's CRTC until disable(). With this, all checks
      and resource acquisition that only need to be done once per modeset
      can be moved from update() to enable(). And then the update(),
      activate() and deactivate() code will also get simpler since they
      won't need to worry about the CRTC being changed.
      
      The disable() function will do the reverse operation of enable(). One
      of its features is that it should only be called while the pipe is
      already off. This guarantees that FBC is stopped and nothing is
      using the CFB.
      
      With this, the activate() and deactivate() functions just start and
      temporarily stop FBC. They are the ones touching the hardware enable
      bit, so HW state reflects dev_priv->crtc.active.
      
      The last function remaining is update(). A lot of times I thought
      about renaming update() to activate() or try_to_activate() since it's
      called when we want to activate FBC. The thing is that update() may
      not only decide to activate FBC, but also deactivate or keep it on the
      same state, so I'll leave this name for now.
      
      Moving code to enable() and disable() will also help in case we decide
      to move FBC to pipe_config or something else later.
      
      The current patch only puts the very basic code on enable() and
      disable(). The next commits will take care of moving more stuff from
      update() to the new functions.
      
      v2:
        - Rebase.
        - Improve commit message (Chris).
      v3: Rebase after changing the patch order.
      v4: Rebase again after upstream changes.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/
      d029bcad
    • P
      drm/i915: introduce is_active/activate/deactivate to the FBC terminology · 0e631adc
      Paulo Zanoni 提交于
      The long term goal is to have enable/disable as the higher level
      functions and activate/deactivate as the lower level functions, just
      like we do for PSR and for the CRTC. This way, we'll run enable and
      disable once per modeset, while update, activate and deactivate will
      be run many times. With this, we can move the checks and code that
      need to run only once per modeset to enable(), making the code simpler
      and possibly a little faster.
      
      This patch is just the first step on the conversion: it starts by
      converting the current low level functions from enable/disable to
      activate/deactivate. This patch by itself has no benefits other than
      making review and rebase easier. Please see the next patches for more
      details on the conversion.
      
      v2:
        - Rebase.
        - Improve commit message (Chris).
      v3: Rebase after changing the patch order.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/
      0e631adc
    • P
      drm/i915: pass the crtc as an argument to intel_fbc_update() · 754d1133
      Paulo Zanoni 提交于
      There's no need to reevaluate the status of every single crtc when a
      single crtc changes its state.
      
      With this, we're cutting the case where due to a change in pipe B,
      intel_fbc_update() is called, then intel_fbc_find_crtc() concludes FBC
      should be enabled on pipe A, then it completely rechecks the state of
      pipe A only to conclude FBC should remain enabled on pipe A. If any
      change on pipe A triggers a need to recompute whether FBC is valid on
      pipe A, then at some point someone is going to call
      intel_fbc_update(PIPE_A).
      
      The addition of intel_fbc_deactivate() is necessary so we keep track
      of the previously selected CRTC when we do invalidate/flush. We're
      also going to continue the enable/disable/activate/deactivate concept
      in the next patches.
      
      v2: Rebase.
      v3: Rebase after changing the patch order.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/
      754d1133
  15. 02 12月, 2015 3 次提交