Skip to content
Snippets Groups Projects
Select Git revision
  • f5ef68da5fda5e095b585ea5ecdd42af3c8695f7
  • 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

proc_misc.c

Blame
  • amdgpu_kms.c 35.59 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 <drm/drmP.h>
    #include "amdgpu.h"
    #include <drm/amdgpu_drm.h>
    #include "amdgpu_sched.h"
    #include "amdgpu_uvd.h"
    #include "amdgpu_vce.h"
    
    #include <linux/vga_switcheroo.h>
    #include <linux/slab.h>
    #include <linux/pm_runtime.h>
    #include "amdgpu_amdkfd.h"
    
    /**
     * amdgpu_driver_unload_kms - Main unload function for KMS.
     *
     * @dev: drm dev pointer
     *
     * This is the main unload function for KMS (all asics).
     * Returns 0 on success.
     */
    void amdgpu_driver_unload_kms(struct drm_device *dev)
    {
    	struct amdgpu_device *adev = dev->dev_private;
    
    	if (adev == NULL)
    		return;
    
    	if (adev->rmmio == NULL)
    		goto done_free;
    
    	if (amdgpu_sriov_vf(adev))
    		amdgpu_virt_request_full_gpu(adev, false);
    
    	if (amdgpu_device_is_px(dev)) {
    		pm_runtime_get_sync(dev->dev);
    		pm_runtime_forbid(dev->dev);
    	}
    
    	amdgpu_acpi_fini(adev);
    
    	amdgpu_device_fini(adev);
    
    done_free: