Skip to content
Snippets Groups Projects
Select Git revision
  • 851b4c14532df4e4fd902b4b34cb0fe6937f03ca
  • master default
  • android-container
  • nanopc-t4
  • for-kernelci
  • WIP-syscall
  • v4.16-rc5
  • v4.16-rc4
  • v4.16-rc3
  • v4.16-rc2
  • v4.16-rc1
  • v4.15
  • v4.15-rc9
  • v4.15-rc8
  • v4.15-rc7
  • v4.15-rc6
  • v4.15-rc5
  • v4.15-rc4
  • v4.15-rc3
  • v4.15-rc2
  • v4.15-rc1
  • v4.14
  • v4.14-rc8
  • v4.14-rc7
  • v4.14-rc6
  • v4.14-rc5
26 results

framebuffer-coreboot.c

Blame
  • amdgpu_fb.c 10.37 KiB
    /*
     * Copyright © 2007 David Airlie
     *
     * 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 (including the next
     * paragraph) 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 AUTHORS OR COPYRIGHT HOLDERS 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:
     *     David Airlie
     */
    #include <linux/module.h>
    #include <linux/slab.h>
    #include <linux/pm_runtime.h>
    
    #include <drm/drmP.h>
    #include <drm/drm_crtc.h>
    #include <drm/drm_crtc_helper.h>
    #include <drm/amdgpu_drm.h>
    #include "amdgpu.h"
    #include "cikd.h"
    
    #include <drm/drm_fb_helper.h>
    
    #include <linux/vga_switcheroo.h>
    
    /* object hierarchy -
       this contains a helper + a amdgpu fb
       the helper contains a pointer to amdgpu framebuffer baseclass.
    */
    struct amdgpu_fbdev {
    	struct drm_fb_helper helper;
    	struct amdgpu_framebuffer rfb;
    	struct amdgpu_device *adev;
    };
    
    static int
    amdgpufb_open(struct fb_info *info, int user)
    {
    	struct amdgpu_fbdev *rfbdev = info->par;
    	struct amdgpu_device *adev = rfbdev->adev;
    	int ret = pm_runtime_get_sync(adev->ddev->dev);
    	if (ret < 0 && ret != -EACCES) {
    		pm_runtime_mark_last_busy(adev->ddev->dev);
    		pm_runtime_put_autosuspend(adev->ddev->dev);
    		return ret;
    	}
    	return 0;
    }
    
    static int
    amdgpufb_release(struct fb_info *info, int user)
    {
    	struct amdgpu_fbdev *rfbdev = info->par;
    	struct amdgpu_device *adev = rfbdev->adev;