vsp1_video.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * vsp1_video.h -- R-Car VSP1 Video Node
  3. *
  4. * Copyright (C) 2013-2015 Renesas Electronics Corporation
  5. *
  6. * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef __VSP1_VIDEO_H__
  14. #define __VSP1_VIDEO_H__
  15. #include <linux/list.h>
  16. #include <linux/spinlock.h>
  17. #include <media/videobuf2-v4l2.h>
  18. #include "vsp1_rwpf.h"
  19. struct vsp1_vb2_buffer {
  20. struct vb2_v4l2_buffer buf;
  21. struct list_head queue;
  22. struct vsp1_rwpf_memory mem;
  23. };
  24. static inline struct vsp1_vb2_buffer *
  25. to_vsp1_vb2_buffer(struct vb2_v4l2_buffer *vbuf)
  26. {
  27. return container_of(vbuf, struct vsp1_vb2_buffer, buf);
  28. }
  29. struct vsp1_video {
  30. struct list_head list;
  31. struct vsp1_device *vsp1;
  32. struct vsp1_rwpf *rwpf;
  33. struct video_device video;
  34. enum v4l2_buf_type type;
  35. struct media_pad pad;
  36. struct mutex lock;
  37. unsigned int pipe_index;
  38. struct vb2_queue queue;
  39. spinlock_t irqlock;
  40. struct list_head irqqueue;
  41. };
  42. static inline struct vsp1_video *to_vsp1_video(struct video_device *vdev)
  43. {
  44. return container_of(vdev, struct vsp1_video, video);
  45. }
  46. struct vsp1_video *vsp1_video_create(struct vsp1_device *vsp1,
  47. struct vsp1_rwpf *rwpf);
  48. void vsp1_video_cleanup(struct vsp1_video *video);
  49. #endif /* __VSP1_VIDEO_H__ */