omap_drv.h 2.3 KB
Newer Older
1
/*
2
 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 * Author: Rob Clark <rob@ti.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 as published by
 * the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 */

18 19
#ifndef __OMAPDRM_DRV_H__
#define __OMAPDRM_DRV_H__
20 21 22

#include <linux/module.h>
#include <linux/types.h>
23
#include <linux/workqueue.h>
24

25
#include <drm/drmP.h>
26
#include <drm/drm_crtc_helper.h>
D
Daniel Vetter 已提交
27
#include <drm/drm_gem.h>
28
#include <drm/omap_drm.h>
29

30 31
#include "dss/omapdss.h"

32 33 34 35 36 37 38 39 40
#include "omap_connector.h"
#include "omap_crtc.h"
#include "omap_encoder.h"
#include "omap_fb.h"
#include "omap_fbdev.h"
#include "omap_gem.h"
#include "omap_irq.h"
#include "omap_plane.h"

41 42 43 44 45
#define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
#define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */

#define MODULE_NAME     "omapdrm"

46 47
struct omap_drm_usergart;

48
struct omap_drm_private {
49 50
	struct drm_device *ddev;
	struct device *dev;
51
	u32 omaprev;
52

T
Tomi Valkeinen 已提交
53 54
	const struct dispc_ops *dispc_ops;

55 56
	unsigned int num_crtcs;
	struct drm_crtc *crtcs[8];
57

58 59
	unsigned int num_planes;
	struct drm_plane *planes[8];
60

61 62
	unsigned int num_encoders;
	struct drm_encoder *encoders[8];
63

64 65 66 67
	unsigned int num_connectors;
	struct drm_connector *connectors[8];

	struct drm_fb_helper *fbdev;
68

R
Rob Clark 已提交
69 70
	struct workqueue_struct *wq;

71 72 73
	/* lock for obj_list below */
	spinlock_t list_lock;

74
	/* list of GEM objects: */
75 76
	struct list_head obj_list;

77
	struct omap_drm_usergart *usergart;
78
	bool has_dmm;
79 80

	/* properties: */
81
	struct drm_property *zorder_prop;
82 83

	/* irq handling: */
84 85
	spinlock_t wait_lock;		/* protects the wait_list */
	struct list_head wait_list;	/* list of omap_irq_wait */
86
	u32 irq_mask;			/* enabled irqs in addition to wait_list */
87 88 89

	/* memory bandwidth limit if it is needed on the platform */
	unsigned int max_bandwidth;
90 91 92
};


93
int omap_debugfs_init(struct drm_minor *minor);
94 95

#endif /* __OMAPDRM_DRV_H__ */