1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
4 * Author: Rob Clark <rob@ti.com>
7 #ifndef __OMAPDRM_DRV_H__
8 #define __OMAPDRM_DRV_H__
10 #include <linux/module.h>
11 #include <linux/types.h>
12 #include <linux/workqueue.h>
14 #include "dss/omapdss.h"
16 #include <drm/drm_gem.h>
17 #include <drm/omap_drm.h>
19 #include "omap_connector.h"
20 #include "omap_crtc.h"
21 #include "omap_encoder.h"
23 #include "omap_fbdev.h"
26 #include "omap_plane.h"
28 #define DBG(fmt, ...) DRM_DEBUG_DRIVER(fmt"\n", ##__VA_ARGS__)
29 #define VERB(fmt, ...) if (0) DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__) /* verbose debug */
31 #define MODULE_NAME "omapdrm"
33 struct omap_drm_usergart;
35 struct omap_drm_pipeline {
36 struct drm_crtc *crtc;
37 struct drm_encoder *encoder;
38 struct drm_connector *connector;
39 struct omap_dss_device *output;
40 unsigned int alias_id;
43 struct omap_drm_private {
44 struct drm_device *ddev;
48 struct dss_device *dss;
49 struct dispc_device *dispc;
50 const struct dispc_ops *dispc_ops;
52 unsigned int num_pipes;
53 struct omap_drm_pipeline pipes[8];
54 struct omap_drm_pipeline *channels[8];
56 unsigned int num_planes;
57 struct drm_plane *planes[8];
59 struct drm_fb_helper *fbdev;
61 struct workqueue_struct *wq;
63 /* lock for obj_list below */
64 struct mutex list_lock;
66 /* list of GEM objects: */
67 struct list_head obj_list;
69 struct omap_drm_usergart *usergart;
73 struct drm_property *zorder_prop;
76 spinlock_t wait_lock; /* protects the wait_list */
77 struct list_head wait_list; /* list of omap_irq_wait */
78 u32 irq_mask; /* enabled irqs in addition to wait_list */
80 /* memory bandwidth limit if it is needed on the platform */
81 unsigned int max_bandwidth;
85 int omap_debugfs_init(struct drm_minor *minor);
87 #endif /* __OMAPDRM_DRV_H__ */