Skip to content
Permalink
Tejas-Upadhyay…
Switch branches/tags

Commits on Nov 11, 2021

  1. drm/i915/gt: Hold RPM wakelock during PXP suspend

    selftest --r live shows failure in suspend tests when
    RPM wakelock is not acquired during suspend.
    
    This changes addresses below error :
    <4> [154.177535] RPM wakelock ref not held during HW access
    <4> [154.177575] WARNING: CPU: 4 PID: 5772 at
    drivers/gpu/drm/i915/intel_runtime_pm.h:113
    fwtable_write32+0x240/0x320 [i915]
    <4> [154.177974] Modules linked in: i915(+) vgem drm_shmem_helper
    fuse snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic
    ledtrig_audio mei_hdcp mei_pxp x86_pkg_temp_thermal coretemp
    crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_intel_dspcfg
    snd_hda_codec snd_hwdep igc snd_hda_core ttm mei_me ptp
    snd_pcm prime_numbers mei i2c_i801 pps_core i2c_smbus intel_lpss_pci
    btusb btrtl btbcm btintel bluetooth ecdh_generic ecc [last unloaded: i915]
    <4> [154.178143] CPU: 4 PID: 5772 Comm: i915_selftest Tainted: G
    U            5.15.0-rc6-CI-Patchwork_21432+ #1
    <4> [154.178154] Hardware name: ASUS System Product Name/TUF GAMING
    Z590-PLUS WIFI, BIOS 0811 04/06/2021
    <4> [154.178160] RIP: 0010:fwtable_write32+0x240/0x320 [i915]
    <4> [154.178604] Code: 15 7b e1 0f 0b e9 34 fe ff ff 80 3d a9 89 31
    00 00 0f 85 31 fe ff ff 48 c7 c7 88 9e 4f a0 c6 05 95 89 31 00 01 e8
    c0 15 7b e1 <0f> 0b e9 17 fe ff ff 8b 05 0f 83 58 e2 85 c0 0f 85 8d
    00 00 00 48
    <4> [154.178614] RSP: 0018:ffffc900016279f0 EFLAGS: 00010286
    <4> [154.178626] RAX: 0000000000000000 RBX: ffff888204fe0ee0
    RCX: 0000000000000001
    <4> [154.178634] RDX: 0000000080000001 RSI: ffffffff823142b5
    RDI: 00000000ffffffff
    <4> [154.178641] RBP: 00000000000320f0 R08: 0000000000000000
    R09: c0000000ffffcd5a
    <4> [154.178647] R10: 00000000000f8c90 R11: ffffc90001627808
    R12: 0000000000000000
    <4> [154.178654] R13: 0000000040000000 R14: ffffffffa04d12e0
    R15: 0000000000000000
    <4> [154.178660] FS:  00007f7390aa4c00(0000) GS:ffff88844f000000(0000)
    knlGS:0000000000000000
    <4> [154.178669] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    <4> [154.178675] CR2: 000055bc40595028 CR3: 0000000204474005
    CR4: 0000000000770ee0
    <4> [154.178682] PKRU: 55555554
    <4> [154.178687] Call Trace:
    <4> [154.178706]  intel_pxp_fini_hw+0x23/0x30 [i915]
    <4> [154.179284]  intel_pxp_suspend+0x1f/0x30 [i915]
    <4> [154.179807]  live_gt_resume+0x5b/0x90 [i915]
    
    Changes since V2 :
    	- Open-code intel_pxp_runtime_suspend - Daniele
    	- Remove boolean in intel_pxp_runtime_preapre - Daniele
    Changes since V1 :
    	- split the HW access parts in gt_suspend_late - Daniele
    	- Remove default PXP configs
    
    Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
    tejaskux authored and intel-lab-lkp committed Nov 11, 2021

Commits on Nov 9, 2021

  1. drm/i915/adlp/fb: Prevent the mapping of redundant trailing padding N…

    …ULL pages
    
    So far the remapped view size in GTT/DPT was padded to the next aligned
    offset unnecessarily after the last color plane with an unaligned size.
    Remove the unnecessary padding.
    
    Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
    Fixes: 3d1adc3 ("drm/i915/adlp: Add support for remapping CCS FBs")
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-3-imre.deak@intel.com
    (cherry picked from commit 6b6636e)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    ideak authored and rodrigovivi committed Nov 9, 2021
  2. drm/i915/fb: Fix rounding error in subsampled plane size calculation

    For NV12 FBs with odd main surface tile-row height the CCS surface
    height was incorrectly calculated 1 less than the actual value. Fix this
    by rounding up the result of divison. For consistency do the same for
    the CCS surface width calculation.
    
    Fixes: b3e57bc ("drm/i915/tgl: Gen-12 render decompression")
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-2-imre.deak@intel.com
    (cherry picked from commit 2ee5ef9)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    ideak authored and rodrigovivi committed Nov 9, 2021
  3. drm/i915/hdmi: Turn DP++ TMDS output buffers back on in encoder->shut…

    …down()
    
    Looks like our VBIOS/GOP generally fail to turn the DP dual mode adater
    TMDS output buffers back on after a reboot. This leads to a black screen
    after reboot if we turned the TMDS output buffers off prior to reboot.
    And if i915 decides to do a fastboot the black screen will persist even
    after i915 takes over.
    
    Apparently this has been a problem ever since commit b2ccb82 ("drm/i915:
    Enable/disable TMDS output buffers in DP++ adaptor as needed") if one
    rebooted while the display was turned off. And things became worse with
    commit fe0f1e3 ("drm/i915: Shut down displays gracefully on reboot")
    since now we always turn the display off before a reboot.
    
    This was reported on a RKL, but I confirmed the same behaviour on my
    SNB as well. So looks pretty universal.
    
    Let's fix this by explicitly turning the TMDS output buffers back on
    in the encoder->shutdown() hook. Note that this gets called after irqs
    have been disabled, so the i2c communication with the DP dual mode
    adapter has to be performed via polling (which the gmbus code is
    perfectly happy to do for us).
    
    We also need a bit of care in handling DDI encoders which may or may
    not be set up for HDMI output. Specifically ddc_pin will not be
    populated for a DP only DDI encoder, in which case we don't want to
    call intel_gmbus_get_adapter(). We can handle that by simply doing
    the dual mode adapter type check before calling
    intel_gmbus_get_adapter().
    
    Cc: <stable@vger.kernel.org> # v5.11+
    Fixes: fe0f1e3 ("drm/i915: Shut down displays gracefully on reboot")
    Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4371
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211029191802.18448-2-ville.syrjala@linux.intel.com
    Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
    (cherry picked from commit 49c55f7)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    vsyrjala authored and rodrigovivi committed Nov 9, 2021

Commits on Nov 1, 2021

  1. drm/i915: Fix type1 DVI DP dual mode adapter heuristic for modern pla…

    …tforms
    
    Looks like we never updated intel_bios_is_port_dp_dual_mode() when
    the VBT port mapping became erratic on modern platforms. This
    is causing us to look up the wrong child device and thus throwing
    the heuristic off (ie. we might end looking at a child device for
    a genuine DP++ port when we were supposed to look at one for a
    native HDMI port).
    
    Fix it up by not using the outdated port_mapping[] in
    intel_bios_is_port_dp_dual_mode() and rely on
    intel_bios_encoder_data_lookup() instead.
    
    Cc: stable@vger.kernel.org
    Tested-by: Randy Dunlap <rdunlap@infradead.org>
    Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4138
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211025142147.23897-1-ville.syrjala@linux.intel.com
    Reviewed-by: Jani Nikula <jani.nikula@intel.com>
    (cherry picked from commit 32c2bc8)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    vsyrjala authored and rodrigovivi committed Nov 1, 2021
  2. drm/i915: Extend the async flip VT-d w/a to skl/bxt

    Looks like skl/bxt/derivatives also need the plane stride
    stretch w/a when using async flips and VT-d is enabled, or
    else we get corruption on screen. To my surprise this was
    even documented in bspec, but only as a note on the
    CHICHKEN_PIPESL register description rather than on the
    w/a list.
    
    So very much the same thing as on HSW/BDW, except the bits
    moved yet again.
    
    Cc: stable@vger.kernel.org
    Cc: Karthik B S <karthik.b.s@intel.com>
    Fixes: 55ea1cb ("drm/i915: Enable async flips in i915")
    Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20210930190943.17547-1-ville.syrjala@linux.intel.com
    Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
    (cherry picked from commit d08df3b)
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    (cherry picked from commit b2d73de)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    vsyrjala authored and rodrigovivi committed Nov 1, 2021
  3. drm/i915/gvt: fix the usage of ww lock in gvt scheduler.

    As the APIs related to ww lock in i915 was changed recently, the usage of
    ww lock in GVT-g scheduler needs to be changed accrodingly. We noticed a
    deadlock when GVT-g scheduler submits the workload to i915. After some
    investigation, it seems the way of how to use ww lock APIs has been
    changed. Releasing a ww now requires a explicit i915_gem_ww_ctx_fini().
    
    Fixes: 67f1120 ("drm/i915/gvt: Introduce per object locking in GVT scheduler.")
    Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
    Signed-off-by: Zhi A Wang <zhi.a.wang@intel.com>
    Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
    Link: http://patchwork.freedesktop.org/patch/msgid/20210826143834.25410-1-zhi.a.wang@intel.com
    Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>
    (cherry picked from commit d168cd7)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Zhi A Wang authored and rodrigovivi committed Nov 1, 2021

Commits on Oct 28, 2021

  1. drm/i915/dmabuf: fix broken build

    wbinvd_on_all_cpus() is only defined on x86 it seems, plus we need to
    include asm/smp.h here.
    
    Reported-by: kernel test robot <lkp@intel.com>
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211021125332.2455288-1-matthew.auld@intel.com
    (cherry picked from commit 777226d)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    matt-auld authored and rodrigovivi committed Oct 28, 2021
  2. drm/i915: Revert 'guc_id' from i915_request tracepoint

    Avoid adding backend specific data to the tracepoints outside of
    the LOW_LEVEL_TRACEPOINTS kernel config protection. These bits of
    information are bound to change depending on the selected submission
    method per platform and are not necessarily possible to maintain in
    the future.
    
    Fixes: dbf9da8 ("drm/i915/guc: Add trace point for GuC submit")
    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Cc: John Harrison <john.c.harrison@intel.com>
    Cc: Matthew Brost <matthew.brost@intel.com>
    Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Cc: Matt Roper <matthew.d.roper@intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211027093255.66489-1-joonas.lahtinen@linux.intel.com
    (cherry picked from commit 64512a6)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    jlahtine-intel authored and rodrigovivi committed Oct 28, 2021

Commits on Oct 27, 2021

  1. drm/i915/dp: fix integer overflow in 128b/132b data rate calculation

    The intermediate value 1000000 * 10 * 9671 overflows 32 bits, so force
    promotion to a bigger type.
    
    From the logs:
    
    [drm:intel_dp_compute_config [i915]] DP link rate required 3657063 available -580783288
    
    v2: Use mul_u32_u32() (Ville)
    
    Fixes: 48efd01 ("drm/i915/dp: add max data rate calculation for UHBR rates")
    Cc: Manasi Navare <manasi.d.navare@intel.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211026093407.11381-1-jani.nikula@intel.com
    (cherry picked from commit bf0d608)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    jnikula authored and rodrigovivi committed Oct 27, 2021
  2. drm/i915/guc: Fix recursive lock in GuC submission

    Use __release_guc_id (lock held) rather than release_guc_id (acquires
    lock), add lockdep annotations.
    
    213.280129] i915: Running i915_perf_live_selftests/live_noa_gpr
    [ 213.283459] ============================================
    [ 213.283462] WARNING: possible recursive locking detected
    {{[ 213.283466] 5.15.0-rc6+ torvalds#18 Tainted: G U W }}
    [ 213.283470] --------------------------------------------
    [ 213.283472] kworker/u24:0/8 is trying to acquire lock:
    [ 213.283475] ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x2df/0x350 [i915]
    {{[ 213.283618] }}
    {{ but task is already holding lock:}}
    [ 213.283621] ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x4f/0x350 [i915]
    {{[ 213.283720] }}
    {{ other info that might help us debug this:}}
    [ 213.283724] Possible unsafe locking scenario:[ 213.283727] CPU0
    [ 213.283728] ----
    [ 213.283730] lock(&guc->submission_state.lock);
    [ 213.283734] lock(&guc->submission_state.lock);
    {{[ 213.283737] }}
    {{ *** DEADLOCK ***}}[ 213.283740] May be due to missing lock nesting notation[ 213.283744] 3 locks held by kworker/u24:0/8:
    [ 213.283747] #0: ffff8ffb80059d38 ((wq_completion)events_unbound){..}-{0:0}, at: process_one_work+0x1f3/0x550
    [ 213.283757] #1: ffffb509000e3e78 ((work_completion)(&guc->submission_state.destroyed_worker)){..}-{0:0}, at: process_one_work+0x1f3/0x550
    [ 213.283766] #2: ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x4f/0x350 [i915]
    {{[ 213.283860] }}
    {{ stack backtrace:}}
    [ 213.283863] CPU: 8 PID: 8 Comm: kworker/u24:0 Tainted: G U W 5.15.0-rc6+ torvalds#18
    [ 213.283868] Hardware name: ASUS System Product Name/PRIME B560M-A AC, BIOS 0403 01/26/2021
    [ 213.283873] Workqueue: events_unbound destroyed_worker_func [i915]
    [ 213.283957] Call Trace:
    [ 213.283960] dump_stack_lvl+0x57/0x72
    [ 213.283966] __lock_acquire.cold+0x191/0x2d3
    [ 213.283972] lock_acquire+0xb5/0x2b0
    [ 213.283978] ? destroyed_worker_func+0x2df/0x350 [i915]
    [ 213.284059] ? destroyed_worker_func+0x2d7/0x350 [i915]
    [ 213.284139] ? lock_release+0xb9/0x280
    [ 213.284143] _raw_spin_lock_irqsave+0x48/0x60
    [ 213.284148] ? destroyed_worker_func+0x2df/0x350 [i915]
    [ 213.284226] destroyed_worker_func+0x2df/0x350 [i915]
    [ 213.284310] process_one_work+0x270/0x550
    [ 213.284315] worker_thread+0x52/0x3b0
    [ 213.284319] ? process_one_work+0x550/0x550
    [ 213.284322] kthread+0x135/0x160
    [ 213.284326] ? set_kthread_struct+0x40/0x40
    [ 213.284331] ret_from_fork+0x1f/0x30
    
    and a bit later in the trace:
    
    {{ 227.499864] do_raw_spin_lock+0x94/0xa0}}
    [ 227.499868] _raw_spin_lock_irqsave+0x50/0x60
    [ 227.499871] ? guc_flush_destroyed_contexts+0x4f/0xf0 [i915]
    [ 227.499995] guc_flush_destroyed_contexts+0x4f/0xf0 [i915]
    [ 227.500104] intel_guc_submission_reset_prepare+0x99/0x4b0 [i915]
    [ 227.500209] ? mark_held_locks+0x49/0x70
    [ 227.500212] intel_uc_reset_prepare+0x46/0x50 [i915]
    [ 227.500320] reset_prepare+0x78/0x90 [i915]
    [ 227.500412] __intel_gt_set_wedged.part.0+0x13/0xe0 [i915]
    [ 227.500485] intel_gt_set_wedged.part.0+0x54/0x100 [i915]
    [ 227.500556] intel_gt_set_wedged_on_fini+0x1a/0x30 [i915]
    [ 227.500622] intel_gt_driver_unregister+0x1e/0x60 [i915]
    [ 227.500694] i915_driver_remove+0x4a/0xf0 [i915]
    [ 227.500767] i915_pci_probe+0x84/0x170 [i915]
    [ 227.500838] local_pci_probe+0x42/0x80
    [ 227.500842] pci_device_probe+0xd9/0x190
    [ 227.500844] really_probe+0x1f2/0x3f0
    [ 227.500847] __driver_probe_device+0xfe/0x180
    [ 227.500848] driver_probe_device+0x1e/0x90
    [ 227.500850] __driver_attach+0xc4/0x1d0
    [ 227.500851] ? __device_attach_driver+0xe0/0xe0
    [ 227.500853] ? __device_attach_driver+0xe0/0xe0
    [ 227.500854] bus_for_each_dev+0x64/0x90
    [ 227.500856] bus_add_driver+0x12e/0x1f0
    [ 227.500857] driver_register+0x8f/0xe0
    [ 227.500859] i915_init+0x1d/0x8f [i915]
    [ 227.500934] ? 0xffffffffc144a000
    [ 227.500936] do_one_initcall+0x58/0x2d0
    [ 227.500938] ? rcu_read_lock_sched_held+0x3f/0x80
    [ 227.500940] ? kmem_cache_alloc_trace+0x238/0x2d0
    [ 227.500944] do_init_module+0x5c/0x270
    [ 227.500946] __do_sys_finit_module+0x95/0xe0
    [ 227.500949] do_syscall_64+0x38/0x90
    [ 227.500951] entry_SYSCALL_64_after_hwframe+0x44/0xae
    [ 227.500953] RIP: 0033:0x7ffa59d2ae0d
    [ 227.500954] Code: c8 0c 00 0f 05 eb a9 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3b 80 0c 00 f7 d8 64 89 01 48
    [ 227.500955] RSP: 002b:00007fff320bbf48 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
    [ 227.500956] RAX: ffffffffffffffda RBX: 00000000022ea710 RCX: 00007ffa59d2ae0d
    [ 227.500957] RDX: 0000000000000000 RSI: 00000000022e1d90 RDI: 0000000000000004
    [ 227.500958] RBP: 0000000000000020 R08: 00007ffa59df3a60 R09: 0000000000000070
    [ 227.500958] R10: 00000000022e1d90 R11: 0000000000000246 R12: 00000000022e1d90
    [ 227.500959] R13: 00000000022e58e0 R14: 0000000000000043 R15: 00000000022e42c0
    
    v2:
     (CI build)
      - Fix build error
    
    Fixes: 1a52fae ("drm/i915/guc: Take GT PM ref when deregistering context")
    Signed-off-by: Matthew Brost <matthew.brost@intel.com>
    Cc: stable@vger.kernel.org
    Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211020192147.8048-1-matthew.brost@intel.com
    (cherry picked from commit 12a9917)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    mbrost05 authored and rodrigovivi committed Oct 27, 2021
  3. drm/i915/cdclk: put the cdclk vtables in const data

    Add the const that was accidentally left out from the vtables.
    
    Fixes: 6b4cd9c ("drm/i915: constify the cdclk vtable")
    Cc: Dave Airlie <airlied@redhat.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211021133408.32166-1-jani.nikula@intel.com
    (cherry picked from commit 877d074)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    jnikula authored and rodrigovivi committed Oct 27, 2021
  4. Revert "drm/i915/bios: gracefully disable dual eDP for now"

    This reverts commit 05734ca.
    
    It's not graceful, instead it leads to boot time warning splats in the
    case it is supposed to handle gracefully. Apparently the BIOS/GOP
    enabling the port we end up skipping leads to state readout
    problems. Back to the drawing board.
    
    References: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21255/bat-adlp-4/boot0.txt
    Fixes: 05734ca ("drm/i915/bios: gracefully disable dual eDP for now")
    Cc: José Roberto de Souza <jose.souza@intel.com>
    Cc: Uma Shankar <uma.shankar@intel.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Swati Sharma <swati2.sharma@intel.com>
    Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211019114334.24643-1-jani.nikula@intel.com
    (cherry picked from commit 171c555)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    jnikula authored and rodrigovivi committed Oct 27, 2021
  5. drm/i915/dp: Ensure max link params are always valid

    Atm until the DPCD for a connector is read the max link rate and lane
    count params are invalid. If the connector is modeset, in
    intel_dp_compute_config(), intel_dp_common_len_rate_limit(max_link_rate)
    will return 0, leading to a intel_dp->common_rates[-1] access.
    
    Fix the above by making sure the max link params are always valid.
    
    The above access leads to an undefined behaviour by definition, though
    not causing a user visible problem to my best knowledge, see the previous
    patch why. Nevertheless it is an undefined behaviour and it triggers a
    BUG() in CONFIG_UBSAN builds, hence CC:stable.
    
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Acked-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211018094154.1407705-4-imre.deak@intel.com
    (cherry picked from commit 9ad87de)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    ideak authored and rodrigovivi committed Oct 27, 2021
  6. drm/i915/dp: Ensure sink rate values are always valid

    Atm, there are no sink rate values set for DP (vs. eDP) sinks until the
    DPCD capabilities are successfully read from the sink. During this time
    intel_dp->num_common_rates is 0 which can lead to a
    
    intel_dp->common_rates[-1]    (*)
    
    access, which is an undefined behaviour, in the following cases:
    
    - In intel_dp_sync_state(), if the encoder is enabled without a sink
      connected to the encoder's connector (BIOS enabled a monitor, but the
      user unplugged the monitor until the driver loaded).
    - In intel_dp_sync_state() if the encoder is enabled with a sink
      connected, but for some reason the DPCD read has failed.
    - In intel_dp_compute_link_config() if modesetting a connector without
      a sink connected on it.
    - In intel_dp_compute_link_config() if modesetting a connector with a
      a sink connected on it, but before probing the connector first.
    
    To avoid the (*) access in all the above cases, make sure that the sink
    rate table - and hence the common rate table - is always valid, by
    setting a default minimum sink rate when registering the connector
    before anything could use it.
    
    I also considered setting all the DP link rates by default, so that
    modesetting with higher resolution modes also succeeds in the last two
    cases above. However in case a sink is not connected that would stop
    working after the first modeset, due to the LT fallback logic. So this
    would need more work, beyond the scope of this fix.
    
    As I mentioned in the previous patch, I don't think the issue this patch
    fixes is user visible, however it is an undefined behaviour by
    definition and triggers a BUG() in CONFIG_UBSAN builds, hence CC:stable.
    
    v2: Clear the default sink rates, before initializing these for eDP.
    
    Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4297
    References: https://gitlab.freedesktop.org/drm/intel/-/issues/4298
    Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Acked-by: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211018143417.1452632-1-imre.deak@intel.com
    (cherry picked from commit 3f61ef9)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    ideak authored and rodrigovivi committed Oct 27, 2021
  7. Merge tag 'amd-drm-next-5.16-2021-10-22' of https://gitlab.freedeskto…

    …p.org/agd5f/linux into drm-next
    
    amd-drm-next-5.16-2021-10-22:
    
    amdgpu:
    - PSP fix for resume
    - XGMI fixes
    - Interrupt fix in device tear down
    - Renoir USB-C DP alt mode fix for resume
    - DP 2.0 fixes
    - Yellow Carp display fixes
    - Misc display fixes
    - RAS fixes
    - IP Discovery enumeration fixes
    - VGH fixes
    - SR-IOV fixes
    - Revert ChromeOS workaround in display code
    - Cyan Skillfish fixes
    
    amdkfd:
    - Fix error handling in gpu memory allocation
    - Fix build warnings with some configs
    - SVM fixes
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    From: Alex Deucher <alexander.deucher@amd.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211022183112.4574-1-alexander.deucher@amd.com
    airlied committed Oct 27, 2021

Commits on Oct 22, 2021

  1. amd/display: remove ChromeOS workaround

    This reverts commits ddab8bd ("drm/amd/display: Fix two cursor duplication
    when using overlay") and e7d9560 ("Revert "drm/amd/display: Fix overlay
    validation by considering cursors"").
    
    tl;dr ChromeOS uses the atomic interface for everything except the cursor. This
    is incorrect and forces amdgpu to disable some hardware features. Let's revert
    the ChromeOS-specific workaround in mainline and allow the Chrome team to keep
    it internally in their own tree.
    
    See [1] for more details. This patch is an alternative to [2], which added
    ChromeOS detection.
    
    [1]: https://lore.kernel.org/amd-gfx/JIQ_93_cHcshiIDsrMU1huBzx9P9LVQxucx8hQArpQu7Wk5DrCl_vTXj_Q20m_L-8C8A5dSpNcSJ8ehfcCrsQpfB5QG_Spn14EYkH9chtg0=@emersion.fr/
    [2]: https://lore.kernel.org/amd-gfx/20211011151609.452132-1-contact@emersion.fr/
    
    Signed-off-by: Simon Ser <contact@emersion.fr>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Cc: Harry Wentland <hwentlan@amd.com>
    Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
    Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
    Cc: Sean Paul <seanpaul@chromium.org>
    Fixes: ddab8bd ("drm/amd/display: Fix two cursor duplication when using overlay")
    Fixes: e7d9560 ("Revert "drm/amd/display: Fix overlay validation by considering cursors"")
    Reviewed-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    emersion authored and Alex Deucher committed Oct 22, 2021
  2. drm/amd/pm: Disable fan control if not supported

    On arcturus, not all platforms use PMFW based fan control. On such
    ASICs fan control by PMFW will be disabled in PPTable. Disable hwmon
    knobs for fan control also as it is not possible to report or control
    fan speed on such platforms through driver.
    
    Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Lijo Lazar authored and Alex Deucher committed Oct 22, 2021
  3. drm/amdgpu/nbio7.4: use original HDP_FLUSH bits

    The extended bits were not available for use on vega20 and
    presumably arcturus as well.
    
    Fixes: a0f9f85 ("drm/amdgpu/nbio7.4: don't use GPU_HDP_FLUSH bit 12")
    Reviewed-and-tested-by: Guchun Chen <guchun.chen@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  4. drm/amdgpu/smu11.0: add missing IP version check

    Add missing check in smu_v11_0_init_display_count(),
    
    Fixes: af3b89d ("drm/amdgpu/smu11.0: convert to IP version checking")
    Reviewed-by: Guchun Chen <guchun.chen@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  5. drm/amdgpu/swsmu: handle VCN harvesting for VCN SMU setup

    Check if VCN instances are harvested when controlling
    VCN power gating and setting up VCN clocks.
    
    Fixes: 1b592d0 ("drm/amdgpu/vcn: remove manual instance setting")
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1743
    Reviewed-and-tested-by: Guchun Chen <guchun.chen@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  6. drm/amdgpu: Workaround harvesting info for some navy flounder boards

    Some navy flounder boards do not properly mark harvested
    VCN instances.  Fix that here.
    
    v2: use IP versions
    
    Fixes: 1b592d0 ("drm/amdgpu/vcn: remove manual instance setting")
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1743
    Reviewed-and-tested-by: Guchun Chen <guchun.chen@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  7. drm/amdgpu/vcn3.0: remove intermediate variable

    No need to use the id variable, just use the constant
    plus instance offset directly.
    
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  8. drm/amdgpu/vcn2.0: remove intermediate variable

    No need to use the tmp variable, just use the constant
    directly.
    
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  9. drm/amdgpu: Consolidate VCN firmware setup code

    Roughly the same code was present in all VCN versions.
    Consolidate it into a single function.
    
    v2: use AMDGPU_UCODE_ID_VCN + i, check if num_inst >= 2
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Reviewed-by: James Zhu <James.Zhu@amd.com>
    Alex Deucher committed Oct 22, 2021
  10. drm/amdgpu/vcn3.0: handle harvesting in firmware setup

    Only enable firmware for the instance that is enabled.
    
    v2: use AMDGPU_UCODE_ID_VCN + i
    
    Fixes: 1b592d0 ("drm/amdgpu/vcn: remove manual instance setting")
    Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1743
    Reviewed-by: James Zhu <James.Zhu@amd.com>
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Alex Deucher committed Oct 22, 2021
  11. drm/amdkfd: debug message to count successfully migrated pages

    Not all migrate.cpages returned from migrate_vma_setup can be migrated,
    for example non anonymous page, or out of device memory. So after
    migrate_vma_pages returns, add debug message to count pages are
    successfully migrated which has MIGRATE_PFN_VALID and
    MIGRATE_PFN_MIGRATE flag set.
    
    Signed-off-by: Philip Yang <Philip.Yang@amd.com>
    Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    PhilipYangA authored and Alex Deucher committed Oct 22, 2021
  12. drm/amdkfd: clarify the origin of cpages returned by migration functions

    cpages is only updated by migrate_vma_setup. So capture its value at
    that point to clarify the significance of the number. The next patch
    will add counting of actually migrated pages after migrate_vma_pages for
    debug purposes.
    
    Signed-off-by: Philip Yang <Philip.Yang@amd.com>
    Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    PhilipYangA authored and Alex Deucher committed Oct 22, 2021
  13. drm/amd/amdgpu: add dummy_page_addr to sriov msg

    Add dummy_page_addr to sriov msg for host driver to set
    GCVM_L2_PROTECTION_DEFAULT_ADDR* registers correctly.
    
    v2:
    should update vf2pf msg instead
    
    Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
    Reviewed-by: Horace Chen <horace.chen@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Jingwen Chen authored and Alex Deucher committed Oct 22, 2021
  14. drm/amdgpu: remove grbm cam index/data operations for gfx v10

    PSP firmware will be responsible for applying the GRBM CAM remapping in
    the production. And the GRBM_CAM_INDEX / GRBM_CAM_DATA registers will be
    protected by PSP under security policy. So remove it according to the
    new security policy.
    
    Signed-off-by: Huang Rui <ray.huang@amd.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    huangrui authored and Alex Deucher committed Oct 22, 2021
  15. drm/amd/pm: Enable GPU metrics for One VF mode

    Enable GPU metrics feature in one VF mode.
    These are only possible in one VF mode because the VF is dedicated in that case.
    
    Signed-off-by: Vignesh Chander <Vignesh.Chander@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Vignesh Chander authored and Alex Deucher committed Oct 22, 2021

Commits on Oct 21, 2021

  1. Merge tag 'drm-intel-gt-next-2021-10-21' of git://anongit.freedesktop…

    ….org/drm/drm-intel into drm-next
    
    UAPI Changes:
    
    - Expose multi-LRC submission interface
    
      Similar to the bonded submission interface but simplified.
      Comes with GuC only implementation for now. See kerneldoc
      for more details.
    
      Userspace changes: intel/media-driver#1252
    
    - Expose logical engine instance to user
    
      Needed by the multi-LRC submission interface for GuC
    
      Userspace changes: intel/media-driver#1252
    
    Driver Changes:
    
    - Fix blank screen booting crashes when CONFIG_CC_OPTIMIZE_FOR_SIZE=y (Hugh)
    - Add support for multi-LRC submission in the GuC backend (Matt B)
    - Add extra cache flushing before making pages userspace visible (Matt A, Thomas)
    - Mark internal GPU object pages dirty so they will be flushed properly (Matt A)
    
    - Move remaining debugfs interfaces i915_wedged/i915_forcewake_user into gt (Andi)
    - Replace the unconditional clflushes with drm_clflush_virt_range() (Ville)
    - Remove IS_ACTIVE macro completely (Lucas)
    - Improve kerneldocs for cache_dirty (Matt A)
    
    - Add missing includes (Lucas)
    - Selftest improvements (Matt R, Ran, Matt A)
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/YXFmLKoq8Fg9JxSd@jlahtine-mobl.ger.corp.intel.com
    airlied committed Oct 21, 2021
  2. Merge tag 'drm-intel-next-2021-10-15' of git://anongit.freedesktop.or…

    …g/drm/drm-intel into drm-next
    
    UAPI Changes:
    
    - No Functional change, but a clarification around I915_TILING values (Matt).
    
    Driver Changes:
    
    - Changes around async flip VT-d w/a (Ville)
    - Delete bogus NULL check in intel_ddi_encoder_destroy (Dan)
    - DP link training improvements and DP per-lane driver settings (Ville)
    - Free the returned object of acpi_evaluate_dsm (Zenghui)
    - Fixes and improvements around DP's UHBR and MST (Jani)
    - refactor plane config + pin out (Dave)
    - remove unused include in intel_dsi_vbt.c (Lucas)
    - some code clean up (Lucas, Jani)
    - gracefully disable dual eDP (Jani)
    - Remove memory frequency calculation (Jose)
    - Fix oops on platforms w/o hpd support (Ville)
    - Clean up PXP Kconfig info (Rodrigo)
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    
    From: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/YWnMORrixyw90O3/@intel.com
    airlied committed Oct 21, 2021

Commits on Oct 20, 2021

  1. drm/i915/selftests: mark up hugepages object with start_cpu_write

    Just like we do for internal objects. Also just use
    i915_gem_object_set_cache_coherency() here. No need for over-flushing on
    LLC platforms.
    
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211018174508.2137279-9-matthew.auld@intel.com
    matt-auld committed Oct 20, 2021
  2. drm/i915: mark up internal objects with start_cpu_write

    While the pages can't be swapped out, they can be discarded by the shrinker.
    Normally such objects are marked with __I915_MADV_PURGED, which can't be
    unset, and therefore requires a new object. For kernel internal objects
    this is not true, since the madv hint is reset for our special volatile
    objects, such that we can re-acquire new pages, if so desired, without
    needing a new object. As a result we should probably be paranoid here
    and put the object back into the CPU domain when discarding the pages,
    and also correctly set cache_dirty, if required.
    
    Signed-off-by: Matthew Auld <matthew.auld@intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20211018174508.2137279-8-matthew.auld@intel.com
    matt-auld committed Oct 20, 2021
Older