d97dd7b1fa6276f882b92604039677a071238b7e
[platform/kernel/linux-amlogic.git] / drivers / amlogic / drm / meson_crtc.h
1 /*
2  * drivers/amlogic/drm/meson_crtc.h
3  *
4  * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  */
17
18 #ifndef __MESON_CRTC_H
19 #define __MESON_CRTC_H
20
21 #include <linux/kernel.h>
22 #include <drm/drmP.h>
23 #include <drm/drm_plane.h>
24 #include <drm/drm_atomic.h>
25 #include <drm/drm_atomic_helper.h>
26 #include <linux/amlogic/media/vout/vout_notify.h>
27 #ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT
28 #include <linux/amlogic/media/amvecm/amvecm.h>
29 #endif
30 #include "osd.h"
31 #include "osd_drm.h"
32 #include "meson_vpu.h"
33 #include "meson_drv.h"
34 #include "meson_fb.h"
35
36 struct am_meson_crtc_state {
37         struct drm_crtc_state base;
38 };
39
40 struct am_meson_crtc {
41         struct drm_crtc base;
42         struct device *dev;
43         struct drm_device *drm_dev;
44
45         struct meson_drm *priv;
46
47         struct drm_pending_vblank_event *event;
48
49         unsigned int vblank_irq;
50         spinlock_t vblank_irq_lock;/*atomic*/
51         u32 vblank_enable;
52
53         struct dentry *crtc_debugfs_dir;
54
55         struct meson_vpu_pipeline *pipeline;
56
57         int dump_enable;
58         int blank_enable;
59         int dump_counts;
60         int dump_index;
61         char osddump_path[64];
62 };
63
64 #define to_am_meson_crtc(x) container_of(x, \
65                 struct am_meson_crtc, base)
66 #define to_am_meson_crtc_state(x) container_of(x, \
67                 struct am_meson_crtc_state, base)
68
69 int am_meson_crtc_create(struct am_meson_crtc *amcrtc);
70
71 #endif