1. 05 6月, 2014 3 次提交
    • C
      drm/i915: Always apply cursor width changes · 4b0e333e
      Chris Wilson 提交于
      It is possible for userspace to create a big object large enough for a
      256x256, and then switch over to using it as a 64x64 cursor. This
      requires the cursor update routines to check for a change in width on
      every update, rather than just when the cursor is originally enabled.
      
      This also fixes an issue with 845g/865g which cannot change the base
      address of the cursor whilst it is active.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [Antti:rebased, adjusted macro names and moved some lines, no functional
      changes]
      Reviewed-by: NAntti Koskipaa <antti.koskipaa@linux.intel.com>
      Tested-by: NAntti Koskipaa <antti.koskipaa@linux.intel.com>
      Cc: stable@vger.kernel.org
      Testcase: igt/kms_cursor_crc/cursor-size-change
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4b0e333e
    • J
      drm/i915/vlv: assert and de-assert sideband reset at boot and resume v3 · 57021059
      Jesse Barnes 提交于
      This is a bit like the CMN reset de-assert we do in DPIO_CTL, except
      that it resets the whole common lane section of the PHY.  This is
      required on machines where the BIOS doesn't do this for us on boot or
      resume to properly re-calibrate and get the PHY ready to transmit data.
      
      Without this patch, such machines won't resume correctly much of the time,
      with the symptom being a 'port ready' timeout and/or a link training
      failure.
      
      Note that simply asserting reset at suspend and de-asserting at resume
      is not sufficient, nor is simply de-asserting at boot.  Both of these
      cases have been tested and have still been found to have failures on
      some configurations.
      
      v2: extract simpler set_power_well function for use in reset_dpio (Imre)
          move to reset_dpio (Daniel & Ville)
      v3: don't reset if DPIO reset is already de-asserted (Imre)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      57021059
    • R
      drm: convert crtc and connection_mutex to ww_mutex (v5) · 51fd371b
      Rob Clark 提交于
      For atomic, it will be quite necessary to not need to care so much
      about locking order.  And 'state' gives us a convenient place to stash a
      ww_ctx for any sort of update that needs to grab multiple crtc locks.
      
      Because we will want to eventually make locking even more fine grained
      (giving locks to planes, connectors, etc), split out drm_modeset_lock
      and drm_modeset_acquire_ctx to track acquired locks.
      
      Atomic will use this to keep track of which locks have been acquired
      in a transaction.
      
      v1: original
      v2: remove a few things not needed until atomic, for now
      v3: update for v3 of connection_mutex patch..
      v4: squash in docbook
      v5: doc tweaks/fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      51fd371b
  2. 23 5月, 2014 1 次提交
  3. 22 5月, 2014 3 次提交
  4. 21 5月, 2014 2 次提交
    • D
      drm/i915: Accurately initialize fifo underrun state on gmch platforms · c5ab3bc0
      Daniel Vetter 提交于
      We don't have hardware based disable bits on gmch platforms, so need
      to block spurious underrun reports in software. Which means that we
      _must_ start out with fifo underrun reporting disabled everywhere.
      
      This is in big contrast to ilk/hsw/cpt where there's only _one_
      disable bit for all platforms and hence we must allow underrun
      reporting on disabled pipes. Otherwise nothing really works,
      especially the CRC support since that's key'ed off the same irq
      disable bit.
      
      This allows us to ditch the fifo underrun reporting hack from the vlv
      runtime pm code and unexport the internal function from i915_irq.c
      again. Yay!
      
      v2: Keep the display irq disabling, spotted by Imre.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c5ab3bc0
    • V
      drm/i915: Fix mmio vs. CS flip race on ILK+ · 75f7f3ec
      Ville Syrjälä 提交于
      Starting from ILK, mmio flips also cause a flip done interrupt to be
      signalled. This means if we first do a set_base and follow it
      immediately with the CS flip, we might mistake the flip done interrupt
      caused by the set_base as the flip done interrupt caused by the CS
      flip.
      
      The hardware has a flip counter which increments every time a mmio or
      CS flip is issued. It basically counts the number of DSPSURF register
      writes. This means we can sample the counter before we put the CS
      flip into the ring, and then when we get a flip done interrupt we can
      check whether the CS flip has actually performed the surface address
      update, or if the interrupt was caused by a previous but yet
      unfinished mmio flip.
      
      Even with the flip counter we still have a race condition of the CS flip
      base address update happens after the mmio flip done interrupt was
      raised but not yet processed by the driver. When the interrupt is
      eventually processed, the flip counter will already indicate that the
      CS flip has been executed, but it would not actually complete until the
      next start of vblank. We can use the DSPSURFLIVE register to check
      whether the hardware is actually scanning out of the buffer we expect,
      or if we managed hit this race window.
      
      This covers all the cases where the CS flip actually changes the base
      address. If the base address remains unchanged, we might still complete
      the CS flip before it has actually completed. But since the address
      didn't change anyway, the premature flip completion can't result in
      userspace overwriting data that's still being scanned out.
      
      CTG already has the flip counter and DSPSURFLIVE registers, and
      although the flip done interrupt is still limited to CS flips alone,
      the code now also checks the flip counter on CTG as well.
      
      v2: s/dspsurf/gtt_offset/ (Chris)
      
      Testcase: igt/kms_mmio_vs_cs_flip/setcrtc_vs_cs_flip
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73027Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      [danvet: Add g4x_ prefix to flip_count_after_eq.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      75f7f3ec
  5. 16 5月, 2014 4 次提交
  6. 14 5月, 2014 1 次提交
  7. 13 5月, 2014 2 次提交
  8. 06 5月, 2014 1 次提交
    • V
      drm/i915: Make sprite updates atomic · 8d7849db
      Ville Syrjälä 提交于
      Add a mechanism by which we can evade the leading edge of vblank. This
      guarantees that no two sprite register writes will straddle on either
      side of the vblank start, and that means all the writes will be latched
      together in one atomic operation.
      
      We do the vblank evade by checking the scanline counter, and if it's too
      close to the start of vblank (too close has been hardcoded to 100usec
      for now), we will wait for the vblank start to pass. In order to
      eliminate random delayes from the rest of the system, we operate with
      interrupts disabled, except when waiting for the vblank obviously.
      
      Note that we now go digging through pipe_to_crtc_mapping[] in the
      vblank interrupt handler, which is a bit dangerous since we set up
      interrupts before the crtcs. However in this case since it's the vblank
      interrupt, we don't actually unmask it until some piece of code
      requests it.
      
      v2: preempt_check_resched() calls after local_irq_enable() (Jesse)
          Hook up the vblank irq stuff on BDW as well
      v3: Pass intel_crtc instead of drm_crtc (Daniel)
          Warn if crtc.mutex isn't locked (Daniel)
          Add an explicit compiler barrier and document the barriers (Daniel)
          Note the irq vs. modeset setup madness in the commit message (Daniel)
      v4: Use prepare_to_wait() & co. directly and eliminate vbl_received
      v5: Refactor intel_pipe_handle_vblank() vs. drm_handle_vblank() (Chris)
          Check for min/max scanline <= 0 (Chris)
          Don't call intel_pipe_update_end() if start failed totally (Chris)
          Check that the vblank counters match on both sides of the critical
          section (Chris)
      v6: Fix atomic update for interlaced modes
      v7: Reorder code for better readability (Chris)
      v8: Drop preempt_check_resched(). It's not available to modules
          anymore and isn't even needed unless we ourselves cause
          a wakeup needing reschedule while interrupts are off
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NSourab Gupta <sourabgupta@gmail.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8d7849db
  9. 05 5月, 2014 2 次提交
  10. 23 4月, 2014 1 次提交
  11. 10 4月, 2014 2 次提交
    • P
      drm/i915: Add support for DRRS to switch RR · 439d7ac0
      Pradeep Bhat 提交于
      This patch computes and stored 2nd M/N/TU for switching to different
      refresh rate dynamically. PIPECONF_EDP_RR_MODE_SWITCH bit helps toggle
      between alternate refresh rates programmed in 2nd M/N/TU registers.
      
      v2: Daniel's review comments
      Computing M2/N2 in compute_config and storing it in crtc_config
      
      v3: Modified reference to edp_downclock and edp_downclock_avail based on the
      changes made to move them from dev_private to intel_panel.
      
      v4: Modified references to is_drrs_supported based on the changes made to
      rename it to drrs_support.
      
      v5: Jani's review comments
      Removed superfluous return statements. Changed support for Gen 7 and above.
      Corrected indentation. Re-structured the code which finds crtc and connector
      from encoder. Changed some logs to be less verbose.
      
      v6: Modifying i915_drrs to include only intel connector as intel_dp can be
      derived from intel connector when required.
      
      v7: As per internal review comments, acquiring mutex just before accessing
      drrs RR. As per Chris's review comments, added documentation about the use
      of locking in the function.
      
      v8: Incorporated Jani's review comments.
      Removed reference to edp_downclock.
      
      v9: Jani's review comments. Modified comment in set_drrs. Changed index to
      type edp_drrs_refresh_rate_type. Check if PSR is enabled before setting
      registers fo DRRS.
      Signed-off-by: NPradeep Bhat <pradeep.bhat@intel.com>
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      439d7ac0
    • P
      drm/i915: Parse EDID probed modes for DRRS support · 4f9db5b5
      Pradeep Bhat 提交于
      This patch and finds out the lowest refresh rate supported for the resolution
      same as the fixed_mode.
      It also checks the VBT fields to see if panel supports seamless DRRS or not.
      Based on above data it marks whether eDP panel supports seamless DRRS or not.
      This information is needed for supporting seamless DRRS switch for certain
      power saving usecases. This patch is tested by enabling the DRM logs and
      user should see whether Seamless DRRS is supported or not.
      
      v2: Daniel's review comments
      Modified downclock deduction based on intel_find_panel_downclock
      
      v3: Chris's review comments
      Moved edp_downclock_avail and edp_downclock to intel_panel
      
      v4: Jani's review comments.
      Changed name of the enum edp_panel_type to drrs_support type.
      Change is_drrs_supported to drrs_support of type enum drrs_support_type.
      
      v5: Incorporated Jani's review comments
      Modify intel_dp_drrs_initialize to return downclock mode. Support for Gen7
      and above.
      
      v6: Incorporated Chris's review comments.
      Changed initialize to init in intel_drrs_initialize
      
      v7: Incorporated Jani's review comments.
      Removed edp_downclock and edp_downclock_avail. Return NULL explicitly.
      Make drrs_state and unnamed struct. Move Gen based check inside drrs_init.
      
      v8: Made changes to track PSR enable/disable throughout system use (instead
      of just in the init sequence) for disabling/enabling DRRS. Jani's review
      comments.
      
      v9: PSR tracking will be done as part of idleness detection patch. Removed
      PSR state tracker in i915_drrs. Jani's review comments.
      
      v10: Added log for DRRS not supported in drrs_init
      
      v11: Modification in drrs_init. suggested by Jani
      Signed-off-by: NPradeep Bhat <pradeep.bhat@intel.com>
      Signed-off-by: NVandana Kannan <vandana.kannan@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4f9db5b5
  12. 09 4月, 2014 1 次提交
  13. 02 4月, 2014 4 次提交
  14. 21 3月, 2014 1 次提交
  15. 19 3月, 2014 4 次提交
  16. 18 3月, 2014 4 次提交
  17. 11 3月, 2014 1 次提交
    • V
      drm/i915: Make encoder cloning more flexible · bc079e8b
      Ville Syrjälä 提交于
      Currently we allow encoders to indicate whether they can be part of a
      cloned set with just one flag. That's not flexible enough to describe
      the actual hardware capabilities. Instead make it a bitmask of encoder
      types with which the current encoder can be cloned.
      
      For now we set the bitmask to allow DVO+DVO and DVO+VGA, which should
      match what the old boolean flag allowed. We will add some more cloning
      options in the future.
      
      Note that this patch also removes the encoder.possible_clones setting
      from encoder setup code - we compute this dynamically.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      [danvet: Add Ville's explanation why removing the encoder
      possible_clones is save.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bc079e8b
  18. 08 3月, 2014 3 次提交
    • J
      drm/i915: remove early fb allocation dependency on CONFIG_FB v2 · 484b41dd
      Jesse Barnes 提交于
      By stuffing the fb allocation into the crtc, we get mode set lifetime
      refcounting for free, but have to handle the initial pin & fence
      slightly differently.  It also means we can move the shared fb handling
      into the core rather than leaving it out in the fbdev code.
      
      v2: null out crtc->fb on error (Daniel)
          take fbdev fb ref and remove unused error path (Daniel)
      Requested-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      484b41dd
    • J
      drm/i915: Wrap the preallocated BIOS framebuffer and preserve for KMS fbcon v12 · d978ef14
      Jesse Barnes 提交于
      Retrieve current framebuffer config info from the regs and create an fb
      object for the buffer the BIOS or boot loader left us.  This should
      allow for smooth transitions to userspace apps once we finish the
      initial configuration construction.
      
      v2: check for non-native modes and adjust (Jesse)
          fixup aperture and cmap frees (Imre)
          use unlocked unref if init_bios fails (Jesse)
          fix curly brace around DSPADDR check (Imre)
          comment failure path for pin_and_fence (Imre)
      v3: fixup fixup of aperture frees (Chris)
      v4: update to current bits (locking & pin_and_fence hack) (Jesse)
      v5: move fb config fetch to display code (Jesse)
          re-order hw state readout on initial load to suit fb inherit (Jesse)
          re-add pin_and_fence in fbdev code to make sure we refcount properly (Je
      v6: rename to plane_config (Daniel)
          check for valid object when initializing BIOS fb (Jesse)
          split from plane_config readout and other display changes (Jesse)
          drop use_bios_fb option (Chris)
          update comments (Jesse)
          rework fbdev_init_bios for clarity (Jesse)
          drop fb obj ref under lock (Chris)
      v7: use fb object from plane_config instead (Ville)
          take ref on fb object (Jesse)
      v8: put under i915_fastboot option (Jesse)
          fix fb ptr checking (Jesse)
          inform drm_fb_helper if we fail to enable a connector (Jesse)
          drop unnecessary enabled[] modifications in failure cases (Chris)
          split from BIOS connector config readout (Daniel)
          don't memset the fb buffer if preallocated (Chris)
          alloc ifbdev up front and pass to init_bios (Chris)
          check for bad ifbdev in restore_mode too (Chris)
      v9: fix up !fastboot bpp setting (Jesse)
          fix up !fastboot helper alloc (Jesse)
          make sure BIOS fb is sufficient for biggest active pipe (Jesse)
      v10:fix up size calculation for proposed fbs (Chris)
          go back to two pass pipe fb assignment (Chris)
          add warning for active pipes w/o fbs (Chris)
          clean up num_pipes checks in fbdev_init and fbdev_restore_mode (Chris)
          move i915.fastboot into fbdev_init (Chris)
      v11:make BIOS connector config usage unconditional (Daniel)
      v12:fix up fb vs pipe size checking (Chris)
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d978ef14
    • J
      drm/i915: add plane_config fetching infrastructure v2 · 46f297fb
      Jesse Barnes 提交于
      Early at init time, we can try to read out the plane config structure
      and try to preserve it if possible.
      
      v2: alloc fb obj at init time after fetching plane config
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      46f297fb