Home | History | Annotate | Download | only in ttm
History log of /src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c
RevisionDateAuthorComments
 1.28  19-Dec-2021  riastradh drm/ttm: Thread the needle of buffer transfer object initialization.

Kinda finicky here!
 1.27  19-Dec-2021  riastradh Apparently vunmap needs an argument which is num pages... one?


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.26  19-Dec-2021  riastradh drm/ttm: Conditionalize initialization of vma node.

Needs to match conditional destruction.


Author: Maya Rashish <maya@NetBSD.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>
 1.25  19-Dec-2021  riastradh drm_os_netbsd.h is no more
 1.24  19-Dec-2021  riastradh Follow up with TTM API changes


Author: Maya Rashish <maya@NetBSD.org>
 1.23  19-Dec-2021  riastradh drm_os_netbsd.h for CONFIG_THINGS. Might want a better solution...


Author: Maya Rashish <maya@NetBSD.org>
 1.22  19-Dec-2021  riastradh Fix up ttm.
 1.21  18-Dec-2021  riastradh Merge linux-drm-v5-6-rc3
 1.20  23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.19  14-Feb-2020  maya Reduce diffs by side-loading some header files like Linux.

From riastradh
 1.18  14-Feb-2020  riastradh Revert cosmetic changes.
 1.17  14-Feb-2020  riastradh Reduce diffs by nixing DRM_SUSER macro, deleted upstream long ago.

Instead stub Linux capable(CAP_SYS_ADMIN).
 1.16  14-Feb-2020  riastradh Use a header file hack to cope with Linux/NetBSD namespace clashes.

Currently serves for:

ALIGN
mutex_init
mutex_destroy
 1.15  28-Jan-2020  jmcneill ttm_io_prot: follow linux semantics and set either PMAP_WRITE_COMBINE or
PMAP_NOCACHE when existing cache flags are not set
 1.14  30-Aug-2018  riastradh branches: 1.14.6;
This is not merely `not for NetBSD'; upstream it's #if 0 altogether.

Always has been.
 1.13  29-Aug-2018  mrg restore #ifndef __NetBSD__ code so drm on nouveau has a chance.
from @riastradh.

display is still black, but tools some times try to work now.
 1.12  27-Aug-2018  riastradh Be consistent about I/O byte ordering.

Leave XXX comments where it's not clear what we should do.
 1.11  27-Aug-2018  riastradh Reduce some logic duplication and just use vmap/kmap here.
 1.10  27-Aug-2018  riastradh Handle removal of local variable in merge.
 1.9  27-Aug-2018  riastradh Actually do DRM_SUSER check for mapping >1 page in kernel.
 1.8  27-Aug-2018  riastradh Need <asm/barrier.h> for mb.
 1.7  27-Aug-2018  riastradh merge linux-drm-v4-4-143
 1.6  17-Oct-2015  jmcneill branches: 1.6.16; 1.6.18;
vunmap takes 2 parameters on netbsd
 1.5  20-Apr-2015  riastradh First attempt to make ttm_buffer_object_transfer less bogus.
 1.4  18-Jul-2014  riastradh branches: 1.4.2; 1.4.4; 1.4.6;
Don't forget to pmap_update after pmap_kremove!
 1.3  18-Jul-2014  riastradh We need just a VA, not wired physical pages too.
 1.2  16-Jul-2014  riastradh First whack at radeon driver.

No hardware to test yet, but it builds.
 1.1  23-Jul-2013  riastradh branches: 1.1.1;
Initial revision
 1.1.1.4  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.1.1.3  27-Aug-2018  riastradh Import drm from Linux v4.4.143 (commit a8ea6276d00555387deaaa5eaeb380cd5c17bdc9).

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/uapi/drm

GPL sources excluded.
 1.1.1.2  16-Jul-2014  riastradh Import drm from Linux 3.15 (commitid 1860e379875dfe7271c649058aeddffe5afd9d0d).

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/uapi/drm

GPL sources excluded.
 1.1.1.1  23-Jul-2013  riastradh branches: 1.1.1.1.2; 1.1.1.1.4; 1.1.1.1.6; 1.1.1.1.8;
Import drm sources from Linux v3.8-rc6.
(commit id 88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7)

Linux NetBSD
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/uapi/drm

Files/subtrees excluded because of licence issues, to be either
revisited later (particularly nouveau and radeon, which are mostly
permissively licensed but a number of whose files have no licence
statements), rewritten/ignored, or imported later as kernel modules
under external/gpl2 instead:

include/drm/drm_fb_cma_helper.h
include/drm/drm_gem_cma_helper.h
include/drm/drm_os_linux.h
include/drm/drm_pciids.h
include/drm/drm_sysfs.h
include/drm/drm_usb.h
include/drm/exynos_drm.h
include/drm/gma_drm.h
include/drm/intel-gtt.h
drm/cirrus
drm/drm_edid_load.c
drm/drm_fb_cma_helper.c
drm/drm_gem_cma_helper.c
drm/drm_sysfs.c
drm/drm_trace.h
drm/drm_trace_points.c
drm/drm_usb.c
drm/exynos
drm/gma500
drm/i915/i915_trace.h
drm/i915/i915_trace_points.c
drm/i915/intel_acpi.c
drm/mgag200
drm/nouveau
drm/radeon
drm/shmobile
drm/tegra
drm/udl
uapi/exynos_drm.h
 1.1.1.1.8.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.1.1.1.8.1  23-Jul-2013  yamt file ttm_bo_util.c was added on branch yamt-pagecache on 2014-05-22 11:40:54 +0000
 1.1.1.1.6.1  10-Aug-2014  tls Rebase.
 1.1.1.1.4.2  28-Aug-2013  rmind sync with head
 1.1.1.1.4.1  23-Jul-2013  rmind file ttm_bo_util.c was added on branch rmind-smpnet on 2013-08-28 23:59:34 +0000
 1.1.1.1.2.2  23-Jul-2013  riastradh sync with HEAD and actually get the drm2 import
 1.1.1.1.2.1  23-Jul-2013  riastradh file ttm_bo_util.c was added on branch riastradh-drm2 on 2013-07-23 21:28:23 +0000
 1.4.6.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4.6.1  06-Jun-2015  skrll Sync with HEAD
 1.4.4.3  03-Dec-2017  jdolecek update from HEAD
 1.4.4.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.4.1  18-Jul-2014  tls file ttm_bo_util.c was added on branch tls-maxphys on 2014-08-20 00:04:19 +0000
 1.4.2.1  23-Apr-2015  snj Pull up following revision(s) (requested by mrg in ticket #718):
sys/arch/x86/include/pmap.h: revision 1.56
sys/arch/x86/x86/pmap.c: revision 1.188
sys/dev/pci/agp_amd64.c: revision 1.8
sys/dev/pci/agp_i810.c: revision 1.118
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c: revision 1.16
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.29
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_agp.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c: revision 1.2
sys/external/bsd/drm2/dist/drm/radeon/radeon_object.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c: revision 1.7
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c: revisions 1.7-1.10
sys/external/bsd/drm2/dist/drm/ttm/ttm_bo_util.c: revision 1.5
sys/external/bsd/drm2/i915drm/intelfb.c: revision 1.13
sys/external/bsd/drm2/include/drm/drm_wait_netbsd.h: revisions 1.12, 1.13
sys/external/bsd/drm2/include/linux/mm.h: revision 1.5
sys/external/bsd/drm2/include/linux/pci.h: revisions 1.16, 1.17
sys/external/bsd/drm2/nouveau/nouveaufb.c: revision 1.2
sys/external/bsd/drm2/radeon/radeon_pci.c: revisions 1.8, 1.9
sys/uvm/uvm_init.c: revision 1.46
Hack against the blank console problem:
Leave the CLUT alone on ancient cards. At least this leaves us with a
semi working console (red and blue are flipped). Leave an example of what
seems to be happening but disable it because colors are better than 444 bit
greyscale.
--
Initialize P->V tracking for unmanaged device pages in uvm_init.

Conditional on __HAVE_PMAP_PV_TRACK until we add it to all pmaps.

MI part of pmap_pv(9) change proposed on tech-kern:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Implement pmap_pv(9) for x86 for P->V tracking of unmanaged pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html
--
Use pmap_pv(9) to remove mappings of Intel graphics aperture pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Use pmap_pv(9) to remove mappings of device pages in TTM.

Adapt nouveau and radeon to do pmap_pv_track for their device pages.

Proposed on tech-kern with no objections:

https://mail-index.netbsd.org/tech-kern/2015/03/26/msg018561.html

Further background at:

https://mail-index.netbsd.org/tech-kern/2014/07/23/msg017392.html
--
Fix error branches in agp_amd64.c.

- agp_generic_detach always.
- Free asc if it was allocated. (Found by Brainy, noted by maxv@.)
- Free the GATT if it was allocated.
--
pmf_device_register returns false on failure, not true
--
In DRM_SPIN_WAIT_ON, don't stop after waiting only one tick.

Continue the loop to recheck the condition and count the whole
duration.
--
Don't use the video BIOS memory as an i915 flush page!
--
Don't let anyone else allocate the video BIOS either.
--
Missed a zero: it's 0x100000, not 0x10000.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
Don't reserve if atomic -- caller must have pre-pinned the buffer.
--
almost add radeondrmkms suspend/resume support. it unfortunately doesn't work.
--
Need the page's uvm object lock to do pmap_page_protect.
--
Use KASSERTMSG to show bad base/offset.
--
KASSERT about page-alignment on initialization too.
--
Don't break when hardclock_ticks wraps around.

Since we now only count time spent in wait, rather than determining
the end time and checking whether we've passed it, timeouts might be
marginally longer in effect. Unlikely to be an issue.
--
Remove broken drm2 vm_mmap stub. Can't possibly have ever worked.
--
apply some of the additional changes from Arto Huusko in PR#49645:
- call pmf_device_deregister on detach.

i've kept the "resume = true" for radeon_resume_kms() call as it
seems to work for me (indeed, code inspection shows it is unused
on netbsd :-)

my old nforce4 box that can resume old drm (or could, last i tried
several years ago) while X and GL apps were running, can at least
survive a resume if X hasn't started. my one attempt so far with
X exited, but having run, did not work.
--
First attempt to make ttm_buffer_object_transfer less bogus.
--
Make sure mem.bus.is_iomem is initialized. PR 49833
 1.6.18.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.6.18.1  10-Jun-2019  christos Sync with HEAD
 1.6.16.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.14.6.1  29-Feb-2020  ad Sync with head.

RSS XML Feed