dc.h 19 KB

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