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>
15 #include <drm/drm_gem.h>
16 #include <drm/omap_drm.h>
18 #include "dss/omapdss.h"
20 #include "omap_connector.h"
21 #include "omap_crtc.h"
22 #include "omap_encoder.h"
24 #include "omap_fbdev.h"
27 #include "omap_plane.h"
29 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
30 #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
32 #define MODULE_NAME "omapdrm"
34 struct omap_drm_usergart;
36 struct omap_drm_pipeline {
37 struct drm_crtc *crtc;
38 struct drm_encoder *encoder;
39 struct drm_connector *connector;
40 struct omap_dss_device *output;
41 unsigned int alias_id;
44 struct omap_drm_private {
45 struct drm_device *ddev;
49 struct dss_device *dss;
50 struct dispc_device *dispc;
51 const struct dispc_ops *dispc_ops;
53 unsigned int num_pipes;
54 struct omap_drm_pipeline pipes[8];
55 struct omap_drm_pipeline *channels[8];
57 unsigned int num_planes;
58 struct drm_plane *planes[8];
60 struct drm_fb_helper *fbdev;
62 struct workqueue_struct *wq;
64 /* lock for obj_list below */
65 struct mutex list_lock;
67 /* list of GEM objects: */
68 struct list_head obj_list;
70 struct omap_drm_usergart *usergart;
74 struct drm_property *zorder_prop;
77 spinlock_t wait_lock; /* protects the wait_list */
78 struct list_head wait_list; /* list of omap_irq_wait */
79 u32 irq_mask; /* enabled irqs in addition to wait_list */
81 /* memory bandwidth limit if it is needed on the platform */
82 unsigned int max_bandwidth;
86 int omap_debugfs_init(struct drm_minor *minor);
88 #endif /* __OMAPDRM_DRV_H__ */