aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 15:29:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 15:29:43 -0400
commit31cc088a4f5d83481c6f5041bd6eb06115b974af (patch)
treec08195d0f8de69e87e2e1f271130433e1c555ce0 /drivers
parentdd4542d2823ac55cb86450960423f55e818aa182 (diff)
parent8ee795625665208589a97972b01790bb04ea83e3 (diff)
Merge tag 'drm-next-2019-07-19' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Daniel Vetter: "Dave is back in shape, but now family got it so I'm doing the pull. Two things worthy of note: - nouveau feature pull was way too late, Dave&me decided to not take that, so Ben spun up a pull with just the fixes. - after some chatting with the arm display maintainers we decided to change a bit how that's maintained, for more oversight/review and cross vendor collab. More details below: nouveau: - bugfixes - TU116 enabling (minor iteration) :w amdgpu: - large pile of fixes for new hw support this release (navi, vega20) - audio hotplug fix - bunch of corner cases and small fixes all over for amdgpu/kfd komeda: - back out some new properties (from this merge window) that needs more pondering. bochs: - fb pitch setup core: - a new panel quirk - misc fixes" * tag 'drm-next-2019-07-19' of git://anongit.freedesktop.org/drm/drm: (73 commits) drm/nouveau/secboot/gp102-: remove WAR for SEC2 RTOS start bug drm/nouveau/flcn/gp102-: improve implementation of bind_context() on SEC2/GSP drm/nouveau: fix memory leak in nouveau_conn_reset() drm/nouveau/dmem: missing mutex_lock in error path drm/nouveau/hwmon: return EINVAL if the GPU is powered down for sensors reads drm/nouveau: fix bogus GPL-2 license header drm/nouveau: fix bogus GPL-2 license header drm/nouveau/i2c: Enable i2c pads & busses during preinit drm/nouveau/disp/tu102-: wire up scdc parameter setter drm/nouveau/core: recognise TU116 chipset drm/nouveau/kms: disallow dual-link harder if hdmi connection detected drm/nouveau/disp/nv50-: fix center/aspect-corrected scaling drm/nouveau/disp/nv50-: force scaler for any non-default LVDS/eDP modes drm/nouveau/mcp89/mmu: Use mcp77_mmu_new instead of g84_mmu_new on MCP89. drm/amd/display: init res_pool dccg_ref, dchub_ref with xtalin_freq drm/amdgpu/pm: remove check for pp funcs in freq sysfs handlers drm/amd/display: Force uclk to max for every state drm/amdkfd: Remove GWS from process during uninit drm/amd/amdgpu: Fix offset for vmid selection in debugfs interface drm/amd/powerplay: update vega20 driver if to fit latest SMU firmware ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c9
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c19
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c13
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c25
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h12
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c51
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c34
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c8
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/nv.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/psp_v11_0.c52
-rw-r--r--drivers/gpu/drm/amd/amdgpu/psp_v3_1.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/soc15.c14
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi.c1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi_dpm.h32
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c16
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h2
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c3
-rw-r--r--drivers/gpu/drm/amd/display/Kconfig1
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c222
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h25
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c9
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_resource.c45
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc_stream.h1
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn20/Makefile8
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c25
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c12
-rw-r--r--drivers/gpu/drm/amd/display/dc/dsc/Makefile16
-rw-r--r--drivers/gpu/drm/amd/include/amd_shared.h2
-rw-r--r--drivers/gpu/drm/amd/powerplay/amdgpu_smu.c75
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h3
-rw-r--r--drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h6
-rw-r--r--drivers/gpu/drm/amd/powerplay/navi10_ppt.c62
-rw-r--r--drivers/gpu/drm/amd/powerplay/smu_v11_0.c16
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c2
-rw-r--r--drivers/gpu/drm/amd/powerplay/vega20_ppt.c41
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_crtc.c63
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_kms.h18
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h3
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c15
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_plane.c84
-rw-r--r--drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c10
-rw-r--r--drivers/gpu/drm/bochs/bochs.h2
-rw-r--r--drivers/gpu/drm/bochs/bochs_hw.c14
-rw-r--r--drivers/gpu/drm/bochs/bochs_kms.c3
-rw-r--r--drivers/gpu/drm/drm_client_modeset.c3
-rw-r--r--drivers/gpu/drm/drm_connector.c2
-rw-r--r--drivers/gpu/drm/drm_modes.c14
-rw-r--r--drivers/gpu/drm/drm_panel_orientation_quirks.c12
-rw-r--r--drivers/gpu/drm/nouveau/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/dispnv04/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/dispnv04/cursor.c2
-rw-r--r--drivers/gpu/drm/nouveau/dispnv04/disp.h2
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/disp.c9
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/head.c28
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl0002.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl0046.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl006b.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl0080.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl506e.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl506f.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl5070.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl507a.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl507b.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl507c.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl507d.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl507e.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl826e.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl826f.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl906f.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cl9097.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/cla06f.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/class.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/clc36f.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/clc37b.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/clc37e.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/client.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/device.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/driver.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/event.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/if0000.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/if0001.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/if0002.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/if0003.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/if0004.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/if0005.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/ioctl.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/notify.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/object.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/os.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvif/unpack.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/client.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/debug.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/device.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/engine.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/enum.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/event.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/memory.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/mm.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/notify.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/object.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/oproxy.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/option.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/os.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/pci.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/bsp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/ce.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/dma.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/mpeg.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/msenc.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/mspdec.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/msppp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/msvld.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/nvdec.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/nvenc.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/pm.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/sec2.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/sw.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/vic.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/vp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bar.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0203.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0205.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0209.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/P0260.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bit.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bmp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/boost.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/conn.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dcb.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/disp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dp.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/extdev.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/fan.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/gpio.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/i2c.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/iccsense.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/image.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/mxm.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/npde.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pcir.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pll.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/power_budget.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/rammap.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/therm.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/timing.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vmap.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/volt.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vpstate.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/xpio.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/bus.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/ibus.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/mxm.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/pmu.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/vga.h2
-rw-r--r--drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_abi16.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_acpi.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_chan.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c9
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_debugfs.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_dmem.c3
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fence.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_hwmon.c10
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ioctl.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_reg.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_sgdma.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_ttm.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_usif.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_vga.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_vga.h2
-rw-r--r--drivers/gpu/drm/nouveau/nv10_fence.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvif/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/core/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/bsp/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gf100.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gt215.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/ce/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/cipher/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/device/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/device/base.c38
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/head.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c1
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/dma/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/dma/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/dma/user.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv04.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/regsnv04.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv40.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf100.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf117.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk104.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk110.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk208.fuc5.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgm107.fuc5.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf100.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf117.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk104.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk110.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk208.fuc5.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgm107.fuc5.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/os.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/gr/regs.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/mpeg/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/mpeg/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/msenc/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/mspdec/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/mspdec/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/msppp/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/msppp/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/msvld/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/msvld/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/nvdec/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/nvdec/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/nvenc/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/pm/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sec2/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sec2/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sw/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sw/chan.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/sw/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/vic/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/vp/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/falcon/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/falcon/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/falcon/v1.c36
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bar/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bar/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bios/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bus/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bus/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/pll.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/clk/seq.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fault/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramseq.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fb/regsnv04.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fuse/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c20
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ibus/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ibus/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/instmem/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mxm/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/mxm/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/os.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/secboot/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c29
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/timer/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/timer/regsnv04.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/top/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/top/priv.h2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild2
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h2
-rw-r--r--drivers/gpu/drm/selftests/test-drm_cmdline_parser.c136
409 files changed, 1244 insertions, 900 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index f88d8141447c..8199d201b43a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -164,6 +164,7 @@ extern int amdgpu_async_gfx_ring;
164extern int amdgpu_mcbp; 164extern int amdgpu_mcbp;
165extern int amdgpu_discovery; 165extern int amdgpu_discovery;
166extern int amdgpu_mes; 166extern int amdgpu_mes;
167extern int amdgpu_noretry;
167 168
168#ifdef CONFIG_DRM_AMDGPU_SI 169#ifdef CONFIG_DRM_AMDGPU_SI
169extern int amdgpu_si_support; 170extern int amdgpu_si_support;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 20ce158490db..6d54decef7f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -106,10 +106,10 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
106 ssize_t result = 0; 106 ssize_t result = 0;
107 int r; 107 int r;
108 bool pm_pg_lock, use_bank, use_ring; 108 bool pm_pg_lock, use_bank, use_ring;
109 unsigned instance_bank, sh_bank, se_bank, me, pipe, queue; 109 unsigned instance_bank, sh_bank, se_bank, me, pipe, queue, vmid;
110 110
111 pm_pg_lock = use_bank = use_ring = false; 111 pm_pg_lock = use_bank = use_ring = false;
112 instance_bank = sh_bank = se_bank = me = pipe = queue = 0; 112 instance_bank = sh_bank = se_bank = me = pipe = queue = vmid = 0;
113 113
114 if (size & 0x3 || *pos & 0x3 || 114 if (size & 0x3 || *pos & 0x3 ||
115 ((*pos & (1ULL << 62)) && (*pos & (1ULL << 61)))) 115 ((*pos & (1ULL << 62)) && (*pos & (1ULL << 61))))
@@ -135,6 +135,7 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
135 me = (*pos & GENMASK_ULL(33, 24)) >> 24; 135 me = (*pos & GENMASK_ULL(33, 24)) >> 24;
136 pipe = (*pos & GENMASK_ULL(43, 34)) >> 34; 136 pipe = (*pos & GENMASK_ULL(43, 34)) >> 34;
137 queue = (*pos & GENMASK_ULL(53, 44)) >> 44; 137 queue = (*pos & GENMASK_ULL(53, 44)) >> 44;
138 vmid = (*pos & GENMASK_ULL(58, 54)) >> 54;
138 139
139 use_ring = 1; 140 use_ring = 1;
140 } else { 141 } else {
@@ -152,7 +153,7 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
152 sh_bank, instance_bank); 153 sh_bank, instance_bank);
153 } else if (use_ring) { 154 } else if (use_ring) {
154 mutex_lock(&adev->srbm_mutex); 155 mutex_lock(&adev->srbm_mutex);
155 amdgpu_gfx_select_me_pipe_q(adev, me, pipe, queue); 156 amdgpu_gfx_select_me_pipe_q(adev, me, pipe, queue, vmid);
156 } 157 }
157 158
158 if (pm_pg_lock) 159 if (pm_pg_lock)
@@ -185,7 +186,7 @@ end:
185 amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff); 186 amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
186 mutex_unlock(&adev->grbm_idx_mutex); 187 mutex_unlock(&adev->grbm_idx_mutex);
187 } else if (use_ring) { 188 } else if (use_ring) {
188 amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0); 189 amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0, 0);
189 mutex_unlock(&adev->srbm_mutex); 190 mutex_unlock(&adev->srbm_mutex);
190 } 191 }
191 192
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7401bc95c15b..5a7f893cf724 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2537,6 +2537,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
2537 hash_init(adev->mn_hash); 2537 hash_init(adev->mn_hash);
2538 mutex_init(&adev->lock_reset); 2538 mutex_init(&adev->lock_reset);
2539 mutex_init(&adev->virt.dpm_mutex); 2539 mutex_init(&adev->virt.dpm_mutex);
2540 mutex_init(&adev->psp.mutex);
2540 2541
2541 r = amdgpu_device_check_arguments(adev); 2542 r = amdgpu_device_check_arguments(adev);
2542 if (r) 2543 if (r)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
index e049ae6a76fb..1481899f86c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
@@ -123,7 +123,7 @@ static int hw_id_map[MAX_HWIP] = {
123 [UVD_HWIP] = UVD_HWID, 123 [UVD_HWIP] = UVD_HWID,
124 [VCE_HWIP] = VCE_HWID, 124 [VCE_HWIP] = VCE_HWID,
125 [DF_HWIP] = DF_HWID, 125 [DF_HWIP] = DF_HWID,
126 [DCE_HWIP] = DCEAZ_HWID, 126 [DCE_HWIP] = DMU_HWID,
127 [OSSSYS_HWIP] = OSSSYS_HWID, 127 [OSSSYS_HWIP] = OSSSYS_HWID,
128 [SMUIO_HWIP] = SMUIO_HWID, 128 [SMUIO_HWIP] = SMUIO_HWID,
129 [PWR_HWIP] = PWR_HWID, 129 [PWR_HWIP] = PWR_HWID,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 1b0613c7cf95..f2e8b4238efd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -140,8 +140,9 @@ uint amdgpu_smu_memory_pool_size = 0;
140uint amdgpu_dc_feature_mask = 0; 140uint amdgpu_dc_feature_mask = 0;
141int amdgpu_async_gfx_ring = 1; 141int amdgpu_async_gfx_ring = 1;
142int amdgpu_mcbp = 0; 142int amdgpu_mcbp = 0;
143int amdgpu_discovery = 0; 143int amdgpu_discovery = -1;
144int amdgpu_mes = 0; 144int amdgpu_mes = 0;
145int amdgpu_noretry;
145 146
146struct amdgpu_mgpu_info mgpu_info = { 147struct amdgpu_mgpu_info mgpu_info = {
147 .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), 148 .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex),
@@ -593,6 +594,7 @@ module_param_named(mcbp, amdgpu_mcbp, int, 0444);
593/** 594/**
594 * DOC: discovery (int) 595 * DOC: discovery (int)
595 * Allow driver to discover hardware IP information from IP Discovery table at the top of VRAM. 596 * Allow driver to discover hardware IP information from IP Discovery table at the top of VRAM.
597 * (-1 = auto (default), 0 = disabled, 1 = enabled)
596 */ 598 */
597MODULE_PARM_DESC(discovery, 599MODULE_PARM_DESC(discovery,
598 "Allow driver to discover hardware IPs from IP Discovery table at the top of VRAM"); 600 "Allow driver to discover hardware IPs from IP Discovery table at the top of VRAM");
@@ -607,6 +609,10 @@ MODULE_PARM_DESC(mes,
607 "Enable Micro Engine Scheduler (0 = disabled (default), 1 = enabled)"); 609 "Enable Micro Engine Scheduler (0 = disabled (default), 1 = enabled)");
608module_param_named(mes, amdgpu_mes, int, 0444); 610module_param_named(mes, amdgpu_mes, int, 0444);
609 611
612MODULE_PARM_DESC(noretry,
613 "Disable retry faults (0 = retry enabled (default), 1 = retry disabled)");
614module_param_named(noretry, amdgpu_noretry, int, 0644);
615
610#ifdef CONFIG_HSA_AMD 616#ifdef CONFIG_HSA_AMD
611/** 617/**
612 * DOC: sched_policy (int) 618 * DOC: sched_policy (int)
@@ -683,17 +689,6 @@ MODULE_PARM_DESC(ignore_crat,
683 "Ignore CRAT table during KFD initialization (0 = use CRAT (default), 1 = ignore CRAT)"); 689 "Ignore CRAT table during KFD initialization (0 = use CRAT (default), 1 = ignore CRAT)");
684 690
685/** 691/**
686 * DOC: noretry (int)
687 * This parameter sets sh_mem_config.retry_disable. Default value, 0, enables retry.
688 * Setting 1 disables retry.
689 * Retry is needed for recoverable page faults.
690 */
691int noretry;
692module_param(noretry, int, 0644);
693MODULE_PARM_DESC(noretry,
694 "Set sh_mem_config.retry_disable on Vega10 (0 = retry enabled (default), 1 = retry disabled)");
695
696/**
697 * DOC: halt_if_hws_hang (int) 692 * DOC: halt_if_hws_hang (int)
698 * Halt if HWS hang is detected. Default value, 0, disables the halt on hang. 693 * Halt if HWS hang is detected. Default value, 0, disables the halt on hang.
699 * Setting 1 enables halt on hang. 694 * Setting 1 enables halt on hang.
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index f96407ba9770..1199b5828b90 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -195,7 +195,7 @@ struct amdgpu_gfx_funcs {
195 uint32_t wave, uint32_t start, uint32_t size, 195 uint32_t wave, uint32_t start, uint32_t size,
196 uint32_t *dst); 196 uint32_t *dst);
197 void (*select_me_pipe_q)(struct amdgpu_device *adev, u32 me, u32 pipe, 197 void (*select_me_pipe_q)(struct amdgpu_device *adev, u32 me, u32 pipe,
198 u32 queue); 198 u32 queue, u32 vmid);
199}; 199};
200 200
201struct amdgpu_ngg_buf { 201struct amdgpu_ngg_buf {
@@ -327,7 +327,7 @@ struct amdgpu_gfx {
327 327
328#define amdgpu_gfx_get_gpu_clock_counter(adev) (adev)->gfx.funcs->get_gpu_clock_counter((adev)) 328#define amdgpu_gfx_get_gpu_clock_counter(adev) (adev)->gfx.funcs->get_gpu_clock_counter((adev))
329#define amdgpu_gfx_select_se_sh(adev, se, sh, instance) (adev)->gfx.funcs->select_se_sh((adev), (se), (sh), (instance)) 329#define amdgpu_gfx_select_se_sh(adev, se, sh, instance) (adev)->gfx.funcs->select_se_sh((adev), (se), (sh), (instance))
330#define amdgpu_gfx_select_me_pipe_q(adev, me, pipe, q) (adev)->gfx.funcs->select_me_pipe_q((adev), (me), (pipe), (q)) 330#define amdgpu_gfx_select_me_pipe_q(adev, me, pipe, q, vmid) (adev)->gfx.funcs->select_me_pipe_q((adev), (me), (pipe), (q), (vmid))
331 331
332/** 332/**
333 * amdgpu_gfx_create_bitmask - create a bitmask 333 * amdgpu_gfx_create_bitmask - create a bitmask
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 193d53720d9b..8b7efd0a7028 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -2077,11 +2077,6 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev,
2077 (ddev->switch_power_state != DRM_SWITCH_POWER_ON)) 2077 (ddev->switch_power_state != DRM_SWITCH_POWER_ON))
2078 return -EINVAL; 2078 return -EINVAL;
2079 2079
2080 /* sanity check PP is enabled */
2081 if (!(adev->powerplay.pp_funcs &&
2082 adev->powerplay.pp_funcs->read_sensor))
2083 return -EINVAL;
2084
2085 /* get the sclk */ 2080 /* get the sclk */
2086 r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_SCLK, 2081 r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_SCLK,
2087 (void *)&sclk, &size); 2082 (void *)&sclk, &size);
@@ -2112,11 +2107,6 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev,
2112 (ddev->switch_power_state != DRM_SWITCH_POWER_ON)) 2107 (ddev->switch_power_state != DRM_SWITCH_POWER_ON))
2113 return -EINVAL; 2108 return -EINVAL;
2114 2109
2115 /* sanity check PP is enabled */
2116 if (!(adev->powerplay.pp_funcs &&
2117 adev->powerplay.pp_funcs->read_sensor))
2118 return -EINVAL;
2119
2120 /* get the sclk */ 2110 /* get the sclk */
2121 r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_MCLK, 2111 r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_MCLK,
2122 (void *)&mclk, &size); 2112 (void *)&mclk, &size);
@@ -2996,13 +2986,10 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
2996 } 2986 }
2997 2987
2998 if (is_support_sw_smu(adev)) { 2988 if (is_support_sw_smu(adev)) {
2999 struct smu_context *smu = &adev->smu;
3000 struct smu_dpm_context *smu_dpm = &adev->smu.smu_dpm; 2989 struct smu_dpm_context *smu_dpm = &adev->smu.smu_dpm;
3001 mutex_lock(&(smu->mutex));
3002 smu_handle_task(&adev->smu, 2990 smu_handle_task(&adev->smu,
3003 smu_dpm->dpm_level, 2991 smu_dpm->dpm_level,
3004 AMD_PP_TASK_DISPLAY_CONFIG_CHANGE); 2992 AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
3005 mutex_unlock(&(smu->mutex));
3006 } else { 2993 } else {
3007 if (adev->powerplay.pp_funcs->dispatch_tasks) { 2994 if (adev->powerplay.pp_funcs->dispatch_tasks) {
3008 if (!amdgpu_device_has_dc_support(adev)) { 2995 if (!amdgpu_device_has_dc_support(adev)) {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index e69ad6e089c5..c027e5e7713e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -130,6 +130,8 @@ psp_cmd_submit_buf(struct psp_context *psp,
130 int index; 130 int index;
131 int timeout = 2000; 131 int timeout = 2000;
132 132
133 mutex_lock(&psp->mutex);
134
133 memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE); 135 memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);
134 136
135 memcpy(psp->cmd_buf_mem, cmd, sizeof(struct psp_gfx_cmd_resp)); 137 memcpy(psp->cmd_buf_mem, cmd, sizeof(struct psp_gfx_cmd_resp));
@@ -139,6 +141,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
139 fence_mc_addr, index); 141 fence_mc_addr, index);
140 if (ret) { 142 if (ret) {
141 atomic_dec(&psp->fence_value); 143 atomic_dec(&psp->fence_value);
144 mutex_unlock(&psp->mutex);
142 return ret; 145 return ret;
143 } 146 }
144 147
@@ -161,8 +164,10 @@ psp_cmd_submit_buf(struct psp_context *psp,
161 ucode->ucode_id); 164 ucode->ucode_id);
162 DRM_WARN("psp command failed and response status is (%d)\n", 165 DRM_WARN("psp command failed and response status is (%d)\n",
163 psp->cmd_buf_mem->resp.status); 166 psp->cmd_buf_mem->resp.status);
164 if (!timeout) 167 if (!timeout) {
168 mutex_unlock(&psp->mutex);
165 return -EINVAL; 169 return -EINVAL;
170 }
166 } 171 }
167 172
168 /* get xGMI session id from response buffer */ 173 /* get xGMI session id from response buffer */
@@ -172,6 +177,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
172 ucode->tmr_mc_addr_lo = psp->cmd_buf_mem->resp.fw_addr_lo; 177 ucode->tmr_mc_addr_lo = psp->cmd_buf_mem->resp.fw_addr_lo;
173 ucode->tmr_mc_addr_hi = psp->cmd_buf_mem->resp.fw_addr_hi; 178 ucode->tmr_mc_addr_hi = psp->cmd_buf_mem->resp.fw_addr_hi;
174 } 179 }
180 mutex_unlock(&psp->mutex);
175 181
176 return ret; 182 return ret;
177} 183}
@@ -763,6 +769,15 @@ static int psp_hw_start(struct psp_context *psp)
763 int ret; 769 int ret;
764 770
765 if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) { 771 if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
772 if (psp->kdb_bin_size &&
773 (psp->funcs->bootloader_load_kdb != NULL)) {
774 ret = psp_bootloader_load_kdb(psp);
775 if (ret) {
776 DRM_ERROR("PSP load kdb failed!\n");
777 return ret;
778 }
779 }
780
766 ret = psp_bootloader_load_sysdrv(psp); 781 ret = psp_bootloader_load_sysdrv(psp);
767 if (ret) { 782 if (ret) {
768 DRM_ERROR("PSP load sysdrv failed!\n"); 783 DRM_ERROR("PSP load sysdrv failed!\n");
@@ -1188,10 +1203,16 @@ failed:
1188 1203
1189int psp_gpu_reset(struct amdgpu_device *adev) 1204int psp_gpu_reset(struct amdgpu_device *adev)
1190{ 1205{
1206 int ret;
1207
1191 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) 1208 if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
1192 return 0; 1209 return 0;
1193 1210
1194 return psp_mode1_reset(&adev->psp); 1211 mutex_lock(&adev->psp.mutex);
1212 ret = psp_mode1_reset(&adev->psp);
1213 mutex_unlock(&adev->psp.mutex);
1214
1215 return ret;
1195} 1216}
1196 1217
1197int psp_rlc_autoload_start(struct psp_context *psp) 1218int psp_rlc_autoload_start(struct psp_context *psp)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
index 6039acc84346..e0fc2a790e53 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
@@ -42,6 +42,12 @@ struct psp_context;
42struct psp_xgmi_node_info; 42struct psp_xgmi_node_info;
43struct psp_xgmi_topology_info; 43struct psp_xgmi_topology_info;
44 44
45enum psp_bootloader_cmd {
46 PSP_BL__LOAD_SYSDRV = 0x10000,
47 PSP_BL__LOAD_SOSDRV = 0x20000,
48 PSP_BL__LOAD_KEY_DATABASE = 0x80000,
49};
50
45enum psp_ring_type 51enum psp_ring_type
46{ 52{
47 PSP_RING_TYPE__INVALID = 0, 53 PSP_RING_TYPE__INVALID = 0,
@@ -73,6 +79,7 @@ enum psp_reg_prog_id {
73struct psp_funcs 79struct psp_funcs
74{ 80{
75 int (*init_microcode)(struct psp_context *psp); 81 int (*init_microcode)(struct psp_context *psp);
82 int (*bootloader_load_kdb)(struct psp_context *psp);
76 int (*bootloader_load_sysdrv)(struct psp_context *psp); 83 int (*bootloader_load_sysdrv)(struct psp_context *psp);
77 int (*bootloader_load_sos)(struct psp_context *psp); 84 int (*bootloader_load_sos)(struct psp_context *psp);
78 int (*ring_init)(struct psp_context *psp, enum psp_ring_type ring_type); 85 int (*ring_init)(struct psp_context *psp, enum psp_ring_type ring_type);
@@ -156,9 +163,11 @@ struct psp_context
156 uint32_t sys_bin_size; 163 uint32_t sys_bin_size;
157 uint32_t sos_bin_size; 164 uint32_t sos_bin_size;
158 uint32_t toc_bin_size; 165 uint32_t toc_bin_size;
166 uint32_t kdb_bin_size;
159 uint8_t *sys_start_addr; 167 uint8_t *sys_start_addr;
160 uint8_t *sos_start_addr; 168 uint8_t *sos_start_addr;
161 uint8_t *toc_start_addr; 169 uint8_t *toc_start_addr;
170 uint8_t *kdb_start_addr;
162 171
163 /* tmr buffer */ 172 /* tmr buffer */
164 struct amdgpu_bo *tmr_bo; 173 struct amdgpu_bo *tmr_bo;
@@ -201,6 +210,7 @@ struct psp_context
201 uint8_t *ta_ras_start_addr; 210 uint8_t *ta_ras_start_addr;
202 struct psp_xgmi_context xgmi_context; 211 struct psp_xgmi_context xgmi_context;
203 struct psp_ras_context ras; 212 struct psp_ras_context ras;
213 struct mutex mutex;
204}; 214};
205 215
206struct amdgpu_psp_funcs { 216struct amdgpu_psp_funcs {
@@ -219,6 +229,8 @@ struct amdgpu_psp_funcs {
219 (psp)->funcs->compare_sram_data((psp), (ucode), (type)) 229 (psp)->funcs->compare_sram_data((psp), (ucode), (type))
220#define psp_init_microcode(psp) \ 230#define psp_init_microcode(psp) \
221 ((psp)->funcs->init_microcode ? (psp)->funcs->init_microcode((psp)) : 0) 231 ((psp)->funcs->init_microcode ? (psp)->funcs->init_microcode((psp)) : 0)
232#define psp_bootloader_load_kdb(psp) \
233 ((psp)->funcs->bootloader_load_kdb ? (psp)->funcs->bootloader_load_kdb((psp)) : 0)
222#define psp_bootloader_load_sysdrv(psp) \ 234#define psp_bootloader_load_sysdrv(psp) \
223 ((psp)->funcs->bootloader_load_sysdrv ? (psp)->funcs->bootloader_load_sysdrv((psp)) : 0) 235 ((psp)->funcs->bootloader_load_sysdrv ? (psp)->funcs->bootloader_load_sysdrv((psp)) : 0)
224#define psp_bootloader_load_sos(psp) \ 236#define psp_bootloader_load_sos(psp) \
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 5c05644b9b96..e51b48ac48eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -391,6 +391,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
391 src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm, 391 src_node_start = amdgpu_mm_node_addr(src->bo, ++src_mm,
392 src->mem); 392 src->mem);
393 src_node_size = (src_mm->size << PAGE_SHIFT); 393 src_node_size = (src_mm->size << PAGE_SHIFT);
394 src_page_offset = 0;
394 } else { 395 } else {
395 src_node_start += cur_size; 396 src_node_start += cur_size;
396 src_page_offset = src_node_start & (PAGE_SIZE - 1); 397 src_page_offset = src_node_start & (PAGE_SIZE - 1);
@@ -400,6 +401,7 @@ int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
400 dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm, 401 dst_node_start = amdgpu_mm_node_addr(dst->bo, ++dst_mm,
401 dst->mem); 402 dst->mem);
402 dst_node_size = (dst_mm->size << PAGE_SHIFT); 403 dst_node_size = (dst_mm->size << PAGE_SHIFT);
404 dst_page_offset = 0;
403 } else { 405 } else {
404 dst_node_start += cur_size; 406 dst_node_start += cur_size;
405 dst_page_offset = dst_node_start & (PAGE_SIZE - 1); 407 dst_page_offset = dst_node_start & (PAGE_SIZE - 1);
@@ -487,6 +489,7 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
487 placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; 489 placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
488 r = ttm_bo_mem_space(bo, &placement, &tmp_mem, ctx); 490 r = ttm_bo_mem_space(bo, &placement, &tmp_mem, ctx);
489 if (unlikely(r)) { 491 if (unlikely(r)) {
492 pr_err("Failed to find GTT space for blit from VRAM\n");
490 return r; 493 return r;
491 } 494 }
492 495
@@ -545,6 +548,7 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
545 placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT; 548 placements.flags = TTM_PL_MASK_CACHING | TTM_PL_FLAG_TT;
546 r = ttm_bo_mem_space(bo, &placement, &tmp_mem, ctx); 549 r = ttm_bo_mem_space(bo, &placement, &tmp_mem, ctx);
547 if (unlikely(r)) { 550 if (unlikely(r)) {
551 pr_err("Failed to find GTT space for blit to VRAM\n");
548 return r; 552 return r;
549 } 553 }
550 554
@@ -565,6 +569,30 @@ out_cleanup:
565} 569}
566 570
567/** 571/**
572 * amdgpu_mem_visible - Check that memory can be accessed by ttm_bo_move_memcpy
573 *
574 * Called by amdgpu_bo_move()
575 */
576static bool amdgpu_mem_visible(struct amdgpu_device *adev,
577 struct ttm_mem_reg *mem)
578{
579 struct drm_mm_node *nodes = mem->mm_node;
580
581 if (mem->mem_type == TTM_PL_SYSTEM ||
582 mem->mem_type == TTM_PL_TT)
583 return true;
584 if (mem->mem_type != TTM_PL_VRAM)
585 return false;
586
587 /* ttm_mem_reg_ioremap only supports contiguous memory */
588 if (nodes->size != mem->num_pages)
589 return false;
590
591 return ((nodes->start + nodes->size) << PAGE_SHIFT)
592 <= adev->gmc.visible_vram_size;
593}
594
595/**
568 * amdgpu_bo_move - Move a buffer object to a new memory location 596 * amdgpu_bo_move - Move a buffer object to a new memory location
569 * 597 *
570 * Called by ttm_bo_handle_move_mem() 598 * Called by ttm_bo_handle_move_mem()
@@ -608,8 +636,10 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
608 return 0; 636 return 0;
609 } 637 }
610 638
611 if (!adev->mman.buffer_funcs_enabled) 639 if (!adev->mman.buffer_funcs_enabled) {
640 r = -ENODEV;
612 goto memcpy; 641 goto memcpy;
642 }
613 643
614 if (old_mem->mem_type == TTM_PL_VRAM && 644 if (old_mem->mem_type == TTM_PL_VRAM &&
615 new_mem->mem_type == TTM_PL_SYSTEM) { 645 new_mem->mem_type == TTM_PL_SYSTEM) {
@@ -624,10 +654,16 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
624 654
625 if (r) { 655 if (r) {
626memcpy: 656memcpy:
627 r = ttm_bo_move_memcpy(bo, ctx, new_mem); 657 /* Check that all memory is CPU accessible */
628 if (r) { 658 if (!amdgpu_mem_visible(adev, old_mem) ||
659 !amdgpu_mem_visible(adev, new_mem)) {
660 pr_err("Move buffer fallback to memcpy unavailable\n");
629 return r; 661 return r;
630 } 662 }
663
664 r = ttm_bo_move_memcpy(bo, ctx, new_mem);
665 if (r)
666 return r;
631 } 667 }
632 668
633 if (bo->type == ttm_bo_type_device && 669 if (bo->type == ttm_bo_type_device &&
@@ -2059,9 +2095,9 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
2059 mm_node = bo->tbo.mem.mm_node; 2095 mm_node = bo->tbo.mem.mm_node;
2060 num_loops = 0; 2096 num_loops = 0;
2061 while (num_pages) { 2097 while (num_pages) {
2062 uint32_t byte_count = mm_node->size << PAGE_SHIFT; 2098 uint64_t byte_count = mm_node->size << PAGE_SHIFT;
2063 2099
2064 num_loops += DIV_ROUND_UP(byte_count, max_bytes); 2100 num_loops += DIV_ROUND_UP_ULL(byte_count, max_bytes);
2065 num_pages -= mm_node->size; 2101 num_pages -= mm_node->size;
2066 ++mm_node; 2102 ++mm_node;
2067 } 2103 }
@@ -2087,12 +2123,13 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
2087 mm_node = bo->tbo.mem.mm_node; 2123 mm_node = bo->tbo.mem.mm_node;
2088 2124
2089 while (num_pages) { 2125 while (num_pages) {
2090 uint32_t byte_count = mm_node->size << PAGE_SHIFT; 2126 uint64_t byte_count = mm_node->size << PAGE_SHIFT;
2091 uint64_t dst_addr; 2127 uint64_t dst_addr;
2092 2128
2093 dst_addr = amdgpu_mm_node_addr(&bo->tbo, mm_node, &bo->tbo.mem); 2129 dst_addr = amdgpu_mm_node_addr(&bo->tbo, mm_node, &bo->tbo.mem);
2094 while (byte_count) { 2130 while (byte_count) {
2095 uint32_t cur_size_in_bytes = min(byte_count, max_bytes); 2131 uint32_t cur_size_in_bytes = min_t(uint64_t, byte_count,
2132 max_bytes);
2096 2133
2097 amdgpu_emit_fill_buffer(adev, &job->ibs[0], src_data, 2134 amdgpu_emit_fill_buffer(adev, &job->ibs[0], src_data,
2098 dst_addr, cur_size_in_bytes); 2135 dst_addr, cur_size_in_bytes);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
index c352a519ddd4..bfaa0eac3213 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c
@@ -262,6 +262,12 @@ void amdgpu_ucode_print_psp_hdr(const struct common_firmware_header *hdr)
262 le32_to_cpu(psp_hdr_v1_1->toc_offset_bytes)); 262 le32_to_cpu(psp_hdr_v1_1->toc_offset_bytes));
263 DRM_DEBUG("toc_size_bytes: %u\n", 263 DRM_DEBUG("toc_size_bytes: %u\n",
264 le32_to_cpu(psp_hdr_v1_1->toc_size_bytes)); 264 le32_to_cpu(psp_hdr_v1_1->toc_size_bytes));
265 DRM_DEBUG("kdb_header_version: %u\n",
266 le32_to_cpu(psp_hdr_v1_1->kdb_header_version));
267 DRM_DEBUG("kdb_offset_bytes: %u\n",
268 le32_to_cpu(psp_hdr_v1_1->kdb_offset_bytes));
269 DRM_DEBUG("kdb_size_bytes: %u\n",
270 le32_to_cpu(psp_hdr_v1_1->kdb_size_bytes));
265 } 271 }
266 } else { 272 } else {
267 DRM_ERROR("Unknown PSP ucode version: %u.%u\n", 273 DRM_ERROR("Unknown PSP ucode version: %u.%u\n",
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
index f46944453c6e..c1fb6dc86440 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
@@ -85,6 +85,9 @@ struct psp_firmware_header_v1_1 {
85 uint32_t toc_header_version; 85 uint32_t toc_header_version;
86 uint32_t toc_offset_bytes; 86 uint32_t toc_offset_bytes;
87 uint32_t toc_size_bytes; 87 uint32_t toc_size_bytes;
88 uint32_t kdb_header_version;
89 uint32_t kdb_offset_bytes;
90 uint32_t kdb_size_bytes;
88}; 91};
89 92
90/* version_major=1, version_minor=0 */ 93/* version_major=1, version_minor=0 */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 07a7e3820b7b..59dd204498c5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -390,7 +390,8 @@ static uint32_t parse_clk(char *buf, bool min)
390 if (!ptr) 390 if (!ptr)
391 break; 391 break;
392 ptr+=2; 392 ptr+=2;
393 clk = simple_strtoul(ptr, NULL, 10); 393 if (kstrtou32(ptr, 10, &clk))
394 return 0;
394 } while (!min); 395 } while (!min);
395 396
396 return clk * 100; 397 return clk * 100;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
index ee41d5592c51..1675d5837c3c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
@@ -109,6 +109,13 @@ static const struct soc15_reg_golden golden_settings_gc_10_0_nv10[] =
109 /* Pending on emulation bring up */ 109 /* Pending on emulation bring up */
110}; 110};
111 111
112#define DEFAULT_SH_MEM_CONFIG \
113 ((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
114 (SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
115 (SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \
116 (3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))
117
118
112static void gfx_v10_0_set_ring_funcs(struct amdgpu_device *adev); 119static void gfx_v10_0_set_ring_funcs(struct amdgpu_device *adev);
113static void gfx_v10_0_set_irq_funcs(struct amdgpu_device *adev); 120static void gfx_v10_0_set_irq_funcs(struct amdgpu_device *adev);
114static void gfx_v10_0_set_gds_init(struct amdgpu_device *adev); 121static void gfx_v10_0_set_gds_init(struct amdgpu_device *adev);
@@ -995,6 +1002,12 @@ static void gfx_v10_0_read_wave_vgprs(struct amdgpu_device *adev, uint32_t simd,
995 start + SQIND_WAVE_VGPRS_OFFSET, size, dst); 1002 start + SQIND_WAVE_VGPRS_OFFSET, size, dst);
996} 1003}
997 1004
1005static void gfx_v10_0_select_me_pipe_q(struct amdgpu_device *adev,
1006 u32 me, u32 pipe, u32 q, u32 vm)
1007 {
1008 nv_grbm_select(adev, me, pipe, q, vm);
1009 }
1010
998 1011
999static const struct amdgpu_gfx_funcs gfx_v10_0_gfx_funcs = { 1012static const struct amdgpu_gfx_funcs gfx_v10_0_gfx_funcs = {
1000 .get_gpu_clock_counter = &gfx_v10_0_get_gpu_clock_counter, 1013 .get_gpu_clock_counter = &gfx_v10_0_get_gpu_clock_counter,
@@ -1002,6 +1015,7 @@ static const struct amdgpu_gfx_funcs gfx_v10_0_gfx_funcs = {
1002 .read_wave_data = &gfx_v10_0_read_wave_data, 1015 .read_wave_data = &gfx_v10_0_read_wave_data,
1003 .read_wave_sgprs = &gfx_v10_0_read_wave_sgprs, 1016 .read_wave_sgprs = &gfx_v10_0_read_wave_sgprs,
1004 .read_wave_vgprs = &gfx_v10_0_read_wave_vgprs, 1017 .read_wave_vgprs = &gfx_v10_0_read_wave_vgprs,
1018 .select_me_pipe_q = &gfx_v10_0_select_me_pipe_q,
1005}; 1019};
1006 1020
1007static void gfx_v10_0_gpu_early_init(struct amdgpu_device *adev) 1021static void gfx_v10_0_gpu_early_init(struct amdgpu_device *adev)
@@ -1408,7 +1422,6 @@ static u32 gfx_v10_0_init_pa_sc_tile_steering_override(struct amdgpu_device *ade
1408static void gfx_v10_0_init_compute_vmid(struct amdgpu_device *adev) 1422static void gfx_v10_0_init_compute_vmid(struct amdgpu_device *adev)
1409{ 1423{
1410 int i; 1424 int i;
1411 uint32_t sh_mem_config;
1412 uint32_t sh_mem_bases; 1425 uint32_t sh_mem_bases;
1413 1426
1414 /* 1427 /*
@@ -1419,15 +1432,11 @@ static void gfx_v10_0_init_compute_vmid(struct amdgpu_device *adev)
1419 */ 1432 */
1420 sh_mem_bases = DEFAULT_SH_MEM_BASES | (DEFAULT_SH_MEM_BASES << 16); 1433 sh_mem_bases = DEFAULT_SH_MEM_BASES | (DEFAULT_SH_MEM_BASES << 16);
1421 1434
1422 sh_mem_config = SH_MEM_ADDRESS_MODE_64 |
1423 SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
1424 SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT;
1425
1426 mutex_lock(&adev->srbm_mutex); 1435 mutex_lock(&adev->srbm_mutex);
1427 for (i = FIRST_COMPUTE_VMID; i < LAST_COMPUTE_VMID; i++) { 1436 for (i = FIRST_COMPUTE_VMID; i < LAST_COMPUTE_VMID; i++) {
1428 nv_grbm_select(adev, 0, 0, 0, i); 1437 nv_grbm_select(adev, 0, 0, 0, i);
1429 /* CP and shaders */ 1438 /* CP and shaders */
1430 WREG32_SOC15(GC, 0, mmSH_MEM_CONFIG, sh_mem_config); 1439 WREG32_SOC15(GC, 0, mmSH_MEM_CONFIG, DEFAULT_SH_MEM_CONFIG);
1431 WREG32_SOC15(GC, 0, mmSH_MEM_BASES, sh_mem_bases); 1440 WREG32_SOC15(GC, 0, mmSH_MEM_BASES, sh_mem_bases);
1432 } 1441 }
1433 nv_grbm_select(adev, 0, 0, 0, 0); 1442 nv_grbm_select(adev, 0, 0, 0, 0);
@@ -1520,17 +1529,8 @@ static void gfx_v10_0_constants_init(struct amdgpu_device *adev)
1520 for (i = 0; i < adev->vm_manager.id_mgr[AMDGPU_GFXHUB].num_ids; i++) { 1529 for (i = 0; i < adev->vm_manager.id_mgr[AMDGPU_GFXHUB].num_ids; i++) {
1521 nv_grbm_select(adev, 0, 0, 0, i); 1530 nv_grbm_select(adev, 0, 0, 0, i);
1522 /* CP and shaders */ 1531 /* CP and shaders */
1523 if (i == 0) { 1532 WREG32_SOC15(GC, 0, mmSH_MEM_CONFIG, DEFAULT_SH_MEM_CONFIG);
1524 tmp = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE, 1533 if (i != 0) {
1525 SH_MEM_ALIGNMENT_MODE_UNALIGNED);
1526 tmp = REG_SET_FIELD(tmp, SH_MEM_CONFIG, RETRY_MODE, 0);
1527 WREG32_SOC15(GC, 0, mmSH_MEM_CONFIG, tmp);
1528 WREG32_SOC15(GC, 0, mmSH_MEM_BASES, 0);
1529 } else {
1530 tmp = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE,
1531 SH_MEM_ALIGNMENT_MODE_UNALIGNED);
1532 tmp = REG_SET_FIELD(tmp, SH_MEM_CONFIG, RETRY_MODE, 0);
1533 WREG32_SOC15(GC, 0, mmSH_MEM_CONFIG, tmp);
1534 tmp = REG_SET_FIELD(0, SH_MEM_BASES, PRIVATE_BASE, 1534 tmp = REG_SET_FIELD(0, SH_MEM_BASES, PRIVATE_BASE,
1535 (adev->gmc.private_aperture_start >> 48)); 1535 (adev->gmc.private_aperture_start >> 48));
1536 tmp = REG_SET_FIELD(tmp, SH_MEM_BASES, SHARED_BASE, 1536 tmp = REG_SET_FIELD(tmp, SH_MEM_BASES, SHARED_BASE,
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index 789e900905e9..7f0a63628c43 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -3043,7 +3043,7 @@ static void gfx_v6_0_read_wave_sgprs(struct amdgpu_device *adev, uint32_t simd,
3043} 3043}
3044 3044
3045static void gfx_v6_0_select_me_pipe_q(struct amdgpu_device *adev, 3045static void gfx_v6_0_select_me_pipe_q(struct amdgpu_device *adev,
3046 u32 me, u32 pipe, u32 q) 3046 u32 me, u32 pipe, u32 q, u32 vm)
3047{ 3047{
3048 DRM_INFO("Not implemented\n"); 3048 DRM_INFO("Not implemented\n");
3049} 3049}
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 341b5024e598..0db9f488da7e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -4169,9 +4169,9 @@ static void gfx_v7_0_read_wave_sgprs(struct amdgpu_device *adev, uint32_t simd,
4169} 4169}
4170 4170
4171static void gfx_v7_0_select_me_pipe_q(struct amdgpu_device *adev, 4171static void gfx_v7_0_select_me_pipe_q(struct amdgpu_device *adev,
4172 u32 me, u32 pipe, u32 q) 4172 u32 me, u32 pipe, u32 q, u32 vm)
4173{ 4173{
4174 cik_srbm_select(adev, me, pipe, q, 0); 4174 cik_srbm_select(adev, me, pipe, q, vm);
4175} 4175}
4176 4176
4177static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = { 4177static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 032e76dbc51f..5f401b41ef7c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -3436,9 +3436,9 @@ static void gfx_v8_0_select_se_sh(struct amdgpu_device *adev,
3436} 3436}
3437 3437
3438static void gfx_v8_0_select_me_pipe_q(struct amdgpu_device *adev, 3438static void gfx_v8_0_select_me_pipe_q(struct amdgpu_device *adev,
3439 u32 me, u32 pipe, u32 q) 3439 u32 me, u32 pipe, u32 q, u32 vm)
3440{ 3440{
3441 vi_srbm_select(adev, me, pipe, q, 0); 3441 vi_srbm_select(adev, me, pipe, q, vm);
3442} 3442}
3443 3443
3444static u32 gfx_v8_0_get_rb_active_bitmap(struct amdgpu_device *adev) 3444static u32 gfx_v8_0_get_rb_active_bitmap(struct amdgpu_device *adev)
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 5ba332376710..f4c4eea62526 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -1313,9 +1313,9 @@ static void gfx_v9_0_read_wave_vgprs(struct amdgpu_device *adev, uint32_t simd,
1313} 1313}
1314 1314
1315static void gfx_v9_0_select_me_pipe_q(struct amdgpu_device *adev, 1315static void gfx_v9_0_select_me_pipe_q(struct amdgpu_device *adev,
1316 u32 me, u32 pipe, u32 q) 1316 u32 me, u32 pipe, u32 q, u32 vm)
1317{ 1317{
1318 soc15_grbm_select(adev, me, pipe, q, 0); 1318 soc15_grbm_select(adev, me, pipe, q, vm);
1319} 1319}
1320 1320
1321static const struct amdgpu_gfx_funcs gfx_v9_0_gfx_funcs = { 1321static const struct amdgpu_gfx_funcs gfx_v9_0_gfx_funcs = {
@@ -1942,11 +1942,15 @@ static void gfx_v9_0_constants_init(struct amdgpu_device *adev)
1942 if (i == 0) { 1942 if (i == 0) {
1943 tmp = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE, 1943 tmp = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE,
1944 SH_MEM_ALIGNMENT_MODE_UNALIGNED); 1944 SH_MEM_ALIGNMENT_MODE_UNALIGNED);
1945 tmp = REG_SET_FIELD(tmp, SH_MEM_CONFIG, RETRY_DISABLE,
1946 !!amdgpu_noretry);
1945 WREG32_SOC15_RLC(GC, 0, mmSH_MEM_CONFIG, tmp); 1947 WREG32_SOC15_RLC(GC, 0, mmSH_MEM_CONFIG, tmp);
1946 WREG32_SOC15_RLC(GC, 0, mmSH_MEM_BASES, 0); 1948 WREG32_SOC15_RLC(GC, 0, mmSH_MEM_BASES, 0);
1947 } else { 1949 } else {
1948 tmp = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE, 1950 tmp = REG_SET_FIELD(0, SH_MEM_CONFIG, ALIGNMENT_MODE,
1949 SH_MEM_ALIGNMENT_MODE_UNALIGNED); 1951 SH_MEM_ALIGNMENT_MODE_UNALIGNED);
1952 tmp = REG_SET_FIELD(tmp, SH_MEM_CONFIG, RETRY_DISABLE,
1953 !!amdgpu_noretry);
1950 WREG32_SOC15_RLC(GC, 0, mmSH_MEM_CONFIG, tmp); 1954 WREG32_SOC15_RLC(GC, 0, mmSH_MEM_CONFIG, tmp);
1951 tmp = REG_SET_FIELD(0, SH_MEM_BASES, PRIVATE_BASE, 1955 tmp = REG_SET_FIELD(0, SH_MEM_BASES, PRIVATE_BASE,
1952 (adev->gmc.private_aperture_start >> 48)); 1956 (adev->gmc.private_aperture_start >> 48));
diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
index 9f0f189fc111..15986748f59f 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
@@ -236,7 +236,8 @@ static void gfxhub_v1_0_setup_vmid_config(struct amdgpu_device *adev)
236 block_size); 236 block_size);
237 /* Send no-retry XNACK on fault to suppress VM fault storm. */ 237 /* Send no-retry XNACK on fault to suppress VM fault storm. */
238 tmp = REG_SET_FIELD(tmp, VM_CONTEXT1_CNTL, 238 tmp = REG_SET_FIELD(tmp, VM_CONTEXT1_CNTL,
239 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT, 1); 239 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
240 !amdgpu_noretry);
240 WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT1_CNTL, i, tmp); 241 WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT1_CNTL, i, tmp);
241 WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0); 242 WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0);
242 WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0); 243 WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0);
diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c
index b7de60a15623..d605b4963f8a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c
@@ -215,7 +215,8 @@ static void gfxhub_v2_0_setup_vmid_config(struct amdgpu_device *adev)
215 adev->vm_manager.block_size - 9); 215 adev->vm_manager.block_size - 9);
216 /* Send no-retry XNACK on fault to suppress VM fault storm. */ 216 /* Send no-retry XNACK on fault to suppress VM fault storm. */
217 tmp = REG_SET_FIELD(tmp, GCVM_CONTEXT1_CNTL, 217 tmp = REG_SET_FIELD(tmp, GCVM_CONTEXT1_CNTL,
218 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT, 0); 218 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
219 !amdgpu_noretry);
219 WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT1_CNTL, i, tmp); 220 WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT1_CNTL, i, tmp);
220 WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0); 221 WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0);
221 WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0); 222 WREG32_SOC15_OFFSET(GC, 0, mmGCVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0);
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
index 05d1d448c8f5..dc5ce03034d3 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
@@ -265,7 +265,8 @@ static void mmhub_v1_0_setup_vmid_config(struct amdgpu_device *adev)
265 block_size); 265 block_size);
266 /* Send no-retry XNACK on fault to suppress VM fault storm. */ 266 /* Send no-retry XNACK on fault to suppress VM fault storm. */
267 tmp = REG_SET_FIELD(tmp, VM_CONTEXT1_CNTL, 267 tmp = REG_SET_FIELD(tmp, VM_CONTEXT1_CNTL,
268 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT, 1); 268 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
269 !amdgpu_noretry);
269 WREG32_SOC15_OFFSET(MMHUB, 0, mmVM_CONTEXT1_CNTL, i, tmp); 270 WREG32_SOC15_OFFSET(MMHUB, 0, mmVM_CONTEXT1_CNTL, i, tmp);
270 WREG32_SOC15_OFFSET(MMHUB, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0); 271 WREG32_SOC15_OFFSET(MMHUB, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0);
271 WREG32_SOC15_OFFSET(MMHUB, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0); 272 WREG32_SOC15_OFFSET(MMHUB, 0, mmVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0);
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
index 37a1a318ae63..0f9549f19ade 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c
@@ -205,7 +205,8 @@ static void mmhub_v2_0_setup_vmid_config(struct amdgpu_device *adev)
205 adev->vm_manager.block_size - 9); 205 adev->vm_manager.block_size - 9);
206 /* Send no-retry XNACK on fault to suppress VM fault storm. */ 206 /* Send no-retry XNACK on fault to suppress VM fault storm. */
207 tmp = REG_SET_FIELD(tmp, MMVM_CONTEXT1_CNTL, 207 tmp = REG_SET_FIELD(tmp, MMVM_CONTEXT1_CNTL,
208 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT, 0); 208 RETRY_PERMISSION_OR_INVALID_PAGE_FAULT,
209 !amdgpu_noretry);
209 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_CNTL, i, tmp); 210 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_CNTL, i, tmp);
210 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0); 211 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32, i*2, 0);
211 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0); 212 WREG32_SOC15_OFFSET(MMHUB, 0, mmMMVM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32, i*2, 0);
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index ad430cbcd72f..662612f89c70 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -392,8 +392,6 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
392#if defined(CONFIG_DRM_AMD_DC) 392#if defined(CONFIG_DRM_AMD_DC)
393 else if (amdgpu_device_has_dc_support(adev)) 393 else if (amdgpu_device_has_dc_support(adev))
394 amdgpu_device_ip_block_add(adev, &dm_ip_block); 394 amdgpu_device_ip_block_add(adev, &dm_ip_block);
395#else
396# warning "Enable CONFIG_DRM_AMD_DC for display support on navi."
397#endif 395#endif
398 amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block); 396 amdgpu_device_ip_block_add(adev, &gfx_v10_0_ip_block);
399 amdgpu_device_ip_block_add(adev, &sdma_v5_0_ip_block); 397 amdgpu_device_ip_block_add(adev, &sdma_v5_0_ip_block);
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
index 61744e2d16fb..41b72588adcf 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
@@ -103,6 +103,9 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
103 adev->psp.toc_bin_size = le32_to_cpu(sos_hdr_v1_1->toc_size_bytes); 103 adev->psp.toc_bin_size = le32_to_cpu(sos_hdr_v1_1->toc_size_bytes);
104 adev->psp.toc_start_addr = (uint8_t *)adev->psp.sys_start_addr + 104 adev->psp.toc_start_addr = (uint8_t *)adev->psp.sys_start_addr +
105 le32_to_cpu(sos_hdr_v1_1->toc_offset_bytes); 105 le32_to_cpu(sos_hdr_v1_1->toc_offset_bytes);
106 adev->psp.kdb_bin_size = le32_to_cpu(sos_hdr_v1_1->kdb_size_bytes);
107 adev->psp.kdb_start_addr = (uint8_t *)adev->psp.sys_start_addr +
108 le32_to_cpu(sos_hdr_v1_1->kdb_offset_bytes);
106 } 109 }
107 break; 110 break;
108 default: 111 default:
@@ -177,6 +180,48 @@ out:
177 return err; 180 return err;
178} 181}
179 182
183static int psp_v11_0_bootloader_load_kdb(struct psp_context *psp)
184{
185 int ret;
186 uint32_t psp_gfxdrv_command_reg = 0;
187 struct amdgpu_device *adev = psp->adev;
188 uint32_t sol_reg;
189
190 /* Check tOS sign of life register to confirm sys driver and sOS
191 * are already been loaded.
192 */
193 sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
194 if (sol_reg) {
195 psp->sos_fw_version = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58);
196 dev_info(adev->dev, "sos fw version = 0x%x.\n", psp->sos_fw_version);
197 return 0;
198 }
199
200 /* Wait for bootloader to signify that is ready having bit 31 of C2PMSG_35 set to 1 */
201 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
202 0x80000000, 0x80000000, false);
203 if (ret)
204 return ret;
205
206 memset(psp->fw_pri_buf, 0, PSP_1_MEG);
207
208 /* Copy PSP KDB binary to memory */
209 memcpy(psp->fw_pri_buf, psp->kdb_start_addr, psp->kdb_bin_size);
210
211 /* Provide the sys driver to bootloader */
212 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
213 (uint32_t)(psp->fw_pri_mc_addr >> 20));
214 psp_gfxdrv_command_reg = PSP_BL__LOAD_KEY_DATABASE;
215 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
216 psp_gfxdrv_command_reg);
217
218 /* Wait for bootloader to signify that is ready having bit 31 of C2PMSG_35 set to 1*/
219 ret = psp_wait_for(psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
220 0x80000000, 0x80000000, false);
221
222 return ret;
223}
224
180static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp) 225static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
181{ 226{
182 int ret; 227 int ret;
@@ -190,7 +235,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
190 sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81); 235 sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
191 if (sol_reg) { 236 if (sol_reg) {
192 psp->sos_fw_version = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58); 237 psp->sos_fw_version = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_58);
193 printk("sos fw version = 0x%x.\n", psp->sos_fw_version); 238 dev_info(adev->dev, "sos fw version = 0x%x.\n", psp->sos_fw_version);
194 return 0; 239 return 0;
195 } 240 }
196 241
@@ -208,7 +253,7 @@ static int psp_v11_0_bootloader_load_sysdrv(struct psp_context *psp)
208 /* Provide the sys driver to bootloader */ 253 /* Provide the sys driver to bootloader */
209 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, 254 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
210 (uint32_t)(psp->fw_pri_mc_addr >> 20)); 255 (uint32_t)(psp->fw_pri_mc_addr >> 20));
211 psp_gfxdrv_command_reg = 1 << 16; 256 psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
212 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35, 257 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
213 psp_gfxdrv_command_reg); 258 psp_gfxdrv_command_reg);
214 259
@@ -249,7 +294,7 @@ static int psp_v11_0_bootloader_load_sos(struct psp_context *psp)
249 /* Provide the PSP secure OS to bootloader */ 294 /* Provide the PSP secure OS to bootloader */
250 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, 295 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
251 (uint32_t)(psp->fw_pri_mc_addr >> 20)); 296 (uint32_t)(psp->fw_pri_mc_addr >> 20));
252 psp_gfxdrv_command_reg = 2 << 16; 297 psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
253 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35, 298 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
254 psp_gfxdrv_command_reg); 299 psp_gfxdrv_command_reg);
255 300
@@ -822,6 +867,7 @@ static int psp_v11_0_rlc_autoload_start(struct psp_context *psp)
822 867
823static const struct psp_funcs psp_v11_0_funcs = { 868static const struct psp_funcs psp_v11_0_funcs = {
824 .init_microcode = psp_v11_0_init_microcode, 869 .init_microcode = psp_v11_0_init_microcode,
870 .bootloader_load_kdb = psp_v11_0_bootloader_load_kdb,
825 .bootloader_load_sysdrv = psp_v11_0_bootloader_load_sysdrv, 871 .bootloader_load_sysdrv = psp_v11_0_bootloader_load_sysdrv,
826 .bootloader_load_sos = psp_v11_0_bootloader_load_sos, 872 .bootloader_load_sos = psp_v11_0_bootloader_load_sos,
827 .ring_init = psp_v11_0_ring_init, 873 .ring_init = psp_v11_0_ring_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
index 2ea772692037..019c47feee42 100644
--- a/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/psp_v3_1.c
@@ -155,7 +155,7 @@ static int psp_v3_1_bootloader_load_sysdrv(struct psp_context *psp)
155 /* Provide the sys driver to bootloader */ 155 /* Provide the sys driver to bootloader */
156 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, 156 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
157 (uint32_t)(psp->fw_pri_mc_addr >> 20)); 157 (uint32_t)(psp->fw_pri_mc_addr >> 20));
158 psp_gfxdrv_command_reg = 1 << 16; 158 psp_gfxdrv_command_reg = PSP_BL__LOAD_SYSDRV;
159 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35, 159 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
160 psp_gfxdrv_command_reg); 160 psp_gfxdrv_command_reg);
161 161
@@ -218,7 +218,7 @@ static int psp_v3_1_bootloader_load_sos(struct psp_context *psp)
218 /* Provide the PSP secure OS to bootloader */ 218 /* Provide the PSP secure OS to bootloader */
219 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36, 219 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_36,
220 (uint32_t)(psp->fw_pri_mc_addr >> 20)); 220 (uint32_t)(psp->fw_pri_mc_addr >> 20));
221 psp_gfxdrv_command_reg = 2 << 16; 221 psp_gfxdrv_command_reg = PSP_BL__LOAD_SOSDRV;
222 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35, 222 WREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_35,
223 psp_gfxdrv_command_reg); 223 psp_gfxdrv_command_reg);
224 224
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 87152d8ef0df..23265414d448 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -649,8 +649,6 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
649#if defined(CONFIG_DRM_AMD_DC) 649#if defined(CONFIG_DRM_AMD_DC)
650 else if (amdgpu_device_has_dc_support(adev)) 650 else if (amdgpu_device_has_dc_support(adev))
651 amdgpu_device_ip_block_add(adev, &dm_ip_block); 651 amdgpu_device_ip_block_add(adev, &dm_ip_block);
652#else
653# warning "Enable CONFIG_DRM_AMD_DC for display support on SOC15."
654#endif 652#endif
655 if (!(adev->asic_type == CHIP_VEGA20 && amdgpu_sriov_vf(adev))) { 653 if (!(adev->asic_type == CHIP_VEGA20 && amdgpu_sriov_vf(adev))) {
656 amdgpu_device_ip_block_add(adev, &uvd_v7_0_ip_block); 654 amdgpu_device_ip_block_add(adev, &uvd_v7_0_ip_block);
@@ -671,8 +669,6 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
671#if defined(CONFIG_DRM_AMD_DC) 669#if defined(CONFIG_DRM_AMD_DC)
672 else if (amdgpu_device_has_dc_support(adev)) 670 else if (amdgpu_device_has_dc_support(adev))
673 amdgpu_device_ip_block_add(adev, &dm_ip_block); 671 amdgpu_device_ip_block_add(adev, &dm_ip_block);
674#else
675# warning "Enable CONFIG_DRM_AMD_DC for display support on SOC15."
676#endif 672#endif
677 amdgpu_device_ip_block_add(adev, &vcn_v1_0_ip_block); 673 amdgpu_device_ip_block_add(adev, &vcn_v1_0_ip_block);
678 break; 674 break;
@@ -717,9 +713,15 @@ static void soc15_get_pcie_usage(struct amdgpu_device *adev, uint64_t *count0,
717 return; 713 return;
718 714
719 /* Set the 2 events that we wish to watch, defined above */ 715 /* Set the 2 events that we wish to watch, defined above */
720 /* Reg 40 is # received msgs, Reg 104 is # of posted requests sent */ 716 /* Reg 40 is # received msgs */
721 perfctr = REG_SET_FIELD(perfctr, PCIE_PERF_CNTL_TXCLK, EVENT0_SEL, 40); 717 perfctr = REG_SET_FIELD(perfctr, PCIE_PERF_CNTL_TXCLK, EVENT0_SEL, 40);
722 perfctr = REG_SET_FIELD(perfctr, PCIE_PERF_CNTL_TXCLK, EVENT1_SEL, 104); 718 /* Pre-VG20, Reg 104 is # of posted requests sent. On VG20 it's 108 */
719 if (adev->asic_type == CHIP_VEGA20)
720 perfctr = REG_SET_FIELD(perfctr, PCIE_PERF_CNTL_TXCLK,
721 EVENT1_SEL, 108);
722 else
723 perfctr = REG_SET_FIELD(perfctr, PCIE_PERF_CNTL_TXCLK,
724 EVENT1_SEL, 104);
723 725
724 /* Write to enable desired perf counters */ 726 /* Write to enable desired perf counters */
725 WREG32_PCIE(smnPCIE_PERF_CNTL_TXCLK, perfctr); 727 WREG32_PCIE(smnPCIE_PERF_CNTL_TXCLK, perfctr);
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index d40ed1a828dd..6575ddcfcf00 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -59,7 +59,6 @@
59 59
60#include "vid.h" 60#include "vid.h"
61#include "vi.h" 61#include "vi.h"
62#include "vi_dpm.h"
63#include "gmc_v8_0.h" 62#include "gmc_v8_0.h"
64#include "gmc_v7_0.h" 63#include "gmc_v7_0.h"
65#include "gfx_v8_0.h" 64#include "gfx_v8_0.h"
diff --git a/drivers/gpu/drm/amd/amdgpu/vi_dpm.h b/drivers/gpu/drm/amd/amdgpu/vi_dpm.h
deleted file mode 100644
index c43e03fddfba..000000000000
--- a/drivers/gpu/drm/amd/amdgpu/vi_dpm.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright 2014 Advanced Micro Devices, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 */
23
24#ifndef __VI_DPM_H__
25#define __VI_DPM_H__
26
27extern const struct amd_ip_funcs cz_dpm_ip_funcs;
28int cz_smu_init(struct amdgpu_device *adev);
29int cz_smu_start(struct amdgpu_device *adev);
30int cz_smu_fini(struct amdgpu_device *adev);
31
32#endif
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
index 584748c23f14..e6a4288bfaa6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
@@ -1157,12 +1157,7 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
1157 1157
1158 mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type( 1158 mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type(
1159 q->properties.type)]; 1159 q->properties.type)];
1160 /* 1160
1161 * Eviction state logic: mark all queues as evicted, even ones
1162 * not currently active. Restoring inactive queues later only
1163 * updates the is_evicted flag but is a no-op otherwise.
1164 */
1165 q->properties.is_evicted = !!qpd->evicted;
1166 if (q->properties.type == KFD_QUEUE_TYPE_SDMA || 1161 if (q->properties.type == KFD_QUEUE_TYPE_SDMA ||
1167 q->properties.type == KFD_QUEUE_TYPE_SDMA_XGMI) 1162 q->properties.type == KFD_QUEUE_TYPE_SDMA_XGMI)
1168 dqm->asic_ops.init_sdma_vm(dqm, q, qpd); 1163 dqm->asic_ops.init_sdma_vm(dqm, q, qpd);
@@ -1173,9 +1168,16 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
1173 retval = -ENOMEM; 1168 retval = -ENOMEM;
1174 goto out_deallocate_doorbell; 1169 goto out_deallocate_doorbell;
1175 } 1170 }
1171
1172 dqm_lock(dqm);
1173 /*
1174 * Eviction state logic: mark all queues as evicted, even ones
1175 * not currently active. Restoring inactive queues later only
1176 * updates the is_evicted flag but is a no-op otherwise.
1177 */
1178 q->properties.is_evicted = !!qpd->evicted;
1176 mqd_mgr->init_mqd(mqd_mgr, &q->mqd, q->mqd_mem_obj, 1179 mqd_mgr->init_mqd(mqd_mgr, &q->mqd, q->mqd_mem_obj,
1177 &q->gart_mqd_addr, &q->properties); 1180 &q->gart_mqd_addr, &q->properties);
1178 dqm_lock(dqm);
1179 1181
1180 list_add(&q->list, &qpd->queues_list); 1182 list_add(&q->list, &qpd->queues_list);
1181 qpd->queue_count++; 1183 qpd->queue_count++;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c
index e9fe39382371..95a82ac455f2 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v9.c
@@ -61,7 +61,7 @@ static int update_qpd_v9(struct device_queue_manager *dqm,
61 qpd->sh_mem_config = 61 qpd->sh_mem_config =
62 SH_MEM_ALIGNMENT_MODE_UNALIGNED << 62 SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
63 SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT; 63 SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT;
64 if (noretry && 64 if (amdgpu_noretry &&
65 !dqm->dev->device_info->needs_iommu_device) 65 !dqm->dev->device_info->needs_iommu_device)
66 qpd->sh_mem_config |= 66 qpd->sh_mem_config |=
67 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT; 67 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index 08a0feb9d0a0..3933fb6a371e 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -157,7 +157,7 @@ extern int ignore_crat;
157/* 157/*
158 * Set sh_mem_config.retry_disable on Vega10 158 * Set sh_mem_config.retry_disable on Vega10
159 */ 159 */
160extern int noretry; 160extern int amdgpu_noretry;
161 161
162/* 162/*
163 * Halt if HWS hang is detected 163 * Halt if HWS hang is detected
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index da0958625861..7e6c3ee82f5b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -150,6 +150,9 @@ void pqm_uninit(struct process_queue_manager *pqm)
150 struct process_queue_node *pqn, *next; 150 struct process_queue_node *pqn, *next;
151 151
152 list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) { 152 list_for_each_entry_safe(pqn, next, &pqm->queues, process_queue_list) {
153 if (pqn->q && pqn->q->gws)
154 amdgpu_amdkfd_remove_gws_from_process(pqm->process->kgd_process_info,
155 pqn->q->gws);
153 uninit_queue(pqn->q); 156 uninit_queue(pqn->q);
154 list_del(&pqn->process_queue_list); 157 list_del(&pqn->process_queue_list);
155 kfree(pqn); 158 kfree(pqn);
diff --git a/drivers/gpu/drm/amd/display/Kconfig b/drivers/gpu/drm/amd/display/Kconfig
index 7073cfcf04e8..f954bf61af28 100644
--- a/drivers/gpu/drm/amd/display/Kconfig
+++ b/drivers/gpu/drm/amd/display/Kconfig
@@ -5,6 +5,7 @@ menu "Display Engine Configuration"
5config DRM_AMD_DC 5config DRM_AMD_DC
6 bool "AMD DC - Enable new display engine" 6 bool "AMD DC - Enable new display engine"
7 default y 7 default y
8 select SND_HDA_COMPONENT if SND_HDA_CORE
8 select DRM_AMD_DC_DCN1_0 if X86 && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS) 9 select DRM_AMD_DC_DCN1_0 if X86 && !(KCOV_INSTRUMENT_ALL && KCOV_ENABLE_COMPARISONS)
9 help 10 help
10 Choose this option if you want to use the new display engine 11 Choose this option if you want to use the new display engine
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0242d693f4f6..4a29f72334d0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -56,6 +56,7 @@
56#include <linux/pm_runtime.h> 56#include <linux/pm_runtime.h>
57#include <linux/pci.h> 57#include <linux/pci.h>
58#include <linux/firmware.h> 58#include <linux/firmware.h>
59#include <linux/component.h>
59 60
60#include <drm/drm_atomic.h> 61#include <drm/drm_atomic.h>
61#include <drm/drm_atomic_uapi.h> 62#include <drm/drm_atomic_uapi.h>
@@ -65,6 +66,7 @@
65#include <drm/drm_fourcc.h> 66#include <drm/drm_fourcc.h>
66#include <drm/drm_edid.h> 67#include <drm/drm_edid.h>
67#include <drm/drm_vblank.h> 68#include <drm/drm_vblank.h>
69#include <drm/drm_audio_component.h>
68 70
69#if defined(CONFIG_DRM_AMD_DC_DCN1_0) 71#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
70#include "ivsrcid/dcn/irqsrcs_dcn_1_0.h" 72#include "ivsrcid/dcn/irqsrcs_dcn_1_0.h"
@@ -508,6 +510,139 @@ static void amdgpu_dm_fbc_init(struct drm_connector *connector)
508 510
509} 511}
510 512
513static int amdgpu_dm_audio_component_get_eld(struct device *kdev, int port,
514 int pipe, bool *enabled,
515 unsigned char *buf, int max_bytes)
516{
517 struct drm_device *dev = dev_get_drvdata(kdev);
518 struct amdgpu_device *adev = dev->dev_private;
519 struct drm_connector *connector;
520 struct drm_connector_list_iter conn_iter;
521 struct amdgpu_dm_connector *aconnector;
522 int ret = 0;
523
524 *enabled = false;
525
526 mutex_lock(&adev->dm.audio_lock);
527
528 drm_connector_list_iter_begin(dev, &conn_iter);
529 drm_for_each_connector_iter(connector, &conn_iter) {
530 aconnector = to_amdgpu_dm_connector(connector);
531 if (aconnector->audio_inst != port)
532 continue;
533
534 *enabled = true;
535 ret = drm_eld_size(connector->eld);
536 memcpy(buf, connector->eld, min(max_bytes, ret));
537
538 break;
539 }
540 drm_connector_list_iter_end(&conn_iter);
541
542 mutex_unlock(&adev->dm.audio_lock);
543
544 DRM_DEBUG_KMS("Get ELD : idx=%d ret=%d en=%d\n", port, ret, *enabled);
545
546 return ret;
547}
548
549static const struct drm_audio_component_ops amdgpu_dm_audio_component_ops = {
550 .get_eld = amdgpu_dm_audio_component_get_eld,
551};
552
553static int amdgpu_dm_audio_component_bind(struct device *kdev,
554 struct device *hda_kdev, void *data)
555{
556 struct drm_device *dev = dev_get_drvdata(kdev);
557 struct amdgpu_device *adev = dev->dev_private;
558 struct drm_audio_component *acomp = data;
559
560 acomp->ops = &amdgpu_dm_audio_component_ops;
561 acomp->dev = kdev;
562 adev->dm.audio_component = acomp;
563
564 return 0;
565}
566
567static void amdgpu_dm_audio_component_unbind(struct device *kdev,
568 struct device *hda_kdev, void *data)
569{
570 struct drm_device *dev = dev_get_drvdata(kdev);
571 struct amdgpu_device *adev = dev->dev_private;
572 struct drm_audio_component *acomp = data;
573
574 acomp->ops = NULL;
575 acomp->dev = NULL;
576 adev->dm.audio_component = NULL;
577}
578
579static const struct component_ops amdgpu_dm_audio_component_bind_ops = {
580 .bind = amdgpu_dm_audio_component_bind,
581 .unbind = amdgpu_dm_audio_component_unbind,
582};
583
584static int amdgpu_dm_audio_init(struct amdgpu_device *adev)
585{
586 int i, ret;
587
588 if (!amdgpu_audio)
589 return 0;
590
591 adev->mode_info.audio.enabled = true;
592
593 adev->mode_info.audio.num_pins = adev->dm.dc->res_pool->audio_count;
594
595 for (i = 0; i < adev->mode_info.audio.num_pins; i++) {
596 adev->mode_info.audio.pin[i].channels = -1;
597 adev->mode_info.audio.pin[i].rate = -1;
598 adev->mode_info.audio.pin[i].bits_per_sample = -1;
599 adev->mode_info.audio.pin[i].status_bits = 0;
600 adev->mode_info.audio.pin[i].category_code = 0;
601 adev->mode_info.audio.pin[i].connected = false;
602 adev->mode_info.audio.pin[i].id =
603 adev->dm.dc->res_pool->audios[i]->inst;
604 adev->mode_info.audio.pin[i].offset = 0;
605 }
606
607 ret = component_add(adev->dev, &amdgpu_dm_audio_component_bind_ops);
608 if (ret < 0)
609 return ret;
610
611 adev->dm.audio_registered = true;
612
613 return 0;
614}
615
616static void amdgpu_dm_audio_fini(struct amdgpu_device *adev)
617{
618 if (!amdgpu_audio)
619 return;
620
621 if (!adev->mode_info.audio.enabled)
622 return;
623
624 if (adev->dm.audio_registered) {
625 component_del(adev->dev, &amdgpu_dm_audio_component_bind_ops);
626 adev->dm.audio_registered = false;
627 }
628
629 /* TODO: Disable audio? */
630
631 adev->mode_info.audio.enabled = false;
632}
633
634void amdgpu_dm_audio_eld_notify(struct amdgpu_device *adev, int pin)
635{
636 struct drm_audio_component *acomp = adev->dm.audio_component;
637
638 if (acomp && acomp->audio_ops && acomp->audio_ops->pin_eld_notify) {
639 DRM_DEBUG_KMS("Notify ELD: %d\n", pin);
640
641 acomp->audio_ops->pin_eld_notify(acomp->audio_ops->audio_ptr,
642 pin, -1);
643 }
644}
645
511static int amdgpu_dm_init(struct amdgpu_device *adev) 646static int amdgpu_dm_init(struct amdgpu_device *adev)
512{ 647{
513 struct dc_init_data init_data; 648 struct dc_init_data init_data;
@@ -518,6 +653,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
518 memset(&init_data, 0, sizeof(init_data)); 653 memset(&init_data, 0, sizeof(init_data));
519 654
520 mutex_init(&adev->dm.dc_lock); 655 mutex_init(&adev->dm.dc_lock);
656 mutex_init(&adev->dm.audio_lock);
521 657
522 if(amdgpu_dm_irq_init(adev)) { 658 if(amdgpu_dm_irq_init(adev)) {
523 DRM_ERROR("amdgpu: failed to initialize DM IRQ support.\n"); 659 DRM_ERROR("amdgpu: failed to initialize DM IRQ support.\n");
@@ -621,6 +757,8 @@ error:
621 757
622static void amdgpu_dm_fini(struct amdgpu_device *adev) 758static void amdgpu_dm_fini(struct amdgpu_device *adev)
623{ 759{
760 amdgpu_dm_audio_fini(adev);
761
624 amdgpu_dm_destroy_drm_device(&adev->dm); 762 amdgpu_dm_destroy_drm_device(&adev->dm);
625 763
626 /* DC Destroy TODO: Replace destroy DAL */ 764 /* DC Destroy TODO: Replace destroy DAL */
@@ -641,6 +779,7 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
641 adev->dm.freesync_module = NULL; 779 adev->dm.freesync_module = NULL;
642 } 780 }
643 781
782 mutex_destroy(&adev->dm.audio_lock);
644 mutex_destroy(&adev->dm.dc_lock); 783 mutex_destroy(&adev->dm.dc_lock);
645 784
646 return; 785 return;
@@ -1888,6 +2027,10 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
1888 if (r) 2027 if (r)
1889 return r; 2028 return r;
1890 2029
2030 r = amdgpu_dm_audio_init(adev);
2031 if (r)
2032 return r;
2033
1891 return 0; 2034 return 0;
1892} 2035}
1893 2036
@@ -4834,6 +4977,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
4834 aconnector->base.stereo_allowed = false; 4977 aconnector->base.stereo_allowed = false;
4835 aconnector->base.dpms = DRM_MODE_DPMS_OFF; 4978 aconnector->base.dpms = DRM_MODE_DPMS_OFF;
4836 aconnector->hpd.hpd = AMDGPU_HPD_NONE; /* not used */ 4979 aconnector->hpd.hpd = AMDGPU_HPD_NONE; /* not used */
4980 aconnector->audio_inst = -1;
4837 mutex_init(&aconnector->hpd_lock); 4981 mutex_init(&aconnector->hpd_lock);
4838 4982
4839 /* 4983 /*
@@ -5728,6 +5872,81 @@ cleanup:
5728 kfree(bundle); 5872 kfree(bundle);
5729} 5873}
5730 5874
5875static void amdgpu_dm_commit_audio(struct drm_device *dev,
5876 struct drm_atomic_state *state)
5877{
5878 struct amdgpu_device *adev = dev->dev_private;
5879 struct amdgpu_dm_connector *aconnector;
5880 struct drm_connector *connector;
5881 struct drm_connector_state *old_con_state, *new_con_state;
5882 struct drm_crtc_state *new_crtc_state;
5883 struct dm_crtc_state *new_dm_crtc_state;
5884 const struct dc_stream_status *status;
5885 int i, inst;
5886
5887 /* Notify device removals. */
5888 for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
5889 if (old_con_state->crtc != new_con_state->crtc) {
5890 /* CRTC changes require notification. */
5891 goto notify;
5892 }
5893
5894 if (!new_con_state->crtc)
5895 continue;
5896
5897 new_crtc_state = drm_atomic_get_new_crtc_state(
5898 state, new_con_state->crtc);
5899
5900 if (!new_crtc_state)
5901 continue;
5902
5903 if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
5904 continue;
5905
5906 notify:
5907 aconnector = to_amdgpu_dm_connector(connector);
5908
5909 mutex_lock(&adev->dm.audio_lock);
5910 inst = aconnector->audio_inst;
5911 aconnector->audio_inst = -1;
5912 mutex_unlock(&adev->dm.audio_lock);
5913
5914 amdgpu_dm_audio_eld_notify(adev, inst);
5915 }
5916
5917 /* Notify audio device additions. */
5918 for_each_new_connector_in_state(state, connector, new_con_state, i) {
5919 if (!new_con_state->crtc)
5920 continue;
5921
5922 new_crtc_state = drm_atomic_get_new_crtc_state(
5923 state, new_con_state->crtc);
5924
5925 if (!new_crtc_state)
5926 continue;
5927
5928 if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
5929 continue;
5930
5931 new_dm_crtc_state = to_dm_crtc_state(new_crtc_state);
5932 if (!new_dm_crtc_state->stream)
5933 continue;
5934
5935 status = dc_stream_get_status(new_dm_crtc_state->stream);
5936 if (!status)
5937 continue;
5938
5939 aconnector = to_amdgpu_dm_connector(connector);
5940
5941 mutex_lock(&adev->dm.audio_lock);
5942 inst = status->audio_inst;
5943 aconnector->audio_inst = inst;
5944 mutex_unlock(&adev->dm.audio_lock);
5945
5946 amdgpu_dm_audio_eld_notify(adev, inst);
5947 }
5948}
5949
5731/* 5950/*
5732 * Enable interrupts on CRTCs that are newly active, undergone 5951 * Enable interrupts on CRTCs that are newly active, undergone
5733 * a modeset, or have active planes again. 5952 * a modeset, or have active planes again.
@@ -6106,6 +6325,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
6106 /* Enable interrupts for CRTCs going from 0 to n active planes. */ 6325 /* Enable interrupts for CRTCs going from 0 to n active planes. */
6107 amdgpu_dm_enable_crtc_interrupts(dev, state, false); 6326 amdgpu_dm_enable_crtc_interrupts(dev, state, false);
6108 6327
6328 /* Update audio instances for each connector. */
6329 amdgpu_dm_commit_audio(dev, state);
6330
6109 /* 6331 /*
6110 * send vblank event on all events not handled in flip and 6332 * send vblank event on all events not handled in flip and
6111 * mark consumed event for drm_atomic_helper_commit_hw_done 6333 * mark consumed event for drm_atomic_helper_commit_hw_done
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
index baca5dc22b92..b89cbbfcc0e9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
@@ -144,6 +144,28 @@ struct amdgpu_display_manager {
144 struct mutex dc_lock; 144 struct mutex dc_lock;
145 145
146 /** 146 /**
147 * @audio_lock:
148 *
149 * Guards access to audio instance changes.
150 */
151 struct mutex audio_lock;
152
153 /**
154 * @audio_component:
155 *
156 * Used to notify ELD changes to sound driver.
157 */
158 struct drm_audio_component *audio_component;
159
160 /**
161 * @audio_registered:
162 *
163 * True if the audio component has been registered
164 * successfully, false otherwise.
165 */
166 bool audio_registered;
167
168 /**
147 * @irq_handler_list_low_tab: 169 * @irq_handler_list_low_tab:
148 * 170 *
149 * Low priority IRQ handler table. 171 * Low priority IRQ handler table.
@@ -254,6 +276,9 @@ struct amdgpu_dm_connector {
254 int max_vfreq ; 276 int max_vfreq ;
255 int pixel_clock_mhz; 277 int pixel_clock_mhz;
256 278
279 /* Audio instance - protected by audio_lock. */
280 int audio_inst;
281
257 struct mutex hpd_lock; 282 struct mutex hpd_lock;
258 283
259 bool fake_enable; 284 bool fake_enable;
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
index eac09bfe3be2..592fa499c9f8 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c
@@ -308,7 +308,8 @@ static void pp_to_dc_clock_levels_with_voltage(
308 DC_DECODE_PP_CLOCK_TYPE(dc_clk_type)); 308 DC_DECODE_PP_CLOCK_TYPE(dc_clk_type));
309 309
310 for (i = 0; i < clk_level_info->num_levels; i++) { 310 for (i = 0; i < clk_level_info->num_levels; i++) {
311 DRM_INFO("DM_PPLIB:\t %d in kHz\n", pp_clks->data[i].clocks_in_khz); 311 DRM_INFO("DM_PPLIB:\t %d in kHz, %d in mV\n", pp_clks->data[i].clocks_in_khz,
312 pp_clks->data[i].voltage_in_mv);
312 clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz; 313 clk_level_info->data[i].clocks_in_khz = pp_clks->data[i].clocks_in_khz;
313 clk_level_info->data[i].voltage_in_mv = pp_clks->data[i].voltage_in_mv; 314 clk_level_info->data[i].voltage_in_mv = pp_clks->data[i].voltage_in_mv;
314 } 315 }
@@ -910,11 +911,11 @@ void dm_pp_get_funcs(
910 /* todo set_pme_wa_enable cause 4k@6ohz display not light up */ 911 /* todo set_pme_wa_enable cause 4k@6ohz display not light up */
911 funcs->nv_funcs.set_pme_wa_enable = NULL; 912 funcs->nv_funcs.set_pme_wa_enable = NULL;
912 /* todo debug waring message */ 913 /* todo debug waring message */
913 funcs->nv_funcs.set_hard_min_uclk_by_freq = NULL; 914 funcs->nv_funcs.set_hard_min_uclk_by_freq = pp_nv_set_hard_min_uclk_by_freq;
914 /* todo compare data with window driver*/ 915 /* todo compare data with window driver*/
915 funcs->nv_funcs.get_maximum_sustainable_clocks = NULL; 916 funcs->nv_funcs.get_maximum_sustainable_clocks = pp_nv_get_maximum_sustainable_clocks;
916 /*todo compare data with window driver */ 917 /*todo compare data with window driver */
917 funcs->nv_funcs.get_uclk_dpm_states = NULL; 918 funcs->nv_funcs.get_uclk_dpm_states = pp_nv_get_uclk_dpm_states;
918 break; 919 break;
919#endif 920#endif
920 default: 921 default:
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 173fcfb5abe6..51a78283a86d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -175,32 +175,22 @@ struct resource_pool *dc_create_resource_pool(struct dc *dc,
175 if (res_pool != NULL) { 175 if (res_pool != NULL) {
176 struct dc_firmware_info fw_info = { { 0 } }; 176 struct dc_firmware_info fw_info = { { 0 } };
177 177
178 if (dc->ctx->dc_bios->funcs->get_firmware_info( 178 if (dc->ctx->dc_bios->funcs->get_firmware_info(dc->ctx->dc_bios,
179 dc->ctx->dc_bios, &fw_info) == BP_RESULT_OK) { 179 &fw_info) == BP_RESULT_OK) {
180 res_pool->ref_clocks.xtalin_clock_inKhz = fw_info.pll_info.crystal_frequency; 180 res_pool->ref_clocks.xtalin_clock_inKhz =
181 181 fw_info.pll_info.crystal_frequency;
182 if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) { 182 /* initialize with firmware data first, no all
183 // On FPGA these dividers are currently not configured by GDB 183 * ASIC have DCCG SW component. FPGA or
184 res_pool->ref_clocks.dccg_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; 184 * simulation need initialization of
185 res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; 185 * dccg_ref_clock_inKhz, dchub_ref_clock_inKhz
186 } else if (res_pool->dccg && res_pool->hubbub) { 186 * with xtalin_clock_inKhz
187 // If DCCG reference frequency cannot be determined (usually means not set to xtalin) then this is a critical error 187 */
188 // as this value must be known for DCHUB programming 188 res_pool->ref_clocks.dccg_ref_clock_inKhz =
189 (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg, 189 res_pool->ref_clocks.xtalin_clock_inKhz;
190 fw_info.pll_info.crystal_frequency, 190 res_pool->ref_clocks.dchub_ref_clock_inKhz =
191 &res_pool->ref_clocks.dccg_ref_clock_inKhz); 191 res_pool->ref_clocks.xtalin_clock_inKhz;
192 192 } else
193 // Similarly, if DCHUB reference frequency cannot be determined, then it is also a critical error 193 ASSERT_CRITICAL(false);
194 (res_pool->hubbub->funcs->get_dchub_ref_freq)(res_pool->hubbub,
195 res_pool->ref_clocks.dccg_ref_clock_inKhz,
196 &res_pool->ref_clocks.dchub_ref_clock_inKhz);
197 } else {
198 // Not all ASICs have DCCG sw component
199 res_pool->ref_clocks.dccg_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz;
200 res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz;
201 }
202 } else
203 ASSERT_CRITICAL(false);
204 } 194 }
205 195
206 return res_pool; 196 return res_pool;
@@ -2011,6 +2001,9 @@ enum dc_status resource_map_pool_resources(
2011 if (context->streams[i] == stream) { 2001 if (context->streams[i] == stream) {
2012 context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst; 2002 context->stream_status[i].primary_otg_inst = pipe_ctx->stream_res.tg->inst;
2013 context->stream_status[i].stream_enc_inst = pipe_ctx->stream_res.stream_enc->id; 2003 context->stream_status[i].stream_enc_inst = pipe_ctx->stream_res.stream_enc->id;
2004 context->stream_status[i].audio_inst =
2005 pipe_ctx->stream_res.audio ? pipe_ctx->stream_res.audio->inst : -1;
2006
2014 return DC_OK; 2007 return DC_OK;
2015 } 2008 }
2016 2009
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index e253a5c591f6..0fa1c26bc20d 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -42,6 +42,7 @@ struct dc_stream_status {
42 int primary_otg_inst; 42 int primary_otg_inst;
43 int stream_enc_inst; 43 int stream_enc_inst;
44 int plane_count; 44 int plane_count;
45 int audio_inst;
45 struct timing_sync_info timing_sync_info; 46 struct timing_sync_info timing_sync_info;
46 struct dc_plane_state *plane_states[MAX_SURFACE_NUM]; 47 struct dc_plane_state *plane_states[MAX_SURFACE_NUM];
47}; 48};
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
index 1b68de27ba74..e9721a906592 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/Makefile
@@ -10,7 +10,13 @@ ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
10DCN20 += dcn20_dsc.o 10DCN20 += dcn20_dsc.o
11endif 11endif
12 12
13CFLAGS_dcn20_resource.o := -mhard-float -msse -mpreferred-stack-boundary=4 13ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
14 cc_stack_align := -mpreferred-stack-boundary=4
15else ifneq ($(call cc-option, -mstack-alignment=16),)
16 cc_stack_align := -mstack-alignment=16
17endif
18
19CFLAGS_dcn20_resource.o := -mhard-float -msse $(cc_stack_align)
14 20
15AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20)) 21AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))
16 22
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
index 6925d25d2457..0b84a322b8a2 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
@@ -523,6 +523,7 @@ static void dcn20_init_hw(struct dc *dc)
523 struct dc_bios *dcb = dc->ctx->dc_bios; 523 struct dc_bios *dcb = dc->ctx->dc_bios;
524 struct resource_pool *res_pool = dc->res_pool; 524 struct resource_pool *res_pool = dc->res_pool;
525 struct dc_state *context = dc->current_state; 525 struct dc_state *context = dc->current_state;
526 struct dc_firmware_info fw_info = { { 0 } };
526 527
527 if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks) 528 if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks)
528 dc->clk_mgr->funcs->init_clocks(dc->clk_mgr); 529 dc->clk_mgr->funcs->init_clocks(dc->clk_mgr);
@@ -546,6 +547,30 @@ static void dcn20_init_hw(struct dc *dc)
546 } else { 547 } else {
547 if (!dcb->funcs->is_accelerated_mode(dcb)) { 548 if (!dcb->funcs->is_accelerated_mode(dcb)) {
548 bios_golden_init(dc); 549 bios_golden_init(dc);
550 if (dc->ctx->dc_bios->funcs->get_firmware_info(
551 dc->ctx->dc_bios, &fw_info) == BP_RESULT_OK) {
552 res_pool->ref_clocks.xtalin_clock_inKhz = fw_info.pll_info.crystal_frequency;
553
554 if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) {
555 if (res_pool->dccg && res_pool->hubbub) {
556
557 (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
558 fw_info.pll_info.crystal_frequency,
559 &res_pool->ref_clocks.dccg_ref_clock_inKhz);
560
561 (res_pool->hubbub->funcs->get_dchub_ref_freq)(res_pool->hubbub,
562 res_pool->ref_clocks.dccg_ref_clock_inKhz,
563 &res_pool->ref_clocks.dchub_ref_clock_inKhz);
564 } else {
565 // Not all ASICs have DCCG sw component
566 res_pool->ref_clocks.dccg_ref_clock_inKhz =
567 res_pool->ref_clocks.xtalin_clock_inKhz;
568 res_pool->ref_clocks.dchub_ref_clock_inKhz =
569 res_pool->ref_clocks.xtalin_clock_inKhz;
570 }
571 }
572 } else
573 ASSERT_CRITICAL(false);
549 disable_vga(dc->hwseq); 574 disable_vga(dc->hwseq);
550 } 575 }
551 576
diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
index 4e52df82c993..d200bc3cec71 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c
@@ -2415,7 +2415,7 @@ struct pipe_ctx *dcn20_acquire_idle_pipe_for_layer(
2415 ASSERT(0); 2415 ASSERT(0);
2416 2416
2417 if (!idle_pipe) 2417 if (!idle_pipe)
2418 return false; 2418 return NULL;
2419 2419
2420 idle_pipe->stream = head_pipe->stream; 2420 idle_pipe->stream = head_pipe->stream;
2421 idle_pipe->stream_res.tg = head_pipe->stream_res.tg; 2421 idle_pipe->stream_res.tg = head_pipe->stream_res.tg;
@@ -2576,6 +2576,9 @@ static void cap_soc_clocks(
2576 && max_clocks.uClockInKhz != 0) 2576 && max_clocks.uClockInKhz != 0)
2577 bb->clock_limits[i].dram_speed_mts = (max_clocks.uClockInKhz / 1000) * 16; 2577 bb->clock_limits[i].dram_speed_mts = (max_clocks.uClockInKhz / 1000) * 16;
2578 2578
2579 // HACK: Force every uclk to max for now to "disable" uclk switching.
2580 bb->clock_limits[i].dram_speed_mts = (max_clocks.uClockInKhz / 1000) * 16;
2581
2579 if ((bb->clock_limits[i].fabricclk_mhz > (max_clocks.fabricClockInKhz / 1000)) 2582 if ((bb->clock_limits[i].fabricclk_mhz > (max_clocks.fabricClockInKhz / 1000))
2580 && max_clocks.fabricClockInKhz != 0) 2583 && max_clocks.fabricClockInKhz != 0)
2581 bb->clock_limits[i].fabricclk_mhz = (max_clocks.fabricClockInKhz / 1000); 2584 bb->clock_limits[i].fabricclk_mhz = (max_clocks.fabricClockInKhz / 1000);
@@ -2783,6 +2786,8 @@ static bool init_soc_bounding_box(struct dc *dc,
2783 le32_to_cpu(bb->vmm_page_size_bytes); 2786 le32_to_cpu(bb->vmm_page_size_bytes);
2784 dcn2_0_soc.dram_clock_change_latency_us = 2787 dcn2_0_soc.dram_clock_change_latency_us =
2785 fixed16_to_double_to_cpu(bb->dram_clock_change_latency_us); 2788 fixed16_to_double_to_cpu(bb->dram_clock_change_latency_us);
2789 // HACK!! Lower uclock latency switch time so we don't switch
2790 dcn2_0_soc.dram_clock_change_latency_us = 10;
2786 dcn2_0_soc.writeback_dram_clock_change_latency_us = 2791 dcn2_0_soc.writeback_dram_clock_change_latency_us =
2787 fixed16_to_double_to_cpu(bb->writeback_dram_clock_change_latency_us); 2792 fixed16_to_double_to_cpu(bb->writeback_dram_clock_change_latency_us);
2788 dcn2_0_soc.return_bus_width_bytes = 2793 dcn2_0_soc.return_bus_width_bytes =
@@ -2824,6 +2829,7 @@ static bool init_soc_bounding_box(struct dc *dc,
2824 struct pp_smu_nv_clock_table max_clocks = {0}; 2829 struct pp_smu_nv_clock_table max_clocks = {0};
2825 unsigned int uclk_states[8] = {0}; 2830 unsigned int uclk_states[8] = {0};
2826 unsigned int num_states = 0; 2831 unsigned int num_states = 0;
2832 int i;
2827 enum pp_smu_status status; 2833 enum pp_smu_status status;
2828 bool clock_limits_available = false; 2834 bool clock_limits_available = false;
2829 bool uclk_states_available = false; 2835 bool uclk_states_available = false;
@@ -2845,6 +2851,10 @@ static bool init_soc_bounding_box(struct dc *dc,
2845 clock_limits_available = (status == PP_SMU_RESULT_OK); 2851 clock_limits_available = (status == PP_SMU_RESULT_OK);
2846 } 2852 }
2847 2853
2854 // HACK: Use the max uclk_states value for all elements.
2855 for (i = 0; i < num_states; i++)
2856 uclk_states[i] = uclk_states[num_states - 1];
2857
2848 if (clock_limits_available && uclk_states_available && num_states) 2858 if (clock_limits_available && uclk_states_available && num_states)
2849 update_bounding_box(dc, &dcn2_0_soc, &max_clocks, uclk_states, num_states); 2859 update_bounding_box(dc, &dcn2_0_soc, &max_clocks, uclk_states, num_states);
2850 else if (clock_limits_available) 2860 else if (clock_limits_available)
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/Makefile b/drivers/gpu/drm/amd/display/dc/dsc/Makefile
index c5d5b94e2604..e019cd9447e8 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/Makefile
+++ b/drivers/gpu/drm/amd/display/dc/dsc/Makefile
@@ -1,10 +1,18 @@
1# 1#
2# Makefile for the 'dsc' sub-component of DAL. 2# Makefile for the 'dsc' sub-component of DAL.
3 3
4CFLAGS_rc_calc.o := -mhard-float -msse -mpreferred-stack-boundary=4 4ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
5CFLAGS_rc_calc_dpi.o := -mhard-float -msse -mpreferred-stack-boundary=4 5 cc_stack_align := -mpreferred-stack-boundary=4
6CFLAGS_codec_main_amd.o := -mhard-float -msse -mpreferred-stack-boundary=4 6else ifneq ($(call cc-option, -mstack-alignment=16),)
7CFLAGS_dc_dsc.o := -mhard-float -msse -mpreferred-stack-boundary=4 7 cc_stack_align := -mstack-alignment=16
8endif
9
10dsc_ccflags := -mhard-float -msse $(cc_stack_align)
11
12CFLAGS_rc_calc.o := $(dsc_ccflags)
13CFLAGS_rc_calc_dpi.o := $(dsc_ccflags)
14CFLAGS_codec_main_amd.o := $(dsc_ccflags)
15CFLAGS_dc_dsc.o := $(dsc_ccflags)
8 16
9DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o 17DSC = dc_dsc.o rc_calc.o rc_calc_dpi.o
10 18
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index d352b8d76365..a0a7211438f2 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -26,7 +26,7 @@
26#include <drm/amd_asic_type.h> 26#include <drm/amd_asic_type.h>
27 27
28 28
29#define AMD_MAX_USEC_TIMEOUT 200000 /* 200 ms */ 29#define AMD_MAX_USEC_TIMEOUT 1000000 /* 1000 ms */
30 30
31/* 31/*
32 * Chip flags 32 * Chip flags
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 3093917adc2d..f1565c448de5 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -69,6 +69,9 @@ int smu_set_soft_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
69 if (min <= 0 && max <= 0) 69 if (min <= 0 && max <= 0)
70 return -EINVAL; 70 return -EINVAL;
71 71
72 if (!smu_clk_dpm_is_enabled(smu, clk_type))
73 return 0;
74
72 clk_id = smu_clk_get_index(smu, clk_type); 75 clk_id = smu_clk_get_index(smu, clk_type);
73 if (clk_id < 0) 76 if (clk_id < 0)
74 return clk_id; 77 return clk_id;
@@ -102,6 +105,9 @@ int smu_set_hard_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
102 if (min <= 0 && max <= 0) 105 if (min <= 0 && max <= 0)
103 return -EINVAL; 106 return -EINVAL;
104 107
108 if (!smu_clk_dpm_is_enabled(smu, clk_type))
109 return 0;
110
105 clk_id = smu_clk_get_index(smu, clk_type); 111 clk_id = smu_clk_get_index(smu, clk_type);
106 if (clk_id < 0) 112 if (clk_id < 0)
107 return clk_id; 113 return clk_id;
@@ -135,23 +141,8 @@ int smu_get_dpm_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
135 if (!min && !max) 141 if (!min && !max)
136 return -EINVAL; 142 return -EINVAL;
137 143
138 switch (clk_type) { 144 if (!smu_clk_dpm_is_enabled(smu, clk_type))
139 case SMU_UCLK: 145 return 0;
140 if (!smu_feature_is_enabled(smu, SMU_FEATURE_DPM_UCLK_BIT)) {
141 pr_warn("uclk dpm is not enabled\n");
142 return 0;
143 }
144 break;
145 case SMU_GFXCLK:
146 case SMU_SCLK:
147 if (!smu_feature_is_enabled(smu, SMU_FEATURE_DPM_GFXCLK_BIT)) {
148 pr_warn("gfxclk dpm is not enabled\n");
149 return 0;
150 }
151 break;
152 default:
153 break;
154 }
155 146
156 mutex_lock(&smu->mutex); 147 mutex_lock(&smu->mutex);
157 clk_id = smu_clk_get_index(smu, clk_type); 148 clk_id = smu_clk_get_index(smu, clk_type);
@@ -194,6 +185,9 @@ int smu_get_dpm_freq_by_index(struct smu_context *smu, enum smu_clk_type clk_typ
194 if (!value) 185 if (!value)
195 return -EINVAL; 186 return -EINVAL;
196 187
188 if (!smu_clk_dpm_is_enabled(smu, clk_type))
189 return 0;
190
197 clk_id = smu_clk_get_index(smu, clk_type); 191 clk_id = smu_clk_get_index(smu, clk_type);
198 if (clk_id < 0) 192 if (clk_id < 0)
199 return clk_id; 193 return clk_id;
@@ -222,6 +216,35 @@ int smu_get_dpm_level_count(struct smu_context *smu, enum smu_clk_type clk_type,
222 return smu_get_dpm_freq_by_index(smu, clk_type, 0xff, value); 216 return smu_get_dpm_freq_by_index(smu, clk_type, 0xff, value);
223} 217}
224 218
219bool smu_clk_dpm_is_enabled(struct smu_context *smu, enum smu_clk_type clk_type)
220{
221 enum smu_feature_mask feature_id = 0;
222
223 switch (clk_type) {
224 case SMU_MCLK:
225 case SMU_UCLK:
226 feature_id = SMU_FEATURE_DPM_UCLK_BIT;
227 break;
228 case SMU_GFXCLK:
229 case SMU_SCLK:
230 feature_id = SMU_FEATURE_DPM_GFXCLK_BIT;
231 break;
232 case SMU_SOCCLK:
233 feature_id = SMU_FEATURE_DPM_SOCCLK_BIT;
234 break;
235 default:
236 return true;
237 }
238
239 if(!smu_feature_is_enabled(smu, feature_id)) {
240 pr_warn("smu %d clk dpm feature %d is not enabled\n", clk_type, feature_id);
241 return false;
242 }
243
244 return true;
245}
246
247
225int smu_dpm_set_power_gate(struct smu_context *smu, uint32_t block_type, 248int smu_dpm_set_power_gate(struct smu_context *smu, uint32_t block_type,
226 bool gate) 249 bool gate)
227{ 250{
@@ -300,7 +323,7 @@ int smu_common_read_sensor(struct smu_context *smu, enum amd_pp_sensors sensor,
300 return ret; 323 return ret;
301} 324}
302 325
303int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, 326int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int argument,
304 void *table_data, bool drv2smu) 327 void *table_data, bool drv2smu)
305{ 328{
306 struct smu_table_context *smu_table = &smu->smu_table; 329 struct smu_table_context *smu_table = &smu->smu_table;
@@ -327,7 +350,7 @@ int smu_update_table(struct smu_context *smu, enum smu_table_id table_index,
327 ret = smu_send_smc_msg_with_param(smu, drv2smu ? 350 ret = smu_send_smc_msg_with_param(smu, drv2smu ?
328 SMU_MSG_TransferTableDram2Smu : 351 SMU_MSG_TransferTableDram2Smu :
329 SMU_MSG_TransferTableSmu2Dram, 352 SMU_MSG_TransferTableSmu2Dram,
330 table_id); 353 table_id | ((argument & 0xFFFF) << 16));
331 if (ret) 354 if (ret)
332 return ret; 355 return ret;
333 356
@@ -1372,10 +1395,10 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu,
1372 break; 1395 break;
1373 1396
1374 case AMD_DPM_FORCED_LEVEL_AUTO: 1397 case AMD_DPM_FORCED_LEVEL_AUTO:
1398 case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
1375 ret = smu_unforce_dpm_levels(smu); 1399 ret = smu_unforce_dpm_levels(smu);
1376 break; 1400 break;
1377 1401
1378 case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
1379 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK: 1402 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:
1380 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK: 1403 case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:
1381 case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK: 1404 case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:
@@ -1385,8 +1408,9 @@ int smu_adjust_power_state_dynamic(struct smu_context *smu,
1385 &soc_mask); 1408 &soc_mask);
1386 if (ret) 1409 if (ret)
1387 return ret; 1410 return ret;
1388 smu_force_clk_levels(smu, PP_SCLK, 1 << sclk_mask); 1411 smu_force_clk_levels(smu, SMU_SCLK, 1 << sclk_mask);
1389 smu_force_clk_levels(smu, PP_MCLK, 1 << mclk_mask); 1412 smu_force_clk_levels(smu, SMU_MCLK, 1 << mclk_mask);
1413 smu_force_clk_levels(smu, SMU_SOCCLK, 1 << soc_mask);
1390 break; 1414 break;
1391 1415
1392 case AMD_DPM_FORCED_LEVEL_MANUAL: 1416 case AMD_DPM_FORCED_LEVEL_MANUAL:
@@ -1441,17 +1465,16 @@ int smu_handle_task(struct smu_context *smu,
1441enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu) 1465enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu)
1442{ 1466{
1443 struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm); 1467 struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
1468 enum amd_dpm_forced_level level;
1444 1469
1445 if (!smu_dpm_ctx->dpm_context) 1470 if (!smu_dpm_ctx->dpm_context)
1446 return -EINVAL; 1471 return -EINVAL;
1447 1472
1448 mutex_lock(&(smu->mutex)); 1473 mutex_lock(&(smu->mutex));
1449 if (smu_dpm_ctx->dpm_level != smu_dpm_ctx->saved_dpm_level) { 1474 level = smu_dpm_ctx->dpm_level;
1450 smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level;
1451 }
1452 mutex_unlock(&(smu->mutex)); 1475 mutex_unlock(&(smu->mutex));
1453 1476
1454 return smu_dpm_ctx->dpm_level; 1477 return level;
1455} 1478}
1456 1479
1457int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level) 1480int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level)
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
index 1cd5a8b5cdc1..b760f95e7fa7 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
@@ -1067,8 +1067,6 @@ static int pp_tables_v1_0_initialize(struct pp_hwmgr *hwmgr)
1067 PP_ASSERT_WITH_CODE((NULL != hwmgr->pptable), 1067 PP_ASSERT_WITH_CODE((NULL != hwmgr->pptable),
1068 "Failed to allocate hwmgr->pptable!", return -ENOMEM); 1068 "Failed to allocate hwmgr->pptable!", return -ENOMEM);
1069 1069
1070 memset(hwmgr->pptable, 0x00, sizeof(struct phm_ppt_v1_information));
1071
1072 powerplay_table = get_powerplay_table(hwmgr); 1070 powerplay_table = get_powerplay_table(hwmgr);
1073 1071
1074 PP_ASSERT_WITH_CODE((NULL != powerplay_table), 1072 PP_ASSERT_WITH_CODE((NULL != powerplay_table),
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
index c97324ef7db2..1af992fb0bde 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
@@ -937,7 +937,7 @@ extern int smu_feature_is_supported(struct smu_context *smu,
937extern int smu_feature_set_supported(struct smu_context *smu, 937extern int smu_feature_set_supported(struct smu_context *smu,
938 enum smu_feature_mask mask, bool enable); 938 enum smu_feature_mask mask, bool enable);
939 939
940int smu_update_table(struct smu_context *smu, uint32_t table_index, 940int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int argument,
941 void *table_data, bool drv2smu); 941 void *table_data, bool drv2smu);
942 942
943bool is_support_sw_smu(struct amdgpu_device *adev); 943bool is_support_sw_smu(struct amdgpu_device *adev);
@@ -973,5 +973,6 @@ int smu_set_hard_freq_range(struct smu_context *smu, enum smu_clk_type clk_type,
973enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu); 973enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu);
974int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level); 974int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level);
975int smu_set_display_count(struct smu_context *smu, uint32_t count); 975int smu_set_display_count(struct smu_context *smu, uint32_t count);
976bool smu_clk_dpm_is_enabled(struct smu_context *smu, enum smu_clk_type clk_type);
976 977
977#endif 978#endif
diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h b/drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h
index 195c4ae67058..755d51f9c6a9 100644
--- a/drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h
+++ b/drivers/gpu/drm/amd/powerplay/inc/smu11_driver_if.h
@@ -27,7 +27,7 @@
27// *** IMPORTANT *** 27// *** IMPORTANT ***
28// SMU TEAM: Always increment the interface version if 28// SMU TEAM: Always increment the interface version if
29// any structure is changed in this file 29// any structure is changed in this file
30#define SMU11_DRIVER_IF_VERSION 0x12 30#define SMU11_DRIVER_IF_VERSION 0x13
31 31
32#define PPTABLE_V20_SMU_VERSION 3 32#define PPTABLE_V20_SMU_VERSION 3
33 33
@@ -615,6 +615,7 @@ typedef struct {
615 uint16_t UclkAverageLpfTau; 615 uint16_t UclkAverageLpfTau;
616 uint16_t GfxActivityLpfTau; 616 uint16_t GfxActivityLpfTau;
617 uint16_t UclkActivityLpfTau; 617 uint16_t UclkActivityLpfTau;
618 uint16_t SocketPowerLpfTau;
618 619
619 620
620 uint32_t MmHubPadding[8]; 621 uint32_t MmHubPadding[8];
@@ -665,7 +666,8 @@ typedef struct {
665 uint32_t ThrottlerStatus ; 666 uint32_t ThrottlerStatus ;
666 667
667 uint8_t LinkDpmLevel; 668 uint8_t LinkDpmLevel;
668 uint8_t Padding[3]; 669 uint16_t AverageSocketPower;
670 uint8_t Padding;
669 671
670 672
671 uint32_t MmHubPadding[7]; 673 uint32_t MmHubPadding[7];
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
index 880fe0930d9e..2dae0ae0829e 100644
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c
@@ -331,7 +331,10 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
331 | FEATURE_MASK(FEATURE_DS_DCEFCLK_BIT) 331 | FEATURE_MASK(FEATURE_DS_DCEFCLK_BIT)
332 | FEATURE_MASK(FEATURE_FW_DSTATE_BIT) 332 | FEATURE_MASK(FEATURE_FW_DSTATE_BIT)
333 | FEATURE_MASK(FEATURE_BACO_BIT) 333 | FEATURE_MASK(FEATURE_BACO_BIT)
334 | FEATURE_MASK(FEATURE_ACDC_BIT); 334 | FEATURE_MASK(FEATURE_ACDC_BIT)
335 | FEATURE_MASK(FEATURE_GFX_SS_BIT)
336 | FEATURE_MASK(FEATURE_APCC_DFLL_BIT)
337 | FEATURE_MASK(FEATURE_FW_CTF_BIT);
335 338
336 if (adev->pm.pp_feature & PP_MCLK_DPM_MASK) 339 if (adev->pm.pp_feature & PP_MCLK_DPM_MASK)
337 *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_DPM_UCLK_BIT) 340 *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_DPM_UCLK_BIT)
@@ -339,8 +342,7 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
339 | FEATURE_MASK(FEATURE_MEM_MVDD_SCALING_BIT); 342 | FEATURE_MASK(FEATURE_MEM_MVDD_SCALING_BIT);
340 343
341 if (adev->pm.pp_feature & PP_GFXOFF_MASK) { 344 if (adev->pm.pp_feature & PP_GFXOFF_MASK) {
342 *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_GFX_SS_BIT) 345 *(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_GFXOFF_BIT);
343 | FEATURE_MASK(FEATURE_GFXOFF_BIT);
344 /* TODO: remove it once fw fix the bug */ 346 /* TODO: remove it once fw fix the bug */
345 *(uint64_t *)feature_mask &= ~FEATURE_MASK(FEATURE_FW_DSTATE_BIT); 347 *(uint64_t *)feature_mask &= ~FEATURE_MASK(FEATURE_FW_DSTATE_BIT);
346 } 348 }
@@ -465,9 +467,6 @@ static int navi10_append_powerplay_table(struct smu_context *smu)
465 smc_pptable->MvddRatio = smc_dpm_table->MvddRatio; 467 smc_pptable->MvddRatio = smc_dpm_table->MvddRatio;
466 468
467 if (adev->pm.pp_feature & PP_GFXOFF_MASK) { 469 if (adev->pm.pp_feature & PP_GFXOFF_MASK) {
468 *(uint64_t *)smc_pptable->FeaturesToRun |= FEATURE_MASK(FEATURE_GFX_SS_BIT)
469 | FEATURE_MASK(FEATURE_GFXOFF_BIT);
470
471 /* TODO: remove it once SMU fw fix it */ 470 /* TODO: remove it once SMU fw fix it */
472 smc_pptable->DebugOverrides |= DPM_OVERRIDE_DISABLE_DFLL_PLL_SHUTDOWN; 471 smc_pptable->DebugOverrides |= DPM_OVERRIDE_DISABLE_DFLL_PLL_SHUTDOWN;
473 } 472 }
@@ -614,7 +613,7 @@ static int navi10_get_current_clk_freq_by_table(struct smu_context *smu,
614 613
615 memset(&metrics, 0, sizeof(metrics)); 614 memset(&metrics, 0, sizeof(metrics));
616 615
617 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, (void *)&metrics, false); 616 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics, false);
618 if (ret) 617 if (ret)
619 return ret; 618 return ret;
620 619
@@ -709,7 +708,7 @@ static int navi10_force_clk_levels(struct smu_context *smu,
709static int navi10_populate_umd_state_clk(struct smu_context *smu) 708static int navi10_populate_umd_state_clk(struct smu_context *smu)
710{ 709{
711 int ret = 0; 710 int ret = 0;
712 uint32_t min_sclk_freq = 0; 711 uint32_t min_sclk_freq = 0, min_mclk_freq = 0;
713 712
714 ret = smu_get_dpm_freq_range(smu, SMU_SCLK, &min_sclk_freq, NULL); 713 ret = smu_get_dpm_freq_range(smu, SMU_SCLK, &min_sclk_freq, NULL);
715 if (ret) 714 if (ret)
@@ -717,6 +716,12 @@ static int navi10_populate_umd_state_clk(struct smu_context *smu)
717 716
718 smu->pstate_sclk = min_sclk_freq * 100; 717 smu->pstate_sclk = min_sclk_freq * 100;
719 718
719 ret = smu_get_dpm_freq_range(smu, SMU_MCLK, &min_mclk_freq, NULL);
720 if (ret)
721 return ret;
722
723 smu->pstate_mclk = min_mclk_freq * 100;
724
720 return ret; 725 return ret;
721} 726}
722 727
@@ -827,27 +832,20 @@ static int navi10_force_dpm_limit_value(struct smu_context *smu, bool highest)
827 return ret; 832 return ret;
828} 833}
829 834
830static int navi10_unforce_dpm_levels(struct smu_context *smu) { 835static int navi10_unforce_dpm_levels(struct smu_context *smu)
831 836{
832 int ret = 0, i = 0; 837 int ret = 0, i = 0;
833 uint32_t min_freq, max_freq; 838 uint32_t min_freq, max_freq;
834 enum smu_clk_type clk_type; 839 enum smu_clk_type clk_type;
835 840
836 struct clk_feature_map { 841 enum smu_clk_type clks[] = {
837 enum smu_clk_type clk_type; 842 SMU_GFXCLK,
838 uint32_t feature; 843 SMU_MCLK,
839 } clk_feature_map[] = { 844 SMU_SOCCLK,
840 {SMU_GFXCLK, SMU_FEATURE_DPM_GFXCLK_BIT},
841 {SMU_MCLK, SMU_FEATURE_DPM_UCLK_BIT},
842 {SMU_SOCCLK, SMU_FEATURE_DPM_SOCCLK_BIT},
843 }; 845 };
844 846
845 for (i = 0; i < ARRAY_SIZE(clk_feature_map); i++) { 847 for (i = 0; i < ARRAY_SIZE(clks); i++) {
846 if (!smu_feature_is_enabled(smu, clk_feature_map[i].feature)) 848 clk_type = clks[i];
847 continue;
848
849 clk_type = clk_feature_map[i].clk_type;
850
851 ret = smu_get_dpm_freq_range(smu, clk_type, &min_freq, &max_freq); 849 ret = smu_get_dpm_freq_range(smu, clk_type, &min_freq, &max_freq);
852 if (ret) 850 if (ret)
853 return ret; 851 return ret;
@@ -868,7 +866,7 @@ static int navi10_get_gpu_power(struct smu_context *smu, uint32_t *value)
868 if (!value) 866 if (!value)
869 return -EINVAL; 867 return -EINVAL;
870 868
871 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, (void *)&metrics, 869 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics,
872 false); 870 false);
873 if (ret) 871 if (ret)
874 return ret; 872 return ret;
@@ -890,7 +888,7 @@ static int navi10_get_current_activity_percent(struct smu_context *smu,
890 888
891 msleep(1); 889 msleep(1);
892 890
893 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 891 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
894 (void *)&metrics, false); 892 (void *)&metrics, false);
895 if (ret) 893 if (ret)
896 return ret; 894 return ret;
@@ -931,7 +929,7 @@ static int navi10_get_fan_speed(struct smu_context *smu, uint16_t *value)
931 929
932 memset(&metrics, 0, sizeof(metrics)); 930 memset(&metrics, 0, sizeof(metrics));
933 931
934 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 932 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
935 (void *)&metrics, false); 933 (void *)&metrics, false);
936 if (ret) 934 if (ret)
937 return ret; 935 return ret;
@@ -997,7 +995,7 @@ static int navi10_get_power_profile_mode(struct smu_context *smu, char *buf)
997 /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ 995 /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
998 workload_type = smu_workload_get_type(smu, i); 996 workload_type = smu_workload_get_type(smu, i);
999 result = smu_update_table(smu, 997 result = smu_update_table(smu,
1000 SMU_TABLE_ACTIVITY_MONITOR_COEFF | workload_type << 16, 998 SMU_TABLE_ACTIVITY_MONITOR_COEFF, workload_type,
1001 (void *)(&activity_monitor), false); 999 (void *)(&activity_monitor), false);
1002 if (result) { 1000 if (result) {
1003 pr_err("[%s] Failed to get activity monitor!", __func__); 1001 pr_err("[%s] Failed to get activity monitor!", __func__);
@@ -1070,7 +1068,7 @@ static int navi10_set_power_profile_mode(struct smu_context *smu, long *input, u
1070 return -EINVAL; 1068 return -EINVAL;
1071 1069
1072 ret = smu_update_table(smu, 1070 ret = smu_update_table(smu,
1073 SMU_TABLE_ACTIVITY_MONITOR_COEFF | WORKLOAD_PPLIB_CUSTOM_BIT << 16, 1071 SMU_TABLE_ACTIVITY_MONITOR_COEFF, WORKLOAD_PPLIB_CUSTOM_BIT,
1074 (void *)(&activity_monitor), false); 1072 (void *)(&activity_monitor), false);
1075 if (ret) { 1073 if (ret) {
1076 pr_err("[%s] Failed to get activity monitor!", __func__); 1074 pr_err("[%s] Failed to get activity monitor!", __func__);
@@ -1114,7 +1112,7 @@ static int navi10_set_power_profile_mode(struct smu_context *smu, long *input, u
1114 } 1112 }
1115 1113
1116 ret = smu_update_table(smu, 1114 ret = smu_update_table(smu,
1117 SMU_TABLE_ACTIVITY_MONITOR_COEFF | WORKLOAD_PPLIB_CUSTOM_BIT << 16, 1115 SMU_TABLE_ACTIVITY_MONITOR_COEFF, WORKLOAD_PPLIB_CUSTOM_BIT,
1118 (void *)(&activity_monitor), true); 1116 (void *)(&activity_monitor), true);
1119 if (ret) { 1117 if (ret) {
1120 pr_err("[%s] Failed to set activity monitor!", __func__); 1118 pr_err("[%s] Failed to set activity monitor!", __func__);
@@ -1157,14 +1155,14 @@ static int navi10_get_profiling_clk_mask(struct smu_context *smu,
1157 ret = smu_get_dpm_level_count(smu, SMU_MCLK, &level_count); 1155 ret = smu_get_dpm_level_count(smu, SMU_MCLK, &level_count);
1158 if (ret) 1156 if (ret)
1159 return ret; 1157 return ret;
1160 *sclk_mask = level_count - 1; 1158 *mclk_mask = level_count - 1;
1161 } 1159 }
1162 1160
1163 if(soc_mask) { 1161 if(soc_mask) {
1164 ret = smu_get_dpm_level_count(smu, SMU_SOCCLK, &level_count); 1162 ret = smu_get_dpm_level_count(smu, SMU_SOCCLK, &level_count);
1165 if (ret) 1163 if (ret)
1166 return ret; 1164 return ret;
1167 *sclk_mask = level_count - 1; 1165 *soc_mask = level_count - 1;
1168 } 1166 }
1169 } 1167 }
1170 1168
@@ -1280,7 +1278,7 @@ static int navi10_thermal_get_temperature(struct smu_context *smu,
1280 if (!value) 1278 if (!value)
1281 return -EINVAL; 1279 return -EINVAL;
1282 1280
1283 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, (void *)&metrics, false); 1281 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0, (void *)&metrics, false);
1284 if (ret) 1282 if (ret)
1285 return ret; 1283 return ret;
1286 1284
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index a87b86ae2cc5..95c7c4dae523 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
@@ -261,14 +261,20 @@ static int smu_v11_0_check_fw_version(struct smu_context *smu)
261 smu_minor = (smu_version >> 8) & 0xff; 261 smu_minor = (smu_version >> 8) & 0xff;
262 smu_debug = (smu_version >> 0) & 0xff; 262 smu_debug = (smu_version >> 0) & 0xff;
263 263
264 264 /*
265 * 1. if_version mismatch is not critical as our fw is designed
266 * to be backward compatible.
267 * 2. New fw usually brings some optimizations. But that's visible
268 * only on the paired driver.
269 * Considering above, we just leave user a warning message instead
270 * of halt driver loading.
271 */
265 if (if_version != smu->smc_if_version) { 272 if (if_version != smu->smc_if_version) {
266 pr_info("smu driver if version = 0x%08x, smu fw if version = 0x%08x, " 273 pr_info("smu driver if version = 0x%08x, smu fw if version = 0x%08x, "
267 "smu fw version = 0x%08x (%d.%d.%d)\n", 274 "smu fw version = 0x%08x (%d.%d.%d)\n",
268 smu->smc_if_version, if_version, 275 smu->smc_if_version, if_version,
269 smu_version, smu_major, smu_minor, smu_debug); 276 smu_version, smu_major, smu_minor, smu_debug);
270 pr_err("SMU driver if version not matched\n"); 277 pr_warn("SMU driver if version not matched\n");
271 ret = -EINVAL;
272 } 278 }
273 279
274 return ret; 280 return ret;
@@ -703,7 +709,7 @@ static int smu_v11_0_write_pptable(struct smu_context *smu)
703 struct smu_table_context *table_context = &smu->smu_table; 709 struct smu_table_context *table_context = &smu->smu_table;
704 int ret = 0; 710 int ret = 0;
705 711
706 ret = smu_update_table(smu, SMU_TABLE_PPTABLE, 712 ret = smu_update_table(smu, SMU_TABLE_PPTABLE, 0,
707 table_context->driver_pptable, true); 713 table_context->driver_pptable, true);
708 714
709 return ret; 715 return ret;
@@ -722,7 +728,7 @@ static int smu_v11_0_write_watermarks_table(struct smu_context *smu)
722 if (!table->cpu_addr) 728 if (!table->cpu_addr)
723 return -EINVAL; 729 return -EINVAL;
724 730
725 ret = smu_update_table(smu, SMU_TABLE_WATERMARKS, table->cpu_addr, 731 ret = smu_update_table(smu, SMU_TABLE_WATERMARKS, 0, table->cpu_addr,
726 true); 732 true);
727 733
728 return ret; 734 return ret;
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
index 6c81cb91ebae..15590fd86ef4 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c
@@ -2705,8 +2705,6 @@ static int ci_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
2705 cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2)); 2705 cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2));
2706 cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2)); 2706 cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2));
2707 2707
2708 memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table));
2709
2710 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); 2708 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table);
2711 2709
2712 if (0 == result) 2710 if (0 == result)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
index 9e0dd56fe7c5..732005c03a82 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c
@@ -2634,8 +2634,6 @@ static int iceland_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
2634 cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2)); 2634 cgs_write_register(hwmgr->device, mmMC_SEQ_PMG_CMD_MRS2_LP, cgs_read_register(hwmgr->device, mmMC_PMG_CMD_MRS2));
2635 cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2)); 2635 cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2));
2636 2636
2637 memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table));
2638
2639 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); 2637 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table);
2640 2638
2641 if (0 == result) 2639 if (0 == result)
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
index ba3394303b9c..f19bac7ef7ba 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
@@ -3117,8 +3117,6 @@ static int tonga_initialize_mc_reg_table(struct pp_hwmgr *hwmgr)
3117 cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP, 3117 cgs_write_register(hwmgr->device, mmMC_SEQ_WR_CTL_2_LP,
3118 cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2)); 3118 cgs_read_register(hwmgr->device, mmMC_SEQ_WR_CTL_2));
3119 3119
3120 memset(table, 0x00, sizeof(pp_atomctrl_mc_reg_table));
3121
3122 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table); 3120 result = atomctrl_initialize_mc_reg_table(hwmgr, module_index, table);
3123 3121
3124 if (!result) 3122 if (!result)
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
index a76a22a18eb4..bb9bb09cfc7a 100644
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c
@@ -319,7 +319,7 @@ static int vega20_tables_init(struct smu_context *smu, struct smu_table *tables)
319 AMDGPU_GEM_DOMAIN_VRAM); 319 AMDGPU_GEM_DOMAIN_VRAM);
320 320
321 smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); 321 smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL);
322 if (smu_table->metrics_table) 322 if (!smu_table->metrics_table)
323 return -ENOMEM; 323 return -ENOMEM;
324 smu_table->metrics_time = 0; 324 smu_table->metrics_time = 0;
325 325
@@ -441,7 +441,6 @@ static int vega20_store_powerplay_table(struct smu_context *smu)
441{ 441{
442 ATOM_Vega20_POWERPLAYTABLE *powerplay_table = NULL; 442 ATOM_Vega20_POWERPLAYTABLE *powerplay_table = NULL;
443 struct smu_table_context *table_context = &smu->smu_table; 443 struct smu_table_context *table_context = &smu->smu_table;
444 int ret;
445 444
446 if (!table_context->power_play_table) 445 if (!table_context->power_play_table)
447 return -EINVAL; 446 return -EINVAL;
@@ -455,9 +454,7 @@ static int vega20_store_powerplay_table(struct smu_context *smu)
455 table_context->thermal_controller_type = powerplay_table->ucThermalControllerType; 454 table_context->thermal_controller_type = powerplay_table->ucThermalControllerType;
456 table_context->TDPODLimit = le32_to_cpu(powerplay_table->OverDrive8Table.ODSettingsMax[ATOM_VEGA20_ODSETTING_POWERPERCENTAGE]); 455 table_context->TDPODLimit = le32_to_cpu(powerplay_table->OverDrive8Table.ODSettingsMax[ATOM_VEGA20_ODSETTING_POWERPERCENTAGE]);
457 456
458 ret = vega20_setup_od8_information(smu); 457 return 0;
459
460 return ret;
461} 458}
462 459
463static int vega20_append_powerplay_table(struct smu_context *smu) 460static int vega20_append_powerplay_table(struct smu_context *smu)
@@ -992,7 +989,7 @@ static int vega20_print_clk_levels(struct smu_context *smu,
992 break; 989 break;
993 990
994 case SMU_SOCCLK: 991 case SMU_SOCCLK:
995 ret = smu_get_current_clk_freq(smu, PPCLK_SOCCLK, &now); 992 ret = smu_get_current_clk_freq(smu, SMU_SOCCLK, &now);
996 if (ret) { 993 if (ret) {
997 pr_err("Attempt to get current socclk Failed!"); 994 pr_err("Attempt to get current socclk Failed!");
998 return ret; 995 return ret;
@@ -1013,7 +1010,7 @@ static int vega20_print_clk_levels(struct smu_context *smu,
1013 break; 1010 break;
1014 1011
1015 case SMU_FCLK: 1012 case SMU_FCLK:
1016 ret = smu_get_current_clk_freq(smu, PPCLK_FCLK, &now); 1013 ret = smu_get_current_clk_freq(smu, SMU_FCLK, &now);
1017 if (ret) { 1014 if (ret) {
1018 pr_err("Attempt to get current fclk Failed!"); 1015 pr_err("Attempt to get current fclk Failed!");
1019 return ret; 1016 return ret;
@@ -1028,7 +1025,7 @@ static int vega20_print_clk_levels(struct smu_context *smu,
1028 break; 1025 break;
1029 1026
1030 case SMU_DCEFCLK: 1027 case SMU_DCEFCLK:
1031 ret = smu_get_current_clk_freq(smu, PPCLK_DCEFCLK, &now); 1028 ret = smu_get_current_clk_freq(smu, SMU_DCEFCLK, &now);
1032 if (ret) { 1029 if (ret) {
1033 pr_err("Attempt to get current dcefclk Failed!"); 1030 pr_err("Attempt to get current dcefclk Failed!");
1034 return ret; 1031 return ret;
@@ -1502,11 +1499,17 @@ static int vega20_set_default_od8_setttings(struct smu_context *smu)
1502 1499
1503 od8_settings = kzalloc(sizeof(struct vega20_od8_settings), GFP_KERNEL); 1500 od8_settings = kzalloc(sizeof(struct vega20_od8_settings), GFP_KERNEL);
1504 1501
1505 if (od8_settings) 1502 if (!od8_settings)
1506 return -ENOMEM; 1503 return -ENOMEM;
1507 1504
1508 smu->od_settings = (void *)od8_settings; 1505 smu->od_settings = (void *)od8_settings;
1509 1506
1507 ret = vega20_setup_od8_information(smu);
1508 if (ret) {
1509 pr_err("Retrieve board OD limits failed!\n");
1510 return ret;
1511 }
1512
1510 if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) { 1513 if (smu_feature_is_enabled(smu, SMU_FEATURE_DPM_SOCCLK_BIT)) {
1511 if (od8_settings->od_feature_capabilities[ATOM_VEGA20_ODFEATURE_GFXCLK_LIMITS] && 1514 if (od8_settings->od_feature_capabilities[ATOM_VEGA20_ODFEATURE_GFXCLK_LIMITS] &&
1512 od8_settings->od_settings_max[OD8_SETTING_GFXCLK_FMAX] > 0 && 1515 od8_settings->od_settings_max[OD8_SETTING_GFXCLK_FMAX] > 0 &&
@@ -1677,7 +1680,7 @@ static int vega20_get_metrics_table(struct smu_context *smu,
1677 int ret = 0; 1680 int ret = 0;
1678 1681
1679 if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + HZ / 1000)) { 1682 if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + HZ / 1000)) {
1680 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 1683 ret = smu_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
1681 (void *)smu_table->metrics_table, false); 1684 (void *)smu_table->metrics_table, false);
1682 if (ret) { 1685 if (ret) {
1683 pr_info("Failed to export SMU metrics table!\n"); 1686 pr_info("Failed to export SMU metrics table!\n");
@@ -1706,7 +1709,7 @@ static int vega20_set_default_od_settings(struct smu_context *smu,
1706 if (!table_context->overdrive_table) 1709 if (!table_context->overdrive_table)
1707 return -ENOMEM; 1710 return -ENOMEM;
1708 1711
1709 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 1712 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0,
1710 table_context->overdrive_table, false); 1713 table_context->overdrive_table, false);
1711 if (ret) { 1714 if (ret) {
1712 pr_err("Failed to export over drive table!\n"); 1715 pr_err("Failed to export over drive table!\n");
@@ -1718,7 +1721,7 @@ static int vega20_set_default_od_settings(struct smu_context *smu,
1718 return ret; 1721 return ret;
1719 } 1722 }
1720 1723
1721 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 1724 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0,
1722 table_context->overdrive_table, true); 1725 table_context->overdrive_table, true);
1723 if (ret) { 1726 if (ret) {
1724 pr_err("Failed to import over drive table!\n"); 1727 pr_err("Failed to import over drive table!\n");
@@ -1802,7 +1805,7 @@ static int vega20_get_power_profile_mode(struct smu_context *smu, char *buf)
1802 /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */ 1805 /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
1803 workload_type = smu_workload_get_type(smu, i); 1806 workload_type = smu_workload_get_type(smu, i);
1804 result = smu_update_table(smu, 1807 result = smu_update_table(smu,
1805 SMU_TABLE_ACTIVITY_MONITOR_COEFF | workload_type << 16, 1808 SMU_TABLE_ACTIVITY_MONITOR_COEFF, workload_type,
1806 (void *)(&activity_monitor), false); 1809 (void *)(&activity_monitor), false);
1807 if (result) { 1810 if (result) {
1808 pr_err("[%s] Failed to get activity monitor!", __func__); 1811 pr_err("[%s] Failed to get activity monitor!", __func__);
@@ -1888,7 +1891,7 @@ static int vega20_set_power_profile_mode(struct smu_context *smu, long *input, u
1888 1891
1889 if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) { 1892 if (smu->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
1890 ret = smu_update_table(smu, 1893 ret = smu_update_table(smu,
1891 SMU_TABLE_ACTIVITY_MONITOR_COEFF | WORKLOAD_PPLIB_CUSTOM_BIT << 16, 1894 SMU_TABLE_ACTIVITY_MONITOR_COEFF, WORKLOAD_PPLIB_CUSTOM_BIT,
1892 (void *)(&activity_monitor), false); 1895 (void *)(&activity_monitor), false);
1893 if (ret) { 1896 if (ret) {
1894 pr_err("[%s] Failed to get activity monitor!", __func__); 1897 pr_err("[%s] Failed to get activity monitor!", __func__);
@@ -1943,7 +1946,7 @@ static int vega20_set_power_profile_mode(struct smu_context *smu, long *input, u
1943 } 1946 }
1944 1947
1945 ret = smu_update_table(smu, 1948 ret = smu_update_table(smu,
1946 SMU_TABLE_ACTIVITY_MONITOR_COEFF | WORKLOAD_PPLIB_CUSTOM_BIT << 16, 1949 SMU_TABLE_ACTIVITY_MONITOR_COEFF, WORKLOAD_PPLIB_CUSTOM_BIT,
1947 (void *)(&activity_monitor), true); 1950 (void *)(&activity_monitor), true);
1948 if (ret) { 1951 if (ret) {
1949 pr_err("[%s] Failed to set activity monitor!", __func__); 1952 pr_err("[%s] Failed to set activity monitor!", __func__);
@@ -2492,7 +2495,7 @@ static int vega20_update_od8_settings(struct smu_context *smu,
2492 struct smu_table_context *table_context = &smu->smu_table; 2495 struct smu_table_context *table_context = &smu->smu_table;
2493 int ret; 2496 int ret;
2494 2497
2495 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 2498 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0,
2496 table_context->overdrive_table, false); 2499 table_context->overdrive_table, false);
2497 if (ret) { 2500 if (ret) {
2498 pr_err("Failed to export over drive table!\n"); 2501 pr_err("Failed to export over drive table!\n");
@@ -2503,7 +2506,7 @@ static int vega20_update_od8_settings(struct smu_context *smu,
2503 if (ret) 2506 if (ret)
2504 return ret; 2507 return ret;
2505 2508
2506 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 2509 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0,
2507 table_context->overdrive_table, true); 2510 table_context->overdrive_table, true);
2508 if (ret) { 2511 if (ret) {
2509 pr_err("Failed to import over drive table!\n"); 2512 pr_err("Failed to import over drive table!\n");
@@ -2767,7 +2770,7 @@ static int vega20_odn_edit_dpm_table(struct smu_context *smu,
2767 break; 2770 break;
2768 2771
2769 case PP_OD_RESTORE_DEFAULT_TABLE: 2772 case PP_OD_RESTORE_DEFAULT_TABLE:
2770 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, table_context->overdrive_table, false); 2773 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0, table_context->overdrive_table, false);
2771 if (ret) { 2774 if (ret) {
2772 pr_err("Failed to export over drive table!\n"); 2775 pr_err("Failed to export over drive table!\n");
2773 return ret; 2776 return ret;
@@ -2776,7 +2779,7 @@ static int vega20_odn_edit_dpm_table(struct smu_context *smu,
2776 break; 2779 break;
2777 2780
2778 case PP_OD_COMMIT_DPM_TABLE: 2781 case PP_OD_COMMIT_DPM_TABLE:
2779 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, table_context->overdrive_table, true); 2782 ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0, table_context->overdrive_table, true);
2780 if (ret) { 2783 if (ret) {
2781 pr_err("Failed to import over drive table!\n"); 2784 pr_err("Failed to import over drive table!\n");
2782 return ret; 2785 return ret;
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index 3f222f464eb2..f4400788ab94 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -454,24 +454,6 @@ static void komeda_crtc_vblank_disable(struct drm_crtc *crtc)
454 mdev->funcs->on_off_vblank(mdev, kcrtc->master->id, false); 454 mdev->funcs->on_off_vblank(mdev, kcrtc->master->id, false);
455} 455}
456 456
457static int
458komeda_crtc_atomic_get_property(struct drm_crtc *crtc,
459 const struct drm_crtc_state *state,
460 struct drm_property *property, uint64_t *val)
461{
462 struct komeda_crtc *kcrtc = to_kcrtc(crtc);
463 struct komeda_crtc_state *kcrtc_st = to_kcrtc_st(state);
464
465 if (property == kcrtc->clock_ratio_property) {
466 *val = kcrtc_st->clock_ratio;
467 } else {
468 DRM_DEBUG_DRIVER("Unknown property %s\n", property->name);
469 return -EINVAL;
470 }
471
472 return 0;
473}
474
475static const struct drm_crtc_funcs komeda_crtc_funcs = { 457static const struct drm_crtc_funcs komeda_crtc_funcs = {
476 .gamma_set = drm_atomic_helper_legacy_gamma_set, 458 .gamma_set = drm_atomic_helper_legacy_gamma_set,
477 .destroy = drm_crtc_cleanup, 459 .destroy = drm_crtc_cleanup,
@@ -482,7 +464,6 @@ static const struct drm_crtc_funcs komeda_crtc_funcs = {
482 .atomic_destroy_state = komeda_crtc_atomic_destroy_state, 464 .atomic_destroy_state = komeda_crtc_atomic_destroy_state,
483 .enable_vblank = komeda_crtc_vblank_enable, 465 .enable_vblank = komeda_crtc_vblank_enable,
484 .disable_vblank = komeda_crtc_vblank_disable, 466 .disable_vblank = komeda_crtc_vblank_disable,
485 .atomic_get_property = komeda_crtc_atomic_get_property,
486}; 467};
487 468
488int komeda_kms_setup_crtcs(struct komeda_kms_dev *kms, 469int komeda_kms_setup_crtcs(struct komeda_kms_dev *kms,
@@ -518,42 +499,6 @@ int komeda_kms_setup_crtcs(struct komeda_kms_dev *kms,
518 return 0; 499 return 0;
519} 500}
520 501
521static int komeda_crtc_create_clock_ratio_property(struct komeda_crtc *kcrtc)
522{
523 struct drm_crtc *crtc = &kcrtc->base;
524 struct drm_property *prop;
525
526 prop = drm_property_create_range(crtc->dev, DRM_MODE_PROP_ATOMIC,
527 "CLOCK_RATIO", 0, U64_MAX);
528 if (!prop)
529 return -ENOMEM;
530
531 drm_object_attach_property(&crtc->base, prop, 0);
532 kcrtc->clock_ratio_property = prop;
533
534 return 0;
535}
536
537static int komeda_crtc_create_slave_planes_property(struct komeda_crtc *kcrtc)
538{
539 struct drm_crtc *crtc = &kcrtc->base;
540 struct drm_property *prop;
541
542 if (kcrtc->slave_planes == 0)
543 return 0;
544
545 prop = drm_property_create_range(crtc->dev, DRM_MODE_PROP_IMMUTABLE,
546 "slave_planes", 0, U32_MAX);
547 if (!prop)
548 return -ENOMEM;
549
550 drm_object_attach_property(&crtc->base, prop, kcrtc->slave_planes);
551
552 kcrtc->slave_planes_property = prop;
553
554 return 0;
555}
556
557static struct drm_plane * 502static struct drm_plane *
558get_crtc_primary(struct komeda_kms_dev *kms, struct komeda_crtc *crtc) 503get_crtc_primary(struct komeda_kms_dev *kms, struct komeda_crtc *crtc)
559{ 504{
@@ -590,14 +535,6 @@ static int komeda_crtc_add(struct komeda_kms_dev *kms,
590 535
591 crtc->port = kcrtc->master->of_output_port; 536 crtc->port = kcrtc->master->of_output_port;
592 537
593 err = komeda_crtc_create_clock_ratio_property(kcrtc);
594 if (err)
595 return err;
596
597 err = komeda_crtc_create_slave_planes_property(kcrtc);
598 if (err)
599 return err;
600
601 return err; 538 return err;
602} 539}
603 540
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
index 219fa3f0c336..8c89fc245b83 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
@@ -33,11 +33,6 @@ struct komeda_plane {
33 * Layers with same capabilities. 33 * Layers with same capabilities.
34 */ 34 */
35 struct komeda_layer *layer; 35 struct komeda_layer *layer;
36
37 /** @prop_img_enhancement: for on/off image enhancement */
38 struct drm_property *prop_img_enhancement;
39 /** @prop_layer_split: for on/off layer_split */
40 struct drm_property *prop_layer_split;
41}; 36};
42 37
43/** 38/**
@@ -52,11 +47,8 @@ struct komeda_plane_state {
52 /** @zlist_node: zorder list node */ 47 /** @zlist_node: zorder list node */
53 struct list_head zlist_node; 48 struct list_head zlist_node;
54 49
55 /* @img_enhancement: on/off image enhancement 50 /** @layer_split: on/off layer_split */
56 * @layer_split: on/off layer_split 51 u8 layer_split : 1;
57 */
58 u8 img_enhancement : 1,
59 layer_split : 1;
60}; 52};
61 53
62/** 54/**
@@ -94,12 +86,6 @@ struct komeda_crtc {
94 86
95 /** @disable_done: this flip_done is for tracing the disable */ 87 /** @disable_done: this flip_done is for tracing the disable */
96 struct completion *disable_done; 88 struct completion *disable_done;
97
98 /** @clock_ratio_property: property for ratio of (aclk << 32)/pxlclk */
99 struct drm_property *clock_ratio_property;
100
101 /** @slave_planes_property: property for slaves of the planes */
102 struct drm_property *slave_planes_property;
103}; 89};
104 90
105/** 91/**
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
index fc1b8613385e..a90bcbb3cb23 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.h
@@ -537,7 +537,8 @@ void komeda_pipeline_disable(struct komeda_pipeline *pipe,
537void komeda_pipeline_update(struct komeda_pipeline *pipe, 537void komeda_pipeline_update(struct komeda_pipeline *pipe,
538 struct drm_atomic_state *old_state); 538 struct drm_atomic_state *old_state);
539 539
540void komeda_complete_data_flow_cfg(struct komeda_data_flow_cfg *dflow, 540void komeda_complete_data_flow_cfg(struct komeda_layer *layer,
541 struct komeda_data_flow_cfg *dflow,
541 struct drm_framebuffer *fb); 542 struct drm_framebuffer *fb);
542 543
543#endif /* _KOMEDA_PIPELINE_H_*/ 544#endif /* _KOMEDA_PIPELINE_H_*/
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
index 2b415ef2b7d3..950235af1e79 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c
@@ -784,9 +784,11 @@ komeda_timing_ctrlr_validate(struct komeda_timing_ctrlr *ctrlr,
784 return 0; 784 return 0;
785} 785}
786 786
787void komeda_complete_data_flow_cfg(struct komeda_data_flow_cfg *dflow, 787void komeda_complete_data_flow_cfg(struct komeda_layer *layer,
788 struct komeda_data_flow_cfg *dflow,
788 struct drm_framebuffer *fb) 789 struct drm_framebuffer *fb)
789{ 790{
791 struct komeda_scaler *scaler = layer->base.pipeline->scalers[0];
790 u32 w = dflow->in_w; 792 u32 w = dflow->in_w;
791 u32 h = dflow->in_h; 793 u32 h = dflow->in_h;
792 794
@@ -803,6 +805,17 @@ void komeda_complete_data_flow_cfg(struct komeda_data_flow_cfg *dflow,
803 805
804 dflow->en_scaling = (w != dflow->out_w) || (h != dflow->out_h); 806 dflow->en_scaling = (w != dflow->out_w) || (h != dflow->out_h);
805 dflow->is_yuv = fb->format->is_yuv; 807 dflow->is_yuv = fb->format->is_yuv;
808
809 /* try to enable image enhancer if data flow is a 2x+ upscaling */
810 dflow->en_img_enhancement = dflow->out_w >= 2 * w ||
811 dflow->out_h >= 2 * h;
812
813 /* try to enable split if scaling exceed the scaler's acceptable
814 * input/output range.
815 */
816 if (dflow->en_scaling && scaler)
817 dflow->en_split = !in_range(&scaler->hsize, dflow->in_w) ||
818 !in_range(&scaler->hsize, dflow->out_w);
806} 819}
807 820
808static bool merger_is_available(struct komeda_pipeline *pipe, 821static bool merger_is_available(struct komeda_pipeline *pipe,
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
index 04b122f28fb6..c095af154216 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c
@@ -18,7 +18,6 @@ komeda_plane_init_data_flow(struct drm_plane_state *st,
18 struct komeda_data_flow_cfg *dflow) 18 struct komeda_data_flow_cfg *dflow)
19{ 19{
20 struct komeda_plane *kplane = to_kplane(st->plane); 20 struct komeda_plane *kplane = to_kplane(st->plane);
21 struct komeda_plane_state *kplane_st = to_kplane_st(st);
22 struct drm_framebuffer *fb = st->fb; 21 struct drm_framebuffer *fb = st->fb;
23 const struct komeda_format_caps *caps = to_kfb(fb)->format_caps; 22 const struct komeda_format_caps *caps = to_kfb(fb)->format_caps;
24 struct komeda_pipeline *pipe = kplane->layer->base.pipeline; 23 struct komeda_pipeline *pipe = kplane->layer->base.pipeline;
@@ -57,10 +56,7 @@ komeda_plane_init_data_flow(struct drm_plane_state *st,
57 return -EINVAL; 56 return -EINVAL;
58 } 57 }
59 58
60 dflow->en_img_enhancement = !!kplane_st->img_enhancement; 59 komeda_complete_data_flow_cfg(kplane->layer, dflow, fb);
61 dflow->en_split = !!kplane_st->layer_split;
62
63 komeda_complete_data_flow_cfg(dflow, fb);
64 60
65 return 0; 61 return 0;
66} 62}
@@ -175,8 +171,6 @@ komeda_plane_atomic_duplicate_state(struct drm_plane *plane)
175 171
176 old = to_kplane_st(plane->state); 172 old = to_kplane_st(plane->state);
177 173
178 new->img_enhancement = old->img_enhancement;
179
180 return &new->base; 174 return &new->base;
181} 175}
182 176
@@ -188,44 +182,6 @@ komeda_plane_atomic_destroy_state(struct drm_plane *plane,
188 kfree(to_kplane_st(state)); 182 kfree(to_kplane_st(state));
189} 183}
190 184
191static int
192komeda_plane_atomic_get_property(struct drm_plane *plane,
193 const struct drm_plane_state *state,
194 struct drm_property *property,
195 uint64_t *val)
196{
197 struct komeda_plane *kplane = to_kplane(plane);
198 struct komeda_plane_state *st = to_kplane_st(state);
199
200 if (property == kplane->prop_img_enhancement)
201 *val = st->img_enhancement;
202 else if (property == kplane->prop_layer_split)
203 *val = st->layer_split;
204 else
205 return -EINVAL;
206
207 return 0;
208}
209
210static int
211komeda_plane_atomic_set_property(struct drm_plane *plane,
212 struct drm_plane_state *state,
213 struct drm_property *property,
214 uint64_t val)
215{
216 struct komeda_plane *kplane = to_kplane(plane);
217 struct komeda_plane_state *st = to_kplane_st(state);
218
219 if (property == kplane->prop_img_enhancement)
220 st->img_enhancement = !!val;
221 else if (property == kplane->prop_layer_split)
222 st->layer_split = !!val;
223 else
224 return -EINVAL;
225
226 return 0;
227}
228
229static bool 185static bool
230komeda_plane_format_mod_supported(struct drm_plane *plane, 186komeda_plane_format_mod_supported(struct drm_plane *plane,
231 u32 format, u64 modifier) 187 u32 format, u64 modifier)
@@ -245,43 +201,9 @@ static const struct drm_plane_funcs komeda_plane_funcs = {
245 .reset = komeda_plane_reset, 201 .reset = komeda_plane_reset,
246 .atomic_duplicate_state = komeda_plane_atomic_duplicate_state, 202 .atomic_duplicate_state = komeda_plane_atomic_duplicate_state,
247 .atomic_destroy_state = komeda_plane_atomic_destroy_state, 203 .atomic_destroy_state = komeda_plane_atomic_destroy_state,
248 .atomic_get_property = komeda_plane_atomic_get_property,
249 .atomic_set_property = komeda_plane_atomic_set_property,
250 .format_mod_supported = komeda_plane_format_mod_supported, 204 .format_mod_supported = komeda_plane_format_mod_supported,
251}; 205};
252 206
253static int
254komeda_plane_create_layer_properties(struct komeda_plane *kplane,
255 struct komeda_layer *layer)
256{
257 struct drm_device *drm = kplane->base.dev;
258 struct drm_plane *plane = &kplane->base;
259 struct drm_property *prop = NULL;
260
261 /* property: layer image_enhancement */
262 if (layer->base.supported_outputs & KOMEDA_PIPELINE_SCALERS) {
263 prop = drm_property_create_bool(drm, DRM_MODE_PROP_ATOMIC,
264 "img_enhancement");
265 if (!prop)
266 return -ENOMEM;
267
268 drm_object_attach_property(&plane->base, prop, 0);
269 kplane->prop_img_enhancement = prop;
270 }
271
272 /* property: layer split */
273 if (layer->right) {
274 prop = drm_property_create_bool(drm, DRM_MODE_PROP_ATOMIC,
275 "layer_split");
276 if (!prop)
277 return -ENOMEM;
278 kplane->prop_layer_split = prop;
279 drm_object_attach_property(&plane->base, prop, 0);
280 }
281
282 return 0;
283}
284
285/* for komeda, which is pipeline can be share between crtcs */ 207/* for komeda, which is pipeline can be share between crtcs */
286static u32 get_possible_crtcs(struct komeda_kms_dev *kms, 208static u32 get_possible_crtcs(struct komeda_kms_dev *kms,
287 struct komeda_pipeline *pipe) 209 struct komeda_pipeline *pipe)
@@ -375,10 +297,6 @@ static int komeda_plane_add(struct komeda_kms_dev *kms,
375 if (err) 297 if (err)
376 goto cleanup; 298 goto cleanup;
377 299
378 err = komeda_plane_create_layer_properties(kplane, layer);
379 if (err)
380 goto cleanup;
381
382 err = drm_plane_create_color_properties(plane, 300 err = drm_plane_create_color_properties(plane,
383 BIT(DRM_COLOR_YCBCR_BT601) | 301 BIT(DRM_COLOR_YCBCR_BT601) |
384 BIT(DRM_COLOR_YCBCR_BT709) | 302 BIT(DRM_COLOR_YCBCR_BT709) |
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
index bb8a61f6e9a4..617e1f7b8472 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
@@ -13,7 +13,6 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer,
13 struct komeda_crtc_state *kcrtc_st, 13 struct komeda_crtc_state *kcrtc_st,
14 struct komeda_data_flow_cfg *dflow) 14 struct komeda_data_flow_cfg *dflow)
15{ 15{
16 struct komeda_scaler *scaler = wb_layer->base.pipeline->scalers[0];
17 struct drm_framebuffer *fb = conn_st->writeback_job->fb; 16 struct drm_framebuffer *fb = conn_st->writeback_job->fb;
18 17
19 memset(dflow, 0, sizeof(*dflow)); 18 memset(dflow, 0, sizeof(*dflow));
@@ -28,14 +27,7 @@ komeda_wb_init_data_flow(struct komeda_layer *wb_layer,
28 dflow->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE; 27 dflow->pixel_blend_mode = DRM_MODE_BLEND_PIXEL_NONE;
29 dflow->rot = DRM_MODE_ROTATE_0; 28 dflow->rot = DRM_MODE_ROTATE_0;
30 29
31 komeda_complete_data_flow_cfg(dflow, fb); 30 komeda_complete_data_flow_cfg(wb_layer, dflow, fb);
32
33 /* if scaling exceed the acceptable scaler input/output range, try to
34 * enable split.
35 */
36 if (dflow->en_scaling && scaler)
37 dflow->en_split = !in_range(&scaler->hsize, dflow->in_w) ||
38 !in_range(&scaler->hsize, dflow->out_w);
39 31
40 return 0; 32 return 0;
41} 33}
diff --git a/drivers/gpu/drm/bochs/bochs.h b/drivers/gpu/drm/bochs/bochs.h
index cc35d492142c..2a65434500ee 100644
--- a/drivers/gpu/drm/bochs/bochs.h
+++ b/drivers/gpu/drm/bochs/bochs.h
@@ -86,7 +86,7 @@ void bochs_hw_setmode(struct bochs_device *bochs,
86void bochs_hw_setformat(struct bochs_device *bochs, 86void bochs_hw_setformat(struct bochs_device *bochs,
87 const struct drm_format_info *format); 87 const struct drm_format_info *format);
88void bochs_hw_setbase(struct bochs_device *bochs, 88void bochs_hw_setbase(struct bochs_device *bochs,
89 int x, int y, u64 addr); 89 int x, int y, int stride, u64 addr);
90int bochs_hw_load_edid(struct bochs_device *bochs); 90int bochs_hw_load_edid(struct bochs_device *bochs);
91 91
92/* bochs_mm.c */ 92/* bochs_mm.c */
diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index 791ab2f79947..ebfea8744fe6 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -255,16 +255,22 @@ void bochs_hw_setformat(struct bochs_device *bochs,
255} 255}
256 256
257void bochs_hw_setbase(struct bochs_device *bochs, 257void bochs_hw_setbase(struct bochs_device *bochs,
258 int x, int y, u64 addr) 258 int x, int y, int stride, u64 addr)
259{ 259{
260 unsigned long offset = (unsigned long)addr + 260 unsigned long offset;
261 unsigned int vx, vy, vwidth;
262
263 bochs->stride = stride;
264 offset = (unsigned long)addr +
261 y * bochs->stride + 265 y * bochs->stride +
262 x * (bochs->bpp / 8); 266 x * (bochs->bpp / 8);
263 int vy = offset / bochs->stride; 267 vy = offset / bochs->stride;
264 int vx = (offset % bochs->stride) * 8 / bochs->bpp; 268 vx = (offset % bochs->stride) * 8 / bochs->bpp;
269 vwidth = stride * 8 / bochs->bpp;
265 270
266 DRM_DEBUG_DRIVER("x %d, y %d, addr %llx -> offset %lx, vx %d, vy %d\n", 271 DRM_DEBUG_DRIVER("x %d, y %d, addr %llx -> offset %lx, vx %d, vy %d\n",
267 x, y, addr, offset, vx, vy); 272 x, y, addr, offset, vx, vy);
273 bochs_dispi_write(bochs, VBE_DISPI_INDEX_VIRT_WIDTH, vwidth);
268 bochs_dispi_write(bochs, VBE_DISPI_INDEX_X_OFFSET, vx); 274 bochs_dispi_write(bochs, VBE_DISPI_INDEX_X_OFFSET, vx);
269 bochs_dispi_write(bochs, VBE_DISPI_INDEX_Y_OFFSET, vy); 275 bochs_dispi_write(bochs, VBE_DISPI_INDEX_Y_OFFSET, vy);
270} 276}
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index 5904eddc83a5..bc19dbd531ef 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -36,7 +36,8 @@ static void bochs_plane_update(struct bochs_device *bochs,
36 bochs_hw_setbase(bochs, 36 bochs_hw_setbase(bochs,
37 state->crtc_x, 37 state->crtc_x,
38 state->crtc_y, 38 state->crtc_y,
39 gbo->bo.offset); 39 state->fb->pitches[0],
40 state->fb->offsets[0] + gbo->bo.offset);
40 bochs_hw_setformat(bochs, state->fb->format); 41 bochs_hw_setformat(bochs, state->fb->format);
41} 42}
42 43
diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
index e95fceac8f8b..56d36779d213 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -180,7 +180,8 @@ again:
180 180
181create_mode: 181create_mode:
182 mode = drm_mode_create_from_cmdline_mode(connector->dev, cmdline_mode); 182 mode = drm_mode_create_from_cmdline_mode(connector->dev, cmdline_mode);
183 list_add(&mode->head, &connector->modes); 183 if (mode)
184 list_add(&mode->head, &connector->modes);
184 185
185 return mode; 186 return mode;
186} 187}
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
index 3afed5677946..b3f2cf7eae9c 100644
--- a/drivers/gpu/drm/drm_connector.c
+++ b/drivers/gpu/drm/drm_connector.c
@@ -141,7 +141,7 @@ static void drm_connector_get_cmdline_mode(struct drm_connector *connector)
141 141
142 DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n", 142 DRM_DEBUG_KMS("cmdline mode for connector %s %s %dx%d@%dHz%s%s%s\n",
143 connector->name, 143 connector->name,
144 mode->name ? mode->name : "", 144 mode->name,
145 mode->xres, mode->yres, 145 mode->xres, mode->yres,
146 mode->refresh_specified ? mode->refresh : 60, 146 mode->refresh_specified ? mode->refresh : 60,
147 mode->rb ? " reduced blanking" : "", 147 mode->rb ? " reduced blanking" : "",
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 57e6408288c8..74a5739df506 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -158,6 +158,9 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay,
158 int interlace; 158 int interlace;
159 u64 tmp; 159 u64 tmp;
160 160
161 if (!hdisplay || !vdisplay)
162 return NULL;
163
161 /* allocate the drm_display_mode structure. If failure, we will 164 /* allocate the drm_display_mode structure. If failure, we will
162 * return directly 165 * return directly
163 */ 166 */
@@ -392,6 +395,9 @@ drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay,
392 int hsync, hfront_porch, vodd_front_porch_lines; 395 int hsync, hfront_porch, vodd_front_porch_lines;
393 unsigned int tmp1, tmp2; 396 unsigned int tmp1, tmp2;
394 397
398 if (!hdisplay || !vdisplay)
399 return NULL;
400
395 drm_mode = drm_mode_create(dev); 401 drm_mode = drm_mode_create(dev);
396 if (!drm_mode) 402 if (!drm_mode)
397 return NULL; 403 return NULL;
@@ -1448,7 +1454,7 @@ static int drm_mode_parse_cmdline_refresh(const char *str, char **end_ptr,
1448} 1454}
1449 1455
1450static int drm_mode_parse_cmdline_extra(const char *str, int length, 1456static int drm_mode_parse_cmdline_extra(const char *str, int length,
1451 struct drm_connector *connector, 1457 const struct drm_connector *connector,
1452 struct drm_cmdline_mode *mode) 1458 struct drm_cmdline_mode *mode)
1453{ 1459{
1454 int i; 1460 int i;
@@ -1493,7 +1499,7 @@ static int drm_mode_parse_cmdline_extra(const char *str, int length,
1493 1499
1494static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length, 1500static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
1495 bool extras, 1501 bool extras,
1496 struct drm_connector *connector, 1502 const struct drm_connector *connector,
1497 struct drm_cmdline_mode *mode) 1503 struct drm_cmdline_mode *mode)
1498{ 1504{
1499 const char *str_start = str; 1505 const char *str_start = str;
@@ -1555,7 +1561,7 @@ static int drm_mode_parse_cmdline_res_mode(const char *str, unsigned int length,
1555} 1561}
1556 1562
1557static int drm_mode_parse_cmdline_options(char *str, size_t len, 1563static int drm_mode_parse_cmdline_options(char *str, size_t len,
1558 struct drm_connector *connector, 1564 const struct drm_connector *connector,
1559 struct drm_cmdline_mode *mode) 1565 struct drm_cmdline_mode *mode)
1560{ 1566{
1561 unsigned int rotation = 0; 1567 unsigned int rotation = 0;
@@ -1689,7 +1695,7 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len,
1689 * True if a valid modeline has been parsed, false otherwise. 1695 * True if a valid modeline has been parsed, false otherwise.
1690 */ 1696 */
1691bool drm_mode_parse_command_line_for_connector(const char *mode_option, 1697bool drm_mode_parse_command_line_for_connector(const char *mode_option,
1692 struct drm_connector *connector, 1698 const struct drm_connector *connector,
1693 struct drm_cmdline_mode *mode) 1699 struct drm_cmdline_mode *mode)
1694{ 1700{
1695 const char *name; 1701 const char *name;
diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c
index d8a0bcd02f34..ffd95bfeaa94 100644
--- a/drivers/gpu/drm/drm_panel_orientation_quirks.c
+++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c
@@ -90,6 +90,12 @@ static const struct drm_dmi_panel_orientation_data itworks_tw891 = {
90 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, 90 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
91}; 91};
92 92
93static const struct drm_dmi_panel_orientation_data lcd720x1280_rightside_up = {
94 .width = 720,
95 .height = 1280,
96 .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
97};
98
93static const struct drm_dmi_panel_orientation_data lcd800x1280_rightside_up = { 99static const struct drm_dmi_panel_orientation_data lcd800x1280_rightside_up = {
94 .width = 800, 100 .width = 800,
95 .height = 1280, 101 .height = 1280,
@@ -123,6 +129,12 @@ static const struct dmi_system_id orientation_data[] = {
123 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), 129 DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"),
124 }, 130 },
125 .driver_data = (void *)&gpd_micropc, 131 .driver_data = (void *)&gpd_micropc,
132 }, { /* GPD MicroPC (later BIOS versions with proper DMI strings) */
133 .matches = {
134 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"),
135 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MicroPC"),
136 },
137 .driver_data = (void *)&lcd720x1280_rightside_up,
126 }, { /* 138 }, { /*
127 * GPD Pocket, note that the the DMI data is less generic then 139 * GPD Pocket, note that the the DMI data is less generic then
128 * it seems, devices with a board-vendor of "AMI Corporation" 140 * it seems, devices with a board-vendor of "AMI Corporation"
diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild
index b0f53f4f71bf..7a62fa04272d 100644
--- a/drivers/gpu/drm/nouveau/Kbuild
+++ b/drivers/gpu/drm/nouveau/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2ccflags-y += -I $(srctree)/$(src)/include 2ccflags-y += -I $(srctree)/$(src)/include
3ccflags-y += -I $(srctree)/$(src)/include/nvkm 3ccflags-y += -I $(srctree)/$(src)/include/nvkm
4ccflags-y += -I $(srctree)/$(src)/nvkm 4ccflags-y += -I $(srctree)/$(src)/nvkm
diff --git a/drivers/gpu/drm/nouveau/dispnv04/Kbuild b/drivers/gpu/drm/nouveau/dispnv04/Kbuild
index 65a3990b4e16..975c4e226936 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/Kbuild
+++ b/drivers/gpu/drm/nouveau/dispnv04/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nouveau-y += dispnv04/arb.o 2nouveau-y += dispnv04/arb.o
3nouveau-y += dispnv04/crtc.o 3nouveau-y += dispnv04/crtc.o
4nouveau-y += dispnv04/cursor.o 4nouveau-y += dispnv04/cursor.o
diff --git a/drivers/gpu/drm/nouveau/dispnv04/cursor.c b/drivers/gpu/drm/nouveau/dispnv04/cursor.c
index ebf860bd59af..16e09f6b9113 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/cursor.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/cursor.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include <drm/drmP.h> 2#include <drm/drmP.h>
3#include <drm/drm_mode.h> 3#include <drm/drm_mode.h>
4#include "nouveau_drv.h" 4#include "nouveau_drv.h"
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.h b/drivers/gpu/drm/nouveau/dispnv04/disp.h
index c6ed20a09f4a..6ccfc09bcf0f 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.h
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV04_DISPLAY_H__ 2#ifndef __NV04_DISPLAY_H__
3#define __NV04_DISPLAY_H__ 3#define __NV04_DISPLAY_H__
4#include <subdev/bios.h> 4#include <subdev/bios.h>
diff --git a/drivers/gpu/drm/nouveau/dispnv50/Kbuild b/drivers/gpu/drm/nouveau/dispnv50/Kbuild
index 475c630308d1..e0c435eae664 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/Kbuild
+++ b/drivers/gpu/drm/nouveau/dispnv50/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nouveau-y += dispnv50/disp.o 2nouveau-y += dispnv50/disp.o
3nouveau-y += dispnv50/lut.o 3nouveau-y += dispnv50/lut.o
4 4
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 7ba373f493b2..8497768f1b41 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -322,8 +322,13 @@ nv50_outp_atomic_check_view(struct drm_encoder *encoder,
322 switch (connector->connector_type) { 322 switch (connector->connector_type) {
323 case DRM_MODE_CONNECTOR_LVDS: 323 case DRM_MODE_CONNECTOR_LVDS:
324 case DRM_MODE_CONNECTOR_eDP: 324 case DRM_MODE_CONNECTOR_eDP:
325 /* Force use of scaler for non-EDID modes. */ 325 /* Don't force scaler for EDID modes with
326 if (adjusted_mode->type & DRM_MODE_TYPE_DRIVER) 326 * same size as the native one (e.g. different
327 * refresh rate)
328 */
329 if (adjusted_mode->hdisplay == native_mode->hdisplay &&
330 adjusted_mode->vdisplay == native_mode->vdisplay &&
331 adjusted_mode->type & DRM_MODE_TYPE_DRIVER)
327 break; 332 break;
328 mode = native_mode; 333 mode = native_mode;
329 asyc->scaler.full = true; 334 asyc->scaler.full = true;
diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c
index 48a6485ec4e0..929d93b1677e 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/head.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/head.c
@@ -169,14 +169,34 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh,
169 */ 169 */
170 switch (mode) { 170 switch (mode) {
171 case DRM_MODE_SCALE_CENTER: 171 case DRM_MODE_SCALE_CENTER:
172 asyh->view.oW = min((u16)umode->hdisplay, asyh->view.oW); 172 /* NOTE: This will cause scaling when the input is
173 asyh->view.oH = min((u16)umode_vdisplay, asyh->view.oH); 173 * larger than the output.
174 /* fall-through */ 174 */
175 asyh->view.oW = min(asyh->view.iW, asyh->view.oW);
176 asyh->view.oH = min(asyh->view.iH, asyh->view.oH);
177 break;
175 case DRM_MODE_SCALE_ASPECT: 178 case DRM_MODE_SCALE_ASPECT:
176 if (asyh->view.oH < asyh->view.oW) { 179 /* Determine whether the scaling should be on width or on
180 * height. This is done by comparing the aspect ratios of the
181 * sizes. If the output AR is larger than input AR, that means
182 * we want to change the width (letterboxed on the
183 * left/right), otherwise on the height (letterboxed on the
184 * top/bottom).
185 *
186 * E.g. 4:3 (1.333) AR image displayed on a 16:10 (1.6) AR
187 * screen will have letterboxes on the left/right. However a
188 * 16:9 (1.777) AR image on that same screen will have
189 * letterboxes on the top/bottom.
190 *
191 * inputAR = iW / iH; outputAR = oW / oH
192 * outputAR > inputAR is equivalent to oW * iH > iW * oH
193 */
194 if (asyh->view.oW * asyh->view.iH > asyh->view.iW * asyh->view.oH) {
195 /* Recompute output width, i.e. left/right letterbox */
177 u32 r = (asyh->view.iW << 19) / asyh->view.iH; 196 u32 r = (asyh->view.iW << 19) / asyh->view.iH;
178 asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19; 197 asyh->view.oW = ((asyh->view.oH * r) + (r / 2)) >> 19;
179 } else { 198 } else {
199 /* Recompute output height, i.e. top/bottom letterbox */
180 u32 r = (asyh->view.iH << 19) / asyh->view.iW; 200 u32 r = (asyh->view.iH << 19) / asyh->view.iW;
181 asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19; 201 asyh->view.oH = ((asyh->view.oW * r) + (r / 2)) >> 19;
182 } 202 }
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl0002.h b/drivers/gpu/drm/nouveau/include/nvif/cl0002.h
index 1a8b45b4631f..65d432a5bd6c 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl0002.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl0002.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL0002_H__ 2#ifndef __NVIF_CL0002_H__
3#define __NVIF_CL0002_H__ 3#define __NVIF_CL0002_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl0046.h b/drivers/gpu/drm/nouveau/include/nvif/cl0046.h
index c0d5eba4f8fc..d490d401870a 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl0046.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl0046.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL0046_H__ 2#ifndef __NVIF_CL0046_H__
3#define __NVIF_CL0046_H__ 3#define __NVIF_CL0046_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl006b.h b/drivers/gpu/drm/nouveau/include/nvif/cl006b.h
index d0e8f35d9e92..c960c449e430 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl006b.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl006b.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL006B_H__ 2#ifndef __NVIF_CL006B_H__
3#define __NVIF_CL006B_H__ 3#define __NVIF_CL006B_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl0080.h b/drivers/gpu/drm/nouveau/include/nvif/cl0080.h
index 4cbed0329367..cd9a2e687bb6 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl0080.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl0080.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL0080_H__ 2#ifndef __NVIF_CL0080_H__
3#define __NVIF_CL0080_H__ 3#define __NVIF_CL0080_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl506e.h b/drivers/gpu/drm/nouveau/include/nvif/cl506e.h
index 989690fe3cd8..9df289c7a84f 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl506e.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl506e.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL506E_H__ 2#ifndef __NVIF_CL506E_H__
3#define __NVIF_CL506E_H__ 3#define __NVIF_CL506E_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl506f.h b/drivers/gpu/drm/nouveau/include/nvif/cl506f.h
index 5137b6879abd..327c96a994bb 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl506f.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl506f.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL506F_H__ 2#ifndef __NVIF_CL506F_H__
3#define __NVIF_CL506F_H__ 3#define __NVIF_CL506F_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl5070.h b/drivers/gpu/drm/nouveau/include/nvif/cl5070.h
index bced81987269..38bf4f38e869 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl5070.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl5070.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL5070_H__ 2#ifndef __NVIF_CL5070_H__
3#define __NVIF_CL5070_H__ 3#define __NVIF_CL5070_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl507a.h b/drivers/gpu/drm/nouveau/include/nvif/cl507a.h
index 36e537218596..3b2a9809b8ce 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl507a.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl507a.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL507A_H__ 2#ifndef __NVIF_CL507A_H__
3#define __NVIF_CL507A_H__ 3#define __NVIF_CL507A_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl507b.h b/drivers/gpu/drm/nouveau/include/nvif/cl507b.h
index 3e643b752bfc..0f3d05581ea5 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl507b.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl507b.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL507B_H__ 2#ifndef __NVIF_CL507B_H__
3#define __NVIF_CL507B_H__ 3#define __NVIF_CL507B_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl507c.h b/drivers/gpu/drm/nouveau/include/nvif/cl507c.h
index fd9e336d0a24..7da8813f4f5c 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl507c.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl507c.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL507C_H__ 2#ifndef __NVIF_CL507C_H__
3#define __NVIF_CL507C_H__ 3#define __NVIF_CL507C_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl507d.h b/drivers/gpu/drm/nouveau/include/nvif/cl507d.h
index e994c6894e3e..4a56e42d8bc9 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl507d.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl507d.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL507D_H__ 2#ifndef __NVIF_CL507D_H__
3#define __NVIF_CL507D_H__ 3#define __NVIF_CL507D_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl507e.h b/drivers/gpu/drm/nouveau/include/nvif/cl507e.h
index 8082d2fde248..633936cb6313 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl507e.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl507e.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL507E_H__ 2#ifndef __NVIF_CL507E_H__
3#define __NVIF_CL507E_H__ 3#define __NVIF_CL507E_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl826e.h b/drivers/gpu/drm/nouveau/include/nvif/cl826e.h
index 1a875090b251..1b6496d31580 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl826e.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl826e.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL826E_H__ 2#ifndef __NVIF_CL826E_H__
3#define __NVIF_CL826E_H__ 3#define __NVIF_CL826E_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl826f.h b/drivers/gpu/drm/nouveau/include/nvif/cl826f.h
index e4e50cfe88f1..148602264a76 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl826f.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl826f.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL826F_H__ 2#ifndef __NVIF_CL826F_H__
3#define __NVIF_CL826F_H__ 3#define __NVIF_CL826F_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl906f.h b/drivers/gpu/drm/nouveau/include/nvif/cl906f.h
index ab0fa8adb756..3823d6891b55 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl906f.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl906f.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL906F_H__ 2#ifndef __NVIF_CL906F_H__
3#define __NVIF_CL906F_H__ 3#define __NVIF_CL906F_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cl9097.h b/drivers/gpu/drm/nouveau/include/nvif/cl9097.h
index e4c8de6d00b7..599d858afa36 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cl9097.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cl9097.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CL9097_H__ 2#ifndef __NVIF_CL9097_H__
3#define __NVIF_CL9097_H__ 3#define __NVIF_CL9097_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/cla06f.h b/drivers/gpu/drm/nouveau/include/nvif/cla06f.h
index 81401eb970ea..cfa18f1fbf83 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/cla06f.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/cla06f.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CLA06F_H__ 2#ifndef __NVIF_CLA06F_H__
3#define __NVIF_CLA06F_H__ 3#define __NVIF_CLA06F_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/class.h b/drivers/gpu/drm/nouveau/include/nvif/class.h
index 7d556a1c92fa..f704ae600e94 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/class.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/class.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CLASS_H__ 2#ifndef __NVIF_CLASS_H__
3#define __NVIF_CLASS_H__ 3#define __NVIF_CLASS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/clc36f.h b/drivers/gpu/drm/nouveau/include/nvif/clc36f.h
index 6b14d7e3f6bb..f66885891238 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/clc36f.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/clc36f.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CLC36F_H__ 2#ifndef __NVIF_CLC36F_H__
3#define __NVIF_CLC36F_H__ 3#define __NVIF_CLC36F_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/clc37b.h b/drivers/gpu/drm/nouveau/include/nvif/clc37b.h
index 89b18189d43b..970a5ac4cb95 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/clc37b.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/clc37b.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CLC37B_H__ 2#ifndef __NVIF_CLC37B_H__
3#define __NVIF_CLC37B_H__ 3#define __NVIF_CLC37B_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/clc37e.h b/drivers/gpu/drm/nouveau/include/nvif/clc37e.h
index 899db9e915ef..7ea23695e7e1 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/clc37e.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/clc37e.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CLC37E_H__ 2#ifndef __NVIF_CLC37E_H__
3#define __NVIF_CLC37E_H__ 3#define __NVIF_CLC37E_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/client.h b/drivers/gpu/drm/nouveau/include/nvif/client.h
index f5df8b30c599..e63c6c965b54 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/client.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/client.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_CLIENT_H__ 2#ifndef __NVIF_CLIENT_H__
3#define __NVIF_CLIENT_H__ 3#define __NVIF_CLIENT_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/device.h b/drivers/gpu/drm/nouveau/include/nvif/device.h
index ef839bd1d37e..25d969dcf67d 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/device.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/device.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_DEVICE_H__ 2#ifndef __NVIF_DEVICE_H__
3#define __NVIF_DEVICE_H__ 3#define __NVIF_DEVICE_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/driver.h b/drivers/gpu/drm/nouveau/include/nvif/driver.h
index 93bccd45a042..8e85b936eaa0 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/driver.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/driver.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_DRIVER_H__ 2#ifndef __NVIF_DRIVER_H__
3#define __NVIF_DRIVER_H__ 3#define __NVIF_DRIVER_H__
4#include <nvif/os.h> 4#include <nvif/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvif/event.h b/drivers/gpu/drm/nouveau/include/nvif/event.h
index ec5c924f576a..a6b1ee4f10ca 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/event.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/event.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_EVENT_H__ 2#ifndef __NVIF_EVENT_H__
3#define __NVIF_EVENT_H__ 3#define __NVIF_EVENT_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0000.h b/drivers/gpu/drm/nouveau/include/nvif/if0000.h
index 30ecd31db5df..f7b8f8f48760 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0000.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0000.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IF0000_H__ 2#ifndef __NVIF_IF0000_H__
3#define __NVIF_IF0000_H__ 3#define __NVIF_IF0000_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0001.h b/drivers/gpu/drm/nouveau/include/nvif/if0001.h
index ca9215262215..4ced50e98ced 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0001.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0001.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IF0001_H__ 2#ifndef __NVIF_IF0001_H__
3#define __NVIF_IF0001_H__ 3#define __NVIF_IF0001_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0002.h b/drivers/gpu/drm/nouveau/include/nvif/if0002.h
index d9235c011196..df2915d6a61e 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0002.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0002.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IF0002_H__ 2#ifndef __NVIF_IF0002_H__
3#define __NVIF_IF0002_H__ 3#define __NVIF_IF0002_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0003.h b/drivers/gpu/drm/nouveau/include/nvif/if0003.h
index ae30b8261b88..78467da07c37 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0003.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0003.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IF0003_H__ 2#ifndef __NVIF_IF0003_H__
3#define __NVIF_IF0003_H__ 3#define __NVIF_IF0003_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0004.h b/drivers/gpu/drm/nouveau/include/nvif/if0004.h
index b35547c8ea36..d324c73c27fb 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0004.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0004.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IF0004_H__ 2#ifndef __NVIF_IF0004_H__
3#define __NVIF_IF0004_H__ 3#define __NVIF_IF0004_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/if0005.h b/drivers/gpu/drm/nouveau/include/nvif/if0005.h
index 8ed0ae101715..fb9305b3b32c 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/if0005.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/if0005.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IF0005_H__ 2#ifndef __NVIF_IF0005_H__
3#define __NVIF_IF0005_H__ 3#define __NVIF_IF0005_H__
4#define NV10_NVSW_NTFY_UEVENT 0x00 4#define NV10_NVSW_NTFY_UEVENT 0x00
diff --git a/drivers/gpu/drm/nouveau/include/nvif/ioctl.h b/drivers/gpu/drm/nouveau/include/nvif/ioctl.h
index b93d586a2304..886c63fe753f 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/ioctl.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/ioctl.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_IOCTL_H__ 2#ifndef __NVIF_IOCTL_H__
3#define __NVIF_IOCTL_H__ 3#define __NVIF_IOCTL_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/notify.h b/drivers/gpu/drm/nouveau/include/nvif/notify.h
index 4ed169230657..6863732eb286 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/notify.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/notify.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_NOTIFY_H__ 2#ifndef __NVIF_NOTIFY_H__
3#define __NVIF_NOTIFY_H__ 3#define __NVIF_NOTIFY_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/object.h b/drivers/gpu/drm/nouveau/include/nvif/object.h
index 8407651f6ac6..604fabc0e689 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/object.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/object.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_OBJECT_H__ 2#ifndef __NVIF_OBJECT_H__
3#define __NVIF_OBJECT_H__ 3#define __NVIF_OBJECT_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/os.h b/drivers/gpu/drm/nouveau/include/nvif/os.h
index fd09b2842972..429d0106c123 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/os.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/os.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_OS_H__ 2#ifndef __NOUVEAU_OS_H__
3#define __NOUVEAU_OS_H__ 3#define __NOUVEAU_OS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvif/unpack.h b/drivers/gpu/drm/nouveau/include/nvif/unpack.h
index 7f0d9f6cc1e7..0584b938e8f9 100644
--- a/drivers/gpu/drm/nouveau/include/nvif/unpack.h
+++ b/drivers/gpu/drm/nouveau/include/nvif/unpack.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVIF_UNPACK_H__ 2#ifndef __NVIF_UNPACK_H__
3#define __NVIF_UNPACK_H__ 3#define __NVIF_UNPACK_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h
index 757fac823a10..5d7017fe5039 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/client.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/client.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CLIENT_H__ 2#ifndef __NVKM_CLIENT_H__
3#define __NVKM_CLIENT_H__ 3#define __NVKM_CLIENT_H__
4#define nvkm_client(p) container_of((p), struct nvkm_client, object) 4#define nvkm_client(p) container_of((p), struct nvkm_client, object)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h b/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h
index 966d1822dd80..b4a9c7d991ca 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/debug.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEBUG_H__ 2#ifndef __NVKM_DEBUG_H__
3#define __NVKM_DEBUG_H__ 3#define __NVKM_DEBUG_H__
4#define NV_DBG_FATAL 0 4#define NV_DBG_FATAL 0
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
index 642492344196..6d55cd0476aa 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/device.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVICE_H__ 2#ifndef __NVKM_DEVICE_H__
3#define __NVKM_DEVICE_H__ 3#define __NVKM_DEVICE_H__
4#include <core/oclass.h> 4#include <core/oclass.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h b/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h
index 8a2be5b635e2..c6b401a6ea23 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_ENGINE_H__ 2#ifndef __NVKM_ENGINE_H__
3#define __NVKM_ENGINE_H__ 3#define __NVKM_ENGINE_H__
4#define nvkm_engine(p) container_of((p), struct nvkm_engine, subdev) 4#define nvkm_engine(p) container_of((p), struct nvkm_engine, subdev)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h b/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h
index 38acbde2de4f..ce98efd4b209 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/enum.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_ENUM_H__ 2#ifndef __NVKM_ENUM_H__
3#define __NVKM_ENUM_H__ 3#define __NVKM_ENUM_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/event.h b/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
index d3c45e90a1c1..a7a413f07a78 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/event.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_EVENT_H__ 2#ifndef __NVKM_EVENT_H__
3#define __NVKM_EVENT_H__ 3#define __NVKM_EVENT_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h b/drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h
index 54da9c6bc8d5..383370c32428 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/firmware.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FIRMWARE_H__ 2#ifndef __NVKM_FIRMWARE_H__
3#define __NVKM_FIRMWARE_H__ 3#define __NVKM_FIRMWARE_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h b/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h
index 10eeaeebc242..0f515ec28fa9 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/gpuobj.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GPUOBJ_H__ 2#ifndef __NVKM_GPUOBJ_H__
3#define __NVKM_GPUOBJ_H__ 3#define __NVKM_GPUOBJ_H__
4#include <core/memory.h> 4#include <core/memory.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h b/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h
index e2d39192fa26..71ed147ad077 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/ioctl.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_IOCTL_H__ 2#ifndef __NVKM_IOCTL_H__
3#define __NVKM_IOCTL_H__ 3#define __NVKM_IOCTL_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h b/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h
index f34c80310861..b23bf6109f2d 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/memory.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MEMORY_H__ 2#ifndef __NVKM_MEMORY_H__
3#define __NVKM_MEMORY_H__ 3#define __NVKM_MEMORY_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h b/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h
index b0726c39429e..4ecfbde88537 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/mm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MM_H__ 2#ifndef __NVKM_MM_H__
3#define __NVKM_MM_H__ 3#define __NVKM_MM_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h b/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h
index 4eb82bc563f3..3d358a66db3a 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/notify.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_NOTIFY_H__ 2#ifndef __NVKM_NOTIFY_H__
3#define __NVKM_NOTIFY_H__ 3#define __NVKM_NOTIFY_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h
index 270f893cc154..7efcd5d2f2ff 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_OBJECT_H__ 2#ifndef __NVKM_OBJECT_H__
3#define __NVKM_OBJECT_H__ 3#define __NVKM_OBJECT_H__
4#include <core/oclass.h> 4#include <core/oclass.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/oproxy.h b/drivers/gpu/drm/nouveau/include/nvkm/core/oproxy.h
index d950d5ee188b..0e70a9afba33 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/oproxy.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/oproxy.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_OPROXY_H__ 2#ifndef __NVKM_OPROXY_H__
3#define __NVKM_OPROXY_H__ 3#define __NVKM_OPROXY_H__
4#define nvkm_oproxy(p) container_of((p), struct nvkm_oproxy, base) 4#define nvkm_oproxy(p) container_of((p), struct nvkm_oproxy, base)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/option.h b/drivers/gpu/drm/nouveau/include/nvkm/core/option.h
index a34a79bacbd0..6882eb7c7e26 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/option.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/option.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_OPTION_H__ 2#ifndef __NVKM_OPTION_H__
3#define __NVKM_OPTION_H__ 3#define __NVKM_OPTION_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h
index 445602d1e8d3..029a416197db 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_OS_H__ 2#ifndef __NVKM_OS_H__
3#define __NVKM_OS_H__ 3#define __NVKM_OS_H__
4#include <nvif/os.h> 4#include <nvif/os.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h b/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
index 4c7f647d2dc9..b4b5df3e1610 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVICE_PCI_H__ 2#ifndef __NVKM_DEVICE_PCI_H__
3#define __NVKM_DEVICE_PCI_H__ 3#define __NVKM_DEVICE_PCI_H__
4#include <core/device.h> 4#include <core/device.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h b/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h
index d5d789663aca..bc2d1dcccb4e 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/ramht.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_RAMHT_H__ 2#ifndef __NVKM_RAMHT_H__
3#define __NVKM_RAMHT_H__ 3#define __NVKM_RAMHT_H__
4#include <core/gpuobj.h> 4#include <core/gpuobj.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
index 85a0777c2ce4..1218f28c14ba 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SUBDEV_H__ 2#ifndef __NVKM_SUBDEV_H__
3#define __NVKM_SUBDEV_H__ 3#define __NVKM_SUBDEV_H__
4#include <core/device.h> 4#include <core/device.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h b/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h
index 5c102d0206a7..924009dd2bb0 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/tegra.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVICE_TEGRA_H__ 2#ifndef __NVKM_DEVICE_TEGRA_H__
3#define __NVKM_DEVICE_TEGRA_H__ 3#define __NVKM_DEVICE_TEGRA_H__
4#include <core/device.h> 4#include <core/device.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/bsp.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/bsp.h
index 40613983fccb..f938f024db81 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/bsp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/bsp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BSP_H__ 2#ifndef __NVKM_BSP_H__
3#define __NVKM_BSP_H__ 3#define __NVKM_BSP_H__
4#include <engine/xtensa.h> 4#include <engine/xtensa.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/ce.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/ce.h
index 5f3650692e4d..86f420f4630b 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/ce.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/ce.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CE_H__ 2#ifndef __NVKM_CE_H__
3#define __NVKM_CE_H__ 3#define __NVKM_CE_H__
4#include <engine/falcon.h> 4#include <engine/falcon.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h
index 72b9da2de7c2..66c5c5e27520 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/cipher.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CIPHER_H__ 2#ifndef __NVKM_CIPHER_H__
3#define __NVKM_CIPHER_H__ 3#define __NVKM_CIPHER_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h
index 3026b22d44fb..5a96c942d912 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_H__ 2#ifndef __NVKM_DISP_H__
3#define __NVKM_DISP_H__ 3#define __NVKM_DISP_H__
4#define nvkm_disp(p) container_of((p), struct nvkm_disp, engine) 4#define nvkm_disp(p) container_of((p), struct nvkm_disp, engine)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/dma.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/dma.h
index f0c1b2c8c78c..2e12cdb6bb93 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/dma.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/dma.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DMA_H__ 2#ifndef __NVKM_DMA_H__
3#define __NVKM_DMA_H__ 3#define __NVKM_DMA_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h
index 6427747b6f77..23b582d696c6 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/falcon.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FALCON_H__ 2#ifndef __NVKM_FALCON_H__
3#define __NVKM_FALCON_H__ 3#define __NVKM_FALCON_H__
4#define nvkm_falcon(p) container_of((p), struct nvkm_falcon, engine) 4#define nvkm_falcon(p) container_of((p), struct nvkm_falcon, engine)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
index b7fc04dd1628..b335f3a1e66d 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FIFO_H__ 2#ifndef __NVKM_FIFO_H__
3#define __NVKM_FIFO_H__ 3#define __NVKM_FIFO_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h
index 1e924c7f7ba7..2cde36f3c064 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/gr.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GR_H__ 2#ifndef __NVKM_GR_H__
3#define __NVKM_GR_H__ 3#define __NVKM_GR_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/mpeg.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/mpeg.h
index 4ef3d4c5e358..8585a31f5943 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/mpeg.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/mpeg.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MPEG_H__ 2#ifndef __NVKM_MPEG_H__
3#define __NVKM_MPEG_H__ 3#define __NVKM_MPEG_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/msenc.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/msenc.h
index 985fc9490643..08fbe7b3cb4b 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/msenc.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/msenc.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSENC_H__ 2#ifndef __NVKM_MSENC_H__
3#define __NVKM_MSENC_H__ 3#define __NVKM_MSENC_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/mspdec.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/mspdec.h
index e03f33472486..83bb2fcb2cbf 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/mspdec.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/mspdec.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSPDEC_H__ 2#ifndef __NVKM_MSPDEC_H__
3#define __NVKM_MSPDEC_H__ 3#define __NVKM_MSPDEC_H__
4#include <engine/falcon.h> 4#include <engine/falcon.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/msppp.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/msppp.h
index 760bf17ea63d..69e09fd96e0c 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/msppp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/msppp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSPPP_H__ 2#ifndef __NVKM_MSPPP_H__
3#define __NVKM_MSPPP_H__ 3#define __NVKM_MSPPP_H__
4#include <engine/falcon.h> 4#include <engine/falcon.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/msvld.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/msvld.h
index 281866d2501d..9e11cefc9649 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/msvld.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/msvld.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSVLD_H__ 2#ifndef __NVKM_MSVLD_H__
3#define __NVKM_MSVLD_H__ 3#define __NVKM_MSVLD_H__
4#include <engine/falcon.h> 4#include <engine/falcon.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/nvdec.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/nvdec.h
index b72a4844c5f7..7c7d7f0abfcc 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/nvdec.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/nvdec.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_NVDEC_H__ 2#ifndef __NVKM_NVDEC_H__
3#define __NVKM_NVDEC_H__ 3#define __NVKM_NVDEC_H__
4#define nvkm_nvdec(p) container_of((p), struct nvkm_nvdec, engine) 4#define nvkm_nvdec(p) container_of((p), struct nvkm_nvdec, engine)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/nvenc.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/nvenc.h
index cdd68a8bab8b..21624046d0a1 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/nvenc.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/nvenc.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_NVENC_H__ 2#ifndef __NVKM_NVENC_H__
3#define __NVKM_NVENC_H__ 3#define __NVKM_NVENC_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/pm.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/pm.h
index 6cce8502f9df..4d754e7650d9 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/pm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/pm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PM_H__ 2#ifndef __NVKM_PM_H__
3#define __NVKM_PM_H__ 3#define __NVKM_PM_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h
index b206b918c43e..f14e98a8a0ca 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/sec.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SEC_H__ 2#ifndef __NVKM_SEC_H__
3#define __NVKM_SEC_H__ 3#define __NVKM_SEC_H__
4#include <engine/falcon.h> 4#include <engine/falcon.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/sec2.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/sec2.h
index c93ad332461a..33078f86c779 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/sec2.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/sec2.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SEC2_H__ 2#ifndef __NVKM_SEC2_H__
3#define __NVKM_SEC2_H__ 3#define __NVKM_SEC2_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/sw.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/sw.h
index 83a17c4e11e7..2e91769e3ee2 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/sw.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/sw.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SW_H__ 2#ifndef __NVKM_SW_H__
3#define __NVKM_SW_H__ 3#define __NVKM_SW_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/vic.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/vic.h
index 9b7d4877cf41..35555c559eab 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/vic.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/vic.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_VIC_H__ 2#ifndef __NVKM_VIC_H__
3#define __NVKM_VIC_H__ 3#define __NVKM_VIC_H__
4#include <core/engine.h> 4#include <core/engine.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/vp.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/vp.h
index 53bf8aed48fb..8984415b2a3d 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/vp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/vp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_VP_H__ 2#ifndef __NVKM_VP_H__
3#define __NVKM_VP_H__ 3#define __NVKM_VP_H__
4#include <engine/xtensa.h> 4#include <engine/xtensa.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h
index 13c00ce6d556..fbf27b2293a9 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/xtensa.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_XTENSA_H__ 2#ifndef __NVKM_XTENSA_H__
3#define __NVKM_XTENSA_H__ 3#define __NVKM_XTENSA_H__
4#define nvkm_xtensa(p) container_of((p), struct nvkm_xtensa, engine) 4#define nvkm_xtensa(p) container_of((p), struct nvkm_xtensa, engine)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bar.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bar.h
index da14486317ca..14b09f7e46a5 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bar.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bar.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BAR_H__ 2#ifndef __NVKM_BAR_H__
3#define __NVKM_BAR_H__ 3#define __NVKM_BAR_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h
index 979e9a144e7b..f2860f8e0c2e 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BIOS_H__ 2#ifndef __NVKM_BIOS_H__
3#define __NVKM_BIOS_H__ 3#define __NVKM_BIOS_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0203.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0203.h
index 425ccc47e3b7..9227ed640132 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0203.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0203.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_M0203_H__ 2#ifndef __NVBIOS_M0203_H__
3#define __NVBIOS_M0203_H__ 3#define __NVBIOS_M0203_H__
4struct nvbios_M0203T { 4struct nvbios_M0203T {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0205.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0205.h
index b4e14e45a0e8..7ec1dabc5fe4 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0205.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0205.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_M0205_H__ 2#ifndef __NVBIOS_M0205_H__
3#define __NVBIOS_M0205_H__ 3#define __NVBIOS_M0205_H__
4struct nvbios_M0205T { 4struct nvbios_M0205T {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0209.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0209.h
index c09376894d12..49a7bb0f3c50 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0209.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/M0209.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_M0209_H__ 2#ifndef __NVBIOS_M0209_H__
3#define __NVBIOS_M0209_H__ 3#define __NVBIOS_M0209_H__
4u32 nvbios_M0209Te(struct nvkm_bios *, 4u32 nvbios_M0209Te(struct nvkm_bios *,
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/P0260.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/P0260.h
index 901d94ef11b8..caad7256d9e5 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/P0260.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/P0260.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_P0260_H__ 2#ifndef __NVBIOS_P0260_H__
3#define __NVBIOS_P0260_H__ 3#define __NVBIOS_P0260_H__
4u32 nvbios_P0260Te(struct nvkm_bios *, 4u32 nvbios_P0260Te(struct nvkm_bios *,
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bit.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bit.h
index d068586f3263..ebfe45fce965 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bit.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bit.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_BIT_H__ 2#ifndef __NVBIOS_BIT_H__
3#define __NVBIOS_BIT_H__ 3#define __NVBIOS_BIT_H__
4struct bit_entry { 4struct bit_entry {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bmp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bmp.h
index 9a3f9483ee75..263408a535ae 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bmp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/bmp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_BMP_H__ 2#ifndef __NVBIOS_BMP_H__
3#define __NVBIOS_BMP_H__ 3#define __NVBIOS_BMP_H__
4static inline u16 4static inline u16
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/boost.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/boost.h
index a1c48c6b223b..489fd3554a17 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/boost.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/boost.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_BOOST_H__ 2#ifndef __NVBIOS_BOOST_H__
3#define __NVBIOS_BOOST_H__ 3#define __NVBIOS_BOOST_H__
4u32 nvbios_boostTe(struct nvkm_bios *, u8 *, u8 *, u8 *, u8 *, u8 *, u8 *); 4u32 nvbios_boostTe(struct nvkm_bios *, u8 *, u8 *, u8 *, u8 *, u8 *, u8 *);
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/conn.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/conn.h
index 8463b421d345..f5f59261ea81 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/conn.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/conn.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_CONN_H__ 2#ifndef __NVBIOS_CONN_H__
3#define __NVBIOS_CONN_H__ 3#define __NVBIOS_CONN_H__
4enum dcb_connector_type { 4enum dcb_connector_type {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h
index 49343d276e11..6a287a016580 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_CSTEP_H__ 2#ifndef __NVBIOS_CSTEP_H__
3#define __NVBIOS_CSTEP_H__ 3#define __NVBIOS_CSTEP_H__
4u32 nvbios_cstepTe(struct nvkm_bios *, 4u32 nvbios_cstepTe(struct nvkm_bios *,
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dcb.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dcb.h
index 63ddc6ed897a..a27a0f3fe7aa 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dcb.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dcb.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_DCB_H__ 2#ifndef __NVBIOS_DCB_H__
3#define __NVBIOS_DCB_H__ 3#define __NVBIOS_DCB_H__
4enum dcb_output_type { 4enum dcb_output_type {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/disp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/disp.h
index 423d92de0aae..ef44205a91f6 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/disp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/disp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_DISP_H__ 2#ifndef __NVBIOS_DISP_H__
3#define __NVBIOS_DISP_H__ 3#define __NVBIOS_DISP_H__
4u16 nvbios_disp_table(struct nvkm_bios *, 4u16 nvbios_disp_table(struct nvkm_bios *,
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dp.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dp.h
index 512e25a41803..1df5e1618455 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dp.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/dp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_DP_H__ 2#ifndef __NVBIOS_DP_H__
3#define __NVBIOS_DP_H__ 3#define __NVBIOS_DP_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/extdev.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/extdev.h
index f93e4f951f2f..f29f2d8da142 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/extdev.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/extdev.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_EXTDEV_H__ 2#ifndef __NVBIOS_EXTDEV_H__
3#define __NVBIOS_EXTDEV_H__ 3#define __NVBIOS_EXTDEV_H__
4enum nvbios_extdev_type { 4enum nvbios_extdev_type {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/fan.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/fan.h
index 09c1d3b9d009..8b3fb1f5d3ab 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/fan.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/fan.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_FAN_H__ 2#ifndef __NVBIOS_FAN_H__
3#define __NVBIOS_FAN_H__ 3#define __NVBIOS_FAN_H__
4#include <subdev/bios/therm.h> 4#include <subdev/bios/therm.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/gpio.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/gpio.h
index b71a3555c64e..7c4f00366e71 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/gpio.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/gpio.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_GPIO_H__ 2#ifndef __NVBIOS_GPIO_H__
3#define __NVBIOS_GPIO_H__ 3#define __NVBIOS_GPIO_H__
4enum dcb_gpio_func_name { 4enum dcb_gpio_func_name {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/i2c.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/i2c.h
index ae1f7483dd28..e84a0eb6df26 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/i2c.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/i2c.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_I2C_H__ 2#ifndef __NVBIOS_I2C_H__
3#define __NVBIOS_I2C_H__ 3#define __NVBIOS_I2C_H__
4enum dcb_i2c_type { 4enum dcb_i2c_type {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/iccsense.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/iccsense.h
index e220a1ac1387..4c108fd2c805 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/iccsense.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/iccsense.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_ICCSENSE_H__ 2#ifndef __NVBIOS_ICCSENSE_H__
3#define __NVBIOS_ICCSENSE_H__ 3#define __NVBIOS_ICCSENSE_H__
4struct pwr_rail_resistor_t { 4struct pwr_rail_resistor_t {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/image.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/image.h
index 893288b060de..e13dc059a9ee 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/image.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/image.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_IMAGE_H__ 2#ifndef __NVBIOS_IMAGE_H__
3#define __NVBIOS_IMAGE_H__ 3#define __NVBIOS_IMAGE_H__
4struct nvbios_image { 4struct nvbios_image {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h
index 744b1868e789..10df0215475e 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/init.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_INIT_H__ 2#ifndef __NVBIOS_INIT_H__
3#define __NVBIOS_INIT_H__ 3#define __NVBIOS_INIT_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/mxm.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/mxm.h
index 327bf9c4b703..7204c6f4f247 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/mxm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/mxm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_MXM_H__ 2#ifndef __NVBIOS_MXM_H__
3#define __NVBIOS_MXM_H__ 3#define __NVBIOS_MXM_H__
4u16 mxm_table(struct nvkm_bios *, u8 *ver, u8 *hdr); 4u16 mxm_table(struct nvkm_bios *, u8 *ver, u8 *hdr);
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/npde.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/npde.h
index ee5419b7b45b..f10f176a3323 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/npde.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/npde.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_NPDE_H__ 2#ifndef __NVBIOS_NPDE_H__
3#define __NVBIOS_NPDE_H__ 3#define __NVBIOS_NPDE_H__
4struct nvbios_npdeT { 4struct nvbios_npdeT {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pcir.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pcir.h
index 1dffe8d6cc81..bb7bf67d1d19 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pcir.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pcir.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_PCIR_H__ 2#ifndef __NVBIOS_PCIR_H__
3#define __NVBIOS_PCIR_H__ 3#define __NVBIOS_PCIR_H__
4struct nvbios_pcirT { 4struct nvbios_pcirT {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h
index 0ee84ea6d737..1b67c0958721 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/perf.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_PERF_H__ 2#ifndef __NVBIOS_PERF_H__
3#define __NVBIOS_PERF_H__ 3#define __NVBIOS_PERF_H__
4u32 nvbios_perf_table(struct nvkm_bios *, u8 *ver, u8 *hdr, 4u32 nvbios_perf_table(struct nvkm_bios *, u8 *ver, u8 *hdr,
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pll.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pll.h
index ab964e085f02..b2c2d0959f6f 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pll.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pll.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_PLL_H__ 2#ifndef __NVBIOS_PLL_H__
3#define __NVBIOS_PLL_H__ 3#define __NVBIOS_PLL_H__
4/*XXX: kill me */ 4/*XXX: kill me */
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h
index fb41ecab8f8c..7177d39371cf 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/pmu.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_PMU_H__ 2#ifndef __NVBIOS_PMU_H__
3#define __NVBIOS_PMU_H__ 3#define __NVBIOS_PMU_H__
4struct nvbios_pmuT { 4struct nvbios_pmuT {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/power_budget.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/power_budget.h
index ff12d810dce3..95306be163cc 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/power_budget.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/power_budget.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_POWER_BUDGET_H__ 2#ifndef __NVBIOS_POWER_BUDGET_H__
3#define __NVBIOS_POWER_BUDGET_H__ 3#define __NVBIOS_POWER_BUDGET_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
index 2b87a38adb7a..153edf898b5d 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/ramcfg.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_RAMCFG_H__ 2#ifndef __NVBIOS_RAMCFG_H__
3#define __NVBIOS_RAMCFG_H__ 3#define __NVBIOS_RAMCFG_H__
4struct nvbios_ramcfg { 4struct nvbios_ramcfg {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/rammap.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/rammap.h
index 471eef434b51..7f054042f9d7 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/rammap.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/rammap.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_RAMMAP_H__ 2#ifndef __NVBIOS_RAMMAP_H__
3#define __NVBIOS_RAMMAP_H__ 3#define __NVBIOS_RAMMAP_H__
4#include <subdev/bios/ramcfg.h> 4#include <subdev/bios/ramcfg.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/therm.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/therm.h
index 46a3b15e10ec..0fb8a3480871 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/therm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/therm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_THERM_H__ 2#ifndef __NVBIOS_THERM_H__
3#define __NVBIOS_THERM_H__ 3#define __NVBIOS_THERM_H__
4struct nvbios_therm_threshold { 4struct nvbios_therm_threshold {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/timing.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/timing.h
index 40ceabf37827..c1f77773aace 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/timing.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/timing.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_TIMING_H__ 2#ifndef __NVBIOS_TIMING_H__
3#define __NVBIOS_TIMING_H__ 3#define __NVBIOS_TIMING_H__
4#include <subdev/bios/ramcfg.h> 4#include <subdev/bios/ramcfg.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vmap.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vmap.h
index 67419bad584c..13103b9b5b96 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vmap.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vmap.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_VMAP_H__ 2#ifndef __NVBIOS_VMAP_H__
3#define __NVBIOS_VMAP_H__ 3#define __NVBIOS_VMAP_H__
4struct nvbios_vmap { 4struct nvbios_vmap {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/volt.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/volt.h
index 6b36d5ecb8f9..0c9be1b2ebbf 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/volt.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/volt.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_VOLT_H__ 2#ifndef __NVBIOS_VOLT_H__
3#define __NVBIOS_VOLT_H__ 3#define __NVBIOS_VOLT_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vpstate.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vpstate.h
index 36f3028d58ef..df94e26f873a 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vpstate.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/vpstate.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_VPSTATE_H__ 2#ifndef __NVBIOS_VPSTATE_H__
3#define __NVBIOS_VPSTATE_H__ 3#define __NVBIOS_VPSTATE_H__
4struct nvbios_vpstate_header { 4struct nvbios_vpstate_header {
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/xpio.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/xpio.h
index d1bb5d044585..11b4c4d27e5f 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/xpio.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/xpio.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVBIOS_XPIO_H__ 2#ifndef __NVBIOS_XPIO_H__
3#define __NVBIOS_XPIO_H__ 3#define __NVBIOS_XPIO_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bus.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bus.h
index 7695f7f77a06..ae9ad6c034fb 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bus.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bus.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BUS_H__ 2#ifndef __NVKM_BUS_H__
3#define __NVKM_BUS_H__ 3#define __NVKM_BUS_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h
index 15db75ef0189..bf937e7dfd77 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/clk.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CLK_H__ 2#ifndef __NVKM_CLK_H__
3#define __NVKM_CLK_H__ 3#define __NVKM_CLK_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h
index 8ba982c2fdfb..1a39e52e09e3 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/devinit.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVINIT_H__ 2#ifndef __NVKM_DEVINIT_H__
3#define __NVKM_DEVINIT_H__ 3#define __NVKM_DEVINIT_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
index 27298f8b7ead..239ad222b95a 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fb.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FB_H__ 2#ifndef __NVKM_FB_H__
3#define __NVKM_FB_H__ 3#define __NVKM_FB_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h
index 092193b7f98e..00111c34311e 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/fuse.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FUSE_H__ 2#ifndef __NVKM_FUSE_H__
3#define __NVKM_FUSE_H__ 3#define __NVKM_FUSE_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h
index ee54899076e3..eaacf8d80527 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GPIO_H__ 2#ifndef __NVKM_GPIO_H__
3#define __NVKM_GPIO_H__ 3#define __NVKM_GPIO_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
index 7957eafa5f0e..81b977319640 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/i2c.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_I2C_H__ 2#ifndef __NVKM_I2C_H__
3#define __NVKM_I2C_H__ 3#define __NVKM_I2C_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ibus.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ibus.h
index 919653c1d101..db791411eaa8 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ibus.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ibus.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_IBUS_H__ 2#ifndef __NVKM_IBUS_H__
3#define __NVKM_IBUS_H__ 3#define __NVKM_IBUS_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h
index be9475cd94fd..f483dcd7cd1c 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/iccsense.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_ICCSENSE_H__ 2#ifndef __NVKM_ICCSENSE_H__
3#define __NVKM_ICCSENSE_H__ 3#define __NVKM_ICCSENSE_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h
index 36ed520ed2d0..c74ab7c31d05 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/instmem.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_INSTMEM_H__ 2#ifndef __NVKM_INSTMEM_H__
3#define __NVKM_INSTMEM_H__ 3#define __NVKM_INSTMEM_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
index 9db5f8293198..644d527c3b96 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/ltc.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_LTC_H__ 2#ifndef __NVKM_LTC_H__
3#define __NVKM_LTC_H__ 3#define __NVKM_LTC_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
index e38f4958dea2..6641fe4c252c 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mc.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MC_H__ 2#ifndef __NVKM_MC_H__
3#define __NVKM_MC_H__ 3#define __NVKM_MC_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
index 28ade86f74c5..54cdcb017518 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mmu.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MMU_H__ 2#ifndef __NVKM_MMU_H__
3#define __NVKM_MMU_H__ 3#define __NVKM_MMU_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mxm.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mxm.h
index 0fd6d6f8eada..78df1e9def05 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/mxm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/mxm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MXM_H__ 2#ifndef __NVKM_MXM_H__
3#define __NVKM_MXM_H__ 3#define __NVKM_MXM_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h
index 23803cc859fd..4803a4fad4a2 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pci.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PCI_H__ 2#ifndef __NVKM_PCI_H__
3#define __NVKM_PCI_H__ 3#define __NVKM_PCI_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pmu.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pmu.h
index 4bc9384046c6..24fbcccd93eb 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/pmu.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/pmu.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PMU_H__ 2#ifndef __NVKM_PMU_H__
3#define __NVKM_PMU_H__ 3#define __NVKM_PMU_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
index 9398d9f09339..62c34f98c930 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/therm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_THERM_H__ 2#ifndef __NVKM_THERM_H__
3#define __NVKM_THERM_H__ 3#define __NVKM_THERM_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h
index 3693ebf371b6..a8c21c6c800b 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_TIMER_H__ 2#ifndef __NVKM_TIMER_H__
3#define __NVKM_TIMER_H__ 3#define __NVKM_TIMER_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h
index 2904e67d79d2..7be0e7e7bd77 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/top.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_TOP_H__ 2#ifndef __NVKM_TOP_H__
3#define __NVKM_TOP_H__ 3#define __NVKM_TOP_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/vga.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/vga.h
index 312933ad7c2b..15ee5c321574 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/vga.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/vga.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_VGA_H__ 2#ifndef __NOUVEAU_VGA_H__
3#define __NOUVEAU_VGA_H__ 3#define __NOUVEAU_VGA_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
index 6a765682fbfa..45053a280930 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/volt.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_VOLT_H__ 2#ifndef __NVKM_VOLT_H__
3#define __NVKM_VOLT_H__ 3#define __NVKM_VOLT_H__
4#include <core/subdev.h> 4#include <core/subdev.h>
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.h b/drivers/gpu/drm/nouveau/nouveau_abi16.h
index 36fde1ff3ad5..195546719bfe 100644
--- a/drivers/gpu/drm/nouveau/nouveau_abi16.h
+++ b/drivers/gpu/drm/nouveau/nouveau_abi16.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_ABI16_H__ 2#ifndef __NOUVEAU_ABI16_H__
3#define __NOUVEAU_ABI16_H__ 3#define __NOUVEAU_ABI16_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index ffb195850314..fe3a10255c36 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include <linux/acpi.h> 3#include <linux/acpi.h>
4#include <linux/slab.h> 4#include <linux/slab.h>
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.h b/drivers/gpu/drm/nouveau/nouveau_acpi.h
index b86294fc99e8..1e6e8a8c0455 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.h
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_ACPI_H__ 2#ifndef __NOUVEAU_ACPI_H__
3#define __NOUVEAU_ACPI_H__ 3#define __NOUVEAU_ACPI_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.h b/drivers/gpu/drm/nouveau/nouveau_bo.h
index 846f4bdec0de..383ac36d5869 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.h
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_BO_H__ 2#ifndef __NOUVEAU_BO_H__
3#define __NOUVEAU_BO_H__ 3#define __NOUVEAU_BO_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_chan.h b/drivers/gpu/drm/nouveau/nouveau_chan.h
index 93814d1d31e4..9307357e1361 100644
--- a/drivers/gpu/drm/nouveau/nouveau_chan.h
+++ b/drivers/gpu/drm/nouveau/nouveau_chan.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_CHAN_H__ 2#ifndef __NOUVEAU_CHAN_H__
3#define __NOUVEAU_CHAN_H__ 3#define __NOUVEAU_CHAN_H__
4#include <nvif/object.h> 4#include <nvif/object.h>
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 4116ee62adaf..8f15281faa79 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -252,7 +252,7 @@ nouveau_conn_reset(struct drm_connector *connector)
252 return; 252 return;
253 253
254 if (connector->state) 254 if (connector->state)
255 __drm_atomic_helper_connector_destroy_state(connector->state); 255 nouveau_conn_atomic_destroy_state(connector, connector->state);
256 __drm_atomic_helper_connector_reset(connector, &asyc->state); 256 __drm_atomic_helper_connector_reset(connector, &asyc->state);
257 asyc->dither.mode = DITHERING_MODE_AUTO; 257 asyc->dither.mode = DITHERING_MODE_AUTO;
258 asyc->dither.depth = DITHERING_DEPTH_AUTO; 258 asyc->dither.depth = DITHERING_DEPTH_AUTO;
@@ -978,11 +978,13 @@ get_tmds_link_bandwidth(struct drm_connector *connector)
978 struct nouveau_drm *drm = nouveau_drm(connector->dev); 978 struct nouveau_drm *drm = nouveau_drm(connector->dev);
979 struct dcb_output *dcb = nv_connector->detected_encoder->dcb; 979 struct dcb_output *dcb = nv_connector->detected_encoder->dcb;
980 struct drm_display_info *info = NULL; 980 struct drm_display_info *info = NULL;
981 const unsigned duallink_scale = 981 unsigned duallink_scale =
982 nouveau_duallink && nv_encoder->dcb->duallink_possible ? 2 : 1; 982 nouveau_duallink && nv_encoder->dcb->duallink_possible ? 2 : 1;
983 983
984 if (drm_detect_hdmi_monitor(nv_connector->edid)) 984 if (drm_detect_hdmi_monitor(nv_connector->edid)) {
985 info = &nv_connector->base.display_info; 985 info = &nv_connector->base.display_info;
986 duallink_scale = 1;
987 }
986 988
987 if (info) { 989 if (info) {
988 if (nouveau_hdmimhz > 0) 990 if (nouveau_hdmimhz > 0)
@@ -1003,6 +1005,7 @@ get_tmds_link_bandwidth(struct drm_connector *connector)
1003 if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_FERMI) 1005 if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_FERMI)
1004 return 225000; 1006 return 225000;
1005 } 1007 }
1008
1006 if (dcb->location != DCB_LOC_ON_CHIP || 1009 if (dcb->location != DCB_LOC_ON_CHIP ||
1007 drm->client.device.info.chipset >= 0x46) 1010 drm->client.device.info.chipset >= 0x46)
1008 return 165000 * duallink_scale; 1011 return 165000 * duallink_scale;
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.h b/drivers/gpu/drm/nouveau/nouveau_debugfs.h
index 1d01a82d4b6f..9420a6aca138 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.h
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_DEBUGFS_H__ 2#ifndef __NOUVEAU_DEBUGFS_H__
3#define __NOUVEAU_DEBUGFS_H__ 3#define __NOUVEAU_DEBUGFS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.h b/drivers/gpu/drm/nouveau/nouveau_display.h
index 311e175f0513..9185f01e2d9b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.h
+++ b/drivers/gpu/drm/nouveau/nouveau_display.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_DISPLAY_H__ 2#ifndef __NOUVEAU_DISPLAY_H__
3#define __NOUVEAU_DISPLAY_H__ 3#define __NOUVEAU_DISPLAY_H__
4#include "nouveau_drv.h" 4#include "nouveau_drv.h"
diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index 42c026010938..1333220787a1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_dmem.c
@@ -379,9 +379,10 @@ nouveau_dmem_pages_alloc(struct nouveau_drm *drm,
379 ret = nouveau_dmem_chunk_alloc(drm); 379 ret = nouveau_dmem_chunk_alloc(drm);
380 if (ret) { 380 if (ret) {
381 if (c) 381 if (c)
382 break; 382 return 0;
383 return ret; 383 return ret;
384 } 384 }
385 mutex_lock(&drm->dmem->mutex);
385 continue; 386 continue;
386 } 387 }
387 388
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 35ff0ca01a3b..aae035816383 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_DRV_H__ 2#ifndef __NOUVEAU_DRV_H__
3#define __NOUVEAU_DRV_H__ 3#define __NOUVEAU_DRV_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.h b/drivers/gpu/drm/nouveau/nouveau_fence.h
index ad27caeca0fd..c9e24baaaa4f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.h
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_FENCE_H__ 2#ifndef __NOUVEAU_FENCE_H__
3#define __NOUVEAU_FENCE_H__ 3#define __NOUVEAU_FENCE_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.h b/drivers/gpu/drm/nouveau/nouveau_gem.h
index fe39998f65cc..03371204a47c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.h
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_GEM_H__ 2#ifndef __NOUVEAU_GEM_H__
3#define __NOUVEAU_GEM_H__ 3#define __NOUVEAU_GEM_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 08a1ab6b150d..6af2d299c3f9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -428,6 +428,8 @@ nouveau_temp_read(struct device *dev, u32 attr, int channel, long *val)
428 428
429 switch (attr) { 429 switch (attr) {
430 case hwmon_temp_input: 430 case hwmon_temp_input:
431 if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
432 return -EINVAL;
431 ret = nvkm_therm_temp_get(therm); 433 ret = nvkm_therm_temp_get(therm);
432 *val = ret < 0 ? ret : (ret * 1000); 434 *val = ret < 0 ? ret : (ret * 1000);
433 break; 435 break;
@@ -474,6 +476,8 @@ nouveau_fan_read(struct device *dev, u32 attr, int channel, long *val)
474 476
475 switch (attr) { 477 switch (attr) {
476 case hwmon_fan_input: 478 case hwmon_fan_input:
479 if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
480 return -EINVAL;
477 *val = nvkm_therm_fan_sense(therm); 481 *val = nvkm_therm_fan_sense(therm);
478 break; 482 break;
479 default: 483 default:
@@ -496,6 +500,8 @@ nouveau_in_read(struct device *dev, u32 attr, int channel, long *val)
496 500
497 switch (attr) { 501 switch (attr) {
498 case hwmon_in_input: 502 case hwmon_in_input:
503 if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
504 return -EINVAL;
499 ret = nvkm_volt_get(volt); 505 ret = nvkm_volt_get(volt);
500 *val = ret < 0 ? ret : (ret / 1000); 506 *val = ret < 0 ? ret : (ret / 1000);
501 break; 507 break;
@@ -527,6 +533,8 @@ nouveau_pwm_read(struct device *dev, u32 attr, int channel, long *val)
527 *val = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MODE); 533 *val = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MODE);
528 break; 534 break;
529 case hwmon_pwm_input: 535 case hwmon_pwm_input:
536 if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
537 return -EINVAL;
530 *val = therm->fan_get(therm); 538 *val = therm->fan_get(therm);
531 break; 539 break;
532 default: 540 default:
@@ -548,6 +556,8 @@ nouveau_power_read(struct device *dev, u32 attr, int channel, long *val)
548 556
549 switch (attr) { 557 switch (attr) {
550 case hwmon_power_input: 558 case hwmon_power_input:
559 if (drm_dev->switch_power_state != DRM_SWITCH_POWER_ON)
560 return -EINVAL;
551 *val = nvkm_iccsense_read_all(iccsense); 561 *val = nvkm_iccsense_read_all(iccsense);
552 break; 562 break;
553 case hwmon_power_max: 563 case hwmon_power_max:
diff --git a/drivers/gpu/drm/nouveau/nouveau_ioctl.h b/drivers/gpu/drm/nouveau/nouveau_ioctl.h
index 380ede26806c..d17505530e3e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ioctl.h
+++ b/drivers/gpu/drm/nouveau/nouveau_ioctl.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_IOCTL_H__ 2#ifndef __NOUVEAU_IOCTL_H__
3#define __NOUVEAU_IOCTL_H__ 3#define __NOUVEAU_IOCTL_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_reg.h b/drivers/gpu/drm/nouveau/nouveau_reg.h
index b5b5fe40779d..cff7389f6ed3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_reg.h
+++ b/drivers/gpu/drm/nouveau/nouveau_reg.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2 2
3#define NV04_PFB_BOOT_0 0x00100000 3#define NV04_PFB_BOOT_0 0x00100000
4# define NV04_PFB_BOOT_0_RAM_AMOUNT 0x00000003 4# define NV04_PFB_BOOT_0_RAM_AMOUNT 0x00000003
diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
index 8ebdc74cc0ad..feaac908efed 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include <linux/pagemap.h> 2#include <linux/pagemap.h>
3#include <linux/slab.h> 3#include <linux/slab.h>
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.h b/drivers/gpu/drm/nouveau/nouveau_ttm.h
index 89929ad8c7cd..085280754b3e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.h
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_TTM_H__ 2#ifndef __NOUVEAU_TTM_H__
3#define __NOUVEAU_TTM_H__ 3#define __NOUVEAU_TTM_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_usif.h b/drivers/gpu/drm/nouveau/nouveau_usif.h
index c68f1c65af3b..dc90d4a9d0d9 100644
--- a/drivers/gpu/drm/nouveau/nouveau_usif.h
+++ b/drivers/gpu/drm/nouveau/nouveau_usif.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_USIF_H__ 2#ifndef __NOUVEAU_USIF_H__
3#define __NOUVEAU_USIF_H__ 3#define __NOUVEAU_USIF_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index 8f1ce4833230..8f4b12a8092c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include <linux/vgaarb.h> 2#include <linux/vgaarb.h>
3#include <linux/vga_switcheroo.h> 3#include <linux/vga_switcheroo.h>
4 4
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.h b/drivers/gpu/drm/nouveau/nouveau_vga.h
index 6a3000c88142..951a83f984dd 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.h
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NOUVEAU_VGA_H__ 2#ifndef __NOUVEAU_VGA_H__
3#define __NOUVEAU_VGA_H__ 3#define __NOUVEAU_VGA_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.h b/drivers/gpu/drm/nouveau/nv10_fence.h
index 7616c66803f8..300cf3fdbb46 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.h
+++ b/drivers/gpu/drm/nouveau/nv10_fence.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV10_FENCE_H_ 2#ifndef __NV10_FENCE_H_
3#define __NV10_FENCE_H_ 3#define __NV10_FENCE_H_
4 4
diff --git a/drivers/gpu/drm/nouveau/nvif/Kbuild b/drivers/gpu/drm/nouveau/nvif/Kbuild
index 7eebd7d18b6d..50d583d63807 100644
--- a/drivers/gpu/drm/nouveau/nvif/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvif/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvif-y := nvif/object.o 2nvif-y := nvif/object.o
3nvif-y += nvif/client.o 3nvif-y += nvif/client.o
4nvif-y += nvif/device.o 4nvif-y += nvif/device.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/Kbuild b/drivers/gpu/drm/nouveau/nvkm/Kbuild
index a8ec75cf02dc..b53de9ba8c73 100644
--- a/drivers/gpu/drm/nouveau/nvkm/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2include $(src)/nvkm/core/Kbuild 2include $(src)/nvkm/core/Kbuild
3include $(src)/nvkm/falcon/Kbuild 3include $(src)/nvkm/falcon/Kbuild
4include $(src)/nvkm/subdev/Kbuild 4include $(src)/nvkm/subdev/Kbuild
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/Kbuild b/drivers/gpu/drm/nouveau/nvkm/core/Kbuild
index 01de22144259..2b471ab585b4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/core/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y := nvkm/core/client.o 2nvkm-y := nvkm/core/client.o
3nvkm-y += nvkm/core/engine.o 3nvkm-y += nvkm/core/engine.o
4nvkm-y += nvkm/core/enum.o 4nvkm-y += nvkm/core/enum.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/Kbuild
index 5a43bcfb3622..c6dfed18f35b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/falcon.o 2nvkm-y += nvkm/engine/falcon.o
3nvkm-y += nvkm/engine/xtensa.o 3nvkm-y += nvkm/engine/xtensa.o
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/bsp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/bsp/Kbuild
index ad1bcfa6fc6c..b596b990519c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/bsp/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/bsp/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/bsp/g84.o 2nvkm-y += nvkm/engine/bsp/g84.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild
index 157a70721629..ba88613e1e46 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/ce/gt215.o 2nvkm-y += nvkm/engine/ce/gt215.o
3nvkm-y += nvkm/engine/ce/gf100.o 3nvkm-y += nvkm/engine/ce/gf100.o
4nvkm-y += nvkm/engine/ce/gk104.o 4nvkm-y += nvkm/engine/ce/gk104.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gf100.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gf100.fuc3.h
index da130f5058e5..96d934f81600 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gf100.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gf100.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf100_ce_data[] = { 2static uint32_t gf100_ce_data[] = {
3/* 0x0000: ctx_object */ 3/* 0x0000: ctx_object */
4 0x00000000, 4 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gt215.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gt215.fuc3.h
index 0b92eb32598d..d3fbd4ab5e31 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gt215.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/fuc/gt215.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gt215_ce_data[] = { 2static uint32_t gt215_ce_data[] = {
3/* 0x0000: ctx_object */ 3/* 0x0000: ctx_object */
4 0x00000000, 4 0x00000000,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/ce/priv.h
index 0e3d08f11b0b..b0c8342db15f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CE_PRIV_H__ 2#ifndef __NVKM_CE_PRIV_H__
3#define __NVKM_CE_PRIV_H__ 3#define __NVKM_CE_PRIV_H__
4#include <engine/ce.h> 4#include <engine/ce.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/cipher/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/cipher/Kbuild
index 95708b59496c..ffad341f42bc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/cipher/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/cipher/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/cipher/g84.o 2nvkm-y += nvkm/engine/cipher/g84.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/device/Kbuild
index 206163da52e1..293c57678dab 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/device/acpi.o 2nvkm-y += nvkm/engine/device/acpi.o
3nvkm-y += nvkm/engine/device/base.o 3nvkm-y += nvkm/engine/device/base.o
4nvkm-y += nvkm/engine/device/ctrl.o 4nvkm-y += nvkm/engine/device/ctrl.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.h b/drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.h
index 6a62021e9861..1d3c5cf7c3b4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/acpi.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVICE_ACPI_H__ 2#ifndef __NVKM_DEVICE_ACPI_H__
3#define __NVKM_DEVICE_ACPI_H__ 3#define __NVKM_DEVICE_ACPI_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index 10d91e8bbb94..c3c7159f3411 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -1316,7 +1316,7 @@ nvaf_chipset = {
1316 .i2c = g94_i2c_new, 1316 .i2c = g94_i2c_new,
1317 .imem = nv50_instmem_new, 1317 .imem = nv50_instmem_new,
1318 .mc = gt215_mc_new, 1318 .mc = gt215_mc_new,
1319 .mmu = g84_mmu_new, 1319 .mmu = mcp77_mmu_new,
1320 .mxm = nv50_mxm_new, 1320 .mxm = nv50_mxm_new,
1321 .pci = g94_pci_new, 1321 .pci = g94_pci_new,
1322 .pmu = gt215_pmu_new, 1322 .pmu = gt215_pmu_new,
@@ -2575,6 +2575,41 @@ nv167_chipset = {
2575 .sec2 = tu102_sec2_new, 2575 .sec2 = tu102_sec2_new,
2576}; 2576};
2577 2577
2578static const struct nvkm_device_chip
2579nv168_chipset = {
2580 .name = "TU116",
2581 .bar = tu102_bar_new,
2582 .bios = nvkm_bios_new,
2583 .bus = gf100_bus_new,
2584 .devinit = tu102_devinit_new,
2585 .fault = tu102_fault_new,
2586 .fb = gv100_fb_new,
2587 .fuse = gm107_fuse_new,
2588 .gpio = gk104_gpio_new,
2589 .gsp = gv100_gsp_new,
2590 .i2c = gm200_i2c_new,
2591 .ibus = gm200_ibus_new,
2592 .imem = nv50_instmem_new,
2593 .ltc = gp102_ltc_new,
2594 .mc = tu102_mc_new,
2595 .mmu = tu102_mmu_new,
2596 .pci = gp100_pci_new,
2597 .pmu = gp102_pmu_new,
2598 .therm = gp100_therm_new,
2599 .timer = gk20a_timer_new,
2600 .top = gk104_top_new,
2601 .ce[0] = tu102_ce_new,
2602 .ce[1] = tu102_ce_new,
2603 .ce[2] = tu102_ce_new,
2604 .ce[3] = tu102_ce_new,
2605 .ce[4] = tu102_ce_new,
2606 .disp = tu102_disp_new,
2607 .dma = gv100_dma_new,
2608 .fifo = tu102_fifo_new,
2609 .nvdec[0] = gp102_nvdec_new,
2610 .sec2 = tu102_sec2_new,
2611};
2612
2578static int 2613static int
2579nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size, 2614nvkm_device_event_ctor(struct nvkm_object *object, void *data, u32 size,
2580 struct nvkm_notify *notify) 2615 struct nvkm_notify *notify)
@@ -3052,6 +3087,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
3052 case 0x164: device->chip = &nv164_chipset; break; 3087 case 0x164: device->chip = &nv164_chipset; break;
3053 case 0x166: device->chip = &nv166_chipset; break; 3088 case 0x166: device->chip = &nv166_chipset; break;
3054 case 0x167: device->chip = &nv167_chipset; break; 3089 case 0x167: device->chip = &nv167_chipset; break;
3090 case 0x168: device->chip = &nv168_chipset; break;
3055 default: 3091 default:
3056 nvdev_error(device, "unknown chipset (%08x)\n", boot0); 3092 nvdev_error(device, "unknown chipset (%08x)\n", boot0);
3057 goto done; 3093 goto done;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.h b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.h
index ebcc5c52fbd1..9f6d7f23af8d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVICE_CTRL_H__ 2#ifndef __NVKM_DEVICE_CTRL_H__
3#define __NVKM_DEVICE_CTRL_H__ 3#define __NVKM_DEVICE_CTRL_H__
4#define nvkm_control(p) container_of((p), struct nvkm_control, object) 4#define nvkm_control(p) container_of((p), struct nvkm_control, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
index 2a53e37dfa7a..d8be2f77ac66 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVICE_PRIV_H__ 2#ifndef __NVKM_DEVICE_PRIV_H__
3#define __NVKM_DEVICE_PRIV_H__ 3#define __NVKM_DEVICE_PRIV_H__
4#include <core/device.h> 4#include <core/device.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
index dbfda73cfea6..0d584d0da59c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/disp/base.o 2nvkm-y += nvkm/engine/disp/base.o
3nvkm-y += nvkm/engine/disp/nv04.o 3nvkm-y += nvkm/engine/disp/nv04.o
4nvkm-y += nvkm/engine/disp/nv50.o 4nvkm-y += nvkm/engine/disp/nv50.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h
index adc9d76d09cc..e55054b7329f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_DISP_CHAN_H__ 2#ifndef __NV50_DISP_CHAN_H__
3#define __NV50_DISP_CHAN_H__ 3#define __NV50_DISP_CHAN_H__
4#define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object) 4#define nv50_disp_chan(p) container_of((p), struct nv50_disp_chan, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.h
index 090e869ae612..dcbe60a4b911 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/conn.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_CONN_H__ 2#ifndef __NVKM_DISP_CONN_H__
3#define __NVKM_DISP_CONN_H__ 3#define __NVKM_DISP_CONN_H__
4#include <engine/disp.h> 4#include <engine/disp.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
index 495f665a0ee6..428b3f488f03 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_DP_H__ 2#ifndef __NVKM_DISP_DP_H__
3#define __NVKM_DISP_DP_H__ 3#define __NVKM_DISP_DP_H__
4#define nvkm_dp(p) container_of((p), struct nvkm_dp, outp) 4#define nvkm_dp(p) container_of((p), struct nvkm_dp, outp)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c
index 10f2aa9f29a4..7147dc6d9018 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "hdmi.h" 2#include "hdmi.h"
3 3
4void pack_hdmi_infoframe(struct packed_hdmi_infoframe *packed_frame, 4void pack_hdmi_infoframe(struct packed_hdmi_infoframe *packed_frame,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.h
index 45094c6e1425..fb1c3e3c5d4c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdmi.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_HDMI_H__ 2#ifndef __NVKM_DISP_HDMI_H__
3#define __NVKM_DISP_HDMI_H__ 3#define __NVKM_DISP_HDMI_H__
4#include "ior.h" 4#include "ior.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.h
index 7d55faf52fcb..7dde6237441d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/head.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_HEAD_H__ 2#ifndef __NVKM_DISP_HEAD_H__
3#define __NVKM_DISP_HEAD_H__ 3#define __NVKM_DISP_HEAD_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
index 1681ddccd298..009d3a8b7a50 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_IOR_H__ 2#ifndef __NVKM_DISP_IOR_H__
3#define __NVKM_DISP_IOR_H__ 3#define __NVKM_DISP_IOR_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
index e5d00f478bb1..a677161c7f3a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_DISP_H__ 2#ifndef __NV50_DISP_H__
3#define __NV50_DISP_H__ 3#define __NV50_DISP_H__
4#define nv50_disp(p) container_of((p), struct nv50_disp, base) 4#define nv50_disp(p) container_of((p), struct nv50_disp, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h
index 6c8aa5cfed9d..721b068b87ef 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_OUTP_H__ 2#ifndef __NVKM_DISP_OUTP_H__
3#define __NVKM_DISP_OUTP_H__ 3#define __NVKM_DISP_OUTP_H__
4#include <engine/disp.h> 4#include <engine/disp.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h
index ef66c5f38ad5..f815a5342880 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DISP_PRIV_H__ 2#ifndef __NVKM_DISP_PRIV_H__
3#define __NVKM_DISP_PRIV_H__ 3#define __NVKM_DISP_PRIV_H__
4#include <engine/disp.h> 4#include <engine/disp.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
index aee9822a7a87..a1f942793f98 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_DISP_ROOT_H__ 2#ifndef __NV50_DISP_ROOT_H__
3#define __NV50_DISP_ROOT_H__ 3#define __NV50_DISP_ROOT_H__
4#define nv50_disp_root(p) container_of((p), struct nv50_disp_root, object) 4#define nv50_disp_root(p) container_of((p), struct nv50_disp_root, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
index d57b73ada89e..4d5f3791ea7b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sortu102.c
@@ -72,6 +72,7 @@ tu102_sor = {
72 .clock = gf119_sor_clock, 72 .clock = gf119_sor_clock,
73 .hdmi = { 73 .hdmi = {
74 .ctrl = gv100_hdmi_ctrl, 74 .ctrl = gv100_hdmi_ctrl,
75 .scdc = gm200_hdmi_scdc,
75 }, 76 },
76 .dp = { 77 .dp = {
77 .lanes = { 0, 1, 2, 3 }, 78 .lanes = { 0, 1, 2, 3 },
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/dma/Kbuild
index 3e2680cbe370..a0e551b92c8d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/dma/base.o 2nvkm-y += nvkm/engine/dma/base.o
3nvkm-y += nvkm/engine/dma/nv04.o 3nvkm-y += nvkm/engine/dma/nv04.o
4nvkm-y += nvkm/engine/dma/nv50.o 4nvkm-y += nvkm/engine/dma/nv50.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/dma/priv.h
index 4307cbecd5c5..0c9d9640a59d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DMA_PRIV_H__ 2#ifndef __NVKM_DMA_PRIV_H__
3#define __NVKM_DMA_PRIV_H__ 3#define __NVKM_DMA_PRIV_H__
4#define nvkm_dma(p) container_of((p), struct nvkm_dma, engine) 4#define nvkm_dma(p) container_of((p), struct nvkm_dma, engine)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/user.h b/drivers/gpu/drm/nouveau/nvkm/engine/dma/user.h
index 9fe01fd75474..9c72ee214be7 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/user.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/user.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DMA_USER_H__ 2#ifndef __NVKM_DMA_USER_H__
3#define __NVKM_DMA_USER_H__ 3#define __NVKM_DMA_USER_H__
4#define nvkm_dmaobj(p) container_of((p), struct nvkm_dmaobj, object) 4#define nvkm_dmaobj(p) container_of((p), struct nvkm_dmaobj, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild
index 1f0eddacc9b7..90e9a0972a44 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/fifo/base.o 2nvkm-y += nvkm/engine/fifo/base.o
3nvkm-y += nvkm/engine/fifo/nv04.o 3nvkm-y += nvkm/engine/fifo/nv04.o
4nvkm-y += nvkm/engine/fifo/nv10.o 4nvkm-y += nvkm/engine/fifo/nv10.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.h
index 2c7c5afc1ea5..177e10562600 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FIFO_CHAN_H__ 2#ifndef __NVKM_FIFO_CHAN_H__
3#define __NVKM_FIFO_CHAN_H__ 3#define __NVKM_FIFO_CHAN_H__
4#define nvkm_fifo_chan(p) container_of((p), struct nvkm_fifo_chan, object) 4#define nvkm_fifo_chan(p) container_of((p), struct nvkm_fifo_chan, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h
index b653664e081b..7c125a15f963 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changf100.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __GF100_FIFO_CHAN_H__ 2#ifndef __GF100_FIFO_CHAN_H__
3#define __GF100_FIFO_CHAN_H__ 3#define __GF100_FIFO_CHAN_H__
4#define gf100_fifo_chan(p) container_of((p), struct gf100_fifo_chan, base) 4#define gf100_fifo_chan(p) container_of((p), struct gf100_fifo_chan, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h
index f8557cdfbd81..22698661aa85 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/changk104.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __GK104_FIFO_CHAN_H__ 2#ifndef __GK104_FIFO_CHAN_H__
3#define __GK104_FIFO_CHAN_H__ 3#define __GK104_FIFO_CHAN_H__
4#define gk104_fifo_chan(p) container_of((p), struct gk104_fifo_chan, base) 4#define gk104_fifo_chan(p) container_of((p), struct gk104_fifo_chan, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv04.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv04.h
index 15b06bdf5067..60ca79465aff 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv04.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv04.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV04_FIFO_CHAN_H__ 2#ifndef __NV04_FIFO_CHAN_H__
3#define __NV04_FIFO_CHAN_H__ 3#define __NV04_FIFO_CHAN_H__
4#define nv04_fifo_chan(p) container_of((p), struct nv04_fifo_chan, base) 4#define nv04_fifo_chan(p) container_of((p), struct nv04_fifo_chan, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h
index 2e3c4005b874..5735ff72a9d1 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_FIFO_CHAN_H__ 2#ifndef __NV50_FIFO_CHAN_H__
3#define __NV50_FIFO_CHAN_H__ 3#define __NV50_FIFO_CHAN_H__
4#define nv50_fifo_chan(p) container_of((p), struct nv50_fifo_chan, base) 4#define nv50_fifo_chan(p) container_of((p), struct nv50_fifo_chan, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.h
index 68f97ba03df6..b8642490eb2f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gf100.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __GF100_FIFO_H__ 2#ifndef __GF100_FIFO_H__
3#define __GF100_FIFO_H__ 3#define __GF100_FIFO_H__
4#define gf100_fifo(p) container_of((p), struct gf100_fifo, base) 4#define gf100_fifo(p) container_of((p), struct gf100_fifo, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
index d4e565658f46..c33f4593cbc6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __GK104_FIFO_H__ 2#ifndef __GK104_FIFO_H__
3#define __GK104_FIFO_H__ 3#define __GK104_FIFO_H__
4#define gk104_fifo(p) container_of((p), struct gk104_fifo, base) 4#define gk104_fifo(p) container_of((p), struct gk104_fifo, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.h
index 1d70542553cc..e5ecceee77ae 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv04.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV04_FIFO_H__ 2#ifndef __NV04_FIFO_H__
3#define __NV04_FIFO_H__ 3#define __NV04_FIFO_H__
4#define nv04_fifo(p) container_of((p), struct nv04_fifo, base) 4#define nv04_fifo(p) container_of((p), struct nv04_fifo, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.h
index a3994e8db462..87d30b6bd2ea 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_FIFO_H__ 2#ifndef __NV50_FIFO_H__
3#define __NV50_FIFO_H__ 3#define __NV50_FIFO_H__
4#define nv50_fifo(p) container_of((p), struct nv50_fifo, base) 4#define nv50_fifo(p) container_of((p), struct nv50_fifo, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
index d5acbba293f4..c66f5370b21f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FIFO_PRIV_H__ 2#ifndef __NVKM_FIFO_PRIV_H__
3#define __NVKM_FIFO_PRIV_H__ 3#define __NVKM_FIFO_PRIV_H__
4#define nvkm_fifo(p) container_of((p), struct nvkm_fifo, engine) 4#define nvkm_fifo(p) container_of((p), struct nvkm_fifo, engine)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/regsnv04.h b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/regsnv04.h
index 49892a5e7201..4445a12b9a26 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/regsnv04.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/regsnv04.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV04_FIFO_REGS_H__ 2#ifndef __NV04_FIFO_REGS_H__
3#define __NV04_FIFO_REGS_H__ 3#define __NV04_FIFO_REGS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild
index 50bd9830694f..73724a8cb861 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/gr/base.o 2nvkm-y += nvkm/engine/gr/base.o
3nvkm-y += nvkm/engine/gr/nv04.o 3nvkm-y += nvkm/engine/gr/nv04.o
4nvkm-y += nvkm/engine/gr/nv10.o 4nvkm-y += nvkm/engine/gr/nv10.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
index 33e932bd73b1..478b4723d0f9 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GRCTX_NVC0_H__ 2#ifndef __NVKM_GRCTX_NVC0_H__
3#define __NVKM_GRCTX_NVC0_H__ 3#define __NVKM_GRCTX_NVC0_H__
4#include "gf100.h" 4#include "gf100.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv40.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv40.h
index 4d67d90261b8..7917567ade3a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv40.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv40.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GRCTX_H__ 2#ifndef __NVKM_GRCTX_H__
3#define __NVKM_GRCTX_H__ 3#define __NVKM_GRCTX_H__
4#include <core/gpuobj.h> 4#include <core/gpuobj.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf100.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf100.fuc3.h
index 0323acb739c8..54e14b4d31b3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf100.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf100.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf100_grgpc_data[] = { 2static uint32_t gf100_grgpc_data[] = {
3/* 0x0000: gpc_mmio_list_head */ 3/* 0x0000: gpc_mmio_list_head */
4 0x00000064, 4 0x00000064,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf117.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf117.fuc3.h
index 1bb265917915..67524e615d81 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf117.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgf117.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf117_grgpc_data[] = { 2static uint32_t gf117_grgpc_data[] = {
3/* 0x0000: gpc_mmio_list_head */ 3/* 0x0000: gpc_mmio_list_head */
4 0x0000006c, 4 0x0000006c,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk104.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk104.fuc3.h
index cf8343a693ba..60c8b7e89913 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk104.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk104.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk104_grgpc_data[] = { 2static uint32_t gk104_grgpc_data[] = {
3/* 0x0000: gpc_mmio_list_head */ 3/* 0x0000: gpc_mmio_list_head */
4 0x0000006c, 4 0x0000006c,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk110.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk110.fuc3.h
index f4bfa109ed27..c99d1566554c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk110.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk110.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk110_grgpc_data[] = { 2static uint32_t gk110_grgpc_data[] = {
3/* 0x0000: gpc_mmio_list_head */ 3/* 0x0000: gpc_mmio_list_head */
4 0x0000006c, 4 0x0000006c,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk208.fuc5.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk208.fuc5.h
index 59a3e1b2927f..753aa66729bf 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk208.fuc5.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgk208.fuc5.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk208_grgpc_data[] = { 2static uint32_t gk208_grgpc_data[] = {
3/* 0x0000: gpc_mmio_list_head */ 3/* 0x0000: gpc_mmio_list_head */
4 0x0000006c, 4 0x0000006c,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgm107.fuc5.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgm107.fuc5.h
index 8daa0516704a..db8b294cee39 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgm107.fuc5.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/gpcgm107.fuc5.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gm107_grgpc_data[] = { 2static uint32_t gm107_grgpc_data[] = {
3/* 0x0000: gpc_mmio_list_head */ 3/* 0x0000: gpc_mmio_list_head */
4 0x0000006c, 4 0x0000006c,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf100.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf100.fuc3.h
index cbf2351f8da8..56162f6a6a94 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf100.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf100.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf100_grhub_data[] = { 2static uint32_t gf100_grhub_data[] = {
3/* 0x0000: hub_mmio_list_head */ 3/* 0x0000: hub_mmio_list_head */
4 0x00000300, 4 0x00000300,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf117.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf117.fuc3.h
index 70830036ffee..9b9f0d93f915 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf117.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgf117.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf117_grhub_data[] = { 2static uint32_t gf117_grhub_data[] = {
3/* 0x0000: hub_mmio_list_head */ 3/* 0x0000: hub_mmio_list_head */
4 0x00000300, 4 0x00000300,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk104.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk104.fuc3.h
index 7f2fd84d0c3a..fa11857b9d31 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk104.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk104.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk104_grhub_data[] = { 2static uint32_t gk104_grhub_data[] = {
3/* 0x0000: hub_mmio_list_head */ 3/* 0x0000: hub_mmio_list_head */
4 0x00000300, 4 0x00000300,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk110.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk110.fuc3.h
index 560063789de8..1d741b30a04a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk110.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk110.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk110_grhub_data[] = { 2static uint32_t gk110_grhub_data[] = {
3/* 0x0000: hub_mmio_list_head */ 3/* 0x0000: hub_mmio_list_head */
4 0x00000300, 4 0x00000300,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk208.fuc5.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk208.fuc5.h
index 71e85784b615..c24f35ad56a6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk208.fuc5.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgk208.fuc5.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk208_grhub_data[] = { 2static uint32_t gk208_grhub_data[] = {
3/* 0x0000: hub_mmio_list_head */ 3/* 0x0000: hub_mmio_list_head */
4 0x00000300, 4 0x00000300,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgm107.fuc5.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgm107.fuc5.h
index d85eac6d1c61..649a442b4390 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgm107.fuc5.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/hubgm107.fuc5.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gm107_grhub_data[] = { 2static uint32_t gm107_grhub_data[] = {
3/* 0x0000: hub_mmio_list_head */ 3/* 0x0000: hub_mmio_list_head */
4 0x00000300, 4 0x00000300,
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/os.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/os.h
index f87693809c9f..6ac155b9663b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/os.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/fuc/os.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GRAPH_OS_H__ 2#ifndef __NVKM_GRAPH_OS_H__
3#define __NVKM_GRAPH_OS_H__ 3#define __NVKM_GRAPH_OS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.h
index d5a376c4dd0b..4327baea02af 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv10.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV10_GR_H__ 2#ifndef __NV10_GR_H__
3#define __NV10_GR_H__ 3#define __NV10_GR_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c
index 111c8bb4497b..d837630a3625 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "nv20.h" 2#include "nv20.h"
3#include "regs.h" 3#include "regs.h"
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h
index 979dc5f7b32e..e57407a8a7c3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv20.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV20_GR_H__ 2#ifndef __NV20_GR_H__
3#define __NV20_GR_H__ 3#define __NV20_GR_H__
4#define nv20_gr(p) container_of((p), struct nv20_gr, base) 4#define nv20_gr(p) container_of((p), struct nv20_gr, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c
index e59a28a26d65..32d29d3faee0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv25.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "nv20.h" 2#include "nv20.h"
3#include "regs.h" 3#include "regs.h"
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c
index e113b2d4c811..f941062c66f0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv2a.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "nv20.h" 2#include "nv20.h"
3#include "regs.h" 3#include "regs.h"
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c
index 4aac2c224874..785ec956df0f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv30.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "nv20.h" 2#include "nv20.h"
3#include "regs.h" 3#include "regs.h"
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c
index 301556503e93..bd610d75c677 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv34.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "nv20.h" 2#include "nv20.h"
3#include "regs.h" 3#include "regs.h"
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c
index 5d6926611a5b..89db7f523037 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv35.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#include "nv20.h" 2#include "nv20.h"
3#include "regs.h" 3#include "regs.h"
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.h
index 731400937edd..e6128791b2d2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv40.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV40_GR_H__ 2#ifndef __NV40_GR_H__
3#define __NV40_GR_H__ 3#define __NV40_GR_H__
4#define nv40_gr(p) container_of((p), struct nv40_gr, base) 4#define nv40_gr(p) container_of((p), struct nv40_gr, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h
index 5b9d99bee207..465f4da0ddfc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_GR_H__ 2#ifndef __NV50_GR_H__
3#define __NV50_GR_H__ 3#define __NV50_GR_H__
4#define nv50_gr(p) container_of((p), struct nv50_gr, base) 4#define nv50_gr(p) container_of((p), struct nv50_gr, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h
index d4d5601c51e7..3b30f24032cc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GR_PRIV_H__ 2#ifndef __NVKM_GR_PRIV_H__
3#define __NVKM_GR_PRIV_H__ 3#define __NVKM_GR_PRIV_H__
4#define nvkm_gr(p) container_of((p), struct nvkm_gr, engine) 4#define nvkm_gr(p) container_of((p), struct nvkm_gr, engine)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/regs.h b/drivers/gpu/drm/nouveau/nvkm/engine/gr/regs.h
index dc4f936675ac..fd1b7d35c62b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/regs.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/regs.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GR_REGS_H__ 2#ifndef __NVKM_GR_REGS_H__
3#define __NVKM_GR_REGS_H__ 3#define __NVKM_GR_REGS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/Kbuild
index 651270137268..8d2d9eae5604 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/mpeg/nv31.o 2nvkm-y += nvkm/engine/mpeg/nv31.o
3nvkm-y += nvkm/engine/mpeg/nv40.o 3nvkm-y += nvkm/engine/mpeg/nv40.o
4nvkm-y += nvkm/engine/mpeg/nv44.o 4nvkm-y += nvkm/engine/mpeg/nv44.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.h b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.h
index b31fad8bdaad..b3e131538858 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV31_MPEG_H__ 2#ifndef __NV31_MPEG_H__
3#define __NV31_MPEG_H__ 3#define __NV31_MPEG_H__
4#define nv31_mpeg(p) container_of((p), struct nv31_mpeg, engine) 4#define nv31_mpeg(p) container_of((p), struct nv31_mpeg, engine)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/priv.h
index 26f9d14151e2..667a2d05dd89 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MPEG_PRIV_H__ 2#ifndef __NVKM_MPEG_PRIV_H__
3#define __NVKM_MPEG_PRIV_H__ 3#define __NVKM_MPEG_PRIV_H__
4#include <engine/mpeg.h> 4#include <engine/mpeg.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/msenc/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/msenc/Kbuild
index b808d9e9c964..4bf033ff4d41 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/msenc/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/msenc/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2#nvkm-y += nvkm/engine/msenc/base.o 2#nvkm-y += nvkm/engine/msenc/base.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/Kbuild
index df50010e5f2c..0cd957d72593 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/mspdec/base.o 2nvkm-y += nvkm/engine/mspdec/base.o
3nvkm-y += nvkm/engine/mspdec/g98.o 3nvkm-y += nvkm/engine/mspdec/g98.o
4nvkm-y += nvkm/engine/mspdec/gt215.o 4nvkm-y += nvkm/engine/mspdec/gt215.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/priv.h
index db305072a82f..86445a2600d0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/mspdec/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSPDEC_PRIV_H__ 2#ifndef __NVKM_MSPDEC_PRIV_H__
3#define __NVKM_MSPDEC_PRIV_H__ 3#define __NVKM_MSPDEC_PRIV_H__
4#include <engine/mspdec.h> 4#include <engine/mspdec.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/msppp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/msppp/Kbuild
index 322e3470b2f1..788ce7255b61 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/msppp/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/msppp/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/msppp/base.o 2nvkm-y += nvkm/engine/msppp/base.o
3nvkm-y += nvkm/engine/msppp/g98.o 3nvkm-y += nvkm/engine/msppp/g98.o
4nvkm-y += nvkm/engine/msppp/gt215.o 4nvkm-y += nvkm/engine/msppp/gt215.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/msppp/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/msppp/priv.h
index 7708e52c9043..f20b10915db2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/msppp/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/msppp/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSPPP_PRIV_H__ 2#ifndef __NVKM_MSPPP_PRIV_H__
3#define __NVKM_MSPPP_PRIV_H__ 3#define __NVKM_MSPPP_PRIV_H__
4#include <engine/msppp.h> 4#include <engine/msppp.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/msvld/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/msvld/Kbuild
index beddd82f5755..d68b4431cd80 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/msvld/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/msvld/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/msvld/base.o 2nvkm-y += nvkm/engine/msvld/base.o
3nvkm-y += nvkm/engine/msvld/g98.o 3nvkm-y += nvkm/engine/msvld/g98.o
4nvkm-y += nvkm/engine/msvld/gt215.o 4nvkm-y += nvkm/engine/msvld/gt215.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/msvld/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/msvld/priv.h
index 66c36049abca..5cd1e83badbb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/msvld/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/msvld/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MSVLD_PRIV_H__ 2#ifndef __NVKM_MSVLD_PRIV_H__
3#define __NVKM_MSVLD_PRIV_H__ 3#define __NVKM_MSVLD_PRIV_H__
4#include <engine/msvld.h> 4#include <engine/msvld.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/Kbuild
index 29d7ddb56f0e..cdf631822282 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/Kbuild
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/nvdec/base.o 2nvkm-y += nvkm/engine/nvdec/base.o
3nvkm-y += nvkm/engine/nvdec/gp102.o 3nvkm-y += nvkm/engine/nvdec/gp102.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/priv.h
index 6c300739f621..57bfa3aa1835 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvdec/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_NVDEC_PRIV_H__ 2#ifndef __NVKM_NVDEC_PRIV_H__
3#define __NVKM_NVDEC_PRIV_H__ 3#define __NVKM_NVDEC_PRIV_H__
4#include <engine/nvdec.h> 4#include <engine/nvdec.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/Kbuild
index 85725b11200b..f316de8d45a8 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/nvenc/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2#nvkm-y += nvkm/engine/nvenc/base.o 2#nvkm-y += nvkm/engine/nvenc/base.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/pm/Kbuild
index ceb7302e292f..2cc8a5f6fe0c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/pm/base.o 2nvkm-y += nvkm/engine/pm/base.o
3nvkm-y += nvkm/engine/pm/nv40.o 3nvkm-y += nvkm/engine/pm/nv40.o
4nvkm-y += nvkm/engine/pm/nv50.o 4nvkm-y += nvkm/engine/pm/nv50.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.h b/drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.h
index c74fd4557d41..461bb219b1c0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/gf100.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PM_NVC0_H__ 2#ifndef __NVKM_PM_NVC0_H__
3#define __NVKM_PM_NVC0_H__ 3#define __NVKM_PM_NVC0_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.h b/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.h
index 3f37b713936c..8ed19320fda1 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PM_NV40_H__ 2#ifndef __NVKM_PM_NV40_H__
3#define __NVKM_PM_NV40_H__ 3#define __NVKM_PM_NV40_H__
4#define nv40_pm(p) container_of((p), struct nv40_pm, base) 4#define nv40_pm(p) container_of((p), struct nv40_pm, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h
index 9fad3611a843..cd6f8f79b235 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PM_PRIV_H__ 2#ifndef __NVKM_PM_PRIV_H__
3#define __NVKM_PM_PRIV_H__ 3#define __NVKM_PM_PRIV_H__
4#define nvkm_pm(p) container_of((p), struct nvkm_pm, engine) 4#define nvkm_pm(p) container_of((p), struct nvkm_pm, engine)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild
index f72ee558f8e8..b6e02ceb1c5a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/sec/g98.o 2nvkm-y += nvkm/engine/sec/g98.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h b/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h
index 6278a0c5fe83..fe90f2e05853 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec/fuc/g98.fuc0s.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t g98_sec_data[] = { 2static uint32_t g98_sec_data[] = {
3/* 0x0000: ctx_dma */ 3/* 0x0000: ctx_dma */
4/* 0x0000: ctx_dma_query */ 4/* 0x0000: ctx_dma_query */
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/Kbuild
index 9a2f4f669291..97c4696171f0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/sec2/base.o 2nvkm-y += nvkm/engine/sec2/base.o
3nvkm-y += nvkm/engine/sec2/gp102.o 3nvkm-y += nvkm/engine/sec2/gp102.o
4nvkm-y += nvkm/engine/sec2/tu102.o 4nvkm-y += nvkm/engine/sec2/tu102.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/priv.h
index ab0165e2d1a3..b331b00517e6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sec2/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sec2/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SEC2_PRIV_H__ 2#ifndef __NVKM_SEC2_PRIV_H__
3#define __NVKM_SEC2_PRIV_H__ 3#define __NVKM_SEC2_PRIV_H__
4#include <engine/sec2.h> 4#include <engine/sec2.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/sw/Kbuild
index 91cf08084bc1..94fe25964f51 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/sw/base.o 2nvkm-y += nvkm/engine/sw/base.o
3nvkm-y += nvkm/engine/sw/nv04.o 3nvkm-y += nvkm/engine/sw/nv04.o
4nvkm-y += nvkm/engine/sw/nv10.o 4nvkm-y += nvkm/engine/sw/nv10.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/chan.h b/drivers/gpu/drm/nouveau/nvkm/engine/sw/chan.h
index d42862fc43fd..32de53427aa4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/chan.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/chan.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SW_CHAN_H__ 2#ifndef __NVKM_SW_CHAN_H__
3#define __NVKM_SW_CHAN_H__ 3#define __NVKM_SW_CHAN_H__
4#define nvkm_sw_chan(p) container_of((p), struct nvkm_sw_chan, object) 4#define nvkm_sw_chan(p) container_of((p), struct nvkm_sw_chan, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.h
index 459afd30a484..6d364d7b406a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SW_NV50_H__ 2#ifndef __NVKM_SW_NV50_H__
3#define __NVKM_SW_NV50_H__ 3#define __NVKM_SW_NV50_H__
4#define nv50_sw_chan(p) container_of((p), struct nv50_sw_chan, base) 4#define nv50_sw_chan(p) container_of((p), struct nv50_sw_chan, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.h b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.h
index d7034950ba87..d2f846499b92 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/nvsw.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_NVSW_H__ 2#ifndef __NVKM_NVSW_H__
3#define __NVKM_NVSW_H__ 3#define __NVKM_NVSW_H__
4#define nvkm_nvsw(p) container_of((p), struct nvkm_nvsw, object) 4#define nvkm_nvsw(p) container_of((p), struct nvkm_nvsw, object)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/sw/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/sw/priv.h
index 4aca1791abc3..6d18fc6180f2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/sw/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/sw/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_SW_PRIV_H__ 2#ifndef __NVKM_SW_PRIV_H__
3#define __NVKM_SW_PRIV_H__ 3#define __NVKM_SW_PRIV_H__
4#define nvkm_sw(p) container_of((p), struct nvkm_sw, engine) 4#define nvkm_sw(p) container_of((p), struct nvkm_sw, engine)
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/vic/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/vic/Kbuild
index 9281c82ea99c..70164f482cc5 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/vic/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/vic/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2#nvkm-y += nvkm/engine/vic/base.o 2#nvkm-y += nvkm/engine/vic/base.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/vp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/vp/Kbuild
index 456e43fd1f6c..d48ea0fd1d27 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/vp/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/vp/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/engine/vp/g84.o 2nvkm-y += nvkm/engine/vp/g84.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/Kbuild b/drivers/gpu/drm/nouveau/nvkm/falcon/Kbuild
index 8afbf0f9bc86..b5665ada850a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/falcon/base.o 2nvkm-y += nvkm/falcon/base.o
3nvkm-y += nvkm/falcon/v1.o 3nvkm-y += nvkm/falcon/v1.o
4nvkm-y += nvkm/falcon/msgqueue.o 4nvkm-y += nvkm/falcon/msgqueue.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/priv.h b/drivers/gpu/drm/nouveau/nvkm/falcon/priv.h
index d515ad994199..900fe1d37b4d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FALCON_PRIV_H__ 2#ifndef __NVKM_FALCON_PRIV_H__
3#define __NVKM_FALCON_PRIV_H__ 3#define __NVKM_FALCON_PRIV_H__
4#include <engine/falcon.h> 4#include <engine/falcon.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/v1.c b/drivers/gpu/drm/nouveau/nvkm/falcon/v1.c
index 9def926f24d4..6d978feebbd7 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/v1.c
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/v1.c
@@ -182,6 +182,7 @@ nvkm_falcon_v1_read_dmem(struct nvkm_falcon *falcon, u32 start, u32 size,
182static void 182static void
183nvkm_falcon_v1_bind_context(struct nvkm_falcon *falcon, struct nvkm_memory *ctx) 183nvkm_falcon_v1_bind_context(struct nvkm_falcon *falcon, struct nvkm_memory *ctx)
184{ 184{
185 struct nvkm_device *device = falcon->owner->device;
185 u32 inst_loc; 186 u32 inst_loc;
186 u32 fbif; 187 u32 fbif;
187 188
@@ -233,6 +234,41 @@ nvkm_falcon_v1_bind_context(struct nvkm_falcon *falcon, struct nvkm_memory *ctx)
233 234
234 nvkm_falcon_mask(falcon, 0x090, 0x10000, 0x10000); 235 nvkm_falcon_mask(falcon, 0x090, 0x10000, 0x10000);
235 nvkm_falcon_mask(falcon, 0x0a4, 0x8, 0x8); 236 nvkm_falcon_mask(falcon, 0x0a4, 0x8, 0x8);
237
238 /* Not sure if this is a WAR for a HW issue, or some additional
239 * programming sequence that's needed to properly complete the
240 * context switch we trigger above.
241 *
242 * Fixes unreliability of booting the SEC2 RTOS on Quadro P620,
243 * particularly when resuming from suspend.
244 *
245 * Also removes the need for an odd workaround where we needed
246 * to program SEC2's FALCON_CPUCTL_ALIAS_STARTCPU twice before
247 * the SEC2 RTOS would begin executing.
248 */
249 switch (falcon->owner->index) {
250 case NVKM_SUBDEV_GSP:
251 case NVKM_ENGINE_SEC2:
252 nvkm_msec(device, 10,
253 u32 irqstat = nvkm_falcon_rd32(falcon, 0x008);
254 u32 flcn0dc = nvkm_falcon_rd32(falcon, 0x0dc);
255 if ((irqstat & 0x00000008) &&
256 (flcn0dc & 0x00007000) == 0x00005000)
257 break;
258 );
259
260 nvkm_falcon_mask(falcon, 0x004, 0x00000008, 0x00000008);
261 nvkm_falcon_mask(falcon, 0x058, 0x00000002, 0x00000002);
262
263 nvkm_msec(device, 10,
264 u32 flcn0dc = nvkm_falcon_rd32(falcon, 0x0dc);
265 if ((flcn0dc & 0x00007000) == 0x00000000)
266 break;
267 );
268 break;
269 default:
270 break;
271 }
236} 272}
237 273
238static void 274static void
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild
index d8c287173f4c..4e136f3d7c28 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2include $(src)/nvkm/subdev/bar/Kbuild 2include $(src)/nvkm/subdev/bar/Kbuild
3include $(src)/nvkm/subdev/bios/Kbuild 3include $(src)/nvkm/subdev/bios/Kbuild
4include $(src)/nvkm/subdev/bus/Kbuild 4include $(src)/nvkm/subdev/bus/Kbuild
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/Kbuild
index 8210bf9c52a5..8faee3317a74 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/bar/base.o 2nvkm-y += nvkm/subdev/bar/base.o
3nvkm-y += nvkm/subdev/bar/nv50.o 3nvkm-y += nvkm/subdev/bar/nv50.o
4nvkm-y += nvkm/subdev/bar/g84.o 4nvkm-y += nvkm/subdev/bar/g84.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.h
index 4f2b66e8d795..4ae4c7145712 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __GF100_BAR_H__ 2#ifndef __GF100_BAR_H__
3#define __GF100_BAR_H__ 3#define __GF100_BAR_H__
4#define gf100_bar(p) container_of((p), struct gf100_bar, base) 4#define gf100_bar(p) container_of((p), struct gf100_bar, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h
index 2fe833f6d9f7..e4193deb2e51 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_BAR_H__ 2#ifndef __NV50_BAR_H__
3#define __NV50_BAR_H__ 3#define __NV50_BAR_H__
4#define nv50_bar(p) container_of((p), struct nv50_bar, base) 4#define nv50_bar(p) container_of((p), struct nv50_bar, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/priv.h
index 01ba5b26666e..869ad184f923 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BAR_PRIV_H__ 2#ifndef __NVKM_BAR_PRIV_H__
3#define __NVKM_BAR_PRIV_H__ 3#define __NVKM_BAR_PRIV_H__
4#define nvkm_bar(p) container_of((p), struct nvkm_bar, subdev) 4#define nvkm_bar(p) container_of((p), struct nvkm_bar, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/Kbuild
index bb4759cc38a6..5a970fb8f7ee 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/bios/base.o 2nvkm-y += nvkm/subdev/bios/base.o
3nvkm-y += nvkm/subdev/bios/bit.o 3nvkm-y += nvkm/subdev/bios/bit.o
4nvkm-y += nvkm/subdev/bios/boost.o 4nvkm-y += nvkm/subdev/bios/boost.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
index 33435ca16311..fac1bff1311b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BIOS_PRIV_H__ 2#ifndef __NVKM_BIOS_PRIV_H__
3#define __NVKM_BIOS_PRIV_H__ 3#define __NVKM_BIOS_PRIV_H__
4#define nvkm_bios(p) container_of((p), struct nvkm_bios, subdev) 4#define nvkm_bios(p) container_of((p), struct nvkm_bios, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/Kbuild
index 409137fbdddf..01d737989d00 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/bus/base.o 2nvkm-y += nvkm/subdev/bus/base.o
3nvkm-y += nvkm/subdev/bus/hwsq.o 3nvkm-y += nvkm/subdev/bus/hwsq.o
4nvkm-y += nvkm/subdev/bus/nv04.o 4nvkm-y += nvkm/subdev/bus/nv04.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.h
index 17ac1812a928..217a0a4a3bc5 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/hwsq.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BUS_HWSQ_H__ 2#ifndef __NVKM_BUS_HWSQ_H__
3#define __NVKM_BUS_HWSQ_H__ 3#define __NVKM_BUS_HWSQ_H__
4#include <subdev/bus.h> 4#include <subdev/bus.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/priv.h
index ef01e569352d..76f7ba1c6494 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bus/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bus/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_BUS_PRIV_H__ 2#ifndef __NVKM_BUS_PRIV_H__
3#define __NVKM_BUS_PRIV_H__ 3#define __NVKM_BUS_PRIV_H__
4#define nvkm_bus(p) container_of((p), struct nvkm_bus, subdev) 4#define nvkm_bus(p) container_of((p), struct nvkm_bus, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/Kbuild
index 0a8a7072bcbc..dcecd499d8df 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/clk/base.o 2nvkm-y += nvkm/subdev/clk/base.o
3nvkm-y += nvkm/subdev/clk/nv04.o 3nvkm-y += nvkm/subdev/clk/nv04.o
4nvkm-y += nvkm/subdev/clk/nv40.o 4nvkm-y += nvkm/subdev/clk/nv40.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.h b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.h
index 1ea886a4301f..34754efbfb1e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CLK_NVA3_H__ 2#ifndef __NVKM_CLK_NVA3_H__
3#define __NVKM_CLK_NVA3_H__ 3#define __NVKM_CLK_NVA3_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.h b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.h
index f134d979d884..7c7713238ec4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_CLK_H__ 2#ifndef __NV50_CLK_H__
3#define __NV50_CLK_H__ 3#define __NV50_CLK_H__
4#define nv50_clk(p) container_of((p), struct nv50_clk, base) 4#define nv50_clk(p) container_of((p), struct nv50_clk, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/pll.h b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/pll.h
index 9a39f1fd2976..631907564e71 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/pll.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/pll.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PLL_H__ 2#ifndef __NVKM_PLL_H__
3#define __NVKM_PLL_H__ 3#define __NVKM_PLL_H__
4#include <core/os.h> 4#include <core/os.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/priv.h
index b656177923fb..81dfb37480ae 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CLK_PRIV_H__ 2#ifndef __NVKM_CLK_PRIV_H__
3#define __NVKM_CLK_PRIV_H__ 3#define __NVKM_CLK_PRIV_H__
4#define nvkm_clk(p) container_of((p), struct nvkm_clk, subdev) 4#define nvkm_clk(p) container_of((p), struct nvkm_clk, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/seq.h b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/seq.h
index d0715fe84328..e4b362d3449b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/seq.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/seq.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_CLK_SEQ_H__ 2#ifndef __NVKM_CLK_SEQ_H__
3#define __NVKM_CLK_SEQ_H__ 3#define __NVKM_CLK_SEQ_H__
4#include <subdev/bus/hwsq.h> 4#include <subdev/bus/hwsq.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild
index f054c44acab2..b3429371ed82 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/devinit/base.o 2nvkm-y += nvkm/subdev/devinit/base.o
3nvkm-y += nvkm/subdev/devinit/nv04.o 3nvkm-y += nvkm/subdev/devinit/nv04.o
4nvkm-y += nvkm/subdev/devinit/nv05.o 4nvkm-y += nvkm/subdev/devinit/nv05.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.h b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.h
index b18e49847eee..15b029ddf6df 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV04_DEVINIT_H__ 2#ifndef __NV04_DEVINIT_H__
3#define __NV04_DEVINIT_H__ 3#define __NV04_DEVINIT_H__
4#define nv04_devinit(p) container_of((p), struct nv04_devinit, base) 4#define nv04_devinit(p) container_of((p), struct nv04_devinit, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.h b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.h
index 72d130bb7f7c..e8d37a6145a2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV50_DEVINIT_H__ 2#ifndef __NV50_DEVINIT_H__
3#define __NV50_DEVINIT_H__ 3#define __NV50_DEVINIT_H__
4#define nv50_devinit(p) container_of((p), struct nv50_devinit, base) 4#define nv50_devinit(p) container_of((p), struct nv50_devinit, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h
index 5b3097a586dd..94723352137a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_DEVINIT_PRIV_H__ 2#ifndef __NVKM_DEVINIT_PRIV_H__
3#define __NVKM_DEVINIT_PRIV_H__ 3#define __NVKM_DEVINIT_PRIV_H__
4#define nvkm_devinit(p) container_of((p), struct nvkm_devinit, subdev) 4#define nvkm_devinit(p) container_of((p), struct nvkm_devinit, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/Kbuild
index c9bcf3744e5c..53b9d638f2c8 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fault/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fault/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/fault/base.o 2nvkm-y += nvkm/subdev/fault/base.o
3nvkm-y += nvkm/subdev/fault/user.o 3nvkm-y += nvkm/subdev/fault/user.o
4nvkm-y += nvkm/subdev/fault/gp100.o 4nvkm-y += nvkm/subdev/fault/gp100.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
index 88b1668929ba..43a42159a3d0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/fb/base.o 2nvkm-y += nvkm/subdev/fb/base.o
3nvkm-y += nvkm/subdev/fb/nv04.o 3nvkm-y += nvkm/subdev/fb/nv04.o
4nvkm-y += nvkm/subdev/fb/nv10.o 4nvkm-y += nvkm/subdev/fb/nv10.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.h
index ab261310753a..2ed7cdaab37c 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/gf100.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_RAM_NVC0_H__ 2#ifndef __NVKM_RAM_NVC0_H__
3#define __NVKM_RAM_NVC0_H__ 3#define __NVKM_RAM_NVC0_H__
4#define gf100_fb(p) container_of((p), struct gf100_fb, base) 4#define gf100_fb(p) container_of((p), struct gf100_fb, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.h
index dacc696387b6..5e2b0c9539ed 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/nv50.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FB_NV50_H__ 2#ifndef __NVKM_FB_NV50_H__
3#define __NVKM_FB_NV50_H__ 3#define __NVKM_FB_NV50_H__
4#define nv50_fb(p) container_of((p), struct nv50_fb, base) 4#define nv50_fb(p) container_of((p), struct nv50_fb, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h
index 1e4ad61c19e1..c4e9f55af283 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FB_PRIV_H__ 2#ifndef __NVKM_FB_PRIV_H__
3#define __NVKM_FB_PRIV_H__ 3#define __NVKM_FB_PRIV_H__
4#define nvkm_fb(p) container_of((p), struct nvkm_fb, subdev) 4#define nvkm_fb(p) container_of((p), struct nvkm_fb, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
index 330132e95b6f..d723a9b4e3c4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ram.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FB_RAM_PRIV_H__ 2#ifndef __NVKM_FB_RAM_PRIV_H__
3#define __NVKM_FB_RAM_PRIV_H__ 3#define __NVKM_FB_RAM_PRIV_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h
index a65fa5586af8..247c0f8a723b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramfuc.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FBRAM_FUC_H__ 2#ifndef __NVKM_FBRAM_FUC_H__
3#define __NVKM_FBRAM_FUC_H__ 3#define __NVKM_FBRAM_FUC_H__
4#include <subdev/fb.h> 4#include <subdev/fb.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.h
index 11f6bb2936b9..a87de0871dfc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv40.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NV40_FB_RAM_H__ 2#ifndef __NV40_FB_RAM_H__
3#define __NV40_FB_RAM_H__ 3#define __NV40_FB_RAM_H__
4#define nv40_ram(p) container_of((p), struct nv40_ram, base) 4#define nv40_ram(p) container_of((p), struct nv40_ram, base)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramseq.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramseq.h
index d8f5053e8e2a..aba5b73781d3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramseq.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramseq.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FBRAM_SEQ_H__ 2#ifndef __NVKM_FBRAM_SEQ_H__
3#define __NVKM_FBRAM_SEQ_H__ 3#define __NVKM_FBRAM_SEQ_H__
4#include <subdev/bus/hwsq.h> 4#include <subdev/bus/hwsq.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/regsnv04.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/regsnv04.h
index ad26fcbe9e06..8098cd77dfdd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/regsnv04.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/regsnv04.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FB_REGS_04_H__ 2#ifndef __NVKM_FB_REGS_04_H__
3#define __NVKM_FB_REGS_04_H__ 3#define __NVKM_FB_REGS_04_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/Kbuild
index 9626715768c8..8e7cd9d27f23 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/fuse/base.o 2nvkm-y += nvkm/subdev/fuse/base.o
3nvkm-y += nvkm/subdev/fuse/nv50.o 3nvkm-y += nvkm/subdev/fuse/nv50.o
4nvkm-y += nvkm/subdev/fuse/gf100.o 4nvkm-y += nvkm/subdev/fuse/gf100.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h
index 3a5595a9e457..2edc612408dd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fuse/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_FUSE_PRIV_H__ 2#ifndef __NVKM_FUSE_PRIV_H__
3#define __NVKM_FUSE_PRIV_H__ 3#define __NVKM_FUSE_PRIV_H__
4#define nvkm_fuse(p) container_of((p), struct nvkm_fuse, subdev) 4#define nvkm_fuse(p) container_of((p), struct nvkm_fuse, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild
index 0169fc30a2f9..b2ad5922a1c2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/gpio/base.o 2nvkm-y += nvkm/subdev/gpio/base.o
3nvkm-y += nvkm/subdev/gpio/nv10.o 3nvkm-y += nvkm/subdev/gpio/nv10.o
4nvkm-y += nvkm/subdev/gpio/nv50.o 4nvkm-y += nvkm/subdev/gpio/nv50.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h
index 9759f13447bf..59e39affe2a0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_GPIO_PRIV_H__ 2#ifndef __NVKM_GPIO_PRIV_H__
3#define __NVKM_GPIO_PRIV_H__ 3#define __NVKM_GPIO_PRIV_H__
4#define nvkm_gpio(p) container_of((p), struct nvkm_gpio, subdev) 4#define nvkm_gpio(p) container_of((p), struct nvkm_gpio, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild
index fa566ea6cb95..e7c4f068936e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/Kbuild
@@ -1,2 +1,2 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/gsp/gv100.o 2nvkm-y += nvkm/subdev/gsp/gv100.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
index 69f341e11d70..723d0284caef 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/i2c/base.o 2nvkm-y += nvkm/subdev/i2c/base.o
3nvkm-y += nvkm/subdev/i2c/nv04.o 3nvkm-y += nvkm/subdev/i2c/nv04.o
4nvkm-y += nvkm/subdev/i2c/nv4e.o 4nvkm-y += nvkm/subdev/i2c/nv4e.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
index 08f6b2ee64ab..30b48896965e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_I2C_AUX_H__ 2#ifndef __NVKM_I2C_AUX_H__
3#define __NVKM_I2C_AUX_H__ 3#define __NVKM_I2C_AUX_H__
4#include "pad.h" 4#include "pad.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c
index ecacb22834d7..719345074711 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/base.c
@@ -185,6 +185,25 @@ nvkm_i2c_fini(struct nvkm_subdev *subdev, bool suspend)
185} 185}
186 186
187static int 187static int
188nvkm_i2c_preinit(struct nvkm_subdev *subdev)
189{
190 struct nvkm_i2c *i2c = nvkm_i2c(subdev);
191 struct nvkm_i2c_bus *bus;
192 struct nvkm_i2c_pad *pad;
193
194 /*
195 * We init our i2c busses as early as possible, since they may be
196 * needed by the vbios init scripts on some cards
197 */
198 list_for_each_entry(pad, &i2c->pad, head)
199 nvkm_i2c_pad_init(pad);
200 list_for_each_entry(bus, &i2c->bus, head)
201 nvkm_i2c_bus_init(bus);
202
203 return 0;
204}
205
206static int
188nvkm_i2c_init(struct nvkm_subdev *subdev) 207nvkm_i2c_init(struct nvkm_subdev *subdev)
189{ 208{
190 struct nvkm_i2c *i2c = nvkm_i2c(subdev); 209 struct nvkm_i2c *i2c = nvkm_i2c(subdev);
@@ -238,6 +257,7 @@ nvkm_i2c_dtor(struct nvkm_subdev *subdev)
238static const struct nvkm_subdev_func 257static const struct nvkm_subdev_func
239nvkm_i2c = { 258nvkm_i2c = {
240 .dtor = nvkm_i2c_dtor, 259 .dtor = nvkm_i2c_dtor,
260 .preinit = nvkm_i2c_preinit,
241 .init = nvkm_i2c_init, 261 .init = nvkm_i2c_init,
242 .fini = nvkm_i2c_fini, 262 .fini = nvkm_i2c_fini,
243 .intr = nvkm_i2c_intr, 263 .intr = nvkm_i2c_intr,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.h
index 465464bba58b..4c236ab34929 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/bus.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_I2C_BUS_H__ 2#ifndef __NVKM_I2C_BUS_H__
3#define __NVKM_I2C_BUS_H__ 3#define __NVKM_I2C_BUS_H__
4#include "pad.h" 4#include "pad.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h
index 33f0c809e583..461016814f4f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/pad.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_I2C_PAD_H__ 2#ifndef __NVKM_I2C_PAD_H__
3#define __NVKM_I2C_PAD_H__ 3#define __NVKM_I2C_PAD_H__
4#include <subdev/i2c.h> 4#include <subdev/i2c.h>
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h
index f476a69b6cb7..bd86bc298ebe 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_I2C_PRIV_H__ 2#ifndef __NVKM_I2C_PRIV_H__
3#define __NVKM_I2C_PRIV_H__ 3#define __NVKM_I2C_PRIV_H__
4#define nvkm_i2c(p) container_of((p), struct nvkm_i2c, subdev) 4#define nvkm_i2c(p) container_of((p), struct nvkm_i2c, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/Kbuild
index 557530355064..127efb51f67d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/ibus/gf100.o 2nvkm-y += nvkm/subdev/ibus/gf100.o
3nvkm-y += nvkm/subdev/ibus/gf117.o 3nvkm-y += nvkm/subdev/ibus/gf117.o
4nvkm-y += nvkm/subdev/ibus/gk104.o 4nvkm-y += nvkm/subdev/ibus/gk104.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/priv.h
index 504a6d37ec50..302d69e384d8 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_IBUS_PRIV_H__ 2#ifndef __NVKM_IBUS_PRIV_H__
3#define __NVKM_IBUS_PRIV_H__ 3#define __NVKM_IBUS_PRIV_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/Kbuild
index 52eb0746c750..6634bcdc5eeb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/Kbuild
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/iccsense/base.o 2nvkm-y += nvkm/subdev/iccsense/base.o
3nvkm-y += nvkm/subdev/iccsense/gf100.o 3nvkm-y += nvkm/subdev/iccsense/gf100.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h
index bd599b8252ca..cc09c6c504af 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/iccsense/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_ICCSENSE_PRIV_H__ 2#ifndef __NVKM_ICCSENSE_PRIV_H__
3#define __NVKM_ICCSENSE_PRIV_H__ 3#define __NVKM_ICCSENSE_PRIV_H__
4#define nvkm_iccsense(p) container_of((p), struct nvkm_iccsense, subdev) 4#define nvkm_iccsense(p) container_of((p), struct nvkm_iccsense, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/Kbuild
index e0031b5c06b1..06cbe19ce376 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/instmem/base.o 2nvkm-y += nvkm/subdev/instmem/base.o
3nvkm-y += nvkm/subdev/instmem/nv04.o 3nvkm-y += nvkm/subdev/instmem/nv04.o
4nvkm-y += nvkm/subdev/instmem/nv40.o 4nvkm-y += nvkm/subdev/instmem/nv40.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h
index b9e4751b9921..f5da8fcbdde3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_INSTMEM_PRIV_H__ 2#ifndef __NVKM_INSTMEM_PRIV_H__
3#define __NVKM_INSTMEM_PRIV_H__ 3#define __NVKM_INSTMEM_PRIV_H__
4#define nvkm_instmem(p) container_of((p), struct nvkm_instmem, subdev) 4#define nvkm_instmem(p) container_of((p), struct nvkm_instmem, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild
index 61f655c2de0c..2b6d36ea7067 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/ltc/base.o 2nvkm-y += nvkm/subdev/ltc/base.o
3nvkm-y += nvkm/subdev/ltc/gf100.o 3nvkm-y += nvkm/subdev/ltc/gf100.o
4nvkm-y += nvkm/subdev/ltc/gk104.o 4nvkm-y += nvkm/subdev/ltc/gk104.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h
index 9dcde43c0f3c..2fcf18e46ce3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ltc/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_LTC_PRIV_H__ 2#ifndef __NVKM_LTC_PRIV_H__
3#define __NVKM_LTC_PRIV_H__ 3#define __NVKM_LTC_PRIV_H__
4#define nvkm_ltc(p) container_of((p), struct nvkm_ltc, subdev) 4#define nvkm_ltc(p) container_of((p), struct nvkm_ltc, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild
index 15da199d2fca..2585ef07532a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/mc/base.o 2nvkm-y += nvkm/subdev/mc/base.o
3nvkm-y += nvkm/subdev/mc/nv04.o 3nvkm-y += nvkm/subdev/mc/nv04.o
4nvkm-y += nvkm/subdev/mc/nv11.o 4nvkm-y += nvkm/subdev/mc/nv11.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h
index eb91a4cf452b..4aab753a6040 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MC_PRIV_H__ 2#ifndef __NVKM_MC_PRIV_H__
3#define __NVKM_MC_PRIV_H__ 3#define __NVKM_MC_PRIV_H__
4#define nvkm_mc(p) container_of((p), struct nvkm_mc, subdev) 4#define nvkm_mc(p) container_of((p), struct nvkm_mc, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild
index 697dc22c937c..a602b0cb5b31 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/mmu/base.o 2nvkm-y += nvkm/subdev/mmu/base.o
3nvkm-y += nvkm/subdev/mmu/nv04.o 3nvkm-y += nvkm/subdev/mmu/nv04.o
4nvkm-y += nvkm/subdev/mmu/nv41.o 4nvkm-y += nvkm/subdev/mmu/nv41.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h
index 2ad1102a4e31..07f2fcd18f3d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MMU_PRIV_H__ 2#ifndef __NVKM_MMU_PRIV_H__
3#define __NVKM_MMU_PRIV_H__ 3#define __NVKM_MMU_PRIV_H__
4#define nvkm_mmu(p) container_of((p), struct nvkm_mmu, subdev) 4#define nvkm_mmu(p) container_of((p), struct nvkm_mmu, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/Kbuild
index 7a549386e675..5124a0c41367 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/mxm/base.o 2nvkm-y += nvkm/subdev/mxm/base.o
3nvkm-y += nvkm/subdev/mxm/mxms.o 3nvkm-y += nvkm/subdev/mxm/mxms.o
4nvkm-y += nvkm/subdev/mxm/nv50.o 4nvkm-y += nvkm/subdev/mxm/nv50.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h
index 011a67fe4a8b..d9676b282ac0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/mxms.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVMXM_MXMS_H__ 2#ifndef __NVMXM_MXMS_H__
3#define __NVMXM_MXMS_H__ 3#define __NVMXM_MXMS_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/priv.h
index 6767c2279e7c..fc8f69e6fc64 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mxm/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_MXM_PRIV_H__ 2#ifndef __NVKM_MXM_PRIV_H__
3#define __NVKM_MXM_PRIV_H__ 3#define __NVKM_MXM_PRIV_H__
4#define nvkm_mxm(p) container_of((p), struct nvkm_mxm, subdev) 4#define nvkm_mxm(p) container_of((p), struct nvkm_mxm, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild
index 6fbd008d6f10..174bdf995271 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/pci/agp.o 2nvkm-y += nvkm/subdev/pci/agp.o
3nvkm-y += nvkm/subdev/pci/base.o 3nvkm-y += nvkm/subdev/pci/base.o
4nvkm-y += nvkm/subdev/pci/pcie.o 4nvkm-y += nvkm/subdev/pci/pcie.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h
index edb7f00f0de5..ad4d3621d02b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/agp.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#include "priv.h" 2#include "priv.h"
3#if defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)) 3#if defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))
4#ifndef __NVKM_PCI_AGP_H__ 4#ifndef __NVKM_PCI_AGP_H__
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h
index c17f6063c9ea..7009aad86b6e 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pci/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PCI_PRIV_H__ 2#ifndef __NVKM_PCI_PRIV_H__
3#define __NVKM_PCI_PRIV_H__ 3#define __NVKM_PCI_PRIV_H__
4#define nvkm_pci(p) container_of((p), struct nvkm_pci, subdev) 4#define nvkm_pci(p) container_of((p), struct nvkm_pci, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/Kbuild
index 132ae3341d55..e37b6e45eaa2 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/pmu/base.o 2nvkm-y += nvkm/subdev/pmu/base.o
3nvkm-y += nvkm/subdev/pmu/memx.o 3nvkm-y += nvkm/subdev/pmu/memx.o
4nvkm-y += nvkm/subdev/pmu/gt215.o 4nvkm-y += nvkm/subdev/pmu/gt215.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
index 1dbe593e5960..4cf888f2bd03 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf100.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf100_pmu_data[] = { 2static uint32_t gf100_pmu_data[] = {
3/* 0x0000: proc_kern */ 3/* 0x0000: proc_kern */
4 0x52544e49, 4 0x52544e49,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h
index e1e981966c2d..e80eff18e5d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gf119.fuc4.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gf119_pmu_data[] = { 2static uint32_t gf119_pmu_data[] = {
3/* 0x0000: proc_kern */ 3/* 0x0000: proc_kern */
4 0x52544e49, 4 0x52544e49,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h
index e0222cb832fb..275ec71bc0c0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gk208.fuc5.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gk208_pmu_data[] = { 2static uint32_t gk208_pmu_data[] = {
3/* 0x0000: proc_kern */ 3/* 0x0000: proc_kern */
4 0x52544e49, 4 0x52544e49,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h
index defddf5957ee..4b071e9bec7d 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/gt215.fuc3.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2static uint32_t gt215_pmu_data[] = { 2static uint32_t gt215_pmu_data[] = {
3/* 0x0000: proc_kern */ 3/* 0x0000: proc_kern */
4 0x52544e49, 4 0x52544e49,
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/os.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
index 30d9480b9be5..0d5abf27ee52 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/fuc/os.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PWR_OS_H__ 2#ifndef __NVKM_PWR_OS_H__
3#define __NVKM_PWR_OS_H__ 3#define __NVKM_PWR_OS_H__
4 4
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
index 7b052879af72..22eaebefced3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/memx.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: MIT
2#ifndef __NVKM_PMU_MEMX_H__ 2#ifndef __NVKM_PMU_MEMX_H__
3#define __NVKM_PMU_MEMX_H__ 3#define __NVKM_PMU_MEMX_H__
4#include "priv.h" 4#include "priv.h"
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h
index e9c6f9725afe..26d73f9cd6d3 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_PMU_PRIV_H__ 2#ifndef __NVKM_PMU_PRIV_H__
3#define __NVKM_PMU_PRIV_H__ 3#define __NVKM_PMU_PRIV_H__
4#define nvkm_pmu(p) container_of((p), struct nvkm_pmu, subdev) 4#define nvkm_pmu(p) container_of((p), struct nvkm_pmu, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/Kbuild
index 51b33799cfdb..f3dee2693c79 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/secboot/base.o 2nvkm-y += nvkm/subdev/secboot/base.o
3nvkm-y += nvkm/subdev/secboot/hs_ucode.o 3nvkm-y += nvkm/subdev/secboot/hs_ucode.o
4nvkm-y += nvkm/subdev/secboot/ls_ucode_gr.o 4nvkm-y += nvkm/subdev/secboot/ls_ucode_gr.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
index 77c13b096a67..a84a999445bb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/ls_ucode_msgqueue.c
@@ -164,41 +164,12 @@ acr_ls_sec2_post_run(const struct nvkm_acr *acr, const struct nvkm_secboot *sb)
164 struct nvkm_sec2 *sec = device->sec2; 164 struct nvkm_sec2 *sec = device->sec2;
165 /* on SEC arguments are always at the beginning of EMEM */ 165 /* on SEC arguments are always at the beginning of EMEM */
166 const u32 addr_args = 0x01000000; 166 const u32 addr_args = 0x01000000;
167 u32 reg;
168 int ret; 167 int ret;
169 168
170 ret = acr_ls_msgqueue_post_run(sec->queue, sec->falcon, addr_args); 169 ret = acr_ls_msgqueue_post_run(sec->queue, sec->falcon, addr_args);
171 if (ret) 170 if (ret)
172 return ret; 171 return ret;
173 172
174 /*
175 * There is a bug where the LS firmware sometimes require to be started
176 * twice (this happens only on SEC). Detect and workaround that
177 * condition.
178 *
179 * Once started, the falcon will end up in STOPPED condition (bit 5)
180 * if successful, or in HALT condition (bit 4) if not.
181 */
182 nvkm_msec(device, 1,
183 if ((reg = nvkm_falcon_rd32(sb->boot_falcon, 0x100) & 0x30) != 0)
184 break;
185 );
186 if (reg & BIT(4)) {
187 nvkm_debug(subdev, "applying workaround for start bug...\n");
188 nvkm_falcon_start(sb->boot_falcon);
189 nvkm_msec(subdev->device, 1,
190 if ((reg = nvkm_rd32(subdev->device,
191 sb->boot_falcon->addr + 0x100)
192 & 0x30) != 0)
193 break;
194 );
195 if (reg & BIT(4)) {
196 nvkm_error(subdev, "%s failed to start\n",
197 nvkm_secboot_falcon_name[acr->boot_falcon]);
198 return -EINVAL;
199 }
200 }
201
202 nvkm_debug(&sb->subdev, "%s started\n", 173 nvkm_debug(&sb->subdev, "%s started\n",
203 nvkm_secboot_falcon_name[acr->boot_falcon]); 174 nvkm_secboot_falcon_name[acr->boot_falcon]);
204 175
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
index 0cc1439d863b..9aa76a2befa8 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/therm/base.o 2nvkm-y += nvkm/subdev/therm/base.o
3nvkm-y += nvkm/subdev/therm/fan.o 3nvkm-y += nvkm/subdev/therm/fan.o
4nvkm-y += nvkm/subdev/therm/fannil.o 4nvkm-y += nvkm/subdev/therm/fannil.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/Kbuild
index a4aa8e621eb2..f710da4427cf 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/timer/base.o 2nvkm-y += nvkm/subdev/timer/base.o
3nvkm-y += nvkm/subdev/timer/nv04.o 3nvkm-y += nvkm/subdev/timer/nv04.o
4nvkm-y += nvkm/subdev/timer/nv40.o 4nvkm-y += nvkm/subdev/timer/nv40.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h
index 3b8878486faa..89e97294b182 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_TIMER_PRIV_H__ 2#ifndef __NVKM_TIMER_PRIV_H__
3#define __NVKM_TIMER_PRIV_H__ 3#define __NVKM_TIMER_PRIV_H__
4#define nvkm_timer(p) container_of((p), struct nvkm_timer, subdev) 4#define nvkm_timer(p) container_of((p), struct nvkm_timer, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/regsnv04.h b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/regsnv04.h
index 23d07f5f44d9..34a740bc6e4a 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/timer/regsnv04.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/timer/regsnv04.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#define NV04_PTIMER_INTR_0 0x009100 2#define NV04_PTIMER_INTR_0 0x009100
3#define NV04_PTIMER_INTR_EN_0 0x009140 3#define NV04_PTIMER_INTR_EN_0 0x009140
4#define NV04_PTIMER_NUMERATOR 0x009200 4#define NV04_PTIMER_NUMERATOR 0x009200
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/top/Kbuild
index e0b27242eeea..438d9d78ab52 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/Kbuild
@@ -1,3 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/top/base.o 2nvkm-y += nvkm/subdev/top/base.o
3nvkm-y += nvkm/subdev/top/gk104.o 3nvkm-y += nvkm/subdev/top/gk104.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/top/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/top/priv.h
index 4f49b0acaa0e..a16baa2941cf 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/top/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/top/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_TOP_PRIV_H__ 2#ifndef __NVKM_TOP_PRIV_H__
3#define __NVKM_TOP_PRIV_H__ 3#define __NVKM_TOP_PRIV_H__
4#define nvkm_top(p) container_of((p), struct nvkm_top, subdev) 4#define nvkm_top(p) container_of((p), struct nvkm_top, subdev)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild
index e80bc64b638a..523a7cd155a6 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/Kbuild
@@ -1,4 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: MIT
2nvkm-y += nvkm/subdev/volt/base.o 2nvkm-y += nvkm/subdev/volt/base.o
3nvkm-y += nvkm/subdev/volt/gpio.o 3nvkm-y += nvkm/subdev/volt/gpio.o
4nvkm-y += nvkm/subdev/volt/nv40.o 4nvkm-y += nvkm/subdev/volt/nv40.o
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h
index 1a8ad560321b..75f13a34671f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/priv.h
@@ -1,4 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: MIT */
2#ifndef __NVKM_VOLT_PRIV_H__ 2#ifndef __NVKM_VOLT_PRIV_H__
3#define __NVKM_VOLT_PRIV_H__ 3#define __NVKM_VOLT_PRIV_H__
4#define nvkm_volt(p) container_of((p), struct nvkm_volt, subdev) 4#define nvkm_volt(p) container_of((p), struct nvkm_volt, subdev)
diff --git a/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c b/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c
index bef4edde6f9f..14c96edb13df 100644
--- a/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c
+++ b/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c
@@ -15,13 +15,14 @@
15#include "drm_selftest.h" 15#include "drm_selftest.h"
16#include "test-drm_modeset_common.h" 16#include "test-drm_modeset_common.h"
17 17
18static const struct drm_connector no_connector = {};
19
18static int drm_cmdline_test_res(void *ignored) 20static int drm_cmdline_test_res(void *ignored)
19{ 21{
20 struct drm_connector connector = { };
21 struct drm_cmdline_mode mode = { }; 22 struct drm_cmdline_mode mode = { };
22 23
23 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480", 24 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480",
24 &connector, 25 &no_connector,
25 &mode)); 26 &mode));
26 FAIL_ON(!mode.specified); 27 FAIL_ON(!mode.specified);
27 FAIL_ON(mode.xres != 720); 28 FAIL_ON(mode.xres != 720);
@@ -42,11 +43,10 @@ static int drm_cmdline_test_res(void *ignored)
42 43
43static int drm_cmdline_test_res_missing_x(void *ignored) 44static int drm_cmdline_test_res_missing_x(void *ignored)
44{ 45{
45 struct drm_connector connector = { };
46 struct drm_cmdline_mode mode = { }; 46 struct drm_cmdline_mode mode = { };
47 47
48 FAIL_ON(drm_mode_parse_command_line_for_connector("x480", 48 FAIL_ON(drm_mode_parse_command_line_for_connector("x480",
49 &connector, 49 &no_connector,
50 &mode)); 50 &mode));
51 51
52 return 0; 52 return 0;
@@ -54,11 +54,10 @@ static int drm_cmdline_test_res_missing_x(void *ignored)
54 54
55static int drm_cmdline_test_res_missing_y(void *ignored) 55static int drm_cmdline_test_res_missing_y(void *ignored)
56{ 56{
57 struct drm_connector connector = { };
58 struct drm_cmdline_mode mode = { }; 57 struct drm_cmdline_mode mode = { };
59 58
60 FAIL_ON(drm_mode_parse_command_line_for_connector("1024x", 59 FAIL_ON(drm_mode_parse_command_line_for_connector("1024x",
61 &connector, 60 &no_connector,
62 &mode)); 61 &mode));
63 62
64 return 0; 63 return 0;
@@ -66,11 +65,10 @@ static int drm_cmdline_test_res_missing_y(void *ignored)
66 65
67static int drm_cmdline_test_res_bad_y(void *ignored) 66static int drm_cmdline_test_res_bad_y(void *ignored)
68{ 67{
69 struct drm_connector connector = { };
70 struct drm_cmdline_mode mode = { }; 68 struct drm_cmdline_mode mode = { };
71 69
72 FAIL_ON(drm_mode_parse_command_line_for_connector("1024xtest", 70 FAIL_ON(drm_mode_parse_command_line_for_connector("1024xtest",
73 &connector, 71 &no_connector,
74 &mode)); 72 &mode));
75 73
76 return 0; 74 return 0;
@@ -78,11 +76,10 @@ static int drm_cmdline_test_res_bad_y(void *ignored)
78 76
79static int drm_cmdline_test_res_missing_y_bpp(void *ignored) 77static int drm_cmdline_test_res_missing_y_bpp(void *ignored)
80{ 78{
81 struct drm_connector connector = { };
82 struct drm_cmdline_mode mode = { }; 79 struct drm_cmdline_mode mode = { };
83 80
84 FAIL_ON(drm_mode_parse_command_line_for_connector("1024x-24", 81 FAIL_ON(drm_mode_parse_command_line_for_connector("1024x-24",
85 &connector, 82 &no_connector,
86 &mode)); 83 &mode));
87 84
88 return 0; 85 return 0;
@@ -90,11 +87,10 @@ static int drm_cmdline_test_res_missing_y_bpp(void *ignored)
90 87
91static int drm_cmdline_test_res_vesa(void *ignored) 88static int drm_cmdline_test_res_vesa(void *ignored)
92{ 89{
93 struct drm_connector connector = { };
94 struct drm_cmdline_mode mode = { }; 90 struct drm_cmdline_mode mode = { };
95 91
96 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480M", 92 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480M",
97 &connector, 93 &no_connector,
98 &mode)); 94 &mode));
99 FAIL_ON(!mode.specified); 95 FAIL_ON(!mode.specified);
100 FAIL_ON(mode.xres != 720); 96 FAIL_ON(mode.xres != 720);
@@ -115,11 +111,10 @@ static int drm_cmdline_test_res_vesa(void *ignored)
115 111
116static int drm_cmdline_test_res_vesa_rblank(void *ignored) 112static int drm_cmdline_test_res_vesa_rblank(void *ignored)
117{ 113{
118 struct drm_connector connector = { };
119 struct drm_cmdline_mode mode = { }; 114 struct drm_cmdline_mode mode = { };
120 115
121 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480MR", 116 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480MR",
122 &connector, 117 &no_connector,
123 &mode)); 118 &mode));
124 FAIL_ON(!mode.specified); 119 FAIL_ON(!mode.specified);
125 FAIL_ON(mode.xres != 720); 120 FAIL_ON(mode.xres != 720);
@@ -140,11 +135,10 @@ static int drm_cmdline_test_res_vesa_rblank(void *ignored)
140 135
141static int drm_cmdline_test_res_rblank(void *ignored) 136static int drm_cmdline_test_res_rblank(void *ignored)
142{ 137{
143 struct drm_connector connector = { };
144 struct drm_cmdline_mode mode = { }; 138 struct drm_cmdline_mode mode = { };
145 139
146 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480R", 140 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480R",
147 &connector, 141 &no_connector,
148 &mode)); 142 &mode));
149 FAIL_ON(!mode.specified); 143 FAIL_ON(!mode.specified);
150 FAIL_ON(mode.xres != 720); 144 FAIL_ON(mode.xres != 720);
@@ -165,11 +159,10 @@ static int drm_cmdline_test_res_rblank(void *ignored)
165 159
166static int drm_cmdline_test_res_bpp(void *ignored) 160static int drm_cmdline_test_res_bpp(void *ignored)
167{ 161{
168 struct drm_connector connector = { };
169 struct drm_cmdline_mode mode = { }; 162 struct drm_cmdline_mode mode = { };
170 163
171 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24", 164 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24",
172 &connector, 165 &no_connector,
173 &mode)); 166 &mode));
174 FAIL_ON(!mode.specified); 167 FAIL_ON(!mode.specified);
175 FAIL_ON(mode.xres != 720); 168 FAIL_ON(mode.xres != 720);
@@ -191,11 +184,10 @@ static int drm_cmdline_test_res_bpp(void *ignored)
191 184
192static int drm_cmdline_test_res_bad_bpp(void *ignored) 185static int drm_cmdline_test_res_bad_bpp(void *ignored)
193{ 186{
194 struct drm_connector connector = { };
195 struct drm_cmdline_mode mode = { }; 187 struct drm_cmdline_mode mode = { };
196 188
197 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480-test", 189 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480-test",
198 &connector, 190 &no_connector,
199 &mode)); 191 &mode));
200 192
201 return 0; 193 return 0;
@@ -203,11 +195,10 @@ static int drm_cmdline_test_res_bad_bpp(void *ignored)
203 195
204static int drm_cmdline_test_res_refresh(void *ignored) 196static int drm_cmdline_test_res_refresh(void *ignored)
205{ 197{
206 struct drm_connector connector = { };
207 struct drm_cmdline_mode mode = { }; 198 struct drm_cmdline_mode mode = { };
208 199
209 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480@60", 200 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480@60",
210 &connector, 201 &no_connector,
211 &mode)); 202 &mode));
212 FAIL_ON(!mode.specified); 203 FAIL_ON(!mode.specified);
213 FAIL_ON(mode.xres != 720); 204 FAIL_ON(mode.xres != 720);
@@ -229,11 +220,10 @@ static int drm_cmdline_test_res_refresh(void *ignored)
229 220
230static int drm_cmdline_test_res_bad_refresh(void *ignored) 221static int drm_cmdline_test_res_bad_refresh(void *ignored)
231{ 222{
232 struct drm_connector connector = { };
233 struct drm_cmdline_mode mode = { }; 223 struct drm_cmdline_mode mode = { };
234 224
235 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480@refresh", 225 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480@refresh",
236 &connector, 226 &no_connector,
237 &mode)); 227 &mode));
238 228
239 return 0; 229 return 0;
@@ -241,11 +231,10 @@ static int drm_cmdline_test_res_bad_refresh(void *ignored)
241 231
242static int drm_cmdline_test_res_bpp_refresh(void *ignored) 232static int drm_cmdline_test_res_bpp_refresh(void *ignored)
243{ 233{
244 struct drm_connector connector = { };
245 struct drm_cmdline_mode mode = { }; 234 struct drm_cmdline_mode mode = { };
246 235
247 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60", 236 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60",
248 &connector, 237 &no_connector,
249 &mode)); 238 &mode));
250 FAIL_ON(!mode.specified); 239 FAIL_ON(!mode.specified);
251 FAIL_ON(mode.xres != 720); 240 FAIL_ON(mode.xres != 720);
@@ -268,11 +257,10 @@ static int drm_cmdline_test_res_bpp_refresh(void *ignored)
268 257
269static int drm_cmdline_test_res_bpp_refresh_interlaced(void *ignored) 258static int drm_cmdline_test_res_bpp_refresh_interlaced(void *ignored)
270{ 259{
271 struct drm_connector connector = { };
272 struct drm_cmdline_mode mode = { }; 260 struct drm_cmdline_mode mode = { };
273 261
274 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60i", 262 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60i",
275 &connector, 263 &no_connector,
276 &mode)); 264 &mode));
277 FAIL_ON(!mode.specified); 265 FAIL_ON(!mode.specified);
278 FAIL_ON(mode.xres != 720); 266 FAIL_ON(mode.xres != 720);
@@ -295,11 +283,10 @@ static int drm_cmdline_test_res_bpp_refresh_interlaced(void *ignored)
295 283
296static int drm_cmdline_test_res_bpp_refresh_margins(void *ignored) 284static int drm_cmdline_test_res_bpp_refresh_margins(void *ignored)
297{ 285{
298 struct drm_connector connector = { };
299 struct drm_cmdline_mode mode = { }; 286 struct drm_cmdline_mode mode = { };
300 287
301 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60m", 288 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60m",
302 &connector, 289 &no_connector,
303 &mode)); 290 &mode));
304 FAIL_ON(!mode.specified); 291 FAIL_ON(!mode.specified);
305 FAIL_ON(mode.xres != 720); 292 FAIL_ON(mode.xres != 720);
@@ -322,11 +309,10 @@ static int drm_cmdline_test_res_bpp_refresh_margins(void *ignored)
322 309
323static int drm_cmdline_test_res_bpp_refresh_force_off(void *ignored) 310static int drm_cmdline_test_res_bpp_refresh_force_off(void *ignored)
324{ 311{
325 struct drm_connector connector = { };
326 struct drm_cmdline_mode mode = { }; 312 struct drm_cmdline_mode mode = { };
327 313
328 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60d", 314 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60d",
329 &connector, 315 &no_connector,
330 &mode)); 316 &mode));
331 FAIL_ON(!mode.specified); 317 FAIL_ON(!mode.specified);
332 FAIL_ON(mode.xres != 720); 318 FAIL_ON(mode.xres != 720);
@@ -349,11 +335,10 @@ static int drm_cmdline_test_res_bpp_refresh_force_off(void *ignored)
349 335
350static int drm_cmdline_test_res_bpp_refresh_force_on_off(void *ignored) 336static int drm_cmdline_test_res_bpp_refresh_force_on_off(void *ignored)
351{ 337{
352 struct drm_connector connector = { };
353 struct drm_cmdline_mode mode = { }; 338 struct drm_cmdline_mode mode = { };
354 339
355 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480-24@60de", 340 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480-24@60de",
356 &connector, 341 &no_connector,
357 &mode)); 342 &mode));
358 343
359 return 0; 344 return 0;
@@ -361,11 +346,10 @@ static int drm_cmdline_test_res_bpp_refresh_force_on_off(void *ignored)
361 346
362static int drm_cmdline_test_res_bpp_refresh_force_on(void *ignored) 347static int drm_cmdline_test_res_bpp_refresh_force_on(void *ignored)
363{ 348{
364 struct drm_connector connector = { };
365 struct drm_cmdline_mode mode = { }; 349 struct drm_cmdline_mode mode = { };
366 350
367 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60e", 351 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60e",
368 &connector, 352 &no_connector,
369 &mode)); 353 &mode));
370 FAIL_ON(!mode.specified); 354 FAIL_ON(!mode.specified);
371 FAIL_ON(mode.xres != 720); 355 FAIL_ON(mode.xres != 720);
@@ -388,11 +372,10 @@ static int drm_cmdline_test_res_bpp_refresh_force_on(void *ignored)
388 372
389static int drm_cmdline_test_res_bpp_refresh_force_on_analog(void *ignored) 373static int drm_cmdline_test_res_bpp_refresh_force_on_analog(void *ignored)
390{ 374{
391 struct drm_connector connector = { };
392 struct drm_cmdline_mode mode = { }; 375 struct drm_cmdline_mode mode = { };
393 376
394 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60D", 377 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60D",
395 &connector, 378 &no_connector,
396 &mode)); 379 &mode));
397 FAIL_ON(!mode.specified); 380 FAIL_ON(!mode.specified);
398 FAIL_ON(mode.xres != 720); 381 FAIL_ON(mode.xres != 720);
@@ -415,10 +398,11 @@ static int drm_cmdline_test_res_bpp_refresh_force_on_analog(void *ignored)
415 398
416static int drm_cmdline_test_res_bpp_refresh_force_on_digital(void *ignored) 399static int drm_cmdline_test_res_bpp_refresh_force_on_digital(void *ignored)
417{ 400{
418 struct drm_connector connector = { };
419 struct drm_cmdline_mode mode = { }; 401 struct drm_cmdline_mode mode = { };
402 static const struct drm_connector connector = {
403 .connector_type = DRM_MODE_CONNECTOR_DVII,
404 };
420 405
421 connector.connector_type = DRM_MODE_CONNECTOR_DVII;
422 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60D", 406 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60D",
423 &connector, 407 &connector,
424 &mode)); 408 &mode));
@@ -443,11 +427,10 @@ static int drm_cmdline_test_res_bpp_refresh_force_on_digital(void *ignored)
443 427
444static int drm_cmdline_test_res_bpp_refresh_interlaced_margins_force_on(void *ignored) 428static int drm_cmdline_test_res_bpp_refresh_interlaced_margins_force_on(void *ignored)
445{ 429{
446 struct drm_connector connector = { };
447 struct drm_cmdline_mode mode = { }; 430 struct drm_cmdline_mode mode = { };
448 431
449 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60ime", 432 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480-24@60ime",
450 &connector, 433 &no_connector,
451 &mode)); 434 &mode));
452 FAIL_ON(!mode.specified); 435 FAIL_ON(!mode.specified);
453 FAIL_ON(mode.xres != 720); 436 FAIL_ON(mode.xres != 720);
@@ -470,11 +453,10 @@ static int drm_cmdline_test_res_bpp_refresh_interlaced_margins_force_on(void *ig
470 453
471static int drm_cmdline_test_res_margins_force_on(void *ignored) 454static int drm_cmdline_test_res_margins_force_on(void *ignored)
472{ 455{
473 struct drm_connector connector = { };
474 struct drm_cmdline_mode mode = { }; 456 struct drm_cmdline_mode mode = { };
475 457
476 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480me", 458 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480me",
477 &connector, 459 &no_connector,
478 &mode)); 460 &mode));
479 FAIL_ON(!mode.specified); 461 FAIL_ON(!mode.specified);
480 FAIL_ON(mode.xres != 720); 462 FAIL_ON(mode.xres != 720);
@@ -495,11 +477,10 @@ static int drm_cmdline_test_res_margins_force_on(void *ignored)
495 477
496static int drm_cmdline_test_res_vesa_margins(void *ignored) 478static int drm_cmdline_test_res_vesa_margins(void *ignored)
497{ 479{
498 struct drm_connector connector = { };
499 struct drm_cmdline_mode mode = { }; 480 struct drm_cmdline_mode mode = { };
500 481
501 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480Mm", 482 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480Mm",
502 &connector, 483 &no_connector,
503 &mode)); 484 &mode));
504 FAIL_ON(!mode.specified); 485 FAIL_ON(!mode.specified);
505 FAIL_ON(mode.xres != 720); 486 FAIL_ON(mode.xres != 720);
@@ -520,11 +501,10 @@ static int drm_cmdline_test_res_vesa_margins(void *ignored)
520 501
521static int drm_cmdline_test_res_invalid_mode(void *ignored) 502static int drm_cmdline_test_res_invalid_mode(void *ignored)
522{ 503{
523 struct drm_connector connector = { };
524 struct drm_cmdline_mode mode = { }; 504 struct drm_cmdline_mode mode = { };
525 505
526 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480f", 506 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480f",
527 &connector, 507 &no_connector,
528 &mode)); 508 &mode));
529 509
530 return 0; 510 return 0;
@@ -532,11 +512,10 @@ static int drm_cmdline_test_res_invalid_mode(void *ignored)
532 512
533static int drm_cmdline_test_res_bpp_wrong_place_mode(void *ignored) 513static int drm_cmdline_test_res_bpp_wrong_place_mode(void *ignored)
534{ 514{
535 struct drm_connector connector = { };
536 struct drm_cmdline_mode mode = { }; 515 struct drm_cmdline_mode mode = { };
537 516
538 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480e-24", 517 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480e-24",
539 &connector, 518 &no_connector,
540 &mode)); 519 &mode));
541 520
542 return 0; 521 return 0;
@@ -544,11 +523,10 @@ static int drm_cmdline_test_res_bpp_wrong_place_mode(void *ignored)
544 523
545static int drm_cmdline_test_name(void *ignored) 524static int drm_cmdline_test_name(void *ignored)
546{ 525{
547 struct drm_connector connector = { };
548 struct drm_cmdline_mode mode = { }; 526 struct drm_cmdline_mode mode = { };
549 527
550 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC", 528 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC",
551 &connector, 529 &no_connector,
552 &mode)); 530 &mode));
553 FAIL_ON(strcmp(mode.name, "NTSC")); 531 FAIL_ON(strcmp(mode.name, "NTSC"));
554 FAIL_ON(mode.refresh_specified); 532 FAIL_ON(mode.refresh_specified);
@@ -559,11 +537,10 @@ static int drm_cmdline_test_name(void *ignored)
559 537
560static int drm_cmdline_test_name_bpp(void *ignored) 538static int drm_cmdline_test_name_bpp(void *ignored)
561{ 539{
562 struct drm_connector connector = { };
563 struct drm_cmdline_mode mode = { }; 540 struct drm_cmdline_mode mode = { };
564 541
565 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC-24", 542 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC-24",
566 &connector, 543 &no_connector,
567 &mode)); 544 &mode));
568 FAIL_ON(strcmp(mode.name, "NTSC")); 545 FAIL_ON(strcmp(mode.name, "NTSC"));
569 546
@@ -577,11 +554,10 @@ static int drm_cmdline_test_name_bpp(void *ignored)
577 554
578static int drm_cmdline_test_name_bpp_refresh(void *ignored) 555static int drm_cmdline_test_name_bpp_refresh(void *ignored)
579{ 556{
580 struct drm_connector connector = { };
581 struct drm_cmdline_mode mode = { }; 557 struct drm_cmdline_mode mode = { };
582 558
583 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC-24@60", 559 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC-24@60",
584 &connector, 560 &no_connector,
585 &mode)); 561 &mode));
586 562
587 return 0; 563 return 0;
@@ -589,11 +565,10 @@ static int drm_cmdline_test_name_bpp_refresh(void *ignored)
589 565
590static int drm_cmdline_test_name_refresh(void *ignored) 566static int drm_cmdline_test_name_refresh(void *ignored)
591{ 567{
592 struct drm_connector connector = { };
593 struct drm_cmdline_mode mode = { }; 568 struct drm_cmdline_mode mode = { };
594 569
595 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC@60", 570 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC@60",
596 &connector, 571 &no_connector,
597 &mode)); 572 &mode));
598 573
599 return 0; 574 return 0;
@@ -601,11 +576,10 @@ static int drm_cmdline_test_name_refresh(void *ignored)
601 576
602static int drm_cmdline_test_name_refresh_wrong_mode(void *ignored) 577static int drm_cmdline_test_name_refresh_wrong_mode(void *ignored)
603{ 578{
604 struct drm_connector connector = { };
605 struct drm_cmdline_mode mode = { }; 579 struct drm_cmdline_mode mode = { };
606 580
607 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC@60m", 581 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC@60m",
608 &connector, 582 &no_connector,
609 &mode)); 583 &mode));
610 584
611 return 0; 585 return 0;
@@ -613,11 +587,10 @@ static int drm_cmdline_test_name_refresh_wrong_mode(void *ignored)
613 587
614static int drm_cmdline_test_name_refresh_invalid_mode(void *ignored) 588static int drm_cmdline_test_name_refresh_invalid_mode(void *ignored)
615{ 589{
616 struct drm_connector connector = { };
617 struct drm_cmdline_mode mode = { }; 590 struct drm_cmdline_mode mode = { };
618 591
619 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC@60f", 592 FAIL_ON(drm_mode_parse_command_line_for_connector("NTSC@60f",
620 &connector, 593 &no_connector,
621 &mode)); 594 &mode));
622 595
623 return 0; 596 return 0;
@@ -625,11 +598,10 @@ static int drm_cmdline_test_name_refresh_invalid_mode(void *ignored)
625 598
626static int drm_cmdline_test_name_option(void *ignored) 599static int drm_cmdline_test_name_option(void *ignored)
627{ 600{
628 struct drm_connector connector = { };
629 struct drm_cmdline_mode mode = { }; 601 struct drm_cmdline_mode mode = { };
630 602
631 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC,rotate=180", 603 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC,rotate=180",
632 &connector, 604 &no_connector,
633 &mode)); 605 &mode));
634 FAIL_ON(!mode.specified); 606 FAIL_ON(!mode.specified);
635 FAIL_ON(strcmp(mode.name, "NTSC")); 607 FAIL_ON(strcmp(mode.name, "NTSC"));
@@ -640,11 +612,10 @@ static int drm_cmdline_test_name_option(void *ignored)
640 612
641static int drm_cmdline_test_name_bpp_option(void *ignored) 613static int drm_cmdline_test_name_bpp_option(void *ignored)
642{ 614{
643 struct drm_connector connector = { };
644 struct drm_cmdline_mode mode = { }; 615 struct drm_cmdline_mode mode = { };
645 616
646 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC-24,rotate=180", 617 FAIL_ON(!drm_mode_parse_command_line_for_connector("NTSC-24,rotate=180",
647 &connector, 618 &no_connector,
648 &mode)); 619 &mode));
649 FAIL_ON(!mode.specified); 620 FAIL_ON(!mode.specified);
650 FAIL_ON(strcmp(mode.name, "NTSC")); 621 FAIL_ON(strcmp(mode.name, "NTSC"));
@@ -657,11 +628,10 @@ static int drm_cmdline_test_name_bpp_option(void *ignored)
657 628
658static int drm_cmdline_test_rotate_0(void *ignored) 629static int drm_cmdline_test_rotate_0(void *ignored)
659{ 630{
660 struct drm_connector connector = { };
661 struct drm_cmdline_mode mode = { }; 631 struct drm_cmdline_mode mode = { };
662 632
663 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=0", 633 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=0",
664 &connector, 634 &no_connector,
665 &mode)); 635 &mode));
666 FAIL_ON(!mode.specified); 636 FAIL_ON(!mode.specified);
667 FAIL_ON(mode.xres != 720); 637 FAIL_ON(mode.xres != 720);
@@ -683,11 +653,10 @@ static int drm_cmdline_test_rotate_0(void *ignored)
683 653
684static int drm_cmdline_test_rotate_90(void *ignored) 654static int drm_cmdline_test_rotate_90(void *ignored)
685{ 655{
686 struct drm_connector connector = { };
687 struct drm_cmdline_mode mode = { }; 656 struct drm_cmdline_mode mode = { };
688 657
689 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=90", 658 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=90",
690 &connector, 659 &no_connector,
691 &mode)); 660 &mode));
692 FAIL_ON(!mode.specified); 661 FAIL_ON(!mode.specified);
693 FAIL_ON(mode.xres != 720); 662 FAIL_ON(mode.xres != 720);
@@ -709,11 +678,10 @@ static int drm_cmdline_test_rotate_90(void *ignored)
709 678
710static int drm_cmdline_test_rotate_180(void *ignored) 679static int drm_cmdline_test_rotate_180(void *ignored)
711{ 680{
712 struct drm_connector connector = { };
713 struct drm_cmdline_mode mode = { }; 681 struct drm_cmdline_mode mode = { };
714 682
715 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=180", 683 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=180",
716 &connector, 684 &no_connector,
717 &mode)); 685 &mode));
718 FAIL_ON(!mode.specified); 686 FAIL_ON(!mode.specified);
719 FAIL_ON(mode.xres != 720); 687 FAIL_ON(mode.xres != 720);
@@ -735,11 +703,10 @@ static int drm_cmdline_test_rotate_180(void *ignored)
735 703
736static int drm_cmdline_test_rotate_270(void *ignored) 704static int drm_cmdline_test_rotate_270(void *ignored)
737{ 705{
738 struct drm_connector connector = { };
739 struct drm_cmdline_mode mode = { }; 706 struct drm_cmdline_mode mode = { };
740 707
741 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=270", 708 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=270",
742 &connector, 709 &no_connector,
743 &mode)); 710 &mode));
744 FAIL_ON(!mode.specified); 711 FAIL_ON(!mode.specified);
745 FAIL_ON(mode.xres != 720); 712 FAIL_ON(mode.xres != 720);
@@ -761,11 +728,10 @@ static int drm_cmdline_test_rotate_270(void *ignored)
761 728
762static int drm_cmdline_test_rotate_invalid_val(void *ignored) 729static int drm_cmdline_test_rotate_invalid_val(void *ignored)
763{ 730{
764 struct drm_connector connector = { };
765 struct drm_cmdline_mode mode = { }; 731 struct drm_cmdline_mode mode = { };
766 732
767 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=42", 733 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=42",
768 &connector, 734 &no_connector,
769 &mode)); 735 &mode));
770 736
771 return 0; 737 return 0;
@@ -773,11 +739,10 @@ static int drm_cmdline_test_rotate_invalid_val(void *ignored)
773 739
774static int drm_cmdline_test_rotate_truncated(void *ignored) 740static int drm_cmdline_test_rotate_truncated(void *ignored)
775{ 741{
776 struct drm_connector connector = { };
777 struct drm_cmdline_mode mode = { }; 742 struct drm_cmdline_mode mode = { };
778 743
779 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=", 744 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,rotate=",
780 &connector, 745 &no_connector,
781 &mode)); 746 &mode));
782 747
783 return 0; 748 return 0;
@@ -785,11 +750,10 @@ static int drm_cmdline_test_rotate_truncated(void *ignored)
785 750
786static int drm_cmdline_test_hmirror(void *ignored) 751static int drm_cmdline_test_hmirror(void *ignored)
787{ 752{
788 struct drm_connector connector = { };
789 struct drm_cmdline_mode mode = { }; 753 struct drm_cmdline_mode mode = { };
790 754
791 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,reflect_x", 755 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,reflect_x",
792 &connector, 756 &no_connector,
793 &mode)); 757 &mode));
794 FAIL_ON(!mode.specified); 758 FAIL_ON(!mode.specified);
795 FAIL_ON(mode.xres != 720); 759 FAIL_ON(mode.xres != 720);
@@ -811,11 +775,10 @@ static int drm_cmdline_test_hmirror(void *ignored)
811 775
812static int drm_cmdline_test_vmirror(void *ignored) 776static int drm_cmdline_test_vmirror(void *ignored)
813{ 777{
814 struct drm_connector connector = { };
815 struct drm_cmdline_mode mode = { }; 778 struct drm_cmdline_mode mode = { };
816 779
817 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,reflect_y", 780 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,reflect_y",
818 &connector, 781 &no_connector,
819 &mode)); 782 &mode));
820 FAIL_ON(!mode.specified); 783 FAIL_ON(!mode.specified);
821 FAIL_ON(mode.xres != 720); 784 FAIL_ON(mode.xres != 720);
@@ -837,11 +800,10 @@ static int drm_cmdline_test_vmirror(void *ignored)
837 800
838static int drm_cmdline_test_margin_options(void *ignored) 801static int drm_cmdline_test_margin_options(void *ignored)
839{ 802{
840 struct drm_connector connector = { };
841 struct drm_cmdline_mode mode = { }; 803 struct drm_cmdline_mode mode = { };
842 804
843 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,margin_right=14,margin_left=24,margin_bottom=36,margin_top=42", 805 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,margin_right=14,margin_left=24,margin_bottom=36,margin_top=42",
844 &connector, 806 &no_connector,
845 &mode)); 807 &mode));
846 FAIL_ON(!mode.specified); 808 FAIL_ON(!mode.specified);
847 FAIL_ON(mode.xres != 720); 809 FAIL_ON(mode.xres != 720);
@@ -866,11 +828,10 @@ static int drm_cmdline_test_margin_options(void *ignored)
866 828
867static int drm_cmdline_test_multiple_options(void *ignored) 829static int drm_cmdline_test_multiple_options(void *ignored)
868{ 830{
869 struct drm_connector connector = { };
870 struct drm_cmdline_mode mode = { }; 831 struct drm_cmdline_mode mode = { };
871 832
872 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=270,reflect_x", 833 FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480,rotate=270,reflect_x",
873 &connector, 834 &no_connector,
874 &mode)); 835 &mode));
875 FAIL_ON(!mode.specified); 836 FAIL_ON(!mode.specified);
876 FAIL_ON(mode.xres != 720); 837 FAIL_ON(mode.xres != 720);
@@ -892,11 +853,10 @@ static int drm_cmdline_test_multiple_options(void *ignored)
892 853
893static int drm_cmdline_test_invalid_option(void *ignored) 854static int drm_cmdline_test_invalid_option(void *ignored)
894{ 855{
895 struct drm_connector connector = { };
896 struct drm_cmdline_mode mode = { }; 856 struct drm_cmdline_mode mode = { };
897 857
898 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,test=42", 858 FAIL_ON(drm_mode_parse_command_line_for_connector("720x480,test=42",
899 &connector, 859 &no_connector,
900 &mode)); 860 &mode));
901 861
902 return 0; 862 return 0;