xref: /linux/drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h (revision 0e2b2a76278153d1ac312b0691cb65dabb9aef3e)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * shmob_drm_crtc.h  --  SH Mobile DRM CRTCs
4  *
5  * Copyright (C) 2012 Renesas Electronics Corporation
6  *
7  * Laurent Pinchart (laurent.pinchart@ideasonboard.com)
8  */
9 
10 #ifndef __SHMOB_DRM_CRTC_H__
11 #define __SHMOB_DRM_CRTC_H__
12 
13 #include <drm/drm_crtc.h>
14 #include <drm/drm_connector.h>
15 #include <drm/drm_encoder.h>
16 
17 struct backlight_device;
18 struct drm_pending_vblank_event;
19 struct shmob_drm_device;
20 struct shmob_drm_format_info;
21 
22 struct shmob_drm_crtc {
23 	struct drm_crtc crtc;
24 
25 	struct drm_pending_vblank_event *event;
26 	int dpms;
27 
28 	const struct shmob_drm_format_info *format;
29 	unsigned long dma[2];
30 	unsigned int line_size;
31 	bool started;
32 };
33 
34 struct shmob_drm_encoder {
35 	struct drm_encoder encoder;
36 	int dpms;
37 };
38 
39 struct shmob_drm_connector {
40 	struct drm_connector connector;
41 	struct drm_encoder *encoder;
42 
43 	struct backlight_device *backlight;
44 };
45 
46 int shmob_drm_crtc_create(struct shmob_drm_device *sdev);
47 void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc);
48 void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc);
49 void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc);
50 
51 int shmob_drm_encoder_create(struct shmob_drm_device *sdev);
52 int shmob_drm_connector_create(struct shmob_drm_device *sdev,
53 			       struct drm_encoder *encoder);
54 
55 #endif /* __SHMOB_DRM_CRTC_H__ */
56