Linux-libre 5.3.12-gnu
[librecmc/linux-libre.git] / drivers / gpu / drm / shmobile / shmob_drm_crtc.h
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/drmP.h>
14 #include <drm/drm_crtc.h>
15 #include <drm/drm_encoder.h>
16
17 struct backlight_device;
18 struct shmob_drm_device;
19
20 struct shmob_drm_crtc {
21         struct drm_crtc crtc;
22
23         struct drm_pending_vblank_event *event;
24         int dpms;
25
26         const struct shmob_drm_format_info *format;
27         unsigned long dma[2];
28         unsigned int line_size;
29         bool started;
30 };
31
32 struct shmob_drm_encoder {
33         struct drm_encoder encoder;
34         int dpms;
35 };
36
37 struct shmob_drm_connector {
38         struct drm_connector connector;
39         struct drm_encoder *encoder;
40
41         struct backlight_device *backlight;
42 };
43
44 int shmob_drm_crtc_create(struct shmob_drm_device *sdev);
45 void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc);
46 void shmob_drm_crtc_suspend(struct shmob_drm_crtc *scrtc);
47 void shmob_drm_crtc_resume(struct shmob_drm_crtc *scrtc);
48
49 int shmob_drm_encoder_create(struct shmob_drm_device *sdev);
50 int shmob_drm_connector_create(struct shmob_drm_device *sdev,
51                                struct drm_encoder *encoder);
52
53 #endif /* __SHMOB_DRM_CRTC_H__ */