blob: 929d35afbc209ca012567acb2ca5f813cceab43d [file] [log] [blame]
Rob Clarkcd5351f2011-11-12 12:09:40 -06001/*
Rob Clark8bb0daf2013-02-11 12:43:09 -05002 * drivers/gpu/drm/omapdrm/omap_drv.h
Rob Clarkcd5351f2011-11-12 12:09:40 -06003 *
4 * Copyright (C) 2011 Texas Instruments
5 * Author: Rob Clark <rob@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
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 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
Laurent Pinchartb5561412017-10-13 17:59:05 +030020#ifndef __OMAPDRM_DRV_H__
21#define __OMAPDRM_DRV_H__
Rob Clarkcd5351f2011-11-12 12:09:40 -060022
Rob Clarkcd5351f2011-11-12 12:09:40 -060023#include <linux/module.h>
24#include <linux/types.h>
Laurent Pincharta9e6f9f2017-05-09 01:27:10 +030025#include <linux/workqueue.h>
Laurent Pinchart2d278f52015-03-05 21:31:37 +020026
Rob Clarkcd5351f2011-11-12 12:09:40 -060027#include <drm/drmP.h>
Rob Clarkae43d7c2012-01-16 12:51:15 -060028#include <drm/drm_crtc_helper.h>
Daniel Vetterd9fc9412014-09-23 15:46:53 +020029#include <drm/drm_gem.h>
Laurent Pinchart2d278f52015-03-05 21:31:37 +020030#include <drm/omap_drm.h>
Rob Clarkf5f94542012-12-04 13:59:12 -060031
Tomi Valkeinen35a339a2016-02-19 16:54:36 +020032#include "dss/omapdss.h"
33
Laurent Pinchartb5561412017-10-13 17:59:05 +030034#include "omap_connector.h"
35#include "omap_crtc.h"
36#include "omap_encoder.h"
37#include "omap_fb.h"
38#include "omap_fbdev.h"
39#include "omap_gem.h"
40#include "omap_irq.h"
41#include "omap_plane.h"
42
Rob Clarkcd5351f2011-11-12 12:09:40 -060043#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
44#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
45
46#define MODULE_NAME "omapdrm"
47
Laurent Pinchartf4302742015-12-14 22:39:34 +020048struct omap_drm_usergart;
49
Rob Clarkcd5351f2011-11-12 12:09:40 -060050struct omap_drm_private {
Rob Clark5e3b0872012-10-29 09:31:12 +010051 uint32_t omaprev;
52
Tomi Valkeinen9f759222015-11-05 18:39:52 +020053 const struct dispc_ops *dispc_ops;
54
Rob Clarkcd5351f2011-11-12 12:09:40 -060055 unsigned int num_crtcs;
56 struct drm_crtc *crtcs[8];
Rob Clarkf6b60362012-03-05 10:48:36 -060057
Rob Clarkbb5c2d92012-01-16 12:51:16 -060058 unsigned int num_planes;
59 struct drm_plane *planes[8];
Rob Clarkf6b60362012-03-05 10:48:36 -060060
Rob Clarkcd5351f2011-11-12 12:09:40 -060061 unsigned int num_encoders;
62 struct drm_encoder *encoders[8];
Rob Clarkf6b60362012-03-05 10:48:36 -060063
Rob Clarkcd5351f2011-11-12 12:09:40 -060064 unsigned int num_connectors;
65 struct drm_connector *connectors[8];
66
67 struct drm_fb_helper *fbdev;
Rob Clarka6a91822011-12-09 23:26:08 -060068
Rob Clark5609f7f2012-03-05 10:48:32 -060069 struct workqueue_struct *wq;
70
Tomi Valkeinen76c40552014-12-17 14:34:22 +020071 /* lock for obj_list below */
72 spinlock_t list_lock;
73
Rob Clarkf5f94542012-12-04 13:59:12 -060074 /* list of GEM objects: */
Rob Clarkf6b60362012-03-05 10:48:36 -060075 struct list_head obj_list;
76
Laurent Pinchartf4302742015-12-14 22:39:34 +020077 struct omap_drm_usergart *usergart;
Rob Clarka6a91822011-12-09 23:26:08 -060078 bool has_dmm;
Rob Clark3c810c62012-08-15 15:18:01 -050079
80 /* properties: */
Andre Renaud8451b5a2012-08-15 15:18:02 -050081 struct drm_property *zorder_prop;
Rob Clarkf5f94542012-12-04 13:59:12 -060082
83 /* irq handling: */
Laurent Pinchart84e1d452016-04-19 03:07:59 +030084 spinlock_t wait_lock; /* protects the wait_list */
85 struct list_head wait_list; /* list of omap_irq_wait */
Laurent Pinchart80f91bf2016-04-19 02:47:02 +030086 uint32_t irq_mask; /* enabled irqs in addition to wait_list */
Peter Ujfalusia7631c42017-11-30 14:12:37 +020087
88 /* memory bandwidth limit if it is needed on the platform */
89 unsigned int max_bandwidth;
Rob Clark3c810c62012-08-15 15:18:01 -050090};
91
Rob Clark3c810c62012-08-15 15:18:01 -050092
Andy Gross6169a1482011-12-15 21:05:17 -060093int omap_debugfs_init(struct drm_minor *minor);
Andy Gross6169a1482011-12-15 21:05:17 -060094
Laurent Pinchartb5561412017-10-13 17:59:05 +030095#endif /* __OMAPDRM_DRV_H__ */