aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_drv.h')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_drv.h38
1 files changed, 30 insertions, 8 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 13540de90bfc..fbd0a232c93d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -32,9 +32,9 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include "drm.h" 33#include "drm.h"
34 34
35#define MAX_CRTC 2 35#define MAX_CRTC 3
36#define MAX_PLANE 5 36#define MAX_PLANE 5
37#define MAX_FB_BUFFER 3 37#define MAX_FB_BUFFER 4
38#define DEFAULT_ZPOS -1 38#define DEFAULT_ZPOS -1
39 39
40struct drm_device; 40struct drm_device;
@@ -50,6 +50,8 @@ enum exynos_drm_output_type {
50 EXYNOS_DISPLAY_TYPE_LCD, 50 EXYNOS_DISPLAY_TYPE_LCD,
51 /* HDMI Interface. */ 51 /* HDMI Interface. */
52 EXYNOS_DISPLAY_TYPE_HDMI, 52 EXYNOS_DISPLAY_TYPE_HDMI,
53 /* Virtual Display Interface. */
54 EXYNOS_DISPLAY_TYPE_VIDI,
53}; 55};
54 56
55/* 57/*
@@ -155,8 +157,10 @@ struct exynos_drm_display_ops {
155 * 157 *
156 * @dpms: control device power. 158 * @dpms: control device power.
157 * @apply: set timing, vblank and overlay data to registers. 159 * @apply: set timing, vblank and overlay data to registers.
160 * @mode_fixup: fix mode data comparing to hw specific display mode.
158 * @mode_set: convert drm_display_mode to hw specific display mode and 161 * @mode_set: convert drm_display_mode to hw specific display mode and
159 * would be called by encoder->mode_set(). 162 * would be called by encoder->mode_set().
163 * @get_max_resol: get maximum resolution to specific hardware.
160 * @commit: set current hw specific display mode to hw. 164 * @commit: set current hw specific display mode to hw.
161 * @enable_vblank: specific driver callback for enabling vblank interrupt. 165 * @enable_vblank: specific driver callback for enabling vblank interrupt.
162 * @disable_vblank: specific driver callback for disabling vblank interrupt. 166 * @disable_vblank: specific driver callback for disabling vblank interrupt.
@@ -164,7 +168,13 @@ struct exynos_drm_display_ops {
164struct exynos_drm_manager_ops { 168struct exynos_drm_manager_ops {
165 void (*dpms)(struct device *subdrv_dev, int mode); 169 void (*dpms)(struct device *subdrv_dev, int mode);
166 void (*apply)(struct device *subdrv_dev); 170 void (*apply)(struct device *subdrv_dev);
171 void (*mode_fixup)(struct device *subdrv_dev,
172 struct drm_connector *connector,
173 struct drm_display_mode *mode,
174 struct drm_display_mode *adjusted_mode);
167 void (*mode_set)(struct device *subdrv_dev, void *mode); 175 void (*mode_set)(struct device *subdrv_dev, void *mode);
176 void (*get_max_resol)(struct device *subdrv_dev, unsigned int *width,
177 unsigned int *height);
168 void (*commit)(struct device *subdrv_dev); 178 void (*commit)(struct device *subdrv_dev);
169 int (*enable_vblank)(struct device *subdrv_dev); 179 int (*enable_vblank)(struct device *subdrv_dev);
170 void (*disable_vblank)(struct device *subdrv_dev); 180 void (*disable_vblank)(struct device *subdrv_dev);
@@ -217,10 +227,13 @@ struct exynos_drm_private {
217 * @list: sub driver has its own list object to register to exynos drm driver. 227 * @list: sub driver has its own list object to register to exynos drm driver.
218 * @drm_dev: pointer to drm_device and this pointer would be set 228 * @drm_dev: pointer to drm_device and this pointer would be set
219 * when sub driver calls exynos_drm_subdrv_register(). 229 * when sub driver calls exynos_drm_subdrv_register().
230 * @is_local: appear encoder and connector disrelated device.
220 * @probe: this callback would be called by exynos drm driver after 231 * @probe: this callback would be called by exynos drm driver after
221 * subdrv is registered to it. 232 * subdrv is registered to it.
222 * @remove: this callback is used to release resources created 233 * @remove: this callback is used to release resources created
223 * by probe callback. 234 * by probe callback.
235 * @open: this would be called with drm device file open.
236 * @close: this would be called with drm device file close.
224 * @manager: subdrv has its own manager to control a hardware appropriately 237 * @manager: subdrv has its own manager to control a hardware appropriately
225 * and we can access a hardware drawing on this manager. 238 * and we can access a hardware drawing on this manager.
226 * @encoder: encoder object owned by this sub driver. 239 * @encoder: encoder object owned by this sub driver.
@@ -229,9 +242,14 @@ struct exynos_drm_private {
229struct exynos_drm_subdrv { 242struct exynos_drm_subdrv {
230 struct list_head list; 243 struct list_head list;
231 struct drm_device *drm_dev; 244 struct drm_device *drm_dev;
245 bool is_local;
232 246
233 int (*probe)(struct drm_device *drm_dev, struct device *dev); 247 int (*probe)(struct drm_device *drm_dev, struct device *dev);
234 void (*remove)(struct drm_device *dev); 248 void (*remove)(struct drm_device *dev);
249 int (*open)(struct drm_device *drm_dev, struct device *dev,
250 struct drm_file *file);
251 void (*close)(struct drm_device *drm_dev, struct device *dev,
252 struct drm_file *file);
235 253
236 struct exynos_drm_manager manager; 254 struct exynos_drm_manager manager;
237 struct drm_encoder *encoder; 255 struct drm_encoder *encoder;
@@ -254,15 +272,19 @@ int exynos_drm_device_unregister(struct drm_device *dev);
254 * this function would be called by sub drivers such as display controller 272 * this function would be called by sub drivers such as display controller
255 * or hdmi driver to register this sub driver object to exynos drm driver 273 * or hdmi driver to register this sub driver object to exynos drm driver
256 * and when a sub driver is registered to exynos drm driver a probe callback 274 * and when a sub driver is registered to exynos drm driver a probe callback
257 * of the sub driver is called and creates its own encoder and connector 275 * of the sub driver is called and creates its own encoder and connector.
258 * and then fb helper and drm mode group would be re-initialized.
259 */ 276 */
260int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv); 277int exynos_drm_subdrv_register(struct exynos_drm_subdrv *drm_subdrv);
261 278
262/* 279/* this function removes subdrv list from exynos drm driver */
263 * this function removes subdrv list from exynos drm driver and fb helper
264 * and drm mode group would be re-initialized.
265 */
266int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv); 280int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *drm_subdrv);
267 281
282int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file);
283void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file);
284
285extern struct platform_driver fimd_driver;
286extern struct platform_driver hdmi_driver;
287extern struct platform_driver mixer_driver;
288extern struct platform_driver exynos_drm_common_hdmi_driver;
289extern struct platform_driver vidi_driver;
268#endif 290#endif