dc_state.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2023 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: AMD
  23. *
  24. */
  25. #ifndef _DC_STATE_H_
  26. #define _DC_STATE_H_
  27. #include "dc.h"
  28. #include "inc/core_status.h"
  29. struct dc_state *dc_state_create(struct dc *dc, struct dc_state_create_params *params);
  30. void dc_state_copy(struct dc_state *dst_state, struct dc_state *src_state);
  31. struct dc_state *dc_state_create_copy(struct dc_state *src_state);
  32. void dc_state_copy_current(struct dc *dc, struct dc_state *dst_state);
  33. struct dc_state *dc_state_create_current_copy(struct dc *dc);
  34. void dc_state_construct(struct dc *dc, struct dc_state *state);
  35. void dc_state_destruct(struct dc_state *state);
  36. void dc_state_retain(struct dc_state *state);
  37. void dc_state_release(struct dc_state *state);
  38. enum dc_status dc_state_add_stream(const struct dc *dc,
  39. struct dc_state *state,
  40. struct dc_stream_state *stream);
  41. enum dc_status dc_state_remove_stream(
  42. const struct dc *dc,
  43. struct dc_state *state,
  44. struct dc_stream_state *stream);
  45. bool dc_state_add_plane(
  46. const struct dc *dc,
  47. struct dc_stream_state *stream,
  48. struct dc_plane_state *plane_state,
  49. struct dc_state *state);
  50. bool dc_state_remove_plane(
  51. const struct dc *dc,
  52. struct dc_stream_state *stream,
  53. struct dc_plane_state *plane_state,
  54. struct dc_state *state);
  55. bool dc_state_rem_all_planes_for_stream(
  56. const struct dc *dc,
  57. struct dc_stream_state *stream,
  58. struct dc_state *state);
  59. bool dc_state_add_all_planes_for_stream(
  60. const struct dc *dc,
  61. struct dc_stream_state *stream,
  62. struct dc_plane_state * const *plane_states,
  63. int plane_count,
  64. struct dc_state *state);
  65. struct dc_stream_status *dc_state_get_stream_status(
  66. struct dc_state *state,
  67. const struct dc_stream_state *stream);
  68. #endif /* _DC_STATE_H_ */