omap_drv.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
  3. * 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. #ifndef __OMAPDRM_DRV_H__
  18. #define __OMAPDRM_DRV_H__
  19. #include <linux/module.h>
  20. #include <linux/types.h>
  21. #include <linux/workqueue.h>
  22. #include <drm/drmP.h>
  23. #include <drm/drm_crtc_helper.h>
  24. #include <drm/drm_gem.h>
  25. #include <drm/omap_drm.h>
  26. #include "dss/omapdss.h"
  27. #include "omap_connector.h"
  28. #include "omap_crtc.h"
  29. #include "omap_encoder.h"
  30. #include "omap_fb.h"
  31. #include "omap_fbdev.h"
  32. #include "omap_gem.h"
  33. #include "omap_irq.h"
  34. #include "omap_plane.h"
  35. #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
  36. #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
  37. #define MODULE_NAME "omapdrm"
  38. struct omap_drm_usergart;
  39. struct omap_drm_private {
  40. struct drm_device *ddev;
  41. struct device *dev;
  42. u32 omaprev;
  43. struct dss_device *dss;
  44. struct dispc_device *dispc;
  45. const struct dispc_ops *dispc_ops;
  46. unsigned int num_crtcs;
  47. struct drm_crtc *crtcs[8];
  48. unsigned int num_planes;
  49. struct drm_plane *planes[8];
  50. unsigned int num_encoders;
  51. struct drm_encoder *encoders[8];
  52. unsigned int num_connectors;
  53. struct drm_connector *connectors[8];
  54. struct drm_fb_helper *fbdev;
  55. struct workqueue_struct *wq;
  56. /* lock for obj_list below */
  57. spinlock_t list_lock;
  58. /* list of GEM objects: */
  59. struct list_head obj_list;
  60. struct omap_drm_usergart *usergart;
  61. bool has_dmm;
  62. /* properties: */
  63. struct drm_property *zorder_prop;
  64. /* irq handling: */
  65. spinlock_t wait_lock; /* protects the wait_list */
  66. struct list_head wait_list; /* list of omap_irq_wait */
  67. u32 irq_mask; /* enabled irqs in addition to wait_list */
  68. /* memory bandwidth limit if it is needed on the platform */
  69. unsigned int max_bandwidth;
  70. };
  71. int omap_debugfs_init(struct drm_minor *minor);
  72. #endif /* __OMAPDRM_DRV_H__ */