Skip to content
  1. Mar 29, 2018
  2. Mar 28, 2018
  3. Mar 27, 2018
    • Chris Wilson's avatar
      drm/i915/execlists: Avoid kicking the submission too early for rescheduling · ae2f5c00
      Chris Wilson authored
      If the request is still waiting on external fences, it has not yet been
      submitted to the HW queue and so we can forgo kicking the submission
      tasklet when re-evaluating its priority.
      
      This should have no impact other than reducing the number of tasklet
      wakeups under signal heavy workloads (e.g. switching between engines).
      
      v2: Use prebaked container_of()
      
      References: f6322edd
      
       ("drm/i915/preemption: Allow preemption between submission ports")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180326115044.2505-2-chris@chris-wilson.co.uk
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      ae2f5c00
    • Chris Wilson's avatar
      drm/i915: Include submission tasklet state in engine dump · 90408713
      Chris Wilson authored
      
      
      For the off-chance we have an interrupt posted and haven't processed the
      CSB.
      
      v2: Include tasklet enable/disable state for good measure.
      
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180326115044.2505-4-chris@chris-wilson.co.uk
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      90408713
    • Chris Wilson's avatar
      drm/i915/execlists: Clear user-active flag on preemption completion · eed7ec52
      Chris Wilson authored
      When cancelling the requests and clearing out the ports following a
      successful preemption completion, also clear the active flag. I had
      assumed that all preemptions would be followed by an immediate dequeue
      (preserving the active user flag), but under rare circumstances we may
      be triggering a preemption for the second port only for it to have
      completed before the preemotion kicks in; leaving execlists->active set
      even though the system is now idle.
      
      We can clear the flag inside the common execlists_cancel_port_requests()
      as the other users also expect the semantics of active being cleared.
      
      Fixes: f6322edd
      
       ("drm/i915/preemption: Allow preemption between submission ports")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180324125829.27026-1-chris@chris-wilson.co.uk
      eed7ec52
  4. Mar 24, 2018
    • Paulo Zanoni's avatar
      drm/i915: protect macro parameters in SWING_SEL_{UPP,LO}WER · 7487508e
      Paulo Zanoni authored
      Protect the macro parameters with parens in order to avoid priority
      issues on macro evaluation when the macro argument is not a single
      operand.
      
      This is not a problem today, but it could be in the future. I found
      this while reviewing a patch that introduces new callers for the
      macros.
      
      v2: Rebase.
      
      Reference: commit 04416108
      
       ("drm/i915/cnl: Add registers related to voltage swing sequences.")
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323195853.4599-1-paulo.r.zanoni@intel.com
      7487508e
    • Nabendu Maiti's avatar
      drm/i915/icl: Added 5k source scaling support for Gen11 platform · 323301af
      Nabendu Maiti authored
      
      
      Gen11 supports upto 5k source scaling
      
      v2: Re-factoring of code as per review
      v3: Corrected max Vertical size and indentation
      v4: Added max Vertical dst size in same patch
      
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarNabendu Maiti <nabendu.bikash.maiti@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323172419.24911-7-paulo.r.zanoni@intel.com
      323301af
    • Dhinakaran Pandiyan's avatar
      drm/i915/icl: HPD pin for port F · 96ae4831
      Dhinakaran Pandiyan authored
      
      
      Extend enum hpd_pin to port F so that we can start using this for ICL.
      
      v2: Rebase.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323172419.24911-6-paulo.r.zanoni@intel.com
      96ae4831
    • Manasi Navare's avatar
      drm/i915/icl: Add Voltage swing table for MG PHY DDI Buffer · cd96bea7
      Manasi Navare authored
      
      
      This table is used for voltage swing programming sequence during DDI
      Buffer initialization for MG PHY DDI Buffers on Icelake.
      
      v2 (from Paulo):
      * Fix white space issues.
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323172419.24911-5-paulo.r.zanoni@intel.com
      cd96bea7
    • Manasi Navare's avatar
      drm/i915/icl: Add register defs for voltage swing sequences for MG PHY DDI · c92f47b5
      Manasi Navare authored
      
      
      On Icelake platform, MG PHY is used when operating in DP alternate
      mode or the legacy HDMI or DP modes. DDI Ports C, D, E, F are MG PHY
      DDI ports on ICL.
      
      This patch adds the necessary voltage swing programming related
      register definitions and macros for MG PHY DDI ports.
      
      v4 (from Paulo):
      * Use _PORT instead of _PICK
      * Change some mask names to our current coding standards
      * Stay under 80 columns
      v3:
      * Rebase on new revision of patches
      v2:
      * Remove whitespaces in the #defines (Paulo)
      
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323172419.24911-4-paulo.r.zanoni@intel.com
      c92f47b5
    • Manasi Navare's avatar
      drm/i915/icl: Add Combo PHY DDI Buffer translation tables for Icelake. · 19b904f8
      Manasi Navare authored
      
      
      These tables are used on voltage vswing sequence initialization on
      Icelake.
      
      The swing_sel on the spec's table is defined in a 4 bits binary like
      1010.  However the register bits are split in upper 1 bit swing_sel
      and lower 3 bits swing sel.
      
      In this table here we store this value as a single value in hex like
      it is mentioned in the Bspec and split it to the upper and lower bit
      values only while programming the registers.
      
      For instance: b1010 is written as 0xA and then while writing to the
      register, the upper 1 bit is obtained by (0xA & 0x8) and shifting by
      appropriate bits while lower 3 bits are obtained by (0xA & 0x7) and
      shifting by appropriate bits.
      
      Some of the columns need to be updated after the spec is updated.
      
      v5 (from Paulo):
      * Checkpatch fixes.
      v4 (from Paulo):
      * Fix minor typo
      * Coding style conformance
      v3:
      * Get rid of HDMI/DVI tables, same as DP (Paulo)
      * Use combo_phy in ddi buf trans table defs (Paulo)
      v2:
      * Added DW4_scaling_hex column to the translation tables (Rodrigo)
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323172419.24911-3-paulo.r.zanoni@intel.com
      19b904f8
    • Manasi Navare's avatar
      drm/i915/icl: Add register definitions for Combo PHY vswing sequences. · 5bb975de
      Manasi Navare authored
      
      
      This patch defines register definitions required for ICL voltage
      vswing programming for Combo PHY DDI Ports. It uses the same bit
      definitions and macros as the CNL voltage swing sequences.
      
      v8 (from Paulo):
      * Rebase.
      v7:
      * Kill _MMIIO_PORT2_LN (Paulo)
      v6:
      * Replace some spaces with TAB (Paulo)
      v5:
      * Use _PORT instead of _PICK (Paulo)
      * Remove DW7 defs for ICL, not used (Paulo)
      v4:
      * Rebase after _PICK was used instead of _PORT3
      * Use _PICK for _MMIO_PORT2 since address of B is less
      than address of A so cant use the math (Paulo)
      v3:
      * Make changes to the existing macro in a diff patch (Paulo)
      v2:
      * Add new defs fro ICL regs (Paulo)
      
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: default avatarManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323172419.24911-2-paulo.r.zanoni@intel.com
      5bb975de
    • Imre Deak's avatar
      drm/i915: Fix hibernation with ACPI S0 target state · 0f90603c
      Imre Deak authored
      After
      
      commit dd9f31c7
      
      
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Wed Aug 16 17:46:07 2017 +0300
      
          drm/i915/gen9+: Set same power state before hibernation image
          save/restore
      
      during hibernation/suspend the power domain functionality got disabled,
      after which resume could leave it incorrectly disabled if the ACPI
      target state was S0 during suspend and i915 was not loaded by the loader
      kernel.
      
      This was caused by not considering if we resumed from hibernation as the
      condition for power domains reiniting.
      
      Fix this by simply tracking if we suspended power domains during system
      suspend and reinit power domains accordingly during resume. This will
      result in reiniting power domains always when resuming from hibernation,
      regardless of the platform and whether or not i915 is loaded by the
      loader kernel.
      
      The reason we didn't catch this earlier is that the enabled/disabled
      state of power domains during PMSG_FREEZE/PMSG_QUIESCE is platform
      and kernel config dependent: on my SKL the target state is S4
      during PMSG_FREEZE and (with the driver loaded in the loader kernel)
      S0 during PMSG_QUIESCE. On the reporter's machine it's S0 during
      PMSG_FREEZE but (contrary to this) power domains are not initialized
      during PMSG_QUIESCE since i915 is not loaded in the loader kernel, or
      it's loaded but without the DMC firmware being available.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105196
      Reported-and-tested-by: default avatar <amn-bas@hotmail.com>
      Fixes: dd9f31c7
      
       ("drm/i915/gen9+: Set same power state before hibernation image save/restore")
      Cc: amn-bas@hotmail.com
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180322143642.26883-1-imre.deak@intel.com
      0f90603c
    • Chris Wilson's avatar
      drm/i915: Actually flush interrupts on reset not just wedging · 46b3617d
      Chris Wilson authored
      Commit 0f36a85c ("drm/i915: Flush pending interrupt following a GPU
      reset") got confused and only applied the flush to the set-wedge path
      (which itself is proving troublesome), but we also need the
      serialisation on the regular reset path. Oops.
      
      Move the interrupt into reset_irq() and make it common to the reset and
      final set-wedge.
      
      v2: reset_irq() after port cancellation, as we assert that
      execlists->active is sane for cancellation (and is being reset by
      reset_irq).
      
      References: 0f36a85c
      
       ("drm/i915: Flush pending interrupt following a GPU reset")
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Michel Thierry <michel.thierry@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Jeff McGee <jeff.mcgee@intel.com>
      Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323101824.14645-1-chris@chris-wilson.co.uk
      46b3617d
    • Michal Wajdeczko's avatar
      drm/i915/uc: Fetch uC firmware in init_early · 8c650aef
      Michal Wajdeczko authored
      
      
      We were fetching uC firmwares in separate uc_init_fw step, while
      there is no reason why we can't fetch them during init_early.
      This will also simplify upcoming patches, as size of the firmware
      may be used for register initialization.
      
      Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Michal Winiarski <michal.winiarski@intel.com>
      Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323123451.59244-2-michal.wajdeczko@intel.com
      8c650aef
    • Michal Wajdeczko's avatar
      drm/i915: Reorder early initialization · a0de908d
      Michal Wajdeczko authored
      
      
      In upcoming patch, we want to perform more actions in early
      initialization of the uC. This reordering will help resolve
      new dependencies that will be introduced by future patch.
      
      v2: s/i915_gem_load_init/i915_gem_init_early (Chris)
      v3: s/i915_gem_load_cleanup/i915_gem_cleanup_early (Michal)
      
      Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323123451.59244-1-michal.wajdeczko@intel.com
      a0de908d
    • Piotr Piórkowski's avatar
      drm/i915/guc: Fix null pointer dereference when GuC FW is not available · 28e0e8ac
      Piotr Piórkowski authored
      If GuC firmware is not available on the system and we load i915 with enable
      GuC, then we hit this null pointer dereference issue:
      
      [   71.098873] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      [   71.098938] IP: intel_uc_fw_upload+0x1f/0x360 [i915]
      [   71.098947] PGD 0 P4D 0
      [   71.098956] Oops: 0000 [#1] PREEMPT SMP PTI
      [   71.098965] Modules linked in: i915(O+) netconsole x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel mei_me i2c_i801 prime_numbers mei [last unloaded: i915]
      [   71.099005] CPU: 2 PID: 1167 Comm: insmod Tainted: G     U  W  O     4.16.0-rc1+ #337
      [   71.099018] Hardware name: /NUC6i5SYB, BIOS SYSKLi35.86A.0065.2018.0103.1000 01/03/2018
      [   71.099077] RIP: 0010:intel_uc_fw_upload+0x1f/0x360 [i915]
      [   71.099087] RSP: 0018:ffffc90000417aa0 EFLAGS: 00010282
      [   71.099097] RAX: 0000000000000000 RBX: ffff88084cad12f8 RCX: ffffffffa03e9357
      [   71.099108] RDX: 0000000000000002 RSI: ffffffffa034dba0 RDI: ffff88084cad12f8
      [   71.099118] RBP: 0000000000000002 R08: ffff88085344ca90 R09: 0000000000000001
      [   71.099128] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88084cad0000
      [   71.099139] R13: ffffffffa034dba0 R14: 00000000fffffff5 R15: ffff88084cad12b0
      [   71.099151] FS:  00007f7f24ae2740(0000) GS:ffff88085e200000(0000) knlGS:0000000000000000
      [   71.099162] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   71.099171] CR2: 0000000000000008 CR3: 0000000855f48001 CR4: 00000000003606e0
      [   71.099182] Call Trace:
      [   71.099246]  intel_uc_init_hw+0xc8/0x520 [i915]
      [   71.099303]  i915_gem_init_hw+0x11f/0x2d0 [i915]
      [   71.099364]  i915_gem_init+0x2b9/0x640 [i915]
      [   71.099413]  i915_driver_load+0xb74/0x1110 [i915]
      [   71.099462]  i915_pci_probe+0x2e/0x90 [i915]
      [   71.099476]  pci_device_probe+0xa1/0x130
      [   71.099488]  driver_probe_device+0x302/0x470
      [   71.099502]  __driver_attach+0xb9/0xe0
      [   71.099513]  ? driver_probe_device+0x470/0x470
      [   71.099525]  ? driver_probe_device+0x470/0x470
      [   71.099538]  bus_for_each_dev+0x64/0x90
      [   71.099550]  bus_add_driver+0x164/0x260
      [   71.099561]  ? 0xffffffffa04d6000
      [   71.099572]  driver_register+0x57/0xc0
      [   71.099582]  ? 0xffffffffa04d6000
      [   71.099593]  do_one_initcall+0x3b/0x160
      [   71.099606]  ? kmem_cache_alloc_trace+0x1c3/0x2a0
      [   71.099621]  do_init_module+0x5b/0x1f9
      [   71.099635]  load_module+0x2467/0x2a70
      [   71.099654]  ? SyS_finit_module+0xbd/0xe0
      [   71.099668]  SyS_finit_module+0xbd/0xe0
      [   71.099682]  do_syscall_64+0x73/0x1c0
      [   71.099694]  entry_SYSCALL_64_after_hwframe+0x26/0x9b
      [   71.099706] RIP: 0033:0x7f7f23fb40d9
      [   71.099717] RSP: 002b:00007ffda7d67ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
      [   71.099734] RAX: ffffffffffffffda RBX: 000055f96e2a8870 RCX: 00007f7f23fb40d9
      [   71.099748] RDX: 0000000000000000 RSI: 000055f96e2a8260 RDI: 0000000000000003
      [   71.099763] RBP: 000055f96e2a8260 R08: 0000000000000000 R09: 00007ffda7d68088
      [   71.099777] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
      [   71.099791] R13: 000055f96e2a8830 R14: 0000000000000000 R15: 000055f96e2a8260
      [   71.099810] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 41 54 49 89 f5 55 53 48 c7 c1 57 93 3e a0 48 8b 47 10 48 89 fb 4c 8b 07 <48> 8b 68 08 8b 47 28 85 c0 74 15 83 f8 01 48 c7 c1 5b 93 3e a0
      [   71.100004] RIP: intel_uc_fw_upload+0x1f/0x360 [i915] RSP: ffffc90000417aa0
      [   71.100020] CR2: 0000000000000008
      [   71.100031] ---[ end trace d8ac93c30ceff5b2 ]--
      
      Fixes: 6b0478fb
      
       ("drm/i915: Implement dynamic GuC WOPCM offset and size calculation")
      
      v2: don't assume it is always GuC FW (Michal)
      v3: added a new variable to avoid exceeding the number of characters in the
      line (Michal)
      
      Signed-off-by: default avatarPiotr Piórkowski <piotr.piorkowski@intel.com>
      Reported-by: default avatarRadoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Jackie Li <yaodong.li@intel.com>
      Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
      Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
      Reviewed-by: default avatarJackie Li <yaodong.li@intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180323112319.16293-1-piotr.piorkowski@intel.com
      28e0e8ac