History log of /src/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c |
Revision | | Date | Author | Comments |
1.28 |
| 26-Jan-2025 |
riastradh | i915: Fix sense of conditional for i915_gem_mmap_ioctl ABI hack.
Original issue and fix described here:
https://mail-index.netbsd.org/source-changes/2018/08/27/msg098501.html
This was broken in the merge in 2021, and I tried to restore it but got the sense of the conditional wrong:
https://mail-index.netbsd.org/source-changes/2021/12/19/msg135215.html
|
1.27 |
| 23-Jun-2024 |
riastradh | i915: Match Linux fault routine return code actions.
Omit needless EINTR interception -- this is now handled by i915_error_to_vmf_fault.
Earlier revert was over a false alarm -- bisection shows the new warnings arose from linux_pci.c 1.29 here:
https://mail-index.netbsd.org/source-changes/2024/06/23/msg151929.html
|
1.26 |
| 23-Jun-2024 |
riastradh | i915: Omit needless i915_gem_object_pin/unpin_pages cycle in fault.
vm_fault_cpu and vm_fault_gtt, called by i915_gem_fault, already do the pinning and unpinning internally, so there is no need for i915_gem_fault to do it.
No functional change intended, except that the transient pin count will be one lower than before during the fault routine (but it will still be positive).
|
1.25 |
| 23-Jun-2024 |
riastradh | Revert "i915: Reduce diff in fault routine."
Evidently this had more side effects than I thought:
warning: ../../../../external/bsd/drm2/dist/drm/i915/intel_uncore.c:1197: Unclaimed read from register 0x61204 ... {drm:netbsd:wait_panel_status+0x74} *ERROR* PPS state mismatch ... warning: ../../../../external/bsd/drm2/dist/drm/i915/display/intel_dp.c:1175: eDP powered off while attempting aux channel communication. ... warning: ../../../../external/bsd/drm2/dist/drm/i915/display/intel_dp.c:5616: Missing case (((&(dev_priv)->__info)->gen) == 9)
So let's roll it back until I have a better understanding of what changed.
Between making the change and writing the commit message, I forgot that the change affected the errno values returned by the fault routine, which may affect how uvm handles the fault failure -- whether to retry, wait for memory and retry, or fail, or what. Perhaps that explains the issue.
|
1.24 |
| 23-Jun-2024 |
riastradh | i915: Reduce diff in fault routine.
- Omit needless i915_gem_object_pin/unpin_pages cycle in i915_gem_fault. This is already done by vm_fault_cpu and vm_fault_gtt.
- Omit needless EINTR interception. This is now already handled by i915_error_to_vmf_fault.
No functional change intended, except that the transient pin count will be one lower than before during the fault routine.
|
1.23 |
| 04-Jun-2024 |
riastradh | i915_gem_mman.c: Apply mmap types via pmap flags.
This way, userland gets buffers mapped write-combining or uncached as needed.
PR xsrc/58307
|
1.22 |
| 19-Jan-2024 |
riastradh | i915_gem: Avoid walking off end of sg_pgs.
sg_npgs currently fails to match obj->base.size/PAGE_SIZE only due to bugs in the construction of sg_pgs in various i915 gem object types, which we should also fix, but let's avoid compounding it here.
Related to PR kern/57833.
XXX pullup-10
|
1.21 |
| 19-Dec-2021 |
riastradh | branches: 1.21.4; i915: Rearrange how mmap offsets work.
Rather than use the magic offsets in each GEM object's uvm object itself, just create a separate uvm object for each mapping type and start at zero within each uvm object. This should avoid problems with things like ubc_uiomove which don't know to adjust the starting offset.
|
1.20 |
| 19-Dec-2021 |
riastradh | i915: Use i915_gem_object_has_pages, not a simple null test.
The pages pointer may be ERR_PTR(-EWHATEVER) instead of null.
|
1.19 |
| 19-Dec-2021 |
riastradh | i915: Draft intel ggtt partial page view.
|
1.18 |
| 19-Dec-2021 |
riastradh | i915: Disable partial views on objects for now.
Needs some logic in i915_get_gtt_vma_pages to be wired up.
|
1.17 |
| 19-Dec-2021 |
riastradh | i915: Release vmobjlock on fault.
We need to take this later, but it's not helpful for uvm_fault to have taken it immediately prior to calling pgo_fault -- still not clear on why uvm_fault does that.
|
1.16 |
| 19-Dec-2021 |
riastradh | i915: Use global uoffset in i915 address space, not per-object.
This is a little sleazy but it enables us to pass the page range through to the fault routine, which wants it in order to find the memory mapping type.
|
1.15 |
| 19-Dec-2021 |
riastradh | i915: Avoid leaking reference count when mapping objects.
We already did i915_gem_object_get_rcu above, which bumps the reference count; no need to additionally do drm_gem_object_get.
|
1.14 |
| 19-Dec-2021 |
riastradh | i915: Fix indexing in gem fault lookups.
|
1.13 |
| 19-Dec-2021 |
riastradh | i915: Simplify releasing mmap offsets; don't release if not mapped.
|
1.12 |
| 19-Dec-2021 |
riastradh | i915: Fix i915_gem_object_release_mmap_offset locking.
|
1.11 |
| 19-Dec-2021 |
riastradh | i915: Must unmake vma nodes we have made.
|
1.10 |
| 19-Dec-2021 |
riastradh | i915: Draft i915_gem_mmap_object.
|
1.9 |
| 19-Dec-2021 |
riastradh | i915: Draft gem fault.
|
1.8 |
| 19-Dec-2021 |
riastradh | i915: Define i915_gem_uvm_ops.
|
1.7 |
| 19-Dec-2021 |
riastradh | drm: Another pass over i915 and some supporting logic.
This makes a shim around sg_table, which essentially represents two things:
1. an array of pages (roughly corresponding to bus_dma_segment_t[]) 2. an array of DMA addresses stored in a bus_dmamap_t
Both parts are optional; different parts of i915 use sg_tables to pass around one or both of the two parts. This helps to reduce the ifdefs by quite a bit, although it's not always clear which part of an sg_table any particular interface is actually using which is why I was reluctant to do this before.
|
1.6 |
| 19-Dec-2021 |
riastradh | i915: obj->base.filp, not obj->filp, now.
|
1.5 |
| 19-Dec-2021 |
riastradh | drm: Nix use of uvm pglist. Just use arrays of page pointers.
|
1.4 |
| 19-Dec-2021 |
riastradh | i915: machete
|
1.3 |
| 19-Dec-2021 |
riastradh | Restore mmap ioctl version ABI hack that was lost in merge.
|
1.2 |
| 18-Dec-2021 |
riastradh | Merge linux-drm-v5-6-rc3
|
1.1 |
| 18-Dec-2021 |
riastradh | branches: 1.1.1; Initial revision
|
1.1.1.1 |
| 18-Dec-2021 |
riastradh | Import drm from Linux v5.6-rc3 (commit f8788d86ab28f61f7b46eb6be375f8a726783636)
drivers/gpu/drm -> sys/external/bsd/drm2/dist/drm include/drm -> sys/external/bsd/drm2/dist/include/drm include/uapi/drm -> sys/external/bsd/drm2/dist/include/uapi/drm
GPL exclusions in dist/drm:
- amd/amdgpu/amdgpu_atpx_handler.c - arc/ - arm/ - armada/ - aspeed/ - atmel-hlcdc/ - bochs/ - bridge/ - cirrus/ - drm_dp_cec.c - drm_dp_mst_topology_internal.h - drm_edid_load.c - drm_format_helper.c - drm_gem_cma_helper.c - drm_gem_framebuffer_helper.c - drm_gem_shmem_helper.c - drm_gem_ttm_helper.c - drm_gem_vram_helper.c - drm_hdcp.c - drm_lease.c - drm_mipi_dbi.c - drm_simple_kms_helper.c - drm_sysfs.c - drm_trace.h - drm_vram_helper_common.c - drm_writeback.c - etnaviv/ - exynos/ - fsl-dcu/ - gma500/ - hisilicon/ - i2c/tda9950.c - i2c/tda998x_drv.c - i915/gt/selftest_context.c - i915/gt/selftest_engine.c - i915/gt/selftest_engine.h - i915/gt/selftest_engine_cs.c - i915/gt/selftest_engine_pm.c - i915/i915_trace.h - i915/selftests/i915_live_selftests.h - i915/selftests/i915_mock_selftests.h - i915/selftests/i915_perf_selftests.h - i915/selftests/lib_sw_fence.h - imx/ - ingenic/ - lima/ - mcde/ - mediatek/ - meson/ - mgag200/ - msm/ - mxsfb/ - omapdrm/ - panel/ - panfrost/ - pl111/ - radeon/radeon_atpx_handler.c - rcar-du/ - rockchip/ - selftests/drm_cmdline_selftests.h - selftests/drm_modeset_selftests.h - selftests/test-drm_cmdline_parser.c - selftests/test-drm_damage_helper.c - selftests/test-drm_dp_mst_helper.c - selftests/test-drm_format.c - selftests/test-drm_framebuffer.c - selftests/test-drm_modeset_common.c - selftests/test-drm_modeset_common.h - selftests/test-drm_plane_helper.c - selftests/test-drm_rect.c - shmobile/ - sti/ - stm/ - sun4i/ - tegra/ - tilcdc/ - tiny/ - tve200/ - udl/ - v3d/ - vc4/ - virtio/virtgpu_trace.h - virtio/virtgpu_trace_points.c - vkms/ - vmwgfx/device_include/vmware_pack_begin.h - vmwgfx/device_include/vmware_pack_end.h - zte/
Exceptions -- these all appear to be files to which someone added an SPDX license header automatically by a script that is not aware of the default MIT licensing under drivers/gpu/drm:
- ast/ast_dp501.c - ast/ast_dram_tables.h - lib/drm_random.c - lib/drm_random.h - i915/display/intel_acpi.c - i915/selftests/mock_gem_device.h - i915/selftests/i915_mock_selftests.h - i915/selftests/i915_live_selftests.h - r128/ati_pcigart.h - selftests/drm_mm_selftests.h - selftests/test-drm_mm.c - vmwgfx/device_include/vm_basic_types.h
GPL exclusions in dist/include/drm:
- bridge - drm_client.h - drm_fb_cma_helper.h - drm_format_helper.h - drm_gem_cma_helper.h - drm_gem_shmem_helper.h - drm_gem_ttm_helper.h - drm_gem_vram_helper.h - drm_lease.h - drm_mipi_dbi.h - drm_mipi_dsi.h - drm_of.h - drm_simple_kms_helper.h - drm_sysfs.h - drm_writeback.h - gma_drm.h - i2c/tda998x.h - i915_mei_hdcp_interface.h - intel-gtt.h
Exceptions: - drm_agpsupport.h - was in original drm; wrong spdx header auto-added
GPL exclusions in dist/include/uapi/drm:
- armada_drm.h - etnaviv_drm.h - exynos_drm.h - lima_drm.h - omap_drm.h
Exceptions: - i810_drm.h - was in original drm; spdx header is wrong
|
1.21.4.2 |
| 04-Oct-2024 |
martin | Pull up following revision(s) (requested by rin in ticket #928):
sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.25 sys/external/bsd/drm2/dist/drm/radeon/radeon_ci_dpm.c: revision 1.7 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/priv.h: revision 1.4 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_acpi.c: revision 1.4 sys/external/bsd/drm2/dist/drm/i915/display/intel_opregion.h: revision 1.6 sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.49 sys/external/bsd/drm2/include/linux/mxm-wmi.h: revision 1.1 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_pcie.c: revision 1.4 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_base.c: revision 1.13 sys/external/bsd/common/include/linux/bitops.h: revision 1.17 sys/external/bsd/drm2/nouveau/files.nouveau: revision 1.40 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.30 sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.h: revision 1.5 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/pci/nouveau_nvkm_subdev_pci_pcie.c: revision 1.5 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/mxm/nouveau_nvkm_subdev_mxm_base.c: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_gart.c: revision 1.12 sys/external/bsd/drm2/dist/drm/radeon/radeon_rv770.c: revision 1.3 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/disp/nouveau_nvkm_engine_disp_sorgm200.c: revision 1.3 sys/external/bsd/common/include/linux/printk.h: revision 1.14 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/instmem/nouveau_nvkm_subdev_instmem_gk20a.c: revision 1.10 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_vi.c: revision 1.4 sys/external/bsd/drm2/include/linux/acpi.h: revision 1.11 sys/external/bsd/drm2/drm/drm_cdevsw.c: revision 1.31 sys/external/bsd/drm2/dist/drm/radeon/radeon_si.c: revision 1.6 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.c: revision 1.5 sys/external/bsd/drm2/dist/drm/i915/display/intel_acpi.h: revision 1.5 sys/external/bsd/drm2/include/acpi/video.h: revision 1.3 sys/external/bsd/drm2/dist/drm/radeon/radeon_evergreen.c: revision 1.6 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_acpi.h: revision 1.4 sys/arch/sparc64/include/pci_machdep.h: revision 1.31 sys/arch/sparc64/dev/pci_machdep.c: revision 1.83 sys/external/bsd/drm2/include/linux/kref.h: revision 1.14 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_pci.c: revision 1.12 sys/external/bsd/drm2/linux/linux_dma_buf.c: revision 1.17 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/subdev/bios/nouveau_nvkm_subdev_bios_shadowacpi.c: revision 1.4 sys/external/bsd/drm2/drm/drm_module.c: revision 1.32 sys/external/bsd/drm2/dist/drm/i915/i915_gem.h: revision 1.8 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c: revision 1.7 sys/external/bsd/drm2/include/linux/smp.h: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_si.c: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.20 sys/arch/x86/x86/bus_dma.c: revision 1.91 sys/external/bsd/drm2/radeon/files.radeon: revision 1.40 sys/external/bsd/drm2/include/acpi/acpi_bus.h: revision 1.1 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h: revision 1.5 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_device.c: revision 1.21 sys/external/bsd/common/include/asm/barrier.h: revision 1.20 sys/external/bsd/drm2/include/linux/nbsd-namespace-acpi.h: revision 1.2 sys/external/bsd/common/include/asm/barrier.h: revision 1.21 sys/modules/drmkms/drmkms_pci.h: revision 1.1 sys/external/bsd/drm2/dist/drm/drm_dp_helper.c: revision 1.17 sys/external/bsd/drm2/radeon/radeon_pci.c: revision 1.23 sys/external/bsd/drm2/linux/linux_xa.c: revision 1.4 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.23 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.24 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.25 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.26 sys/dev/pci/pcivar.h: revision 1.120 sys/arch/xen/include/pci_machdep.h: revision 1.24 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.26 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.27 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.27 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.28 sys/external/bsd/drm2/dist/drm/radeon/radeon_cik.c: revision 1.8 sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.28 sys/external/bsd/drm2/linux/linux_pci.c: revision 1.29 sys/external/bsd/drm2/include/linux/pci.h: revision 1.57 sys/external/bsd/drm2/include/linux/pci.h: revision 1.58 sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c: revision 1.5 sys/external/bsd/drm2/dist/drm/nouveau/nouveau_display.c: revision 1.6 sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_hwmgr.c: revision 1.3 sys/external/bsd/drm2/dist/drm/amd/display/dc/core/amdgpu_dc_stream.c: revision 1.3 share/man/man9/bus_dma.9: revision 1.69 sys/external/bsd/drm2/drm/drm_gem_cma_helper.c: revision 1.15 sys/external/bsd/drm2/dist/drm/radeon/radeon_acpi.c: revision 1.6 sys/external/bsd/drm2/dist/drm/radeon/radeon.h: revision 1.12 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_cik.c: revision 1.7 sys/dev/acpi/acpi_mcfg.c: revision 1.29 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_acpi.c: revision 1.6 sys/external/bsd/drm2/dist/drm/radeon/radeon_r600.c: revision 1.7 sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.13 sys/modules/amdgpu/Makefile: revision 1.9 sys/external/bsd/drm2/dist/drm/radeon/radeon_bios.c: revision 1.14 sys/external/bsd/common/linux/linux_tasklet.c: revision 1.12 sys/external/bsd/drm2/dist/drm/nouveau/include/nvkm/core/device.h: revision 1.10 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.23 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu.h: revision 1.9 sys/external/bsd/drm2/include/linux/interval_tree.h: revision 1.14 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.26 sys/external/bsd/drm2/dist/drm/amd/powerplay/hwmgr/amdgpu_smu7_hwmgr.c: revision 1.5 sys/dev/pci/pci.c: revision 1.168 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.27 sys/external/bsd/drm2/dist/drm/radeon/radeon_si_dpm.c: revision 1.9 sys/external/bsd/drm2/pci/files.drmkms_pci: revision 1.18 sys/external/bsd/drm2/linux/linux_sync_file.c: revision 1.3 sys/external/bsd/drm2/amdgpu/files.amdgpu: revision 1.31 sys/external/bsd/drm2/dist/drm/nouveau/nvkm/engine/device/nouveau_nvkm_engine_device_tegra.c: revision 1.4 sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.24 sys/arch/xen/xen/xpci_xenbus.c: revision 1.29
drm: Eliminate __HAVE_ATOMIC_AS_MEMBAR conditionals. Discussed on tech-kern: https://mail-index.netbsd.org/tech-kern/2023/02/23/msg028729.html
linux asm/barrier.h: Fix !MULTIPROCESSOR build.
remove "nouveau" from a comment. noted by jmcneill.
drm: KASSERT(A && B) -> KASSERT(A); KASSERT(B) comment a function that has a clear overbounds read but it isn't used. found by GCC 12.
nix the NetBSD specific GEM_BUG_ON(). avoids GCC 12 warnings, and matches upstream closer. avoid uninitialised variable usage in drm_gem_cma_create_internal(). in the case nothing has returned 'error', 'nsegs' and the dma info are (potentially) uninitialised, so consider this an error. found by GCC 12.
avoid a GCC 12 warning. there's a 1-element long array and a loop conditional that tries to see if indexes for it are not identical. as these indexes will always both be 0, the only valid index, the condition is always false. GCC 12 triggers a strange warning on this code that can never run (see below), so simply assert the array size is 1 and comment the rest. amdgpu_dc_stream.c:470:55: error: array subscript [0, 0] is outside array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds] 470 | stream->writeback_info[j] = stream->writeback_info[i];
convert a KASSERT() into an if () panic() sequence to appease GCC 12. OK riastradh@.
drm: Fix conditionals around drmkms_pci and agp. Kernel should build now with all pci drm drivers stripped out but DRM_LEGACY still enabled. (Might not be very useful, but it'll build. Maybe we should also have DRM_LEGACY_PCI so those drivers can be modloaded later.)
drmkms: Fix module build. avoid an unlikely array bounds issue picked up by GCC 12. nvkm_pcie_speed() can return -1, which is then used as an array index, so make this default return PCIe 1.0 speeds.
drm: enable almost all PCIe functionality linux_pci.c revisions 1.24 and 1.25 implemented most of the remaining missing PCIe backends, but only enabled them for some amdgpu portions. this enables all code marked with "XXX amdgpu pcie", "XXX radeon pcie", and "XXX pcie speed". for most of it, simply removing #ifndefs __NetBSD__ to enable compliation was required, once the new "bus->max_bus_speed" member was added to struct pci_bus. add an "always fails" backend for pci_enable_atomic_ops_to_root() which seems to only be necessary for virtual GPU functionality (and could be implemented if needed.) tested on radeon 5450, 7750, R7 240 [radeon], and RX 550 [amdgpu], and nvidia 750 and 1030 [nouveau]. this still does not quite work on nvidia cards. there are two problems that remain: - the call to set the link speed is skipped because the speed is set to the default value of "-1". nvkm_pcie_set_link() will actually determine the right value for this and for some cards, calling this function if the current speed is -1 helps set the link speed. it may be that on linux other paths we don't have enabled properly would set this (there's one via debugfs, and a jetson specific one, though perhaps setting either AC or DC speed values as boot options (after hooking up these for netbsd) would currently work. - worse, cards newer than kepler - geforce 900, 1000, and newer, are all lacking the backing support to set pcie link speed. the GT 1030 card i have been testing with remains at pcie 1.0.
radeon: fix and enable ACPI methods for getting ROM BIOS The hacky way of getting the BIOS mapped only works on x86. ACPI should be preferred if available. Makes BIOS reading though VFCT work on aarch64 with EDK2. (But only if EDK2 has POSTed the GPU.) XXX amdgpu should get the same treatment.
drm: put_cpu() should enable preemption, not disable it again
drm(4): make pr_debug equivalent to aprint_debug significantly reduces the default spam from amdgpu(4).
drm: Set CONFIG_ACPI in linux/acpi.h and make it build.
Leave a little ACPI-related functionality disabled for now, like getting EDID out of ACPI -- needs a bit more work to make this work, and I don't have hardware to work on that. Should help with failures of the forms: - unable to locate a BIOS ROM - bios: unable to locate usable image on various machines.
radeon_acpi.c: ifdef out unused function on NetBSD. Should fix syzkaller build.
drm(4): Fix st_rdev in stat. dminor->index already has the 64*type adjustment, as allocated in drm_minor_alloc. PR kern/58180
linux_sync_file: Fix missing init/fini steps. Noted by rjs@. PR kern/58210
ttm: Sync ttm_bo_uvm_fault_idle better with Linux. PR xsrc/58133 ttm: Undo mistake in previous.
PR xsrc/58133 linux: Add a few more cases to pci_get_class. Should fix crash on boot with amdgpu now that the ACPI business is enabled.
i915: Fix dmabuf mmap object.
drm: Fix missing bounds checks in dma buf mmap.
drm_gem.c: Fix sense of assertion. This is the opposite of WARN_ON. Noted by rjs@.
drm_gem.c: Enable drm_gem_fence_array_add now that we emulate xa. linux_xa: Delete and replace collision in xa_store as intended. Don't free the colliding node that's still in the tree. Noted by rjs@.
i915_gem_mman.c: Apply mmap types via pmap flags. This way, userland gets buffers mapped write-combining or uncached as needed. PR xsrc/58307
x86: Teach bus_dmamem_map about BUS_DMA_PREFETCHABLE. PR port-amd64/58308
bus_dma(9): Document BUS_DMA_PREFETCHABLE. Like BUS_DMA_NOCACHE. Doesn't absolve you of the need for bus_dmamap_sync, but if you later pass the vaddr to bus_dmamap_load, the DMA map might notice the mapping is write-combining and use this to make bus_dmamap_sync cheaper. PR kern/58309
nouveau_nvkm_subdev_instmem_gk20a.c: Use BUS_DMA_PREFETCHABLE. Matches Linux's pgprot_writecombine. Unclear where the appropriate bus_dmamap_sync happens, or is supposed to happen -- not using it would be wrong, but asking for a prefetchable mapping may paper over symptoms, at least!
ttm: Sync more with Linux. Add the original copyright and attribution since this is now, intentionally, a modified copy of the original and not just roughly the same algorithm.
ttm: Respect PGO_ALLPAGES. Not sure this is useful but it reduces XXX's and makes this match udv_fault better so it's easier to understand.
ttm: Sync cacheability flag logic with Linux.
ttm: Add XXX about readahead fault failures.
pci: Pass cookie through pci_find_device, pci_enumerate_bus, take 2. New functions pci_find_device1 and pci_enumerate_bus1 have the cookie argument. Existing symbols pci_find_device and pci_enumerate_bus are now wrappers for the cookieless version. This will allow pci_find_device callers to pass a cookie through to the match function so they can keep state or pass in extra parameters like b/d/f numbers, which will allow us to nix some horrible kludges in the Linux PCI API emulation for drm (and, perhaps, Intel wifi). This change drops the symbol pci_probe_device, in favour of a new pci_probe_device1 with the cookie argument. But I don't think that requires a revbump because it's only called by MD pci_enumerate_bus1 implementations, which don't live in modules anyway. Take 2: Make sure to handle NULL match function. linux_pci: Nix pci enumeration kludges. Now that we can pass a cookie through, this stuff will be a little less fragile.
i915: Omit needless i915_gem_object_pin/unpin_pages cycle in fault. vm_fault_cpu and vm_fault_gtt, called by i915_gem_fault, already do the pinning and unpinning internally, so there is no need for i915_gem_fault to do it. No functional change intended, except that the transient pin count will be one lower than before during the fault routine (but it will still be positive).
i915: Match Linux fault routine return code actions. Omit needless EINTR interception -- this is now handled by i915_error_to_vmf_fault. Earlier revert was over a false alarm -- bisection shows the new warnings arose from linux_pci.c 1.29 here: https://mail-index.netbsd.org/source-changes/2024/06/23/msg151929.html
linux_pci: Fix shifto in pci_get_class. It looks like Linux's pci_get_class also matches the interface part of the PCI class register (but not the revision part), and I hadn't noticed that in the previous shim structured differently.
With GCC12 kernel ALL/amd64 triggers "'sor' may be used uninitialized". If "sublinks & 3" is zero GCC is right and sor[1] may be returned unitialized. Fix by initializing "sor" to zero to return -1 instead of uninitialized value. Ok: Taylor R Campbell <riastradh@>
amdgpu: Map BAR 2, not BAR 5, on pre-bonaire chips. PR kern/58384
amdgpu: Map consecutive pages, not the same one over and over again. PR kern/58385
linux/bitops: Fix overestimate for BITS_TO_LONGS(9) Fortunately, this seems harmless except for allocating excessive buffer memory. Pointed out by nonaka@, OK riastradh@.
|
1.21.4.1 |
| 03-Feb-2024 |
martin | Pull up following revision(s) (requested by riastradh in ticket #559):
sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_stolen.c: revision 1.6 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_stolen.c: revision 1.7 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_pages.c: revision 1.7 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_phys.c: revision 1.9 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_mman.c: revision 1.22 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_region.c: revision 1.5 sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_region.c: revision 1.6
i915_gem_region: Reduce diff from upstream a little. No functional change intended. Prompted by upcoming nearby changes related to PR kern/57833.
i915_gem: Avoid walking off end of sg_pgs. sg_npgs currently fails to match obj->base.size/PAGE_SIZE only due to bugs in the construction of sg_pgs in various i915 gem object types, which we should also fix, but let's avoid compounding it here. Related to PR kern/57833.
i915_gem: Assert page array size. Let's detect the bug of sg_npgs failing to match obj->base.size/PAGE_SIZE earlier. Related to PR kern/57833.
i915_gem_phys: Fill sg_pgs. This is needed by i915 gem fault, which maps user virtual addresses to those pages, and by i915 gem object destruction, which does pmap_page_protect on the pages to remove any of those user virtual mappings. This needs pmap_kenter_pa rather than pmap_enter(pmap_kernel(), ...) in order to preserve the _kernel's_ mapping of the pages after pmap_page_protect. But bus_dmamem_map currently uses pmap_enter(pmap_kernel(), ...) instead which creates a mapping that is removed by pmap_page_protect. So we use a variant of bus_dmamem_map that uses pmap_kenter_pa instead. Perhaps bus_dmamem_map should do this itself, but this change is less risky to pull up than a change to bus_dmamem_map itself. PR kern/57833: kernel panic on xorg exit
i915_gem_region: Fill sg_pgs, with size/PAGE_SIZE entries. Use sg_alloc_table_from_bus_dmamem to do this. i915_gem_mman.c vm_fault_cpu and i915_gem_object_release_mmap_offset both rely on sg_pgs to be a page array, so using something else like size >> ilog2(mem->mm.chunk_size) entries doesn't work. And they rely on the sg_pgs entries to be initialized, which we weren't doing before, and which sg_alloc_table_from_bus_dmamem does for us. Related to PR kern/57833.
i915_gem_stolen: Fix memory leak. Found while trying to address the PR 57833 class of problems.
i915_gem_stolen: Fill sg_pgs, with size/PAGE_SIZE entries. Use sg_alloc_table_from_bus_dmamem to do this.
i915_gem_mman.c vm_fault_cpu and i915_gem_object_release_mmap_offset both rely on sg_pgs to be a page array, so providing a table with only one entry doesn't work (except by accident, if the object is page-sized anyway). And they rely on the sg_pgs entries to be initialized, which we weren't doing before, and which sg_alloc_table_from_bus_dmamem does for us. Related to PR kern/57833.
|