1. 30 9月, 2015 9 次提交
    • 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: 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/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
    • M
      drm/i915: Determine I915_MAX_PLANES from plane enum · 31409e97
      Matt Roper 提交于
      Let the compiler figure out what I915_MAX_PLANES is from 'enum plane' so
      that we don't need a separate #define.
      
      While we're at it, add the cursor plane to the enum.  This will cause
      I915_MAX_PLANES to now include the cursor plane in its count (it didn't
      previously).   This change is safe since we currently only use this
      value in array declarations (never in the actual code logic); we just
      wind up allocating slightly more memory than we need to.  A followup
      patch will cause various parts of the code to start using the extra
      array element where appropriate.
      
      (This patch probably should have been squashed with the followup patch,
      but I couldn't figure out how to get Coccinelle to modify enum
      declarations...)
      Suggested-by: NAnder Conselvan De Oliveira <conselvan2@gmail.com>
      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>
      31409e97
    • J
      drm/i915: make backlight hooks connector specific · 5507faeb
      Jani Nikula 提交于
      Previously we've relied on having basically one backlight and one
      backlight type per platform. This is already a bit quirky with PMIC PWM
      support on VLV/CHV platforms with MIPI DSI. In the foreseeable future
      we'll have at least DPCD based backlight control on eDP and DCS command
      based backlight control on MIPI DSI. Backlight is becoming more and more
      connector specific, so reflect this fact by making the backlight control
      hooks connector specific.
      
      This enables further work to reuse generic backlight code in
      intel_panel.c while adding more specific backlight code accessed via the
      hooks.
      
      Cc: Deepak M <m.deepak@intel.com>
      Cc: Yetunde Adebisi <yetundex.adebisi@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NDeepak M <m.deepak@intel.com>
      Reviewed-by: NYetunde Adebisi <yetundex.adebisi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5507faeb
    • V
      drm/i915: Read czclk from CCK on vlv/chv · bfa7df01
      Ville Syrjälä 提交于
      As with the cdclk, read out czclk from CCK as well. This gives us the
      real current value and avoids having to decode fuses and whatnot.
      
      Also store it in kHz under dev_priv like we do for cdlck since it's not
      just an rps related clock, and having it in kHz is more
      standard/convenient for some things.
      
      Imre also pointed out that we currently fail to read czclk on VLV, which
      means the PFI credit programming isn't working as expected.
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bfa7df01
    • V
      drm/i915: s/mode/adjusted_mode/ in functions that really get passed the adjusted_mode · 5e7234c9
      Ville Syrjälä 提交于
      Rename the function argument to 'adjusted_mode' whenever the function
      only ever gets passed the adjusted_mode.
      
      v2: Update due to intel_dsi.c changes
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NMika Kahola <mika.kahola@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5e7234c9
    • R
      drm/i915: Detect virtual south bridge · 30c964a6
      Robert Beckett 提交于
      Virtualized systems often use a virtual P2X4 south bridge.
      Detect this in intel_detect_pch and make a best guess as to which PCH
      we should be using.
      
      This was seen on vmware esxi hypervisor. When passing the graphics device
      through to a guest, it can not pass through the PCH. Instead it simulates
      a P2X4 southbridge.
      Signed-off-by: NRobert Beckett <robert.beckett@intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      30c964a6
  2. 28 9月, 2015 1 次提交
  3. 23 9月, 2015 9 次提交
  4. 15 9月, 2015 1 次提交
  5. 14 9月, 2015 2 次提交
    • N
      drm/i915: Split alloc from init for lrc · e84fe803
      Nick Hoath 提交于
      Extend init/init_hw split to context init.
         - Move context initialisation in to i915_gem_init_hw
         - Move one off initialisation for render ring to
              i915_gem_validate_context
         - Move default context initialisation to logical_ring_init
      
      Rename intel_lr_context_deferred_create to
      intel_lr_context_deferred_alloc, to reflect reduced functionality &
      alloc/init split.
      
      This patch is intended to split out the allocation of resources &
      initialisation to allow easier reuse of code for resume/gpu reset.
      
      v2: Removed function ptr wrapping of do_switch_context (Daniel Vetter)
          Left ->init_context int intel_lr_context_deferred_alloc
          (Daniel Vetter)
          Remove unnecessary init flag & ring type test. (Daniel Vetter)
          Improve commit message (Daniel Vetter)
      v3: On init/reinit, set the hw next sequence number to the sw next
          sequence number. This is set to 1 at driver load time. This prevents
          the seqno being reset on reinit (Chris Wilson)
      v4: Set seqno back to ~0 - 0x1000 at start-of-day, and increment by 0x100
          on reset.
          This makes it obvious which bbs are which after a reset. (David Gordon
          & John Harrison)
          Rebase.
      v5: Rebase. Fixed rebase breakage. Put context pinning in separate
          function. Removed code churn. (Thomas Daniel)
      v6: Cleanup up issues introduced in v2 & v5 (Thomas Daniel)
      
      Issue: VIZ-4798
      Signed-off-by: NNick Hoath <nicholas.hoath@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: John Harrison <john.c.harrison@intel.com>
      Cc: David Gordon <david.s.gordon@intel.com>
      Cc: Thomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NThomas Daniel <thomas.daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e84fe803
    • M
      drm/i915: skip modeset if compatible for everyone. · 6764e9f8
      Maarten Lankhorst 提交于
      This is done as a separate commit, to make it easier to revert
      when things break.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6764e9f8
  6. 12 9月, 2015 1 次提交
  7. 10 9月, 2015 1 次提交
  8. 09 9月, 2015 1 次提交
  9. 08 9月, 2015 1 次提交
    • J
      drm/i915: initialize backlight max from VBT · aa17cdb4
      Jani Nikula 提交于
      Normally we determine the backlight PWM modulation frequency (which we
      also use as backlight max value) from the backlight registers at module
      load time, expecting the registers have been initialized by the BIOS. If
      this is not the case, we fail.
      
      The VBT contains the backlight modulation frequency in Hz. Add platform
      specific functions to convert the frequency in Hz to backlight PWM
      modulation frequency, and use them to initialize the backlight when the
      registers are not initialized by the BIOS.
      
      v2: Fix SPT and VLV. Thanks to Clint for the VLV code.
      
      Cc: Clint Taylor <clinton.a.taylor@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NClint Taylor <Clinton.A.Taylor@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      aa17cdb4
  10. 02 9月, 2015 4 次提交
  11. 31 8月, 2015 2 次提交
  12. 29 8月, 2015 1 次提交
  13. 26 8月, 2015 4 次提交
  14. 15 8月, 2015 3 次提交
    • A
      drm/i915: GuC-specific firmware loader · 33a732f4
      Alex Dai 提交于
      This fetches the required firmware image from the filesystem,
      then loads it into the GuC's memory via a dedicated DMA engine.
      
      This patch is derived from GuC loading work originally done by
      Vinit Azad and Ben Widawsky.
      
      v2:
          Various improvements per review comments by Chris Wilson
      
      v3:
          Removed 'wait' parameter to intel_guc_ucode_load() as firmware
              prefetch is no longer supported in the common firmware loader,
      	per Daniel Vetter's request.
          Firmware checker callback fn now returns errno rather than bool.
      
      v4:
          Squash uC-independent code into GuC-specifc loader [Daniel Vetter]
          Don't keep the driver working (by falling back to execlist mode)
              if GuC firmware loading fails [Daniel Vetter]
      
      v5:
          Clarify WOPCM-related #defines [Tom O'Rourke]
          Delete obsolete code no longer required with current h/w & f/w
              [Tom O'Rourke]
          Move the call to intel_guc_ucode_init() later, so that it can
              allocate GEM objects, and have it fetch the firmware; then
      	intel_guc_ucode_load() doesn't need to fetch it later.
              [Daniel Vetter].
      
      v6:
          Update comment describing intel_guc_ucode_load() [Tom O'Rourke]
      
      Issue: VIZ-4884
      Signed-off-by: NAlex Dai <yu.dai@intel.com>
      Signed-off-by: NDave Gordon <david.s.gordon@intel.com>
      Reviewed-by: NTom O'Rourke <Tom.O'Rourke@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      33a732f4
    • M
      drm/i915/gtt: Allow >= 4GB offsets in X86_32 · 088e0df4
      Michel Thierry 提交于
      Similar to commit c44ef60e ("drm/i915/gtt:
      Allow >= 4GB sizes for vm"), i915_gem_obj_offset and i915_gem_obj_ggtt_offset
      return an unsigned long, which in only 4-bytes long in 32-bit kernels.
      
      Change return type (and other related offset variables) to u64.
      
      Since Global GTT is always limited to 4GB, this change would not be required
      in i915_gem_obj_ggtt_offset, but this is done for consistency.
      
      v2: Remove unnecessary offset variable in do_pin, as we already have
          vma->node.start (Chris).
          Update GGTT offset too (Tvrtko).
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      088e0df4
    • M
      drm/i915: batch_obj vm offset must be u64 · af98714e
      Michel Thierry 提交于
      Otherwise it can overflow in 48-bit mode, and cause an incorrect
      exec_start.
      
      Before commit 5f19e2bf ("drm/i915: Merged
      the many do_execbuf() parameters into a structure"), it was already an u64.
      Signed-off-by: NMichel Thierry <michel.thierry@intel.com>
      Reviewed-by: NAkash Goel <akash.goel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      af98714e