Linux Audio

Check our new training course

Loading...
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0-only */
  2/*
  3 * Copyright (C) 2011 Texas Instruments Incorporated - https://www.ti.com/
  4 * Author: Rob Clark <rob@ti.com>
  5 */
  6
  7#ifndef __OMAPDRM_DRV_H__
  8#define __OMAPDRM_DRV_H__
  9
 10#include <linux/module.h>
 11#include <linux/types.h>
 12#include <linux/workqueue.h>
 13
 14#include "dss/omapdss.h"
 15#include "dss/dss.h"
 16
 17#include <drm/drm_atomic.h>
 18#include <drm/drm_gem.h>
 19#include <drm/omap_drm.h>
 20
 
 21#include "omap_crtc.h"
 22#include "omap_encoder.h"
 23#include "omap_fb.h"
 
 24#include "omap_gem.h"
 25#include "omap_irq.h"
 26#include "omap_plane.h"
 27#include "omap_overlay.h"
 28
 29#define DBG(fmt, ...) DRM_DEBUG_DRIVER(fmt"\n", ##__VA_ARGS__)
 30#define VERB(fmt, ...) if (0) DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__) /* verbose debug */
 31
 32#define MODULE_NAME     "omapdrm"
 33
 34struct omap_drm_usergart;
 35struct omap_fbdev;
 36
 37struct omap_drm_pipeline {
 38	struct drm_crtc *crtc;
 39	struct drm_encoder *encoder;
 40	struct drm_connector *connector;
 41	struct omap_dss_device *output;
 42	unsigned int alias_id;
 43};
 44
 45/*
 46 * Global private object state for tracking resources that are shared across
 47 * multiple kms objects (planes/crtcs/etc).
 48 */
 49#define to_omap_global_state(x) container_of(x, struct omap_global_state, base)
 50
 51struct omap_global_state {
 52	struct drm_private_state base;
 53
 54	/* global atomic state of assignment between overlays and planes */
 55	struct drm_plane *hwoverlay_to_plane[8];
 56};
 57
 58struct omap_drm_private {
 59	struct drm_device *ddev;
 60	struct device *dev;
 61	u32 omaprev;
 62
 63	struct dss_device *dss;
 64	struct dispc_device *dispc;
 65
 66	bool irq_enabled;
 67
 68	unsigned int num_pipes;
 69	struct omap_drm_pipeline pipes[8];
 70	struct omap_drm_pipeline *channels[8];
 71
 72	unsigned int num_planes;
 73	struct drm_plane *planes[8];
 74
 75	unsigned int num_ovls;
 76	struct omap_hw_overlay *overlays[8];
 77
 78	struct drm_private_obj glob_obj;
 79
 80	struct workqueue_struct *wq;
 81
 82	/* lock for obj_list below */
 83	struct mutex list_lock;
 84
 85	/* list of GEM objects: */
 86	struct list_head obj_list;
 87
 88	struct omap_drm_usergart *usergart;
 89	bool has_dmm;
 90
 91	/* properties: */
 92	struct drm_property *zorder_prop;
 93
 94	/* irq handling: */
 95	spinlock_t wait_lock;		/* protects the wait_list */
 96	struct list_head wait_list;	/* list of omap_irq_wait */
 97	u32 irq_mask;			/* enabled irqs in addition to wait_list */
 98
 99	/* memory bandwidth limit if it is needed on the platform */
100	unsigned int max_bandwidth;
101
102	struct omap_fbdev *fbdev;
103};
104
105
106void omap_debugfs_init(struct drm_minor *minor);
107
108struct omap_global_state * __must_check omap_get_global_state(struct drm_atomic_state *s);
109
110struct omap_global_state *omap_get_existing_global_state(struct omap_drm_private *priv);
111
112#endif /* __OMAPDRM_DRV_H__ */
v5.4
 1/* SPDX-License-Identifier: GPL-2.0-only */
 2/*
 3 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 4 * Author: Rob Clark <rob@ti.com>
 5 */
 6
 7#ifndef __OMAPDRM_DRV_H__
 8#define __OMAPDRM_DRV_H__
 9
10#include <linux/module.h>
11#include <linux/types.h>
12#include <linux/workqueue.h>
13
14#include "dss/omapdss.h"
 
15
 
16#include <drm/drm_gem.h>
17#include <drm/omap_drm.h>
18
19#include "omap_connector.h"
20#include "omap_crtc.h"
21#include "omap_encoder.h"
22#include "omap_fb.h"
23#include "omap_fbdev.h"
24#include "omap_gem.h"
25#include "omap_irq.h"
26#include "omap_plane.h"
 
27
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 */
30
31#define MODULE_NAME     "omapdrm"
32
33struct omap_drm_usergart;
 
34
35struct 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;
41};
42
 
 
 
 
 
 
 
 
 
 
 
 
 
43struct omap_drm_private {
44	struct drm_device *ddev;
45	struct device *dev;
46	u32 omaprev;
47
48	struct dss_device *dss;
49	struct dispc_device *dispc;
50	const struct dispc_ops *dispc_ops;
 
51
52	unsigned int num_pipes;
53	struct omap_drm_pipeline pipes[8];
54	struct omap_drm_pipeline *channels[8];
55
56	unsigned int num_planes;
57	struct drm_plane *planes[8];
58
59	struct drm_fb_helper *fbdev;
 
 
 
60
61	struct workqueue_struct *wq;
62
63	/* lock for obj_list below */
64	struct mutex list_lock;
65
66	/* list of GEM objects: */
67	struct list_head obj_list;
68
69	struct omap_drm_usergart *usergart;
70	bool has_dmm;
71
72	/* properties: */
73	struct drm_property *zorder_prop;
74
75	/* irq handling: */
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 */
79
80	/* memory bandwidth limit if it is needed on the platform */
81	unsigned int max_bandwidth;
 
 
82};
83
84
85int omap_debugfs_init(struct drm_minor *minor);
 
 
 
 
86
87#endif /* __OMAPDRM_DRV_H__ */