aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/inc/resource.h
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2017-09-12 15:58:20 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:01:32 -0400
commit4562236b3bc0a28aeb6ee93b2d8a849a4c4e1c7c (patch)
tree84301c04dcaaa05c3318a8fe62cf62ab52ecc162 /drivers/gpu/drm/amd/display/dc/inc/resource.h
parent9c5b2b0d409304c2e3c1f4d1c9bb4958e1d46f8f (diff)
drm/amd/dc: Add dc display driver (v2)
Supported DCE versions: 8.0, 10.0, 11.0, 11.2 v2: rebase against 4.11 Signed-off-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/inc/resource.h')
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/resource.h164
1 files changed, 164 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/inc/resource.h b/drivers/gpu/drm/amd/display/dc/inc/resource.h
new file mode 100644
index 000000000000..8dd676de6b07
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/inc/resource.h
@@ -0,0 +1,164 @@
1/*
2 * Copyright 2015 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 DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_
26#define DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_
27
28#include "core_types.h"
29#include "core_status.h"
30#include "core_dc.h"
31#include "dal_asic_id.h"
32
33/* TODO unhardcode, 4 for CZ*/
34#define MEMORY_TYPE_MULTIPLIER 4
35
36enum dce_version resource_parse_asic_id(
37 struct hw_asic_id asic_id);
38
39struct resource_caps {
40 int num_timing_generator;
41 int num_video_plane;
42 int num_audio;
43 int num_stream_encoder;
44 int num_pll;
45};
46
47struct resource_straps {
48 uint32_t hdmi_disable;
49 uint32_t dc_pinstraps_audio;
50 uint32_t audio_stream_number;
51};
52
53struct resource_create_funcs {
54 void (*read_dce_straps)(
55 struct dc_context *ctx, struct resource_straps *straps);
56
57 struct audio *(*create_audio)(
58 struct dc_context *ctx, unsigned int inst);
59
60 struct stream_encoder *(*create_stream_encoder)(
61 enum engine_id eng_id, struct dc_context *ctx);
62
63 struct dce_hwseq *(*create_hwseq)(
64 struct dc_context *ctx);
65};
66
67bool resource_construct(
68 unsigned int num_virtual_links,
69 struct core_dc *dc,
70 struct resource_pool *pool,
71 const struct resource_create_funcs *create_funcs);
72
73struct resource_pool *dc_create_resource_pool(
74 struct core_dc *dc,
75 int num_virtual_links,
76 enum dce_version dc_version,
77 struct hw_asic_id asic_id);
78
79void dc_destroy_resource_pool(struct core_dc *dc);
80
81enum dc_status resource_map_pool_resources(
82 const struct core_dc *dc,
83 struct validate_context *context);
84
85bool resource_build_scaling_params(
86 const struct dc_surface *surface,
87 struct pipe_ctx *pipe_ctx);
88
89enum dc_status resource_build_scaling_params_for_context(
90 const struct core_dc *dc,
91 struct validate_context *context);
92
93void resource_build_info_frame(struct pipe_ctx *pipe_ctx);
94
95void resource_unreference_clock_source(
96 struct resource_context *res_ctx,
97 struct clock_source *clock_source);
98
99void resource_reference_clock_source(
100 struct resource_context *res_ctx,
101 struct clock_source *clock_source);
102
103bool resource_are_streams_timing_synchronizable(
104 const struct core_stream *stream1,
105 const struct core_stream *stream2);
106
107struct clock_source *resource_find_used_clk_src_for_sharing(
108 struct resource_context *res_ctx,
109 struct pipe_ctx *pipe_ctx);
110
111struct clock_source *dc_resource_find_first_free_pll(
112 struct resource_context *res_ctx);
113
114struct pipe_ctx *resource_get_head_pipe_for_stream(
115 struct resource_context *res_ctx,
116 const struct core_stream *stream);
117
118bool resource_attach_surfaces_to_context(
119 const struct dc_surface *const *surfaces,
120 int surface_count,
121 const struct dc_target *dc_target,
122 struct validate_context *context);
123
124struct pipe_ctx *find_idle_secondary_pipe(struct resource_context *res_ctx);
125
126bool resource_is_stream_unchanged(
127 const struct validate_context *old_context, struct core_stream *stream);
128
129bool is_target_unchanged(
130 const struct core_target *old_target, const struct core_target *target);
131bool resource_validate_attach_surfaces(
132 const struct dc_validation_set set[],
133 int set_count,
134 const struct validate_context *old_context,
135 struct validate_context *context);
136
137void validate_guaranteed_copy_target(
138 struct validate_context *context,
139 int max_targets);
140
141void resource_validate_ctx_update_pointer_after_copy(
142 const struct validate_context *src_ctx,
143 struct validate_context *dst_ctx);
144
145void resource_validate_ctx_copy_construct(
146 const struct validate_context *src_ctx,
147 struct validate_context *dst_ctx);
148
149void resource_validate_ctx_destruct(struct validate_context *context);
150
151enum dc_status resource_map_clock_resources(
152 const struct core_dc *dc,
153 struct validate_context *context);
154
155enum dc_status resource_map_phy_clock_resources(
156 const struct core_dc *dc,
157 struct validate_context *context);
158
159bool pipe_need_reprogram(
160 struct pipe_ctx *pipe_ctx_old,
161 struct pipe_ctx *pipe_ctx);
162
163
164#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */