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

amdgpu_display.c

Blame
  • amdgpu_display.c 27.32 KiB
    /*
     * Copyright 2007-8 Advanced Micro Devices, Inc.
     * Copyright 2008 Red Hat Inc.
     *
     * 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
     */
    #include <drm/drmP.h>
    #include <drm/amdgpu_drm.h>
    #include "amdgpu.h"
    #include "amdgpu_i2c.h"
    #include "atom.h"
    #include "amdgpu_connectors.h"
    #include "amdgpu_display.h"
    #include <asm/div64.h>
    
    #include <linux/pm_runtime.h>
    #include <drm/drm_crtc_helper.h>
    #include <drm/drm_edid.h>
    #include <drm/drm_gem_framebuffer_helper.h>
    #include <drm/drm_fb_helper.h>
    
    static void amdgpu_display_flip_callback(struct dma_fence *f,
    					 struct dma_fence_cb *cb)
    {
    	struct amdgpu_flip_work *work =
    		container_of(cb, struct amdgpu_flip_work, cb);
    
    	dma_fence_put(f);
    	schedule_work(&work->flip_work.work);
    }
    
    static bool amdgpu_display_flip_handle_fence(struct amdgpu_flip_work *work,
    					     struct dma_fence **f)
    {
    	struct dma_fence *fence= *f;
    
    	if (fence == NULL)
    		return false;
    
    	*f = NULL;
    
    	if (!dma_fence_add_callback(fence, &work->cb,
    				    amdgpu_display_flip_callback))
    		return true;
    
    	dma_fence_put(fence);
    	return false;
    }
    
    static void amdgpu_display_flip_work_func(struct work_struct *__work)
    {