vsp1_rwpf.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * vsp1_rwpf.h -- R-Car VSP1 Read and Write Pixel Formatters
  3. *
  4. * Copyright (C) 2013-2014 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_RWPF_H__
  14. #define __VSP1_RWPF_H__
  15. #include <linux/spinlock.h>
  16. #include <media/media-entity.h>
  17. #include <media/v4l2-ctrls.h>
  18. #include <media/v4l2-subdev.h>
  19. #include "vsp1.h"
  20. #include "vsp1_entity.h"
  21. #define RWPF_PAD_SINK 0
  22. #define RWPF_PAD_SOURCE 1
  23. struct v4l2_ctrl;
  24. struct vsp1_dl_manager;
  25. struct vsp1_pipeline;
  26. struct vsp1_rwpf;
  27. struct vsp1_video;
  28. struct vsp1_rwpf_memory {
  29. dma_addr_t addr[3];
  30. };
  31. struct vsp1_rwpf {
  32. struct vsp1_entity entity;
  33. struct v4l2_ctrl_handler ctrls;
  34. struct vsp1_pipeline *pipe;
  35. struct vsp1_video *video;
  36. unsigned int max_width;
  37. unsigned int max_height;
  38. struct v4l2_pix_format_mplane format;
  39. const struct vsp1_format_info *fmtinfo;
  40. unsigned int bru_input;
  41. unsigned int alpha;
  42. u32 mult_alpha;
  43. u32 outfmt;
  44. struct {
  45. spinlock_t lock;
  46. struct v4l2_ctrl *ctrls[2];
  47. unsigned int pending;
  48. unsigned int active;
  49. } flip;
  50. struct vsp1_rwpf_memory mem;
  51. struct vsp1_dl_manager *dlm;
  52. };
  53. static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev)
  54. {
  55. return container_of(subdev, struct vsp1_rwpf, entity.subdev);
  56. }
  57. static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity)
  58. {
  59. return container_of(entity, struct vsp1_rwpf, entity);
  60. }
  61. struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index);
  62. struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index);
  63. int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols);
  64. extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops;
  65. struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
  66. struct v4l2_subdev_pad_config *config);
  67. #endif /* __VSP1_RWPF_H__ */