1. 23 12月, 2015 1 次提交
  2. 22 12月, 2015 4 次提交
  3. 10 12月, 2015 1 次提交
  4. 02 12月, 2015 3 次提交
  5. 25 11月, 2015 1 次提交
  6. 19 11月, 2015 1 次提交
  7. 18 11月, 2015 1 次提交
  8. 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
  9. 16 11月, 2015 2 次提交
  10. 05 11月, 2015 1 次提交
  11. 02 11月, 2015 1 次提交
  12. 15 10月, 2015 1 次提交
  13. 14 10月, 2015 4 次提交
  14. 13 10月, 2015 7 次提交
  15. 09 10月, 2015 3 次提交
  16. 02 10月, 2015 1 次提交
    • S
      drm/i915/bxt: DSI encoder support in CRTC modeset · 7d4aefd0
      Shashank Sharma 提交于
      SKL and BXT qualifies the HAS_DDI() check, and hence haswell
      modeset functions are re-used for modeset sequence. But DDI
      interface doesn't include support for DSI.
      This patch adds:
      1. cases for DSI encoder, in those modeset functions and allows
         a CRTC modeset
      2. Adds call to pre_pll enabled from CRTC modeset function. Nothing
         needs to be done as such in CRTC for DSI encoder, as PLL, clock
         and and transcoder programming will be taken care in encoder's
         pre_enable and pre_pll_enable function.
      
      v2: Fixed Jani's review comments. Added INVALID_PORT for non DDI
          encoder like DSI for platforms having HAS_DDI as true.
      
      v3: Rebased on latest drm-nightly branch. Added a WARN_ON for invalid
          encoder.
      
      v4: WARN_ON for invalid encoder is refactored as per Jani's suggestion.
          Fixed the sequence for pre_pll_enable.
      
      v5: Protected DDI code paths in case of DSI encoder calls.
      Signed-off-by: NShashank Sharma <shashank.sharma@intel.com>
      Signed-off-by: NUma Shankar <uma.shankar@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7d4aefd0
  17. 30 9月, 2015 6 次提交
    • M
      drm/i915: Calculate watermark configuration during atomic check (v2) · 76305b1a
      Matt Roper 提交于
      v2: Don't forget to actually check the cstate->active value when
          tallying up the number of active CRTC's.  (Ander)
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      76305b1a
    • M
      drm/i915: Don't set plane visible during HW readout if CRTC is off · a4611e44
      Matt Roper 提交于
      We already ensure that pstate->visible = false when crtc->active = false
      during runtime programming; make sure we follow the same logic when
      reading out initial hardware state.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a4611e44
    • M
      drm/i915: Calculate ILK-style watermarks during atomic check (v3) · a28170f3
      Matt Roper 提交于
      Calculate pipe watermarks during atomic calculation phase, based on the
      contents of the atomic transaction's state structure.  We still program
      the watermarks at the same time we did before, but the computation now
      happens much earlier.
      
      While this patch isn't too exciting by itself, it paves the way for
      future patches.  The eventual goal (which will be realized in future
      patches in this series) is to calculate multiple sets up watermark
      values up front, and then program them at different times (pre- vs
      post-vblank) on the platforms that need a two-step watermark update.
      
      While we're at it, s/intel_compute_pipe_wm/ilk_compute_pipe_wm/ since
      this function only applies to ILK-style watermarks and we have a
      completely different function for SKL-style watermarks.
      
      Note that the original code had a memcmp() in ilk_update_wm() to avoid
      calling ilk_program_watermarks() if the watermarks hadn't changed.  This
      memcmp vanishes here, which means we may do some unnecessary result
      generation and merging in cases where watermarks didn't change, but the
      lower-level function ilk_write_wm_values already makes sure that we
      don't actually try to program the watermark registers again.
      
      v2: Squash a few commits from the original series together; no longer
          leave pre-calculated wm's in a separate temporary structure since
          it's easier to follow the logic if we just cut over to using the
          pre-calculated values directly.
      
      v3:
       - Pass intel_crtc instead of drm_crtc to .compute_pipe_wm() entrypoint
         and use intel_atomic_get_crtc_state() to avoid need for extra
         casting.  (Ander)
       - Drop unused intel_check_crtc() function prototype.  (Ander)
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a28170f3
    • M
      drm/i915: Drop intel_update_sprite_watermarks · 47c99438
      Matt Roper 提交于
      The only platform that still has an update_sprite_wm entrypoint is SKL;
      on SKL, intel_update_sprite_watermarks just updates intel_plane->wm and
      then performs a regular watermark update.  However intel_plane->wm is
      only used to update a couple fields in intel_wm_config, and those fields
      are never used by the SKL code, so on SKL an update_sprite_wm is
      effectively identical to an update_wm call.  Since we're already
      ensuring that the regular intel_update_wm is called any time we'd try to
      call intel_update_sprite_watermarks, the whole call is redundant and can
      be dropped.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      47c99438
    • M
      drm/i915/ivb: Move WaCxSRDisabledForSpriteScaling w/a to atomic check · 7809e5ae
      Matt Roper 提交于
      Determine whether we need to apply this workaround at atomic check time
      and just set a flag that will be used by the main watermark update
      routine.
      
      Moving this workaround into the atomic framework reduces
      ilk_update_sprite_wm() to just a standard watermark update, so drop it
      completely and just ensure that ilk_update_wm() is called whenever a
      sprite plane is updated in a way that would affect watermarks.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7809e5ae
    • M
      drm/i915/skl: Simplify wm structures slightly (v2) · 4969d33e
      Matt Roper 提交于
      A bunch of SKL watermark-related structures have the cursor plane as a
      separate entry from the rest of the planes.  Since a previous patch
      updated I915_MAX_PLANES such that those plane arrays now have a slot for
      the cursor, update the code to use the new slot in the existing plane
      arrays and kill off the cursor-specific structures.
      
      There shouldn't be any functional change here; this is just shuffling
      around how the data is stored in some of the data structures.  The whole
      patch is generated with Coccinelle via the following semantic patch:
      
              @@ struct skl_pipe_wm_parameters WMP; @@
              - WMP.cursor
              + WMP.plane[PLANE_CURSOR]
      
              @@ struct skl_pipe_wm_parameters *WMP; @@
              - WMP->cursor
              + WMP->plane[PLANE_CURSOR]
      
              @@ @@
              struct skl_pipe_wm_parameters {
              ...
              - struct intel_plane_wm_parameters cursor;
              ...
              };
      
              @@
              struct skl_ddb_allocation DDB;
              expression E;
              @@
              - DDB.cursor[E]
              + DDB.plane[E][PLANE_CURSOR]
      
              @@
              struct skl_ddb_allocation *DDB;
              expression E;
              @@
              - DDB->cursor[E]
              + DDB->plane[E][PLANE_CURSOR]
      
              @@ @@
              struct skl_ddb_allocation {
              ...
              - struct skl_ddb_entry cursor[I915_MAX_PIPES];
              ...
              };
      
              @@
              struct skl_wm_values WMV;
              expression E1, E2;
              @@
              (
              - WMV.cursor[E1][E2]
              + WMV.plane[E1][PLANE_CURSOR][E2]
              |
              - WMV.cursor_trans[E1]
              + WMV.plane_trans[E1][PLANE_CURSOR]
              )
      
              @@
              struct skl_wm_values *WMV;
              expression E1, E2;
              @@
              (
              - WMV->cursor[E1][E2]
              + WMV->plane[E1][PLANE_CURSOR][E2]
              |
              - WMV->cursor_trans[E1]
              + WMV->plane_trans[E1][PLANE_CURSOR]
              )
      
              @@ @@
              struct skl_wm_values {
              ...
              - uint32_t cursor[I915_MAX_PIPES][8];
              ...
              - uint32_t cursor_trans[I915_MAX_PIPES];
              ...
              };
      
              @@ struct skl_wm_level WML; @@
              (
              - WML.cursor_en
              + WML.plane_en[PLANE_CURSOR]
              |
              - WML.cursor_res_b
              + WML.plane_res_b[PLANE_CURSOR]
              |
              - WML.cursor_res_l
              + WML.plane_res_l[PLANE_CURSOR]
              )
      
              @@ struct skl_wm_level *WML; @@
              (
              - WML->cursor_en
              + WML->plane_en[PLANE_CURSOR]
              |
              - WML->cursor_res_b
              + WML->plane_res_b[PLANE_CURSOR]
              |
              - WML->cursor_res_l
              + WML->plane_res_l[PLANE_CURSOR]
              )
      
              @@ @@
              struct skl_wm_level {
              ...
              - bool cursor_en;
              ...
              - uint16_t cursor_res_b;
              - uint8_t cursor_res_l;
              ...
              };
      
      v2: Use a PLANE_CURSOR enum entry rather than making the code reference
          I915_MAX_PLANES or I915_MAX_PLANES+1, which was confusing.  (Ander)
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4969d33e