Skip to content
Snippets Groups Projects
Select Git revision
  • e1ce697db67421cc7e9a1cc1312149f3a4e08c93
  • panfrost/ci default
  • jakob-v5.4-patch
  • jakob-v5.4
  • jakob-4.19
  • drm-misc-next-with-blob
  • v5.3-hack-boot/ci
  • v5.3/ci
  • v5.2/ci
  • boot-time-improvement
  • jakob-v4.8
  • jakob-v4.9
12 results

timer-atmel-pit.c

Blame
  • amdgpu_fb.c 11.54 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;