rocket_device.h 794 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright 2024-2025 Tomeu Vizoso <tomeu@tomeuvizoso.net> */
  3. #ifndef __ROCKET_DEVICE_H__
  4. #define __ROCKET_DEVICE_H__
  5. #include <drm/drm_device.h>
  6. #include <linux/clk.h>
  7. #include <linux/container_of.h>
  8. #include <linux/iommu.h>
  9. #include <linux/platform_device.h>
  10. #include "rocket_core.h"
  11. struct rocket_device {
  12. struct drm_device ddev;
  13. struct mutex sched_lock;
  14. struct rocket_core *cores;
  15. unsigned int num_cores;
  16. };
  17. struct rocket_device *rocket_device_init(struct platform_device *pdev,
  18. const struct drm_driver *rocket_drm_driver);
  19. void rocket_device_fini(struct rocket_device *rdev);
  20. #define to_rocket_device(drm_dev) \
  21. ((struct rocket_device *)(container_of((drm_dev), struct rocket_device, ddev)))
  22. #endif /* __ROCKET_DEVICE_H__ */