dc.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. /*
  2. * Copyright 2012-14 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 DC_INTERFACE_H_
  26. #define DC_INTERFACE_H_
  27. #include "dc_types.h"
  28. #include "grph_object_defs.h"
  29. #include "logger_types.h"
  30. #include "gpio_types.h"
  31. #include "link_service_types.h"
  32. #include "grph_object_ctrl_defs.h"
  33. #include <inc/hw/opp.h>
  34. #include "inc/hw_sequencer.h"
  35. #include "inc/compressor.h"
  36. #include "dml/display_mode_lib.h"
  37. #define DC_VER "3.1.59"
  38. #define MAX_SURFACES 3
  39. #define MAX_STREAMS 6
  40. #define MAX_SINKS_PER_LINK 4
  41. /*******************************************************************************
  42. * Display Core Interfaces
  43. ******************************************************************************/
  44. struct dmcu_version {
  45. unsigned int date;
  46. unsigned int month;
  47. unsigned int year;
  48. unsigned int interface_version;
  49. };
  50. struct dc_versions {
  51. const char *dc_ver;
  52. struct dmcu_version dmcu_version;
  53. };
  54. struct dc_caps {
  55. uint32_t max_streams;
  56. uint32_t max_links;
  57. uint32_t max_audios;
  58. uint32_t max_slave_planes;
  59. uint32_t max_planes;
  60. uint32_t max_downscale_ratio;
  61. uint32_t i2c_speed_in_khz;
  62. uint32_t dmdata_alloc_size;
  63. unsigned int max_cursor_size;
  64. unsigned int max_video_width;
  65. int linear_pitch_alignment;
  66. bool dcc_const_color;
  67. bool dynamic_audio;
  68. bool is_apu;
  69. bool dual_link_dvi;
  70. bool post_blend_color_processing;
  71. bool force_dp_tps4_for_cp2520;
  72. bool disable_dp_clk_share;
  73. bool psp_setup_panel_mode;
  74. };
  75. struct dc_dcc_surface_param {
  76. struct dc_size surface_size;
  77. enum surface_pixel_format format;
  78. enum swizzle_mode_values swizzle_mode;
  79. enum dc_scan_direction scan;
  80. };
  81. struct dc_dcc_setting {
  82. unsigned int max_compressed_blk_size;
  83. unsigned int max_uncompressed_blk_size;
  84. bool independent_64b_blks;
  85. };
  86. struct dc_surface_dcc_cap {
  87. union {
  88. struct {
  89. struct dc_dcc_setting rgb;
  90. } grph;
  91. struct {
  92. struct dc_dcc_setting luma;
  93. struct dc_dcc_setting chroma;
  94. } video;
  95. };
  96. bool capable;
  97. bool const_color_support;
  98. };
  99. struct dc_static_screen_events {
  100. bool force_trigger;
  101. bool cursor_update;
  102. bool surface_update;
  103. bool overlay_update;
  104. };
  105. /* Surface update type is used by dc_update_surfaces_and_stream
  106. * The update type is determined at the very beginning of the function based
  107. * on parameters passed in and decides how much programming (or updating) is
  108. * going to be done during the call.
  109. *
  110. * UPDATE_TYPE_FAST is used for really fast updates that do not require much
  111. * logical calculations or hardware register programming. This update MUST be
  112. * ISR safe on windows. Currently fast update will only be used to flip surface
  113. * address.
  114. *
  115. * UPDATE_TYPE_MED is used for slower updates which require significant hw
  116. * re-programming however do not affect bandwidth consumption or clock
  117. * requirements. At present, this is the level at which front end updates
  118. * that do not require us to run bw_calcs happen. These are in/out transfer func
  119. * updates, viewport offset changes, recout size changes and pixel depth changes.
  120. * This update can be done at ISR, but we want to minimize how often this happens.
  121. *
  122. * UPDATE_TYPE_FULL is slow. Really slow. This requires us to recalculate our
  123. * bandwidth and clocks, possibly rearrange some pipes and reprogram anything front
  124. * end related. Any time viewport dimensions, recout dimensions, scaling ratios or
  125. * gamma need to be adjusted or pipe needs to be turned on (or disconnected) we do
  126. * a full update. This cannot be done at ISR level and should be a rare event.
  127. * Unless someone is stress testing mpo enter/exit, playing with colour or adjusting
  128. * underscan we don't expect to see this call at all.
  129. */
  130. enum surface_update_type {
  131. UPDATE_TYPE_FAST, /* super fast, safe to execute in isr */
  132. UPDATE_TYPE_MED, /* ISR safe, most of programming needed, no bw/clk change*/
  133. UPDATE_TYPE_FULL, /* may need to shuffle resources */
  134. };
  135. /* Forward declaration*/
  136. struct dc;
  137. struct dc_plane_state;
  138. struct dc_state;
  139. struct dc_cap_funcs {
  140. bool (*get_dcc_compression_cap)(const struct dc *dc,
  141. const struct dc_dcc_surface_param *input,
  142. struct dc_surface_dcc_cap *output);
  143. };
  144. struct link_training_settings;
  145. /* Structure to hold configuration flags set by dm at dc creation. */
  146. struct dc_config {
  147. bool gpu_vm_support;
  148. bool disable_disp_pll_sharing;
  149. };
  150. enum visual_confirm {
  151. VISUAL_CONFIRM_DISABLE = 0,
  152. VISUAL_CONFIRM_SURFACE = 1,
  153. VISUAL_CONFIRM_HDR = 2,
  154. };
  155. enum dcc_option {
  156. DCC_ENABLE = 0,
  157. DCC_DISABLE = 1,
  158. DCC_HALF_REQ_DISALBE = 2,
  159. };
  160. enum pipe_split_policy {
  161. MPC_SPLIT_DYNAMIC = 0,
  162. MPC_SPLIT_AVOID = 1,
  163. MPC_SPLIT_AVOID_MULT_DISP = 2,
  164. };
  165. enum wm_report_mode {
  166. WM_REPORT_DEFAULT = 0,
  167. WM_REPORT_OVERRIDE = 1,
  168. };
  169. /*
  170. * For any clocks that may differ per pipe
  171. * only the max is stored in this structure
  172. */
  173. struct dc_clocks {
  174. int dispclk_khz;
  175. int max_supported_dppclk_khz;
  176. int dppclk_khz;
  177. int dcfclk_khz;
  178. int socclk_khz;
  179. int dcfclk_deep_sleep_khz;
  180. int fclk_khz;
  181. int phyclk_khz;
  182. };
  183. struct dc_debug_options {
  184. enum visual_confirm visual_confirm;
  185. bool sanity_checks;
  186. bool max_disp_clk;
  187. bool surface_trace;
  188. bool timing_trace;
  189. bool clock_trace;
  190. bool validation_trace;
  191. bool bandwidth_calcs_trace;
  192. int max_downscale_src_width;
  193. /* stutter efficiency related */
  194. bool disable_stutter;
  195. bool use_max_lb;
  196. enum dcc_option disable_dcc;
  197. enum pipe_split_policy pipe_split_policy;
  198. bool force_single_disp_pipe_split;
  199. bool voltage_align_fclk;
  200. bool disable_dfs_bypass;
  201. bool disable_dpp_power_gate;
  202. bool disable_hubp_power_gate;
  203. bool disable_pplib_wm_range;
  204. enum wm_report_mode pplib_wm_report_mode;
  205. unsigned int min_disp_clk_khz;
  206. int sr_exit_time_dpm0_ns;
  207. int sr_enter_plus_exit_time_dpm0_ns;
  208. int sr_exit_time_ns;
  209. int sr_enter_plus_exit_time_ns;
  210. int urgent_latency_ns;
  211. int percent_of_ideal_drambw;
  212. int dram_clock_change_latency_ns;
  213. bool optimized_watermark;
  214. int always_scale;
  215. bool disable_pplib_clock_request;
  216. bool disable_clock_gate;
  217. bool disable_dmcu;
  218. bool disable_psr;
  219. bool force_abm_enable;
  220. bool disable_hbup_pg;
  221. bool disable_dpp_pg;
  222. bool disable_stereo_support;
  223. bool vsr_support;
  224. bool performance_trace;
  225. bool az_endpoint_mute_only;
  226. bool always_use_regamma;
  227. bool p010_mpo_support;
  228. bool recovery_enabled;
  229. bool avoid_vbios_exec_table;
  230. bool scl_reset_length10;
  231. bool hdmi20_disable;
  232. bool skip_detection_link_training;
  233. };
  234. struct dc_debug_data {
  235. uint32_t ltFailCount;
  236. uint32_t i2cErrorCount;
  237. uint32_t auxErrorCount;
  238. };
  239. struct dc_state;
  240. struct resource_pool;
  241. struct dce_hwseq;
  242. struct dc {
  243. struct dc_versions versions;
  244. struct dc_caps caps;
  245. struct dc_cap_funcs cap_funcs;
  246. struct dc_config config;
  247. struct dc_debug_options debug;
  248. struct dc_context *ctx;
  249. uint8_t link_count;
  250. struct dc_link *links[MAX_PIPES * 2];
  251. struct dc_state *current_state;
  252. struct resource_pool *res_pool;
  253. /* Display Engine Clock levels */
  254. struct dm_pp_clock_levels sclk_lvls;
  255. /* Inputs into BW and WM calculations. */
  256. struct bw_calcs_dceip *bw_dceip;
  257. struct bw_calcs_vbios *bw_vbios;
  258. #ifdef CONFIG_DRM_AMD_DC_DCN1_0
  259. struct dcn_soc_bounding_box *dcn_soc;
  260. struct dcn_ip_params *dcn_ip;
  261. struct display_mode_lib dml;
  262. #endif
  263. /* HW functions */
  264. struct hw_sequencer_funcs hwss;
  265. struct dce_hwseq *hwseq;
  266. /* temp store of dm_pp_display_configuration
  267. * to compare to see if display config changed
  268. */
  269. struct dm_pp_display_configuration prev_display_config;
  270. bool optimized_required;
  271. bool apply_edp_fast_boot_optimization;
  272. /* FBC compressor */
  273. struct compressor *fbc_compressor;
  274. struct dc_debug_data debug_data;
  275. };
  276. enum frame_buffer_mode {
  277. FRAME_BUFFER_MODE_LOCAL_ONLY = 0,
  278. FRAME_BUFFER_MODE_ZFB_ONLY,
  279. FRAME_BUFFER_MODE_MIXED_ZFB_AND_LOCAL,
  280. } ;
  281. struct dchub_init_data {
  282. int64_t zfb_phys_addr_base;
  283. int64_t zfb_mc_base_addr;
  284. uint64_t zfb_size_in_byte;
  285. enum frame_buffer_mode fb_mode;
  286. bool dchub_initialzied;
  287. bool dchub_info_valid;
  288. };
  289. struct dc_init_data {
  290. struct hw_asic_id asic_id;
  291. void *driver; /* ctx */
  292. struct cgs_device *cgs_device;
  293. int num_virtual_links;
  294. /*
  295. * If 'vbios_override' not NULL, it will be called instead
  296. * of the real VBIOS. Intended use is Diagnostics on FPGA.
  297. */
  298. struct dc_bios *vbios_override;
  299. enum dce_environment dce_environment;
  300. struct dc_config flags;
  301. uint32_t log_mask;
  302. };
  303. struct dc *dc_create(const struct dc_init_data *init_params);
  304. void dc_destroy(struct dc **dc);
  305. /*******************************************************************************
  306. * Surface Interfaces
  307. ******************************************************************************/
  308. enum {
  309. TRANSFER_FUNC_POINTS = 1025
  310. };
  311. struct dc_hdr_static_metadata {
  312. /* display chromaticities and white point in units of 0.00001 */
  313. unsigned int chromaticity_green_x;
  314. unsigned int chromaticity_green_y;
  315. unsigned int chromaticity_blue_x;
  316. unsigned int chromaticity_blue_y;
  317. unsigned int chromaticity_red_x;
  318. unsigned int chromaticity_red_y;
  319. unsigned int chromaticity_white_point_x;
  320. unsigned int chromaticity_white_point_y;
  321. uint32_t min_luminance;
  322. uint32_t max_luminance;
  323. uint32_t maximum_content_light_level;
  324. uint32_t maximum_frame_average_light_level;
  325. };
  326. enum dc_transfer_func_type {
  327. TF_TYPE_PREDEFINED,
  328. TF_TYPE_DISTRIBUTED_POINTS,
  329. TF_TYPE_BYPASS,
  330. TF_TYPE_HWPWL
  331. };
  332. struct dc_transfer_func_distributed_points {
  333. struct fixed31_32 red[TRANSFER_FUNC_POINTS];
  334. struct fixed31_32 green[TRANSFER_FUNC_POINTS];
  335. struct fixed31_32 blue[TRANSFER_FUNC_POINTS];
  336. uint16_t end_exponent;
  337. uint16_t x_point_at_y1_red;
  338. uint16_t x_point_at_y1_green;
  339. uint16_t x_point_at_y1_blue;
  340. };
  341. enum dc_transfer_func_predefined {
  342. TRANSFER_FUNCTION_SRGB,
  343. TRANSFER_FUNCTION_BT709,
  344. TRANSFER_FUNCTION_PQ,
  345. TRANSFER_FUNCTION_LINEAR,
  346. TRANSFER_FUNCTION_UNITY,
  347. TRANSFER_FUNCTION_HLG,
  348. TRANSFER_FUNCTION_HLG12,
  349. TRANSFER_FUNCTION_GAMMA22
  350. };
  351. struct dc_transfer_func {
  352. struct kref refcount;
  353. enum dc_transfer_func_type type;
  354. enum dc_transfer_func_predefined tf;
  355. /* FP16 1.0 reference level in nits, default is 80 nits, only for PQ*/
  356. uint32_t sdr_ref_white_level;
  357. struct dc_context *ctx;
  358. union {
  359. struct pwl_params pwl;
  360. struct dc_transfer_func_distributed_points tf_pts;
  361. };
  362. };
  363. /*
  364. * This structure is filled in by dc_surface_get_status and contains
  365. * the last requested address and the currently active address so the called
  366. * can determine if there are any outstanding flips
  367. */
  368. struct dc_plane_status {
  369. struct dc_plane_address requested_address;
  370. struct dc_plane_address current_address;
  371. bool is_flip_pending;
  372. bool is_right_eye;
  373. };
  374. union surface_update_flags {
  375. struct {
  376. /* Medium updates */
  377. uint32_t dcc_change:1;
  378. uint32_t color_space_change:1;
  379. uint32_t horizontal_mirror_change:1;
  380. uint32_t per_pixel_alpha_change:1;
  381. uint32_t rotation_change:1;
  382. uint32_t swizzle_change:1;
  383. uint32_t scaling_change:1;
  384. uint32_t position_change:1;
  385. uint32_t in_transfer_func_change:1;
  386. uint32_t input_csc_change:1;
  387. uint32_t coeff_reduction_change:1;
  388. uint32_t output_tf_change:1;
  389. uint32_t pixel_format_change:1;
  390. /* Full updates */
  391. uint32_t new_plane:1;
  392. uint32_t bpp_change:1;
  393. uint32_t gamma_change:1;
  394. uint32_t bandwidth_change:1;
  395. uint32_t clock_change:1;
  396. uint32_t stereo_format_change:1;
  397. uint32_t full_update:1;
  398. } bits;
  399. uint32_t raw;
  400. };
  401. struct dc_plane_state {
  402. struct dc_plane_address address;
  403. struct dc_plane_flip_time time;
  404. struct scaling_taps scaling_quality;
  405. struct rect src_rect;
  406. struct rect dst_rect;
  407. struct rect clip_rect;
  408. union plane_size plane_size;
  409. union dc_tiling_info tiling_info;
  410. struct dc_plane_dcc_param dcc;
  411. struct dc_gamma *gamma_correction;
  412. struct dc_transfer_func *in_transfer_func;
  413. struct dc_bias_and_scale *bias_and_scale;
  414. struct dc_csc_transform input_csc_color_matrix;
  415. struct fixed31_32 coeff_reduction_factor;
  416. uint32_t sdr_white_level;
  417. // TODO: No longer used, remove
  418. struct dc_hdr_static_metadata hdr_static_ctx;
  419. enum dc_color_space color_space;
  420. enum surface_pixel_format format;
  421. enum dc_rotation_angle rotation;
  422. enum plane_stereo_format stereo_format;
  423. bool is_tiling_rotated;
  424. bool per_pixel_alpha;
  425. bool visible;
  426. bool flip_immediate;
  427. bool horizontal_mirror;
  428. union surface_update_flags update_flags;
  429. /* private to DC core */
  430. struct dc_plane_status status;
  431. struct dc_context *ctx;
  432. /* HACK: Workaround for forcing full reprogramming under some conditions */
  433. bool force_full_update;
  434. /* private to dc_surface.c */
  435. enum dc_irq_source irq_source;
  436. struct kref refcount;
  437. };
  438. struct dc_plane_info {
  439. union plane_size plane_size;
  440. union dc_tiling_info tiling_info;
  441. struct dc_plane_dcc_param dcc;
  442. enum surface_pixel_format format;
  443. enum dc_rotation_angle rotation;
  444. enum plane_stereo_format stereo_format;
  445. enum dc_color_space color_space;
  446. unsigned int sdr_white_level;
  447. bool horizontal_mirror;
  448. bool visible;
  449. bool per_pixel_alpha;
  450. bool input_csc_enabled;
  451. };
  452. struct dc_scaling_info {
  453. struct rect src_rect;
  454. struct rect dst_rect;
  455. struct rect clip_rect;
  456. struct scaling_taps scaling_quality;
  457. };
  458. struct dc_surface_update {
  459. struct dc_plane_state *surface;
  460. /* isr safe update parameters. null means no updates */
  461. const struct dc_flip_addrs *flip_addr;
  462. const struct dc_plane_info *plane_info;
  463. const struct dc_scaling_info *scaling_info;
  464. /* following updates require alloc/sleep/spin that is not isr safe,
  465. * null means no updates
  466. */
  467. const struct dc_gamma *gamma;
  468. const struct dc_transfer_func *in_transfer_func;
  469. const struct dc_csc_transform *input_csc_color_matrix;
  470. const struct fixed31_32 *coeff_reduction_factor;
  471. };
  472. /*
  473. * Create a new surface with default parameters;
  474. */
  475. struct dc_plane_state *dc_create_plane_state(struct dc *dc);
  476. const struct dc_plane_status *dc_plane_get_status(
  477. const struct dc_plane_state *plane_state);
  478. void dc_plane_state_retain(struct dc_plane_state *plane_state);
  479. void dc_plane_state_release(struct dc_plane_state *plane_state);
  480. void dc_gamma_retain(struct dc_gamma *dc_gamma);
  481. void dc_gamma_release(struct dc_gamma **dc_gamma);
  482. struct dc_gamma *dc_create_gamma(void);
  483. void dc_transfer_func_retain(struct dc_transfer_func *dc_tf);
  484. void dc_transfer_func_release(struct dc_transfer_func *dc_tf);
  485. struct dc_transfer_func *dc_create_transfer_func(void);
  486. /*
  487. * This structure holds a surface address. There could be multiple addresses
  488. * in cases such as Stereo 3D, Planar YUV, etc. Other per-flip attributes such
  489. * as frame durations and DCC format can also be set.
  490. */
  491. struct dc_flip_addrs {
  492. struct dc_plane_address address;
  493. unsigned int flip_timestamp_in_us;
  494. bool flip_immediate;
  495. /* TODO: add flip duration for FreeSync */
  496. };
  497. bool dc_post_update_surfaces_to_stream(
  498. struct dc *dc);
  499. #include "dc_stream.h"
  500. /*
  501. * Structure to store surface/stream associations for validation
  502. */
  503. struct dc_validation_set {
  504. struct dc_stream_state *stream;
  505. struct dc_plane_state *plane_states[MAX_SURFACES];
  506. uint8_t plane_count;
  507. };
  508. enum dc_status dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state);
  509. enum dc_status dc_validate_global_state(
  510. struct dc *dc,
  511. struct dc_state *new_ctx);
  512. void dc_resource_state_construct(
  513. const struct dc *dc,
  514. struct dc_state *dst_ctx);
  515. void dc_resource_state_copy_construct(
  516. const struct dc_state *src_ctx,
  517. struct dc_state *dst_ctx);
  518. void dc_resource_state_copy_construct_current(
  519. const struct dc *dc,
  520. struct dc_state *dst_ctx);
  521. void dc_resource_state_destruct(struct dc_state *context);
  522. /*
  523. * TODO update to make it about validation sets
  524. * Set up streams and links associated to drive sinks
  525. * The streams parameter is an absolute set of all active streams.
  526. *
  527. * After this call:
  528. * Phy, Encoder, Timing Generator are programmed and enabled.
  529. * New streams are enabled with blank stream; no memory read.
  530. */
  531. bool dc_commit_state(struct dc *dc, struct dc_state *context);
  532. struct dc_state *dc_create_state(void);
  533. void dc_retain_state(struct dc_state *context);
  534. void dc_release_state(struct dc_state *context);
  535. /*******************************************************************************
  536. * Link Interfaces
  537. ******************************************************************************/
  538. struct dpcd_caps {
  539. union dpcd_rev dpcd_rev;
  540. union max_lane_count max_ln_count;
  541. union max_down_spread max_down_spread;
  542. /* dongle type (DP converter, CV smart dongle) */
  543. enum display_dongle_type dongle_type;
  544. /* Dongle's downstream count. */
  545. union sink_count sink_count;
  546. /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
  547. indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
  548. struct dc_dongle_caps dongle_caps;
  549. uint32_t sink_dev_id;
  550. int8_t sink_dev_id_str[6];
  551. int8_t sink_hw_revision;
  552. int8_t sink_fw_revision[2];
  553. uint32_t branch_dev_id;
  554. int8_t branch_dev_name[6];
  555. int8_t branch_hw_revision;
  556. int8_t branch_fw_revision[2];
  557. bool allow_invalid_MSA_timing_param;
  558. bool panel_mode_edp;
  559. bool dpcd_display_control_capable;
  560. };
  561. #include "dc_link.h"
  562. /*******************************************************************************
  563. * Sink Interfaces - A sink corresponds to a display output device
  564. ******************************************************************************/
  565. struct dc_container_id {
  566. // 128bit GUID in binary form
  567. unsigned char guid[16];
  568. // 8 byte port ID -> ELD.PortID
  569. unsigned int portId[2];
  570. // 128bit GUID in binary formufacturer name -> ELD.ManufacturerName
  571. unsigned short manufacturerName;
  572. // 2 byte product code -> ELD.ProductCode
  573. unsigned short productCode;
  574. };
  575. /*
  576. * The sink structure contains EDID and other display device properties
  577. */
  578. struct dc_sink {
  579. enum signal_type sink_signal;
  580. struct dc_edid dc_edid; /* raw edid */
  581. struct dc_edid_caps edid_caps; /* parse display caps */
  582. struct dc_container_id *dc_container_id;
  583. uint32_t dongle_max_pix_clk;
  584. void *priv;
  585. struct stereo_3d_features features_3d[TIMING_3D_FORMAT_MAX];
  586. bool converter_disable_audio;
  587. /* private to DC core */
  588. struct dc_link *link;
  589. struct dc_context *ctx;
  590. uint32_t sink_id;
  591. /* private to dc_sink.c */
  592. // refcount must be the last member in dc_sink, since we want the
  593. // sink structure to be logically cloneable up to (but not including)
  594. // refcount
  595. struct kref refcount;
  596. };
  597. void dc_sink_retain(struct dc_sink *sink);
  598. void dc_sink_release(struct dc_sink *sink);
  599. struct dc_sink_init_data {
  600. enum signal_type sink_signal;
  601. struct dc_link *link;
  602. uint32_t dongle_max_pix_clk;
  603. bool converter_disable_audio;
  604. };
  605. struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);
  606. /* Newer interfaces */
  607. struct dc_cursor {
  608. struct dc_plane_address address;
  609. struct dc_cursor_attributes attributes;
  610. };
  611. /*******************************************************************************
  612. * Interrupt interfaces
  613. ******************************************************************************/
  614. enum dc_irq_source dc_interrupt_to_irq_source(
  615. struct dc *dc,
  616. uint32_t src_id,
  617. uint32_t ext_id);
  618. bool dc_interrupt_set(struct dc *dc, enum dc_irq_source src, bool enable);
  619. void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src);
  620. enum dc_irq_source dc_get_hpd_irq_source_at_index(
  621. struct dc *dc, uint32_t link_index);
  622. /*******************************************************************************
  623. * Power Interfaces
  624. ******************************************************************************/
  625. void dc_set_power_state(
  626. struct dc *dc,
  627. enum dc_acpi_cm_power_state power_state);
  628. void dc_resume(struct dc *dc);
  629. #endif /* DC_INTERFACE_H_ */