Linux Audio

Check our new training course

Loading...
v6.9.4
  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_PRIV_H_
 27#define _DC_STATE_PRIV_H_
 28
 29#include "dc_state.h"
 30#include "dc_stream.h"
 31
 
 
 32/* Get the type of the provided resource (none, phantom, main) based on the provided
 33 * context. If the context is unavailable, determine only if phantom or not.
 34 */
 35enum mall_stream_type dc_state_get_pipe_subvp_type(const struct dc_state *state,
 36		const struct pipe_ctx *pipe_ctx);
 37enum mall_stream_type dc_state_get_stream_subvp_type(const struct dc_state *state,
 38		const struct dc_stream_state *stream);
 39
 40/* Gets the phantom stream if main is provided, gets the main if phantom is provided.*/
 41struct dc_stream_state *dc_state_get_paired_subvp_stream(const struct dc_state *state,
 42		const struct dc_stream_state *stream);
 43
 44/* allocate's phantom stream or plane and returns pointer to the object */
 45struct dc_stream_state *dc_state_create_phantom_stream(const struct dc *dc,
 46		struct dc_state *state,
 47		struct dc_stream_state *main_stream);
 48struct dc_plane_state *dc_state_create_phantom_plane(struct dc *dc,
 49		struct dc_state *state,
 50		struct dc_plane_state *main_plane);
 51
 52/* deallocate's phantom stream or plane */
 53void dc_state_release_phantom_stream(const struct dc *dc,
 54		struct dc_state *state,
 55		struct dc_stream_state *phantom_stream);
 56void dc_state_release_phantom_plane(const struct dc *dc,
 57		struct dc_state *state,
 58		struct dc_plane_state *phantom_plane);
 59
 60/* add/remove phantom stream to context and generate subvp meta data */
 61enum dc_status dc_state_add_phantom_stream(struct dc *dc,
 62		struct dc_state *state,
 63		struct dc_stream_state *phantom_stream,
 64		struct dc_stream_state *main_stream);
 65enum dc_status dc_state_remove_phantom_stream(struct dc *dc,
 66		struct dc_state *state,
 67		struct dc_stream_state *phantom_stream);
 68
 69bool dc_state_add_phantom_plane(
 70		const struct dc *dc,
 71		struct dc_stream_state *phantom_stream,
 72		struct dc_plane_state *phantom_plane,
 73		struct dc_state *state);
 74
 75bool dc_state_remove_phantom_plane(
 76		const struct dc *dc,
 77		struct dc_stream_state *phantom_stream,
 78		struct dc_plane_state *phantom_plane,
 79		struct dc_state *state);
 80
 81bool dc_state_rem_all_phantom_planes_for_stream(
 82		const struct dc *dc,
 83		struct dc_stream_state *phantom_stream,
 84		struct dc_state *state,
 85		bool should_release_planes);
 86
 87bool dc_state_add_all_phantom_planes_for_stream(
 88		const struct dc *dc,
 89		struct dc_stream_state *phantom_stream,
 90		struct dc_plane_state * const *phantom_planes,
 91		int plane_count,
 92		struct dc_state *state);
 93
 94bool dc_state_remove_phantom_streams_and_planes(
 95		struct dc *dc,
 96		struct dc_state *state);
 97
 98void dc_state_release_phantom_streams_and_planes(
 99		struct dc *dc,
100		struct dc_state *state);
 
 
 
 
101
102#endif /* _DC_STATE_PRIV_H_ */
v6.13.7
  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_PRIV_H_
 27#define _DC_STATE_PRIV_H_
 28
 29#include "dc_state.h"
 30#include "dc_stream.h"
 31
 32struct dc_stream_state *dc_state_get_stream_from_id(const struct dc_state *state, unsigned int id);
 33
 34/* Get the type of the provided resource (none, phantom, main) based on the provided
 35 * context. If the context is unavailable, determine only if phantom or not.
 36 */
 37enum mall_stream_type dc_state_get_pipe_subvp_type(const struct dc_state *state,
 38		const struct pipe_ctx *pipe_ctx);
 39enum mall_stream_type dc_state_get_stream_subvp_type(const struct dc_state *state,
 40		const struct dc_stream_state *stream);
 41
 42/* Gets the phantom stream if main is provided, gets the main if phantom is provided.*/
 43struct dc_stream_state *dc_state_get_paired_subvp_stream(const struct dc_state *state,
 44		const struct dc_stream_state *stream);
 45
 46/* allocate's phantom stream or plane and returns pointer to the object */
 47struct dc_stream_state *dc_state_create_phantom_stream(const struct dc *dc,
 48		struct dc_state *state,
 49		struct dc_stream_state *main_stream);
 50struct dc_plane_state *dc_state_create_phantom_plane(const struct dc *dc,
 51		struct dc_state *state,
 52		struct dc_plane_state *main_plane);
 53
 54/* deallocate's phantom stream or plane */
 55void dc_state_release_phantom_stream(const struct dc *dc,
 56		struct dc_state *state,
 57		struct dc_stream_state *phantom_stream);
 58void dc_state_release_phantom_plane(const struct dc *dc,
 59		struct dc_state *state,
 60		struct dc_plane_state *phantom_plane);
 61
 62/* add/remove phantom stream to context and generate subvp meta data */
 63enum dc_status dc_state_add_phantom_stream(const struct dc *dc,
 64		struct dc_state *state,
 65		struct dc_stream_state *phantom_stream,
 66		struct dc_stream_state *main_stream);
 67enum dc_status dc_state_remove_phantom_stream(const struct dc *dc,
 68		struct dc_state *state,
 69		struct dc_stream_state *phantom_stream);
 70
 71bool dc_state_add_phantom_plane(
 72		const struct dc *dc,
 73		struct dc_stream_state *phantom_stream,
 74		struct dc_plane_state *phantom_plane,
 75		struct dc_state *state);
 76
 77bool dc_state_remove_phantom_plane(
 78		const struct dc *dc,
 79		struct dc_stream_state *phantom_stream,
 80		struct dc_plane_state *phantom_plane,
 81		struct dc_state *state);
 82
 83bool dc_state_rem_all_phantom_planes_for_stream(
 84		const struct dc *dc,
 85		struct dc_stream_state *phantom_stream,
 86		struct dc_state *state,
 87		bool should_release_planes);
 88
 89bool dc_state_add_all_phantom_planes_for_stream(
 90		const struct dc *dc,
 91		struct dc_stream_state *phantom_stream,
 92		struct dc_plane_state * const *phantom_planes,
 93		int plane_count,
 94		struct dc_state *state);
 95
 96bool dc_state_remove_phantom_streams_and_planes(
 97		const struct dc *dc,
 98		struct dc_state *state);
 99
100void dc_state_release_phantom_streams_and_planes(
101		const struct dc *dc,
102		struct dc_state *state);
103
104bool dc_state_is_fams2_in_use(
105		const struct dc *dc,
106		const struct dc_state *state);
107
108#endif /* _DC_STATE_PRIV_H_ */