1. 22 6月, 2015 5 次提交
  2. 12 6月, 2015 5 次提交
    • M
      Revert "drm/i915: Read hw state into an atomic state struct, v2." · f7217905
      Maarten Lankhorst 提交于
      This reverts commit 3bae26eb2991c00670df377cf6c3bc2b0577e82a.
      
      Seems it introduces regressions for 3 different reasons, oh boy..
      
      In bug #90868 as I can see the atomic state will be restored on
      resume without the planes being set up properly. Because plane
      setup here requires the atomic state, we'll have to settle
      for committing atomic planes first.
      
      In bug #90861 the failure appears to affect mostly DP devices,
      and happens because reading out the atomic state prevents a modeset
      on boot, which would require better hw state readout.
      
      In bug #90874 it's shown that cdclk should be part of the atomic
      state, so only performing a single modeset during resume excarbated
      the issue.
      
      It's better to fix those issues first, and then commit this patch,
      so do that temporarily.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90868
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90861
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90874Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Acked-by: NAnder Conselvan de Oliveira <conselvan2@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      f7217905
    • A
      drm/i915: Read hw state into an atomic state struct, v2. · 37ade417
      Ander Conselvan de Oliveira 提交于
      To make this work we load the new hardware state into the
      atomic_state, then swap it with the sw state.
      
      This lets us change the force restore path in setup_hw_state()
      to use a single call to intel_mode_set() to restore all the
      previous state.
      
      As a nice bonus this kills off encoder->new_encoder,
      connector->new_enabled and crtc->new_enabled. They were used only
      to restore the state after a modeset.
      
      Changes since v1:
      - Make sure all possible planes are added with their crtc set,
        so they will be turned off on first modeset.
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      37ade417
    • M
      drm/i915: Swap planes on each crtc separately, v2. · 5ac1c4bc
      Maarten Lankhorst 提交于
      Repeated calls to begin_crtc_commit can cause warnings like this:
      [  169.127746] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:616
      [  169.127835] in_atomic(): 0, irqs_disabled(): 1, pid: 1947, name: kms_flip
      [  169.127840] 3 locks held by kms_flip/1947:
      [  169.127843]  #0:  (&dev->mode_config.mutex){+.+.+.}, at: [<ffffffff814774bc>] __drm_modeset_lock_all+0x9c/0x130
      [  169.127860]  #1:  (crtc_ww_class_acquire){+.+.+.}, at: [<ffffffff814774cd>] __drm_modeset_lock_all+0xad/0x130
      [  169.127870]  #2:  (crtc_ww_class_mutex){+.+.+.}, at: [<ffffffff81477178>] drm_modeset_lock+0x38/0x110
      [  169.127879] irq event stamp: 665690
      [  169.127882] hardirqs last  enabled at (665689): [<ffffffff817ffdb5>] _raw_spin_unlock_irqrestore+0x55/0x70
      [  169.127889] hardirqs last disabled at (665690): [<ffffffffc0197a23>] intel_pipe_update_start+0x113/0x5c0 [i915]
      [  169.127936] softirqs last  enabled at (665470): [<ffffffff8108a766>] __do_softirq+0x236/0x650
      [  169.127942] softirqs last disabled at (665465): [<ffffffff8108ae75>] irq_exit+0xc5/0xd0
      [  169.127951] CPU: 1 PID: 1947 Comm: kms_flip Not tainted 4.1.0-rc4-patser+ #4039
      [  169.127954] Hardware name: LENOVO 2349AV8/2349AV8, BIOS G1ETA5WW (2.65 ) 04/15/2014
      [  169.127957]  ffff8800c49036f0 ffff8800cde5fa28 ffffffff817f6907 0000000080000001
      [  169.127964]  0000000000000000 ffff8800cde5fa58 ffffffff810aebed 0000000000000046
      [  169.127970]  ffffffff81c5d518 0000000000000268 0000000000000000 ffff8800cde5fa88
      [  169.127981] Call Trace:
      [  169.127992]  [<ffffffff817f6907>] dump_stack+0x4f/0x7b
      [  169.128001]  [<ffffffff810aebed>] ___might_sleep+0x16d/0x270
      [  169.128008]  [<ffffffff810aed38>] __might_sleep+0x48/0x90
      [  169.128017]  [<ffffffff817fc359>] mutex_lock_nested+0x29/0x410
      [  169.128073]  [<ffffffffc01635f0>] ? vgpu_write64+0x220/0x220 [i915]
      [  169.128138]  [<ffffffffc017fddf>] ? ironlake_update_primary_plane+0x2ff/0x410 [i915]
      [  169.128198]  [<ffffffffc0190e75>] intel_frontbuffer_flush+0x25/0x70 [i915]
      [  169.128253]  [<ffffffffc01831ac>] intel_finish_crtc_commit+0x4c/0x180 [i915]
      [  169.128279]  [<ffffffffc00784ac>] drm_atomic_helper_commit_planes+0x12c/0x240 [drm_kms_helper]
      [  169.128338]  [<ffffffffc0184264>] __intel_set_mode+0x684/0x830 [i915]
      [  169.128378]  [<ffffffffc018a84a>] intel_crtc_set_config+0x49a/0x620 [i915]
      [  169.128385]  [<ffffffff817fdd39>] ? mutex_unlock+0x9/0x10
      [  169.128391]  [<ffffffff81467b69>] drm_mode_set_config_internal+0x69/0x120
      [  169.128398]  [<ffffffff8119b547>] ? might_fault+0x57/0xb0
      [  169.128403]  [<ffffffff8146bf93>] drm_mode_setcrtc+0x253/0x620
      [  169.128409]  [<ffffffff8145c600>] drm_ioctl+0x1a0/0x6a0
      [  169.128415]  [<ffffffff810b3b41>] ? get_parent_ip+0x11/0x50
      [  169.128424]  [<ffffffff811e9ab8>] do_vfs_ioctl+0x2f8/0x530
      [  169.128429]  [<ffffffff810d0fcd>] ? trace_hardirqs_on+0xd/0x10
      [  169.128435]  [<ffffffff812e7676>] ? selinux_file_ioctl+0x56/0x100
      [  169.128439]  [<ffffffff811e9d71>] SyS_ioctl+0x81/0xa0
      [  169.128445]  [<ffffffff81800697>] system_call_fastpath+0x12/0x6f
      
      Solve it by using the newly introduced drm_atomic_helper_commit_planes_on_crtc.
      
      The problem here was that the drm_atomic_helper_commit_planes() helper
      we were using was basically designed to do
      
          begin_crtc_commit(crtc #1)
          begin_crtc_commit(crtc #2)
          ...
          commit all planes
          finish_crtc_commit(crtc #1)
          finish_crtc_commit(crtc #2)
      
      The problem here is that since our hardware relies on vblank evasion,
      our CRTC 'begin' function waits until we're out of the danger zone in
      which register writes might wind up straddling the vblank, then disables
      interrupts; our 'finish' function re-enables interrupts after the
      registers have been written.  The expectation is that the operations between
      'begin' and 'end' must be performed without sleeping (since interrupts
      are disabled) and should happen as quickly as possible.  By clumping all
      of the 'begin' calls together, we introducing a couple problems:
       * Subsequent 'begin' invocations might sleep (which is illegal)
       * The first 'begin' ensured that we were far enough from the vblank that
         we could write our registers safely and ensure they all fell within
         the same frame.  Adding extra delay waiting for subsequent CRTC's
         wasn't accounted for and could put us back into the 'danger zone' for
         CRTC #1.
      
      This commit solves the problem by using a new helper that allows an
      order of operations like:
      
         for each crtc {
              begin_crtc_commit(crtc)  // sleep (maybe), then disable interrupts
              commit planes for this specific CRTC
              end_crtc_commit(crtc)    // reenable interrupts
         }
      
      so that sleeps will only be performed while interrupts are enabled and
      we can be sure that registers for a CRTC will be written immediately
      once we know we're in the safe zone.
      
      The crtc->config->base.crtc update may seem unrelated, but the helper
      will use it to obtain the crtc for the state. Without the update it
      will dereference NULL and crash.
      
      Changes since v1:
      - Use Matt Roper's commit message.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      5ac1c4bc
    • M
      drm/i915: Use drm_atomic_helper_swap_state in intel_atomic_commit. · 61c05498
      Maarten Lankhorst 提交于
      And update crtc->config to point to the new state. There is no point
      in swapping only part of the state when the rest of the state
      should be untouched.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      61c05498
    • M
      drm/i915: Use global atomic state for staged pll, config, v3. · de419ab6
      Maarten Lankhorst 提交于
      Now that we can subclass drm_atomic_state we can also use it to keep
      track of all the pll settings. atomic_state is a better place to hold
      all shared state than keeping pll->new_config everywhere.
      
      Changes since v1:
      - Assert connection_mutex is held.
      Changes since v2:
      - Fix swapped arguments to kzalloc for intel_atomic_state_alloc. (Jani Nikula)
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      de419ab6
  3. 08 5月, 2015 2 次提交
    • A
      drm/i915: Call drm helpers when duplicating crtc and plane states · f0c60574
      Ander Conselvan de Oliveira 提交于
      Use the helpers introduced by the commit below to properly initialize
      the duplicated states.
      
      commit f5e7840b
      Author: Thierry Reding <treding@nvidia.com>
      Date:   Wed Jan 28 14:54:32 2015 +0100
      
          drm/atomic: Add helpers for state-subclassing drivers
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f0c60574
    • C
      drm/i915: skylake primary plane scaling using shared scalers · 6156a456
      Chandra Konduru 提交于
      This patch enables skylake primary plane scaling using shared
      scalers atomic desgin.
      
      v2:
      -use single copy of scaler limits (Matt)
      
      v3:
      -move detach_scalers to crtc commit path (Matt)
      -use values in plane_state->src as regular integers (me)
      
      v4:
      -changes to align with updated scaler structures (Matt, me)
      -keep plane src rect in 16.16 format (Matt, Daniel)
      
      v5:
      -Rebased on top of 90/270 rotation changes (me)
      -Fixed an issue introduced by 90/270 changes where plane programming
       is using drm_plane->state rect instead of intel_plane->state rect.
       This change also required for scaling to work properly. (me)
      -With 90/270, updated limits to cover both portrait and landscape usages (me)
      -Refactored skylake_update_primary_plane to reduce its size (Daniel)
       Added helper functions for refactoring are comprehended enough to be
       used for skylake_update_plane (for sprite) too. One stop towards
       having single function for all planes.
      
      v6:
      -Added fixme note when checking plane_state->src width in update_plane (Daniel)
      -Release lock when failing to colorkey request with active scaler (Daniel)
      Signed-off-by: NChandra Konduru <chandra.konduru@intel.com>
      Reviewed-by: matthew.d.roper@intel.com
      Reviewed-by: sonika.jindal@intel.com (v5)
      Testcase: igt/kms_plane_scaling
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6156a456
  4. 13 4月, 2015 3 次提交
  5. 10 4月, 2015 1 次提交
    • M
      drm/i915: Clear crtc atomic flags at beginning of transaction · f1e2daea
      Matt Roper 提交于
      Once we have full atomic modeset, these kind of flags should be in a
      real intel_crtc_state that's tracked properly.  In the meantime, make
      sure we clear out any old flags at the beginning of a transaction so
      that we don't wind up seeing leftover flags from old transactions that
      were checked, but never went to the commit step.  At the moment, a
      failed check or prepare could leave stale flags behind that interfere
      with the next atomic transaction.
      
      v2: Just do a memset; the series this patch was originally part of
          placed additional fields into the structure that shouldn't be
          cleared, but that's no longer the case.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f1e2daea
  6. 18 3月, 2015 1 次提交
  7. 24 2月, 2015 1 次提交
  8. 27 1月, 2015 3 次提交