Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/*
2 * Copyright 2017 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#include "display_mode_lib.h"
27#include "dc_features.h"
28
29static void set_soc_bounding_box(struct _vcs_dpi_soc_bounding_box_st *soc, enum dml_project project)
30{
31 if (project == DML_PROJECT_RAVEN1) {
32 soc->sr_exit_time_us = 9.0;
33 soc->sr_enter_plus_exit_time_us = 11.0;
34 soc->urgent_latency_us = 4.0;
35 soc->writeback_latency_us = 12.0;
36 soc->ideal_dram_bw_after_urgent_percent = 80.0;
37 soc->max_request_size_bytes = 256;
38 soc->downspread_percent = 0.5;
39 soc->dram_page_open_time_ns = 50.0;
40 soc->dram_rw_turnaround_time_ns = 17.5;
41 soc->dram_return_buffer_per_channel_bytes = 8192;
42 soc->round_trip_ping_latency_dcfclk_cycles = 128;
43 soc->urgent_out_of_order_return_per_channel_bytes = 256;
44 soc->channel_interleave_bytes = 256;
45 soc->num_banks = 8;
46 soc->num_chans = 2;
47 soc->vmm_page_size_bytes = 4096;
48 soc->dram_clock_change_latency_us = 17.0;
49 soc->writeback_dram_clock_change_latency_us = 23.0;
50 soc->return_bus_width_bytes = 64;
51 } else {
52 BREAK_TO_DEBUGGER(); /* Invalid Project Specified */
53 }
54}
55
56static void set_ip_params(struct _vcs_dpi_ip_params_st *ip, enum dml_project project)
57{
58 if (project == DML_PROJECT_RAVEN1) {
59 ip->rob_buffer_size_kbytes = 64;
60 ip->det_buffer_size_kbytes = 164;
61 ip->dpte_buffer_size_in_pte_reqs = 42;
62 ip->dpp_output_buffer_pixels = 2560;
63 ip->opp_output_buffer_lines = 1;
64 ip->pixel_chunk_size_kbytes = 8;
65 ip->pte_enable = 1;
66 ip->pte_chunk_size_kbytes = 2;
67 ip->meta_chunk_size_kbytes = 2;
68 ip->writeback_chunk_size_kbytes = 2;
69 ip->line_buffer_size_bits = 589824;
70 ip->max_line_buffer_lines = 12;
71 ip->IsLineBufferBppFixed = 0;
72 ip->LineBufferFixedBpp = -1;
73 ip->writeback_luma_buffer_size_kbytes = 12;
74 ip->writeback_chroma_buffer_size_kbytes = 8;
75 ip->max_num_dpp = 4;
76 ip->max_num_wb = 2;
77 ip->max_dchub_pscl_bw_pix_per_clk = 4;
78 ip->max_pscl_lb_bw_pix_per_clk = 2;
79 ip->max_lb_vscl_bw_pix_per_clk = 4;
80 ip->max_vscl_hscl_bw_pix_per_clk = 4;
81 ip->max_hscl_ratio = 4;
82 ip->max_vscl_ratio = 4;
83 ip->hscl_mults = 4;
84 ip->vscl_mults = 4;
85 ip->max_hscl_taps = 8;
86 ip->max_vscl_taps = 8;
87 ip->dispclk_ramp_margin_percent = 1;
88 ip->underscan_factor = 1.10;
89 ip->min_vblank_lines = 14;
90 ip->dppclk_delay_subtotal = 90;
91 ip->dispclk_delay_subtotal = 42;
92 ip->dcfclk_cstate_latency = 10;
93 ip->max_inter_dcn_tile_repeaters = 8;
94 ip->can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one = 0;
95 ip->bug_forcing_LC_req_same_size_fixed = 0;
96 } else {
97 BREAK_TO_DEBUGGER(); /* Invalid Project Specified */
98 }
99}
100
101void dml_init_instance(struct display_mode_lib *lib, enum dml_project project)
102{
103 if (lib->project != project) {
104 set_soc_bounding_box(&lib->soc, project);
105 set_ip_params(&lib->ip, project);
106 lib->project = project;
107 }
108}
109