Skip to content
Snippets Groups Projects
Select Git revision
  • 30da46b5dc3a9a14db11706d841440e28b12bb53
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

prog.c

Blame
  • amdgpu_vm.c 70.11 KiB
    /*
     * Copyright 2008 Advanced Micro Devices, Inc.
     * Copyright 2008 Red Hat Inc.
     * Copyright 2009 Jerome Glisse.
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
     * to deal in the Software without restriction, including without limitation
     * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     * and/or sell copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following conditions:
     *
     * The above copyright notice and this permission notice shall be included in
     * all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
     * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
     * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
     * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     * OTHER DEALINGS IN THE SOFTWARE.
     *
     * Authors: Dave Airlie
     *          Alex Deucher
     *          Jerome Glisse
     */
    #include <linux/dma-fence-array.h>
    #include <linux/interval_tree_generic.h>
    #include <drm/drmP.h>
    #include <drm/amdgpu_drm.h>
    #include "amdgpu.h"
    #include "amdgpu_trace.h"
    
    /*
     * GPUVM
     * GPUVM is similar to the legacy gart on older asics, however
     * rather than there being a single global gart table
     * for the entire GPU, there are multiple VM page tables active
     * at any given time.  The VM page tables can contain a mix
     * vram pages and system memory pages and system memory pages
     * can be mapped as snooped (cached system pages) or unsnooped
     * (uncached system pages).
     * Each VM has an ID associated with it and there is a page table
     * associated with each VMID.  When execting a command buffer,
     * the kernel tells the the ring what VMID to use for that command
     * buffer.  VMIDs are allocated dynamically as commands are submitted.
     * The userspace drivers maintain their own address space and the kernel
     * sets up their pages tables accordingly when they submit their
     * command buffers and a VMID is assigned.
     * Cayman/Trinity support up to 8 active VMs at any given time;
     * SI supports 16.
     */
    
    #define START(node) ((node)->start)
    #define LAST(node) ((node)->last)
    
    INTERVAL_TREE_DEFINE(struct amdgpu_bo_va_mapping, rb, uint64_t, __subtree_last,
    		     START, LAST, static, amdgpu_vm_it)
    
    #undef START
    #undef LAST
    
    /* Local structure. Encapsulate some VM table update parameters to reduce
     * the number of function parameters
     */
    struct amdgpu_pte_update_params {
    	/* amdgpu device we do this update for */
    	struct amdgpu_device *adev;
    	/* optional amdgpu_vm we do this update for */