1. 14 7月, 2015 1 次提交
  2. 23 6月, 2015 2 次提交
  3. 22 6月, 2015 2 次提交
  4. 12 6月, 2015 3 次提交
  5. 29 5月, 2015 1 次提交
  6. 22 5月, 2015 1 次提交
    • D
      drm/i915/skl: Deinit/init the display at suspend/resume · 5d96d8af
      Damien Lespiau 提交于
      We need to re-init the display hardware when going out of suspend. This
      includes:
      
        - Hooking the PCH to the reset logic
        - Restoring CDCDLK
        - Enabling the DDB power
      
      Among those, only the CDCDLK one is a bit tricky. There's some
      complexity in that:
      
        - DPLL0 (which is the source for CDCLK) has two VCOs, each with a set
          of supported frequencies. As eDP also uses DPLL0 for its link rate,
          once DPLL0 is on, we restrict the possible eDP link rates the chosen
          VCO.
        - CDCLK also limits the bandwidth available to push pixels.
      
      So, as a first step, this commit restore what the BIOS set, until I can
      do more testing.
      
      In case that's of interest for the reviewer, I've unit tested the
      function that derives the decimal frequency field:
      
        #include <stdio.h>
        #include <stdint.h>
        #include <assert.h>
      
        #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
      
        static const struct dpll_freq {
                unsigned int freq;
                unsigned int decimal;
        } freqs[] = {
                { .freq = 308570, .decimal = 0b01001100111},
                { .freq = 337500, .decimal = 0b01010100001},
                { .freq = 432000, .decimal = 0b01101011110},
                { .freq = 450000, .decimal = 0b01110000010},
                { .freq = 540000, .decimal = 0b10000110110},
                { .freq = 617140, .decimal = 0b10011010000},
                { .freq = 675000, .decimal = 0b10101000100},
        };
      
        static void intbits(unsigned int v)
        {
                int i;
      
                for(i = 10; i >= 0; i--)
                        putchar('0' + ((v >> i) & 1));
        }
      
        static unsigned int freq_decimal(unsigned int freq /* in kHz */)
        {
                return (freq - 1000) / 500;
        }
      
        static void test_freq(const struct dpll_freq *entry)
        {
                unsigned int decimal = freq_decimal(entry->freq);
      
                printf("freq: %d, expected: ", entry->freq);
                intbits(entry->decimal);
                printf(", got: ");
                intbits(decimal);
                putchar('\n');
      
                assert(decimal == entry->decimal);
        }
      
        int main(int argc, char **argv)
        {
                int i;
      
                for (i = 0; i < ARRAY_SIZE(freqs); i++)
                        test_freq(&freqs[i]);
      
                return 0;
        }
      
      v2:
        - Rebase on top of -nightly
        - Use (freq - 1000) / 500 for the decimal frequency (Ville)
        - Fix setting the enable bit of HSW_NDE_RSTWRN_OPT (Ville)
        - Rename skl_display_{resume,suspend} to skl_{init,uninit}_cdclk to
          be consistent with the BXT code (Ville)
        - Store boot CDCLK in ddi_pll_init (Ville)
        - Merge dev_priv's skl_boot_cdclk into cdclk_freq
        - Use LCPLL_PLL_LOCK instead of (1 << 30) (Ville)
        - Replace various '0' by SKL_DPLL0 to be a bit more explicit that
          we're programming DPLL0
        - Busy poll the PCU before doing the frequency change. It takes about
          3/4 cycles, each separated by 10us, to get the ACK from the CPU
          (Ville)
      
      v3:
        - Restore dev_priv->skl_boot_cdclk, leaving unification with
          dev_priv->cdclk_freq for a later patch (Daniel, Ville)
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5d96d8af
  7. 20 5月, 2015 4 次提交
  8. 11 5月, 2015 2 次提交
  9. 08 5月, 2015 3 次提交
    • J
      drm/i915/vlv: remove wait for previous GFX clk disable request · ac935a8b
      Jesse Barnes 提交于
      Looks like it was introduced in:
      
      commit 650ad970
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Fri Apr 18 16:35:02 2014 +0300
      
          drm/i915: vlv: factor out vlv_force_gfx_clock and check for pending force-of
      
      but I'm not sure why.  It has caused problems for us in the past (see
      85250ddf "drm/i915/chv: Remove Wait for a previous gfx force-off"
      and 8d4eee9c "drm/i915: vlv: increase timeout when forcing on the
      GFX clock") and doesn't seem to be required, so let's just drop it.
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=89611Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Tested-by: NDarren Hart <dvhart@linux.intel.com>
      Reviewed-by: NDeepak S <deepak.s@linux.intel.com>
      Cc: stable@vger.kernel.org # c9c52e24: drm/i915/chv: Remove Wait ...
      Cc: stable@vger.kernel.org
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      [danvet: Repick this commit from
      5df0582b becuase Dave Airlie lost it
      in his merge commit e1dee197.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      ac935a8b
    • S
      drm/i915/skl: Add DC6 Trigger sequence. · f75a1985
      Suketu Shah 提交于
      Add triggers for DC6 as per details provided in skl_enable_dc6
      and skl_disable_dc6 implementations.
      
      Also Call POSTING_READ for every write to a register to ensure
      it is written to immediately
      
      v1: Remove POSTING_READ and intel_prepare_ddi calls as they've been added in previous patches.
      
      v2:
      1] Remove check for backlight disabled as it should be the case by that time.
      2] Mark DC5 as disabled when enabling DC6.
      3] Return from DC5-disabling function early if DC5 is already be disabled which can happen
         due to DC6-enabling earlier.
      3] Ensure CSR firmware is loaded after resume from DC6 as corresponding memory contents won't
         be retained after runtime-suspend.
      4] Ensure that CSR isn't identified as loaded before CSR-loading program is called during
         runtime-resume.
      
      v3: Rebase to latest
      Modified as per review comments from Imre and after discussion with Art:
      1] DC6 should be preferably enabled when PG2 is disabled by SW as the check for PG1 being
         disabled is taken of by HW to enter DC6, and disabled when PG2 is enabled respectively.
         This helps save more power, especially in the case when display is disabled but GT is
         enabled. Accordingly, replacing DC5 trigger sequence with DC6 for SKL.
      2] DC6 could be enabled from intel_runtime_suspend() function, if DC5 is already enabled.
      3] Move CSR-load-status setting code from intel_runtime_suspend function to a new function.
      
      v4:
      1] Enable/disable DC6 only when toggling the power-well using a newly defined macro ENABLE_DC6.
      
      v5:
      1] Load CSR on system resume too as firmware may be lost on system suspend preventing
         enabling DC5, DC6.
      2] DDI buffers shouldn't be programmed during driver-load/resume as it's already done
         during modeset initialization then and also that the encoder list is still uninitialized by
         then. Therefore, call intel_prepare_ddi function right after disabling DC6 but outside
         skl_disable_dc6 function and not during driver-load/resume.
      
      v6:
      1] Rebase to latest.
      2] Move SKL_ENABLE_DC6 macro definition from intel_display.c to intel_runtime_pm.c.
      
      v7:
      1) Refactored the code for removing the warning got from checkpatch.
      2) After adding dmc ver 1.0 support rebased on top of nightly. (Animesh)
      
      v8:
      - Reverted the changes done in v7.
      - Removed the condition check in skl_prepare_resune(). (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>
      f75a1985
    • 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
  10. 24 4月, 2015 1 次提交
  11. 16 4月, 2015 1 次提交
    • S
      drm/i915/bxt: Add DC9 Trigger sequence · 31335cec
      Suketu Shah 提交于
      Add triggers for DC9 as per details provided in bxt_enable_dc9
      and bxt_disable_dc9 implementations.
      
      v1:
      - Add SKL check in gen9_disable_dc5 as it is possible for DC5
        to remain disabled only for SKL.
      - Add additional checks for whether DC5 is already disabled during
        DC5-disabling only for BXT.
      
      v2:
      - rebase to latest.
      - Load CSR during DC9 disabling in the beginning before DC9 is
        disabled.
      - Make gen9_disable_dc5 function non-static as it's being called by
        functions in i915_drv.c.
      - Enable DC9-related functionality using a macro.
      
      v3: (imre)
      - remove BXT_ENABLE_DC9, we want DC9 always, and it's only valid on BXT
      - remove DC5 disabling and CSR FW loaded check, these are nop atm
      - squash in Vandana's "Do ddi_phy_init always" patch
      
      v4:
      - add TODO to re-enable DC5 during resume if CSR FW is available (sagar)
      Signed-off-by: NSuketu Shah <suketu.j.shah@intel.com>
      Signed-off-by: A.Sunil Kamath <sunil.kamath@intel.com> (v2)
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NSagar Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      31335cec
  12. 09 4月, 2015 2 次提交
  13. 07 4月, 2015 3 次提交
  14. 31 3月, 2015 1 次提交
  15. 18 3月, 2015 2 次提交
  16. 04 3月, 2015 1 次提交
    • I
      drm/i915: gen4: work around hang during hibernation · ab3be73f
      Imre Deak 提交于
      Bjørn reported that his machine hang during hibernation and eventually
      bisected the problem to the following commit:
      
      commit da2bc1b9
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Thu Oct 23 19:23:26 2014 +0300
      
          drm/i915: add poweroff_late handler
      
      The problem seems to be that after the kernel puts the device into D3
      the BIOS still tries to access it, or otherwise assumes that it's in D0.
      This is clearly bogus, since ACPI mandates that devices are put into D3
      by the OSPM if they are not wake-up sources. In the future we want to
      unify more of the driver's runtime and system suspend paths, for example
      by skipping all the system suspend/hibernation hooks if the device is
      runtime suspended already. Accordingly for all other platforms the goal
      is still to properly power down the device during hibernation.
      
      v2:
      - Another GEN4 Lenovo laptop had the same issue, while platforms from
        other vendors (including mobile and desktop, GEN4 and non-GEN4) seem
        to work fine. Based on this apply the workaround on all GEN4 Lenovo
        platforms.
      - add code comment about failing platforms (Ville)
      
      Reference: http://lists.freedesktop.org/archives/intel-gfx/2015-February/060633.htmlReported-and-bisected-by: NBjørn Mork <bjorn@mork.no>
      Cc: stable@vger.kernel.org # v3.19
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Acked-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      ab3be73f
  17. 27 2月, 2015 2 次提交
  18. 14 2月, 2015 2 次提交
  19. 29 1月, 2015 1 次提交
    • C
      drm/i915: Convert hangcheck from a timer into a delayed work item · 737b1506
      Chris Wilson 提交于
      When run as a timer, i915_hangcheck_elapsed() must adhere to all the
      rules of running in a softirq context. This is advantageous to us as we
      want to minimise the risk that a driver bug will prevent us from
      detecting a hung GPU. However, that is irrelevant if the driver bug
      prevents us from resetting and recovering. Still it is prudent not to
      rely on mutexes inside the checker, but given the coarseness of
      dev->struct_mutex doing so is extremely hard.
      
      Give in and run from a work queue, i.e. outside of softirq.
      
      v2: Use own workqueue to avoid deadlocks (Daniel)
          Cleanup commit msg and add comment to i915_queue_hangcheck() (Chris)
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Daniel Vetter <dnaiel.vetter@ffwll.chm>
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      [danvet: Remove accidental kerneldoc comment starter, to appease the 0
      day builder.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      737b1506
  20. 27 1月, 2015 3 次提交
  21. 26 1月, 2015 1 次提交
  22. 12 1月, 2015 1 次提交