diff options
author | Dave Airlie <airlied@redhat.com> | 2016-09-19 16:17:38 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-09-19 16:17:38 -0400 |
commit | bd4a68da1989a3735b9c183422effc177e2d5ae8 (patch) | |
tree | a7ad047fc3ecebdeb2f671c6d0710b44155e21b9 /drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | |
parent | 9f8cf165c62913244479832f04c44cd77ffc9293 (diff) | |
parent | af1f85ddecfa341e684db950c34a1813d36750db (diff) |
Merge branch 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux into drm-next
More radeon and amdgpu changes for 4.9. Highlights:
- Initial SI support for amdgpu (controlled by a Kconfig option)
- misc ttm cleanups
- runtimepm fixes
- S3/S4 fixes
- power improvements
- lots of code cleanups and optimizations
* 'drm-next-4.9' of git://people.freedesktop.org/~agd5f/linux: (151 commits)
drm/ttm: remove cpu_address member from ttm_tt
drm/radeon/radeon_device: remove unused function
drm/amdgpu: clean function declarations in amdgpu_ttm.c up
drm/amdgpu: use the new ring ib and dma frame size callbacks (v2)
drm/amdgpu/vce3: add ring callbacks for ib and dma frame size
drm/amdgpu/vce2: add ring callbacks for ib and dma frame size
drm/amdgpu/vce: add common ring callbacks for ib and dma frame size
drm/amdgpu/uvd6: add ring callbacks for ib and dma frame size
drm/amdgpu/uvd5: add ring callbacks for ib and dma frame size
drm/amdgpu/uvd4.2: add ring callbacks for ib and dma frame size
drm/amdgpu/sdma3: add ring callbacks for ib and dma frame size
drm/amdgpu/sdma2.4: add ring callbacks for ib and dma frame size
drm/amdgpu/cik_sdma: add ring callbacks for ib and dma frame size
drm/amdgpu/si_dma: add ring callbacks for ib and dma frame size
drm/amdgpu/gfx8: add ring callbacks for ib and dma frame size
drm/amdgpu/gfx7: add ring callbacks for ib and dma frame size
drm/amdgpu/gfx6: add ring callbacks for ib and dma frame size
drm/amdgpu/ring: add an interface to get dma frame and ib size
drm/amdgpu/sdma3: drop unused functions
drm/amdgpu/gfx6: drop gds_switch callback
...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c index bf033b58056c..107fbb2d2847 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | |||
@@ -25,6 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/pm_runtime.h> | ||
28 | 29 | ||
29 | #include <drm/drmP.h> | 30 | #include <drm/drmP.h> |
30 | #include <drm/drm_crtc.h> | 31 | #include <drm/drm_crtc.h> |
@@ -47,8 +48,35 @@ struct amdgpu_fbdev { | |||
47 | struct amdgpu_device *adev; | 48 | struct amdgpu_device *adev; |
48 | }; | 49 | }; |
49 | 50 | ||
51 | static int | ||
52 | amdgpufb_open(struct fb_info *info, int user) | ||
53 | { | ||
54 | struct amdgpu_fbdev *rfbdev = info->par; | ||
55 | struct amdgpu_device *adev = rfbdev->adev; | ||
56 | int ret = pm_runtime_get_sync(adev->ddev->dev); | ||
57 | if (ret < 0 && ret != -EACCES) { | ||
58 | pm_runtime_mark_last_busy(adev->ddev->dev); | ||
59 | pm_runtime_put_autosuspend(adev->ddev->dev); | ||
60 | return ret; | ||
61 | } | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | static int | ||
66 | amdgpufb_release(struct fb_info *info, int user) | ||
67 | { | ||
68 | struct amdgpu_fbdev *rfbdev = info->par; | ||
69 | struct amdgpu_device *adev = rfbdev->adev; | ||
70 | |||
71 | pm_runtime_mark_last_busy(adev->ddev->dev); | ||
72 | pm_runtime_put_autosuspend(adev->ddev->dev); | ||
73 | return 0; | ||
74 | } | ||
75 | |||
50 | static struct fb_ops amdgpufb_ops = { | 76 | static struct fb_ops amdgpufb_ops = { |
51 | .owner = THIS_MODULE, | 77 | .owner = THIS_MODULE, |
78 | .fb_open = amdgpufb_open, | ||
79 | .fb_release = amdgpufb_release, | ||
52 | .fb_check_var = drm_fb_helper_check_var, | 80 | .fb_check_var = drm_fb_helper_check_var, |
53 | .fb_set_par = drm_fb_helper_set_par, | 81 | .fb_set_par = drm_fb_helper_set_par, |
54 | .fb_fillrect = drm_fb_helper_cfb_fillrect, | 82 | .fb_fillrect = drm_fb_helper_cfb_fillrect, |