Commit 786b4061 authored by Wenjing Liu's avatar Wenjing Liu Committed by Alex Deucher

drm/amd/display: minor restructuring of pbn calculation functions

Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
Acked-by: default avatarBindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent aceeeea3
...@@ -2818,15 +2818,12 @@ static struct fixed31_32 get_pbn_per_slot(struct dc_stream_state *stream) ...@@ -2818,15 +2818,12 @@ static struct fixed31_32 get_pbn_per_slot(struct dc_stream_state *stream)
return dc_fixpt_div_int(mbytes_per_sec, 54); return dc_fixpt_div_int(mbytes_per_sec, 54);
} }
static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx) static struct fixed31_32 get_pbn_from_bw_in_kbps(uint64_t kbps)
{ {
uint64_t kbps;
struct fixed31_32 peak_kbps; struct fixed31_32 peak_kbps;
uint32_t numerator; uint32_t numerator;
uint32_t denominator; uint32_t denominator;
kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
/* /*
* margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006 * margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006
* The unit of 54/64Mbytes/sec is an arbitrary unit chosen based on * The unit of 54/64Mbytes/sec is an arbitrary unit chosen based on
...@@ -2846,6 +2843,14 @@ static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx) ...@@ -2846,6 +2843,14 @@ static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
return peak_kbps; return peak_kbps;
} }
static struct fixed31_32 get_pbn_from_timing(struct pipe_ctx *pipe_ctx)
{
uint64_t kbps;
kbps = dc_bandwidth_in_kbps_from_timing(&pipe_ctx->stream->timing);
return get_pbn_from_bw_in_kbps(kbps);
}
static void update_mst_stream_alloc_table( static void update_mst_stream_alloc_table(
struct dc_link *link, struct dc_link *link,
struct stream_encoder *stream_enc, struct stream_encoder *stream_enc,
...@@ -2873,6 +2878,7 @@ static void update_mst_stream_alloc_table( ...@@ -2873,6 +2878,7 @@ static void update_mst_stream_alloc_table(
proposed_table->stream_allocations[i].vcp_id) { proposed_table->stream_allocations[i].vcp_id) {
work_table[i] = *dc_alloc; work_table[i] = *dc_alloc;
work_table[i].slot_count = proposed_table->stream_allocations[i].slot_count;
break; /* exit j loop */ break; /* exit j loop */
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment