hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/gpu/drm/exynos/exynos_drm_drv.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /* exynos_drm_drv.h
23 *
34 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
....@@ -5,24 +6,25 @@
56 * Inki Dae <inki.dae@samsung.com>
67 * Joonyoung Shim <jy0922.shim@samsung.com>
78 * Seung-Woo Kim <sw0312.kim@samsung.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License as published by the
11
- * Free Software Foundation; either version 2 of the License, or (at your
12
- * option) any later version.
139 */
1410
1511 #ifndef _EXYNOS_DRM_DRV_H_
1612 #define _EXYNOS_DRM_DRV_H_
1713
18
-#include <drm/drmP.h>
1914 #include <linux/module.h>
15
+
16
+#include <drm/drm_crtc.h>
17
+#include <drm/drm_device.h>
18
+#include <drm/drm_plane.h>
2019
2120 #define MAX_CRTC 3
2221 #define MAX_PLANE 5
2322 #define MAX_FB_BUFFER 4
2423
2524 #define DEFAULT_WIN 0
25
+
26
+struct drm_crtc_state;
27
+struct drm_display_mode;
2628
2729 #define to_exynos_crtc(x) container_of(x, struct exynos_drm_crtc, base)
2830 #define to_exynos_plane(x) container_of(x, struct exynos_drm_plane, base)
....@@ -92,6 +94,8 @@
9294 #define EXYNOS_DRM_PLANE_CAP_SCALE (1 << 1)
9395 #define EXYNOS_DRM_PLANE_CAP_ZPOS (1 << 2)
9496 #define EXYNOS_DRM_PLANE_CAP_TILE (1 << 3)
97
+#define EXYNOS_DRM_PLANE_CAP_PIX_BLEND (1 << 4)
98
+#define EXYNOS_DRM_PLANE_CAP_WIN_BLEND (1 << 5)
9599
96100 /*
97101 * Exynos DRM plane configuration structure.
....@@ -114,8 +118,8 @@
114118 /*
115119 * Exynos drm crtc ops
116120 *
117
- * @enable: enable the device
118
- * @disable: disable the device
121
+ * @atomic_enable: enable the device
122
+ * @atomic_disable: disable the device
119123 * @enable_vblank: specific driver callback for enabling vblank interrupt.
120124 * @disable_vblank: specific driver callback for disabling vblank interrupt.
121125 * @mode_valid: specific driver callback for mode validation
....@@ -129,8 +133,8 @@
129133 */
130134 struct exynos_drm_crtc;
131135 struct exynos_drm_crtc_ops {
132
- void (*enable)(struct exynos_drm_crtc *crtc);
133
- void (*disable)(struct exynos_drm_crtc *crtc);
136
+ void (*atomic_enable)(struct exynos_drm_crtc *crtc);
137
+ void (*atomic_disable)(struct exynos_drm_crtc *crtc);
134138 int (*enable_vblank)(struct exynos_drm_crtc *crtc);
135139 void (*disable_vblank)(struct exynos_drm_crtc *crtc);
136140 enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc,
....@@ -194,7 +198,6 @@
194198 */
195199 struct exynos_drm_private {
196200 struct drm_fb_helper *fb_helper;
197
- struct drm_atomic_state *suspend_state;
198201
199202 struct device *g2d_dev;
200203 struct device *dma_dev;
....@@ -213,6 +216,19 @@
213216 return priv->dma_dev;
214217 }
215218
219
+static inline bool is_drm_iommu_supported(struct drm_device *drm_dev)
220
+{
221
+ struct exynos_drm_private *priv = drm_dev->dev_private;
222
+
223
+ return priv->mapping ? true : false;
224
+}
225
+
226
+int exynos_drm_register_dma(struct drm_device *drm, struct device *dev,
227
+ void **dma_priv);
228
+void exynos_drm_unregister_dma(struct drm_device *drm, struct device *dev,
229
+ void **dma_priv);
230
+void exynos_drm_cleanup_dma(struct drm_device *drm);
231
+
216232 #ifdef CONFIG_DRM_EXYNOS_DPI
217233 struct drm_encoder *exynos_dpi_probe(struct device *dev);
218234 int exynos_dpi_remove(struct drm_encoder *encoder);