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
26#ifndef _DC_STATE_H_
27#define _DC_STATE_H_
28
29#include "dc.h"
30#include "inc/core_status.h"
31
32struct dc_state *dc_state_create(struct dc *dc);
33void dc_state_copy(struct dc_state *dst_state, struct dc_state *src_state);
34struct dc_state *dc_state_create_copy(struct dc_state *src_state);
35void dc_state_copy_current(struct dc *dc, struct dc_state *dst_state);
36struct dc_state *dc_state_create_current_copy(struct dc *dc);
37void dc_state_construct(struct dc *dc, struct dc_state *state);
38void dc_state_destruct(struct dc_state *state);
39void dc_state_retain(struct dc_state *state);
40void dc_state_release(struct dc_state *state);
41
42enum dc_status dc_state_add_stream(struct dc *dc,
43				    struct dc_state *state,
44				    struct dc_stream_state *stream);
45
46enum dc_status dc_state_remove_stream(
47		struct dc *dc,
48		struct dc_state *state,
49		struct dc_stream_state *stream);
50
51bool dc_state_add_plane(
52		const struct dc *dc,
53		struct dc_stream_state *stream,
54		struct dc_plane_state *plane_state,
55		struct dc_state *state);
56
57bool dc_state_remove_plane(
58		const struct dc *dc,
59		struct dc_stream_state *stream,
60		struct dc_plane_state *plane_state,
61		struct dc_state *state);
62
63bool dc_state_rem_all_planes_for_stream(
64		const struct dc *dc,
65		struct dc_stream_state *stream,
66		struct dc_state *state);
67
68bool dc_state_add_all_planes_for_stream(
69		const struct dc *dc,
70		struct dc_stream_state *stream,
71		struct dc_plane_state * const *plane_states,
72		int plane_count,
73		struct dc_state *state);
74
75struct dc_stream_status *dc_state_get_stream_status(
76	struct dc_state *state,
77	struct dc_stream_state *stream);
78#endif /* _DC_STATE_H_ */
79