drm/msm/hdmi: Enable HPD after HDMI IRQ is set up
[linux/fpc-iii.git] / drivers / gpu / drm / vkms / vkms_drv.h
blob07be29f2dc44115f64c0e09875892c89223301d8
1 #ifndef _VKMS_DRV_H_
2 #define _VKMS_DRV_H_
4 #include <drm/drmP.h>
5 #include <drm/drm.h>
6 #include <drm/drm_gem.h>
7 #include <drm/drm_encoder.h>
8 #include <linux/hrtimer.h>
10 #define XRES_MIN 32
11 #define YRES_MIN 32
13 #define XRES_DEF 1024
14 #define YRES_DEF 768
16 #define XRES_MAX 8192
17 #define YRES_MAX 8192
19 static const u32 vkms_formats[] = {
20 DRM_FORMAT_XRGB8888,
23 struct vkms_output {
24 struct drm_crtc crtc;
25 struct drm_encoder encoder;
26 struct drm_connector connector;
27 struct hrtimer vblank_hrtimer;
28 ktime_t period_ns;
29 struct drm_pending_vblank_event *event;
32 struct vkms_device {
33 struct drm_device drm;
34 struct platform_device *platform;
35 struct vkms_output output;
38 struct vkms_gem_object {
39 struct drm_gem_object gem;
40 struct mutex pages_lock; /* Page lock used in page fault handler */
41 struct page **pages;
44 #define drm_crtc_to_vkms_output(target) \
45 container_of(target, struct vkms_output, crtc)
47 #define drm_device_to_vkms_device(target) \
48 container_of(target, struct vkms_device, drm)
50 /* CRTC */
51 int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
52 struct drm_plane *primary, struct drm_plane *cursor);
54 bool vkms_get_vblank_timestamp(struct drm_device *dev, unsigned int pipe,
55 int *max_error, ktime_t *vblank_time,
56 bool in_vblank_irq);
58 int vkms_output_init(struct vkms_device *vkmsdev);
60 struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev);
62 /* Gem stuff */
63 struct drm_gem_object *vkms_gem_create(struct drm_device *dev,
64 struct drm_file *file,
65 u32 *handle,
66 u64 size);
68 int vkms_gem_fault(struct vm_fault *vmf);
70 int vkms_dumb_create(struct drm_file *file, struct drm_device *dev,
71 struct drm_mode_create_dumb *args);
73 int vkms_dumb_map(struct drm_file *file, struct drm_device *dev,
74 u32 handle, u64 *offset);
76 void vkms_gem_free_object(struct drm_gem_object *obj);
78 #endif /* _VKMS_DRV_H_ */