omap_drv.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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_pipeline {
  40. struct drm_crtc *crtc;
  41. struct drm_encoder *encoder;
  42. struct drm_connector *connector;
  43. struct omap_dss_device *output;
  44. struct omap_dss_device *display;
  45. };
  46. struct omap_drm_private {
  47. struct drm_device *ddev;
  48. struct device *dev;
  49. u32 omaprev;
  50. struct dss_device *dss;
  51. struct dispc_device *dispc;
  52. const struct dispc_ops *dispc_ops;
  53. unsigned int num_pipes;
  54. struct omap_drm_pipeline pipes[8];
  55. struct omap_drm_pipeline *channels[8];
  56. unsigned int num_planes;
  57. struct drm_plane *planes[8];
  58. struct drm_fb_helper *fbdev;
  59. struct workqueue_struct *wq;
  60. /* lock for obj_list below */
  61. struct mutex list_lock;
  62. /* list of GEM objects: */
  63. struct list_head obj_list;
  64. struct omap_drm_usergart *usergart;
  65. bool has_dmm;
  66. /* properties: */
  67. struct drm_property *zorder_prop;
  68. /* irq handling: */
  69. spinlock_t wait_lock; /* protects the wait_list */
  70. struct list_head wait_list; /* list of omap_irq_wait */
  71. u32 irq_mask; /* enabled irqs in addition to wait_list */
  72. /* memory bandwidth limit if it is needed on the platform */
  73. unsigned int max_bandwidth;
  74. };
  75. int omap_debugfs_init(struct drm_minor *minor);
  76. #endif /* __OMAPDRM_DRV_H__ */