xref: /OK3568_Linux_fs/kernel/drivers/gpu/drm/nouveau/nouveau_fbcon.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright (C) 2008 Maarten Maathuis.
3*4882a593Smuzhiyun  * All Rights Reserved.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining
6*4882a593Smuzhiyun  * a copy of this software and associated documentation files (the
7*4882a593Smuzhiyun  * "Software"), to deal in the Software without restriction, including
8*4882a593Smuzhiyun  * without limitation the rights to use, copy, modify, merge, publish,
9*4882a593Smuzhiyun  * distribute, sublicense, and/or sell copies of the Software, and to
10*4882a593Smuzhiyun  * permit persons to whom the Software is furnished to do so, subject to
11*4882a593Smuzhiyun  * the following conditions:
12*4882a593Smuzhiyun  *
13*4882a593Smuzhiyun  * The above copyright notice and this permission notice (including the
14*4882a593Smuzhiyun  * next paragraph) shall be included in all copies or substantial
15*4882a593Smuzhiyun  * portions of the Software.
16*4882a593Smuzhiyun  *
17*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18*4882a593Smuzhiyun  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19*4882a593Smuzhiyun  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20*4882a593Smuzhiyun  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21*4882a593Smuzhiyun  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22*4882a593Smuzhiyun  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23*4882a593Smuzhiyun  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*4882a593Smuzhiyun  *
25*4882a593Smuzhiyun  */
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #ifndef __NOUVEAU_FBCON_H__
28*4882a593Smuzhiyun #define __NOUVEAU_FBCON_H__
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun #include <drm/drm_fb_helper.h>
31*4882a593Smuzhiyun 
32*4882a593Smuzhiyun #include "nouveau_display.h"
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun struct nouveau_vma;
35*4882a593Smuzhiyun 
36*4882a593Smuzhiyun struct nouveau_fbdev {
37*4882a593Smuzhiyun 	struct drm_fb_helper helper; /* must be first */
38*4882a593Smuzhiyun 	unsigned int saved_flags;
39*4882a593Smuzhiyun 	struct nvif_object surf2d;
40*4882a593Smuzhiyun 	struct nvif_object clip;
41*4882a593Smuzhiyun 	struct nvif_object rop;
42*4882a593Smuzhiyun 	struct nvif_object patt;
43*4882a593Smuzhiyun 	struct nvif_object gdi;
44*4882a593Smuzhiyun 	struct nvif_object blit;
45*4882a593Smuzhiyun 	struct nvif_object twod;
46*4882a593Smuzhiyun 	struct nouveau_vma *vma;
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun 	struct mutex hotplug_lock;
49*4882a593Smuzhiyun 	bool hotplug_waiting;
50*4882a593Smuzhiyun };
51*4882a593Smuzhiyun 
52*4882a593Smuzhiyun void nouveau_fbcon_restore(void);
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun int nv04_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region);
55*4882a593Smuzhiyun int nv04_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
56*4882a593Smuzhiyun int nv04_fbcon_imageblit(struct fb_info *info, const struct fb_image *image);
57*4882a593Smuzhiyun int nv04_fbcon_accel_init(struct fb_info *info);
58*4882a593Smuzhiyun 
59*4882a593Smuzhiyun int nv50_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
60*4882a593Smuzhiyun int nv50_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region);
61*4882a593Smuzhiyun int nv50_fbcon_imageblit(struct fb_info *info, const struct fb_image *image);
62*4882a593Smuzhiyun int nv50_fbcon_accel_init(struct fb_info *info);
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun int nvc0_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
65*4882a593Smuzhiyun int nvc0_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *region);
66*4882a593Smuzhiyun int nvc0_fbcon_imageblit(struct fb_info *info, const struct fb_image *image);
67*4882a593Smuzhiyun int nvc0_fbcon_accel_init(struct fb_info *info);
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun void nouveau_fbcon_gpu_lockup(struct fb_info *info);
70*4882a593Smuzhiyun 
71*4882a593Smuzhiyun int nouveau_fbcon_init(struct drm_device *dev);
72*4882a593Smuzhiyun void nouveau_fbcon_fini(struct drm_device *dev);
73*4882a593Smuzhiyun void nouveau_fbcon_set_suspend(struct drm_device *dev, int state);
74*4882a593Smuzhiyun void nouveau_fbcon_accel_save_disable(struct drm_device *dev);
75*4882a593Smuzhiyun void nouveau_fbcon_accel_restore(struct drm_device *dev);
76*4882a593Smuzhiyun 
77*4882a593Smuzhiyun void nouveau_fbcon_output_poll_changed(struct drm_device *dev);
78*4882a593Smuzhiyun void nouveau_fbcon_hotplug_resume(struct nouveau_fbdev *fbcon);
79*4882a593Smuzhiyun extern int nouveau_nofbaccel;
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun #endif /* __NV50_FBCON_H__ */
82*4882a593Smuzhiyun 
83