6 #include <drm/drm_gem.h>
7 #include <drm/drm_encoder.h>
8 #include <linux/hrtimer.h>
19 static const u32 vkms_formats
[] = {
25 struct drm_encoder encoder
;
26 struct drm_connector connector
;
27 struct hrtimer vblank_hrtimer
;
29 struct drm_pending_vblank_event
*event
;
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 */
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)
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
,
58 int vkms_output_init(struct vkms_device
*vkmsdev
);
60 struct drm_plane
*vkms_plane_init(struct vkms_device
*vkmsdev
);
63 struct drm_gem_object
*vkms_gem_create(struct drm_device
*dev
,
64 struct drm_file
*file
,
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_ */