1. 20 5月, 2015 3 次提交
    • C
      drm/i915: Fix race on unreferencing the wrong mmio-flip-request · b2cfe0ab
      Chris Wilson 提交于
      As we perform the mmio-flip without any locking and then try to acquire
      the struct_mutex prior to dereferencing the request, it is possible for
      userspace to queue a new pageflip before the worker can finish clearing
      the old state - and then it will clear the new flip request. The result
      is that the new flip could be completed before the GPU has finished
      rendering.
      
      The bugs stems from removing the seqno checking in
      commit 536f5b5e
      Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Date:   Thu Nov 6 11:03:40 2014 +0200
      
          drm/i915: Make mmio flip wait for seqno in the work function
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b2cfe0ab
    • C
      drm/i915: Remove domain flubbing from i915_gem_object_finish_gpu() · 2e2f351d
      Chris Wilson 提交于
      We no longer interpolate domains in the same manner, and even if we did,
      we should trust setting either of the other write domains would trigger
      an invalidation rather than force it. Remove the tweaking of the
      read_domains since it serves no purpose and use
      i915_gem_object_wait_rendering() directly.
      
      Note that this goes back to
      
      commit a8198eea
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Wed Apr 13 22:04:09 2011 +0100
      
          drm/i915: Introduce i915_gem_object_finish_gpu()
      
      and gpu domain tracking died in
      
      commit cc889e0f
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Jun 13 20:45:19 2012 +0200
      
          drm/i915: disable flushing_list/gpu_write_list
      
      which is more than 1 year older.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Add notes with information dug out of git history.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2e2f351d
    • C
      drm/i915: Adding dbuf support for skl nv12 format. · 2cd601c6
      Chandra Konduru 提交于
      Skylake nv12 format requires dbuf (aka. ddb) calculations
      and programming for each of y and uv sub-planes. Made minor
      changes to reuse current dbuf calculations and programming
      for uv plane. i.e., with this change, existing computation
      is used for either packed format or uv portion of nv12
      depending on incoming format. Added new code for dbuf
      computation and programming for y plane.
      
      This patch is a pre-requisite for adding NV12 format support.
      Actual nv12 support is coming in later patches.
      Signed-off-by: NChandra Konduru <chandra.konduru@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2cd601c6
  2. 08 5月, 2015 8 次提交
    • D
      drm/i915: Update DRIVER_DATE to 20150508 · 214a2b7f
      Daniel Vetter 提交于
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      214a2b7f
    • V
      drm/i915: Work around DISPLAY_PHY_CONTROL register corruption on CHV · 70722468
      Ville Syrjälä 提交于
      Sometimes (exactly when is a bit unclear) DISPLAY_PHY_CONTROL appears to
      get corrupted. The values I've managed to read from it seem to have some
      pattern but vary quite a lot. The corruption doesn't seem to just happen
      when the register is accessed, but can also happen spontaneosly during
      modeset. When this happens during a modeset things go south and the
      display doesn't light up.
      
      I've managed to hit the problemn when toggling HDMI on port D on and
      off. When things get corrupted the display doesn't light up, but as soon
      as I manually write the correct value to the register the display comes
      up.
      
      First I was suspicious that we ourselves accidentally overwrite it with
      garbage, but didn't catch anything with the reg_rw tracepoint. Also I
      sprinkled check all over the modeset path to see exactly when the
      corruption happens, and eg. the read back value was fine just before
      intel_dp_set_m(), and corrupted immediately after it. I also made my
      check function repair the register value whenever it was wrong, and with
      this approach the corruption repeated several times during the modeset
      operation, always seeming to trigger in the same exact calls to the
      check function, while other calls to the function never caught anything.
      
      So far I've not seen this problem occurring when carefully avoiding all
      read accesses to DISPLAY_PHY_CONTROL. Not sure if that's just pure luck
      or an actual workaround, but we can hope it works. So let's avoid reading
      the register and instead track the desired value of the register in dev_priv.
      
      v2: Read out the power well state to determine initial register value
      v3: Use DPIO_CHx names instead of raw numbers
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDeepak S <deepak.s@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      70722468
    • M
      drm/i915: Use the disable callback for disabling planes. · 27321ae8
      Maarten Lankhorst 提交于
      This allows disabling all planes affecting a crtc without caring what type it is.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      27321ae8
    • S
      drm/i915/skl: Add module parameter to select edp vswing table · 9e458034
      Sonika Jindal 提交于
      This provides an option to override the value set by VBT
      for selecting edp Vswing Pre-emph setting table.
      
      v2: Adding comment about this being a temporary workaround and
      making the parameter read-only (Jani)
      v3: Changing mode to 0400 instead of 0 (Jani)
      
      https://bugs.freedesktop.org/show_bug.cgi?id=89554Signed-off-by: NSonika Jindal <sonika.jindal@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9e458034
    • D
    • S
      drm/i915/skl: Enable runtime PM · 00776511
      Suketu Shah 提交于
      Enable runtime PM for Skylake platform
      
      v2: After adding dmc ver 1.0 support rebased on top of nightly. (Animesh)
      
      Issue: VIZ-2819
      Signed-off-by: NA.Sunil Kamath <sunil.kamath@intel.com>
      Signed-off-by: NSuketu Shah <suketu.j.shah@intel.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NAnimesh Manna <animesh.manna@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      00776511
    • S
      drm/i915/skl: Add DC5 Trigger Sequence · dc174300
      Suketu Shah 提交于
      Add triggers as per expectations mentioned in gen9_enable_dc5
      and gen9_disable_dc5 patch.
      
      Also call POSTING_READ for every write to a register to ensure that
      its written immediately.
      
      v1: Remove POSTING_READ calls as they've already been added in previous patches.
      
      v2: Rebase to move all runtime pm specific changes to intel_runtime_pm.c file.
      
      Modified as per review comments from Imre:
      1] Change variable name 'dc5_allowed' to 'dc5_enabled' to correspond to relevant
         functions.
      2] Move the check dc5_enabled in skl_set_power_well() to disable DC5 into
         gen9_disable_DC5 which is a more appropriate place.
      3] Convert checks for 'pm.dc5_enabled' and 'pm.suspended' in skl_set_power_well()
         to warnings. However, removing them for now as they'll be included in a future patch
         asserting DC-state entry/exit criteria.
      4] Enable DC5, only when CSR firmware is verified to be loaded. Create new structure
         to track 'enabled' and 'deferred' status of DC5.
      5] Ensure runtime PM reference is obtained, if CSR is not loaded, to avoid entering
         runtime-suspend and release it when it's loaded.
      6] Protect necessary CSR-related code with locks.
      7] Move CSR-loading call to runtime PM initialization, as power domains needed to be
         accessed during deferred DC5-enabling, are not initialized earlier.
      
      v3: Rebase to latest.
      
      Modified as per review comments from Imre:
      1] Use blocking wait for CSR-loading to finish to enable DC5  for simplicity, instead of
         deferring enabling DC5 until CSR is loaded.
      2] Obtain runtime PM reference during CSR-loading initialization itself as deferred DC5-
         enabling is removed and release it at the end of CSR-loading functionality.
      3] Revert calling CSR-loading functionality to the beginning of i915 driver-load
         functionality to avoid any delay in loading.
      4] Define another variable to track whether CSR-loading failed and use it to avoid enabling
         DC5 if it's true.
      5] Define CSR-load-status accessor functions for use later.
      
      v4:
      1] Disable DC5 before enabling PG2 instead of after it.
      2] DC5 was being mistaken enabled even when CSR-loading timed-out. Fix that.
      3] Enable DC5-related functionality using a macro.
      4] Remove dc5_enabled tracking variable and its use as it's not needed now.
      
      v5:
      1] Mark CSR failed to load where necessary in finish_csr_load function.
      2] Use mutex-protected accessor function to check if CSR loaded instead of directly
         accessing the variable.
      3] Prefix csr_load_status_get/set function names with intel_.
      
      v6: rebase to latest.
      v7: Rebase on top of nightly (Damien)
      v8: Squashed the patch from Imre - added csr helper pointers to simplify the code. (Imre)
      v9: After adding dmc ver 1.0 support rebased on top of nightly. (Animesh)
      v10: Added a enum for different csr states, suggested by Imre. (Animesh)
      
      v11: Based on review comments from Imre, Damien and Daniel following changes done
      - enum name chnaged to csr_state (singular form).
      - FW_UNINITIALIZED used as zeroth element in enum csr_state.
      - Prototype changed for helper function(set/get csr status), using enum csr_state instead of bool.
      
      v12: Based on review comment from Imre, introduced bool fw_loaded local to finish_csr_load() which helps
      calling once to set the csr status. The same flag used to fail RPM if find any issue during
      firmware loading.
      
      Issue: VIZ-2819
      Signed-off-by: NA.Sunil Kamath <sunil.kamath@intel.com>
      Signed-off-by: NSuketu Shah <suketu.j.shah@intel.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NAnimesh Manna <animesh.manna@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dc174300
    • D
      drm/i915/skl: Add support to load SKL CSR firmware. · eb805623
      Daniel Vetter 提交于
      Display Context Save and Restore support is needed for
      various SKL Display C states like DC5, DC6.
      
      This implementation is added based on first version of DMC CSR program
      that we received from h/w team.
      
      Here we are using request_firmware based design.
      Finally this firmware should end up in linux-firmware tree.
      
      For SKL platform its mandatory to ensure that we load this
      csr program before enabling DC states like DC5/DC6.
      
      As CSR program gets reset on various conditions, we should ensure
      to load it during boot and in future change to be added to load
      this system resume sequence too.
      
      v1: Initial relese as RFC patch
      
      v2: Design change as per Daniel, Damien and Shobit's review comments
      request firmware method followed.
      
      v3: Some optimization and functional changes.
      Pulled register defines into drivers/gpu/drm/i915/i915_reg.h
      Used kmemdup to allocate and duplicate firmware content.
      Ensured to free allocated buffer.
      
      v4: Modified as per review comments from Satheesh and Daniel
      Removed temporary buffer.
      Optimized number of writes by replacing I915_WRITE with I915_WRITE64.
      
      v5:
      Modified as per review comemnts from Damien.
      - Changed name for functions and firmware.
      - Introduced HAS_CSR.
      - Reverted back previous change and used csr_buf with u8 size.
      - Using cpu_to_be64 for endianness change.
      
      Modified as per review comments from Imre.
      - Modified registers and macro names to be a bit closer to bspec terminology
      and the existing register naming in the driver.
      - Early return for non SKL platforms in intel_load_csr_program function.
      - Added locking around CSR program load function as it may be called
      concurrently during system/runtime resume.
      - Releasing the fw before loading the program for consistency
      - Handled error path during f/w load.
      
      v6: Modified as per review comments from Imre.
      - Corrected out_freecsr sequence.
      
      v7: Modified as per review comments from Imre.
      Fail loading fw if fw->size%8!=0.
      
      v8: Rebase to latest.
      
      v9: Rebase on top of -nightly (Damien)
      
      v10: Enabled support for dmc firmware ver 1.0.
      According to ver 1.0 in a single binary package all the firmware's that are
      required for different stepping's of the product will be stored. The package
      contains the css header, followed by the package header and the actual dmc
      firmwares. Package header contains the firmware/stepping mapping table and
      the corresponding firmware offsets to the individual binaries, within the
      package. Each individual program binary contains the header and the payload
      sections whose size is specified in the header section. This changes are done
      to extract the specific firmaware from the package. (Animesh)
      
      v11: Modified as per review comemnts from Imre.
      - Added code comment from bpec for header structure elements.
      - Added __packed to avoid structure padding.
      - Added helper functions for stepping and substepping info.
      - Added code comment for CSR_MAX_FW_SIZE.
      - Disabled BXT firmware loading, will be enabled with dmc 1.0 support.
      - Changed skl_stepping_info based on bspec, earlier used from config DB.
      - Removed duplicate call of cpu_to_be* from intel_csr_load_program function.
      - Used cpu_to_be32 instead of cpu_to_be64 as firmware binary in dword aligned.
      - Added sanity check for header length.
      - Added sanity check for mmio address got from firmware binary.
      - kmalloc done separately for dmc header and dmc firmware. (Animesh)
      
      v12: Modified as per review comemnts from Imre.
      - Corrected the typo error in skl stepping info structure.
      - Added out-of-bound access for skl_stepping_info.
      - Sanity check for mmio address modified.
      - Sanity check added for stepping and substeppig.
      - Modified the intel_dmc_info structure, cache only the required header info. (Animesh)
      
      v13: clarify firmware load error message.
      The reason for a firmware loading failure can be obscure if the driver
      is built-in. Provide an explanation to the user about the likely reason for
      the failure and how to resolve it. (Imre)
      
      v14: Suggested by Jani.
      - fix s/I915/CONFIG_DRM_I915/ typo
      - add fw_path to the firmware object instead of using a static ptr (Jani)
      
      v15:
      1) Changed the firmware name as dmc_gen9.bin, everytime for a new firmware version a symbolic link
      with same name will help not to build kernel again.
      2) Changes done as per review comments from Imre.
      - Error check removed for intel_csr_ucode_init.
      - Moved csr-specific data structure to intel_csr.h and optimization done on structure definition.
      - fw->data used directly for parsing the header info & memory allocation
      only done separately for payload. (Animesh)
      
      v16:
      - No need for out_regs label in i915_driver_load(), so removed it.
      - Changed the firmware name as skl_dmc_ver1.bin, followed naming convention <platform>_dmc_<api-version>.bin (Animesh)
      
      Issue: VIZ-2569
      Signed-off-by: NA.Sunil Kamath <sunil.kamath@intel.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NAnimesh Manna <animesh.manna@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eb805623
  3. 30 4月, 2015 1 次提交
  4. 24 4月, 2015 2 次提交
    • D
      drm/i915: Update DRIVER_DATE to 20150423 · de4de566
      Daniel Vetter 提交于
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      de4de566
    • D
      drm/i915: Fix up the vma aliasing ppgtt binding · 0875546c
      Daniel Vetter 提交于
      Currently we have the problem that the decision whether ptes need to
      be (re)written is splattered all over the codebase. Move all that into
      i915_vma_bind. This needs a few changes:
      - Just reuse the PIN_* flags for i915_vma_bind and do the conversion
        to vma->bound in there to avoid duplicating the conversion code all
        over.
      - We need to make binding for EXECBUF (i.e. pick aliasing ppgtt if
        around) explicit, add PIN_USER for that.
      - Two callers want to update ptes, give them a PIN_UPDATE for that.
      
      Of course we still want to avoid double-binding, but that should be
      taken care of:
      - A ppgtt vma will only ever see PIN_USER, so no issue with
        double-binding.
      - A ggtt vma with aliasing ppgtt needs both types of binding, and we
        track that properly now.
      - A ggtt vma without aliasing ppgtt could be bound twice. In the
        lower-level ->bind_vma functions hence unconditionally set
        GLOBAL_BIND when writing the ggtt ptes.
      
      There's still a bit room for cleanup, but that's for follow-up
      patches.
      
      v2: Fixup fumbles.
      
      v3: s/PIN_EXECBUF/PIN_USER/ for clearer meaning, suggested by Chris.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      0875546c
  5. 21 4月, 2015 1 次提交
  6. 20 4月, 2015 1 次提交
    • T
      drm/i915: Simplify and fix object to display tracking · 8a0c39b1
      Tvrtko Ursulin 提交于
      Purpose of this tracking is to know when to flush the cache between
      the CPU and the non-coherent display engine. Prior to:
      
         commit 121920fa
         Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
         Date:   Mon Mar 23 11:10:37 2015 +0000
      
             drm/i915/skl: Query display address through a wrapper
      
      This worked by a mix of direct flag manipulation and checking for
      existence of a pinned GGTT VMA.
      
      With the introduction of rotated display mappings this approach is
      no longer correct.
      
      New simpler approach is to just keep this count over calls which pin
      and unpin objects to and from display, at the slight cost of extra
      space in every bo.
      
      (Inspired and extracted code from a larger rework by Chris Wilson.)
      
      v2: Remove the limit since it is not well defined. (Chris Wilson, Ville Syrjälä)
      v3: Commit message corrections. (Chris Wilson)
      Signed-off-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8a0c39b1
  7. 16 4月, 2015 3 次提交
  8. 15 4月, 2015 1 次提交
    • R
      drm/i915: PSR: deprecate link_standby support for core platforms. · 89251b17
      Rodrigo Vivi 提交于
      On Haswell and Broadwell with link in standby when exit event happens
      between vblank and VSC packet, PSR exit on panel but DPA transmitter
      still sends black pixel. When this condition hits, panel will intermittently
      display black frame.
      
      The known W/A for this case involve the of single_frame update
      that isn't supported on Haswell and to be supported on Broadwell
      3 other workarounds would be required. So it is better and safe to
      just deprecate link_standby for now.
      
      Also, link fully off saves more power than link_standby and afwk
      no OEM is requesting link standby on VBT. There is no reason for that.
      
      For Skylake let's just consider it behaves like Broadwell until
      we prove otherwise.
      
      v2: Fix commit message (Durga).
      
      v3: Fix conflict with PSR2.
      
      Reference: HSD: bdwgfx/1912559
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NDurgadoss R <durgadoss.r@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      89251b17
  9. 13 4月, 2015 1 次提交
  10. 10 4月, 2015 14 次提交
  11. 09 4月, 2015 3 次提交
  12. 07 4月, 2015 2 次提交