blob: 0ac97fe09f9b9049ed7ff3e5fda1b8892fab1631 [file] [log] [blame]
Rob Clarkcd5351f2011-11-12 12:09:40 -06001/*
Andrew F. Davisbb5cdf82017-12-05 14:29:31 -06002 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
Rob Clarkcd5351f2011-11-12 12:09:40 -06003 * Author: Rob Clark <rob@ti.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
Laurent Pinchartb5561412017-10-13 17:59:05 +030018#ifndef __OMAPDRM_DRV_H__
19#define __OMAPDRM_DRV_H__
Rob Clarkcd5351f2011-11-12 12:09:40 -060020
Rob Clarkcd5351f2011-11-12 12:09:40 -060021#include <linux/module.h>
22#include <linux/types.h>
Laurent Pincharta9e6f9f2017-05-09 01:27:10 +030023#include <linux/workqueue.h>
Laurent Pinchart2d278f52015-03-05 21:31:37 +020024
Rob Clarkcd5351f2011-11-12 12:09:40 -060025#include <drm/drmP.h>
Rob Clarkae43d7c2012-01-16 12:51:15 -060026#include <drm/drm_crtc_helper.h>
Daniel Vetterd9fc9412014-09-23 15:46:53 +020027#include <drm/drm_gem.h>
Laurent Pinchart2d278f52015-03-05 21:31:37 +020028#include <drm/omap_drm.h>
Rob Clarkf5f94542012-12-04 13:59:12 -060029
Tomi Valkeinen35a339a2016-02-19 16:54:36 +020030#include "dss/omapdss.h"
31
Laurent Pinchartb5561412017-10-13 17:59:05 +030032#include "omap_connector.h"
33#include "omap_crtc.h"
34#include "omap_encoder.h"
35#include "omap_fb.h"
36#include "omap_fbdev.h"
37#include "omap_gem.h"
38#include "omap_irq.h"
39#include "omap_plane.h"
40
Rob Clarkcd5351f2011-11-12 12:09:40 -060041#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
42#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
43
44#define MODULE_NAME "omapdrm"
45
Laurent Pinchartf4302742015-12-14 22:39:34 +020046struct omap_drm_usergart;
47
Rob Clarkcd5351f2011-11-12 12:09:40 -060048struct omap_drm_private {
Rob Clark5e3b0872012-10-29 09:31:12 +010049 uint32_t omaprev;
50
Tomi Valkeinen9f759222015-11-05 18:39:52 +020051 const struct dispc_ops *dispc_ops;
52
Rob Clarkcd5351f2011-11-12 12:09:40 -060053 unsigned int num_crtcs;
54 struct drm_crtc *crtcs[8];
Rob Clarkf6b60362012-03-05 10:48:36 -060055
Rob Clarkbb5c2d92012-01-16 12:51:16 -060056 unsigned int num_planes;
57 struct drm_plane *planes[8];
Rob Clarkf6b60362012-03-05 10:48:36 -060058
Rob Clarkcd5351f2011-11-12 12:09:40 -060059 unsigned int num_encoders;
60 struct drm_encoder *encoders[8];
Rob Clarkf6b60362012-03-05 10:48:36 -060061
Rob Clarkcd5351f2011-11-12 12:09:40 -060062 unsigned int num_connectors;
63 struct drm_connector *connectors[8];
64
65 struct drm_fb_helper *fbdev;
Rob Clarka6a91822011-12-09 23:26:08 -060066
Rob Clark5609f7f2012-03-05 10:48:32 -060067 struct workqueue_struct *wq;
68
Tomi Valkeinen76c40552014-12-17 14:34:22 +020069 /* lock for obj_list below */
70 spinlock_t list_lock;
71
Rob Clarkf5f94542012-12-04 13:59:12 -060072 /* list of GEM objects: */
Rob Clarkf6b60362012-03-05 10:48:36 -060073 struct list_head obj_list;
74
Laurent Pinchartf4302742015-12-14 22:39:34 +020075 struct omap_drm_usergart *usergart;
Rob Clarka6a91822011-12-09 23:26:08 -060076 bool has_dmm;
Rob Clark3c810c62012-08-15 15:18:01 -050077
78 /* properties: */
Andre Renaud8451b5a2012-08-15 15:18:02 -050079 struct drm_property *zorder_prop;
Rob Clarkf5f94542012-12-04 13:59:12 -060080
81 /* irq handling: */
Laurent Pinchart84e1d452016-04-19 03:07:59 +030082 spinlock_t wait_lock; /* protects the wait_list */
83 struct list_head wait_list; /* list of omap_irq_wait */
Laurent Pinchart80f91bf2016-04-19 02:47:02 +030084 uint32_t irq_mask; /* enabled irqs in addition to wait_list */
Peter Ujfalusia7631c42017-11-30 14:12:37 +020085
86 /* memory bandwidth limit if it is needed on the platform */
87 unsigned int max_bandwidth;
Rob Clark3c810c62012-08-15 15:18:01 -050088};
89
Rob Clark3c810c62012-08-15 15:18:01 -050090
Andy Gross6169a1482011-12-15 21:05:17 -060091int omap_debugfs_init(struct drm_minor *minor);
Andy Gross6169a1482011-12-15 21:05:17 -060092
Laurent Pinchartb5561412017-10-13 17:59:05 +030093#endif /* __OMAPDRM_DRV_H__ */