dc.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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.37"
  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_dppclk_khz;
  162. int dcfclk_khz;
  163. int socclk_khz;
  164. int dcfclk_deep_sleep_khz;
  165. int fclk_khz;
  166. int dram_ccm_us;
  167. int min_active_dram_ccm_us;
  168. };
  169. struct dc_debug {
  170. bool surface_visual_confirm;
  171. bool sanity_checks;
  172. bool max_disp_clk;
  173. bool surface_trace;
  174. bool timing_trace;
  175. bool clock_trace;
  176. bool validation_trace;
  177. /* stutter efficiency related */
  178. bool disable_stutter;
  179. bool use_max_lb;
  180. enum dcc_option disable_dcc;
  181. enum pipe_split_policy pipe_split_policy;
  182. bool force_single_disp_pipe_split;
  183. bool voltage_align_fclk;
  184. bool disable_dfs_bypass;
  185. bool disable_dpp_power_gate;
  186. bool disable_hubp_power_gate;
  187. bool disable_pplib_wm_range;
  188. enum wm_report_mode pplib_wm_report_mode;
  189. unsigned int min_disp_clk_khz;
  190. int sr_exit_time_dpm0_ns;
  191. int sr_enter_plus_exit_time_dpm0_ns;
  192. int sr_exit_time_ns;
  193. int sr_enter_plus_exit_time_ns;
  194. int urgent_latency_ns;
  195. int percent_of_ideal_drambw;
  196. int dram_clock_change_latency_ns;
  197. int always_scale;
  198. bool disable_pplib_clock_request;
  199. bool disable_clock_gate;
  200. bool disable_dmcu;
  201. bool disable_psr;
  202. bool force_abm_enable;
  203. bool disable_hbup_pg;
  204. bool disable_dpp_pg;
  205. bool disable_stereo_support;
  206. bool vsr_support;
  207. bool performance_trace;
  208. bool az_endpoint_mute_only;
  209. bool always_use_regamma;
  210. bool p010_mpo_support;
  211. };
  212. struct dc_state;
  213. struct resource_pool;
  214. struct dce_hwseq;
  215. struct dc {
  216. struct dc_versions versions;
  217. struct dc_caps caps;
  218. struct dc_cap_funcs cap_funcs;
  219. struct dc_config config;
  220. struct dc_debug debug;
  221. struct dc_context *ctx;
  222. uint8_t link_count;
  223. struct dc_link *links[MAX_PIPES * 2];
  224. struct dc_state *current_state;
  225. struct resource_pool *res_pool;
  226. /* Display Engine Clock levels */
  227. struct dm_pp_clock_levels sclk_lvls;
  228. /* Inputs into BW and WM calculations. */
  229. struct bw_calcs_dceip *bw_dceip;
  230. struct bw_calcs_vbios *bw_vbios;
  231. #ifdef CONFIG_DRM_AMD_DC_DCN1_0
  232. struct dcn_soc_bounding_box *dcn_soc;
  233. struct dcn_ip_params *dcn_ip;
  234. struct display_mode_lib dml;
  235. #endif
  236. /* HW functions */
  237. struct hw_sequencer_funcs hwss;
  238. struct dce_hwseq *hwseq;
  239. /* temp store of dm_pp_display_configuration
  240. * to compare to see if display config changed
  241. */
  242. struct dm_pp_display_configuration prev_display_config;
  243. bool optimized_required;
  244. bool apply_edp_fast_boot_optimization;
  245. /* FBC compressor */
  246. #if defined(CONFIG_DRM_AMD_DC_FBC)
  247. struct compressor *fbc_compressor;
  248. #endif
  249. };
  250. enum frame_buffer_mode {
  251. FRAME_BUFFER_MODE_LOCAL_ONLY = 0,
  252. FRAME_BUFFER_MODE_ZFB_ONLY,
  253. FRAME_BUFFER_MODE_MIXED_ZFB_AND_LOCAL,
  254. } ;
  255. struct dchub_init_data {
  256. int64_t zfb_phys_addr_base;
  257. int64_t zfb_mc_base_addr;
  258. uint64_t zfb_size_in_byte;
  259. enum frame_buffer_mode fb_mode;
  260. bool dchub_initialzied;
  261. bool dchub_info_valid;
  262. };
  263. struct dc_init_data {
  264. struct hw_asic_id asic_id;
  265. void *driver; /* ctx */
  266. struct cgs_device *cgs_device;
  267. int num_virtual_links;
  268. /*
  269. * If 'vbios_override' not NULL, it will be called instead
  270. * of the real VBIOS. Intended use is Diagnostics on FPGA.
  271. */
  272. struct dc_bios *vbios_override;
  273. enum dce_environment dce_environment;
  274. struct dc_config flags;
  275. uint32_t log_mask;
  276. };
  277. struct dc *dc_create(const struct dc_init_data *init_params);
  278. void dc_destroy(struct dc **dc);
  279. /*******************************************************************************
  280. * Surface Interfaces
  281. ******************************************************************************/
  282. enum {
  283. TRANSFER_FUNC_POINTS = 1025
  284. };
  285. // Moved here from color module for linux
  286. enum color_transfer_func {
  287. transfer_func_unknown,
  288. transfer_func_srgb,
  289. transfer_func_bt709,
  290. transfer_func_pq2084,
  291. transfer_func_pq2084_interim,
  292. transfer_func_linear_0_1,
  293. transfer_func_linear_0_125,
  294. transfer_func_dolbyvision,
  295. transfer_func_gamma_22,
  296. transfer_func_gamma_26
  297. };
  298. struct dc_hdr_static_metadata {
  299. /* display chromaticities and white point in units of 0.00001 */
  300. unsigned int chromaticity_green_x;
  301. unsigned int chromaticity_green_y;
  302. unsigned int chromaticity_blue_x;
  303. unsigned int chromaticity_blue_y;
  304. unsigned int chromaticity_red_x;
  305. unsigned int chromaticity_red_y;
  306. unsigned int chromaticity_white_point_x;
  307. unsigned int chromaticity_white_point_y;
  308. uint32_t min_luminance;
  309. uint32_t max_luminance;
  310. uint32_t maximum_content_light_level;
  311. uint32_t maximum_frame_average_light_level;
  312. bool hdr_supported;
  313. bool is_hdr;
  314. };
  315. enum dc_transfer_func_type {
  316. TF_TYPE_PREDEFINED,
  317. TF_TYPE_DISTRIBUTED_POINTS,
  318. TF_TYPE_BYPASS,
  319. };
  320. struct dc_transfer_func_distributed_points {
  321. struct fixed31_32 red[TRANSFER_FUNC_POINTS];
  322. struct fixed31_32 green[TRANSFER_FUNC_POINTS];
  323. struct fixed31_32 blue[TRANSFER_FUNC_POINTS];
  324. uint16_t end_exponent;
  325. uint16_t x_point_at_y1_red;
  326. uint16_t x_point_at_y1_green;
  327. uint16_t x_point_at_y1_blue;
  328. };
  329. enum dc_transfer_func_predefined {
  330. TRANSFER_FUNCTION_SRGB,
  331. TRANSFER_FUNCTION_BT709,
  332. TRANSFER_FUNCTION_PQ,
  333. TRANSFER_FUNCTION_LINEAR,
  334. TRANSFER_FUNCTION_UNITY,
  335. };
  336. struct dc_transfer_func {
  337. struct kref refcount;
  338. struct dc_transfer_func_distributed_points tf_pts;
  339. enum dc_transfer_func_type type;
  340. enum dc_transfer_func_predefined tf;
  341. /* FP16 1.0 reference level in nits, default is 80 nits, only for PQ*/
  342. uint32_t sdr_ref_white_level;
  343. struct dc_context *ctx;
  344. };
  345. /*
  346. * This structure is filled in by dc_surface_get_status and contains
  347. * the last requested address and the currently active address so the called
  348. * can determine if there are any outstanding flips
  349. */
  350. struct dc_plane_status {
  351. struct dc_plane_address requested_address;
  352. struct dc_plane_address current_address;
  353. bool is_flip_pending;
  354. bool is_right_eye;
  355. };
  356. union surface_update_flags {
  357. struct {
  358. /* Medium updates */
  359. uint32_t dcc_change:1;
  360. uint32_t color_space_change:1;
  361. uint32_t input_tf_change:1;
  362. uint32_t horizontal_mirror_change:1;
  363. uint32_t per_pixel_alpha_change:1;
  364. uint32_t rotation_change:1;
  365. uint32_t swizzle_change:1;
  366. uint32_t scaling_change:1;
  367. uint32_t position_change:1;
  368. uint32_t in_transfer_func_change:1;
  369. uint32_t input_csc_change:1;
  370. uint32_t output_tf_change:1;
  371. uint32_t pixel_format_change:1;
  372. /* Full updates */
  373. uint32_t new_plane:1;
  374. uint32_t bpp_change:1;
  375. uint32_t gamma_change:1;
  376. uint32_t bandwidth_change:1;
  377. uint32_t clock_change:1;
  378. uint32_t stereo_format_change:1;
  379. uint32_t full_update:1;
  380. } bits;
  381. uint32_t raw;
  382. };
  383. struct dc_plane_state {
  384. struct dc_plane_address address;
  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. bool flip_immediate;
  476. /* TODO: add flip duration for FreeSync */
  477. };
  478. bool dc_post_update_surfaces_to_stream(
  479. struct dc *dc);
  480. #include "dc_stream.h"
  481. /*
  482. * Structure to store surface/stream associations for validation
  483. */
  484. struct dc_validation_set {
  485. struct dc_stream_state *stream;
  486. struct dc_plane_state *plane_states[MAX_SURFACES];
  487. uint8_t plane_count;
  488. };
  489. enum dc_status dc_validate_plane(struct dc *dc, const struct dc_plane_state *plane_state);
  490. enum dc_status dc_validate_global_state(
  491. struct dc *dc,
  492. struct dc_state *new_ctx);
  493. void dc_resource_state_construct(
  494. const struct dc *dc,
  495. struct dc_state *dst_ctx);
  496. void dc_resource_state_copy_construct(
  497. const struct dc_state *src_ctx,
  498. struct dc_state *dst_ctx);
  499. void dc_resource_state_copy_construct_current(
  500. const struct dc *dc,
  501. struct dc_state *dst_ctx);
  502. void dc_resource_state_destruct(struct dc_state *context);
  503. /*
  504. * TODO update to make it about validation sets
  505. * Set up streams and links associated to drive sinks
  506. * The streams parameter is an absolute set of all active streams.
  507. *
  508. * After this call:
  509. * Phy, Encoder, Timing Generator are programmed and enabled.
  510. * New streams are enabled with blank stream; no memory read.
  511. */
  512. bool dc_commit_state(struct dc *dc, struct dc_state *context);
  513. struct dc_state *dc_create_state(void);
  514. void dc_retain_state(struct dc_state *context);
  515. void dc_release_state(struct dc_state *context);
  516. /*******************************************************************************
  517. * Link Interfaces
  518. ******************************************************************************/
  519. struct dpcd_caps {
  520. union dpcd_rev dpcd_rev;
  521. union max_lane_count max_ln_count;
  522. union max_down_spread max_down_spread;
  523. /* dongle type (DP converter, CV smart dongle) */
  524. enum display_dongle_type dongle_type;
  525. /* Dongle's downstream count. */
  526. union sink_count sink_count;
  527. /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
  528. indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
  529. struct dc_dongle_caps dongle_caps;
  530. uint32_t sink_dev_id;
  531. uint32_t branch_dev_id;
  532. int8_t branch_dev_name[6];
  533. int8_t branch_hw_revision;
  534. bool allow_invalid_MSA_timing_param;
  535. bool panel_mode_edp;
  536. bool dpcd_display_control_capable;
  537. };
  538. #include "dc_link.h"
  539. /*******************************************************************************
  540. * Sink Interfaces - A sink corresponds to a display output device
  541. ******************************************************************************/
  542. struct dc_container_id {
  543. // 128bit GUID in binary form
  544. unsigned char guid[16];
  545. // 8 byte port ID -> ELD.PortID
  546. unsigned int portId[2];
  547. // 128bit GUID in binary formufacturer name -> ELD.ManufacturerName
  548. unsigned short manufacturerName;
  549. // 2 byte product code -> ELD.ProductCode
  550. unsigned short productCode;
  551. };
  552. /*
  553. * The sink structure contains EDID and other display device properties
  554. */
  555. struct dc_sink {
  556. enum signal_type sink_signal;
  557. struct dc_edid dc_edid; /* raw edid */
  558. struct dc_edid_caps edid_caps; /* parse display caps */
  559. struct dc_container_id *dc_container_id;
  560. uint32_t dongle_max_pix_clk;
  561. void *priv;
  562. struct stereo_3d_features features_3d[TIMING_3D_FORMAT_MAX];
  563. bool converter_disable_audio;
  564. /* private to DC core */
  565. struct dc_link *link;
  566. struct dc_context *ctx;
  567. /* private to dc_sink.c */
  568. struct kref refcount;
  569. };
  570. void dc_sink_retain(struct dc_sink *sink);
  571. void dc_sink_release(struct dc_sink *sink);
  572. struct dc_sink_init_data {
  573. enum signal_type sink_signal;
  574. struct dc_link *link;
  575. uint32_t dongle_max_pix_clk;
  576. bool converter_disable_audio;
  577. };
  578. struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);
  579. /* Newer interfaces */
  580. struct dc_cursor {
  581. struct dc_plane_address address;
  582. struct dc_cursor_attributes attributes;
  583. };
  584. /*******************************************************************************
  585. * Interrupt interfaces
  586. ******************************************************************************/
  587. enum dc_irq_source dc_interrupt_to_irq_source(
  588. struct dc *dc,
  589. uint32_t src_id,
  590. uint32_t ext_id);
  591. bool dc_interrupt_set(struct dc *dc, enum dc_irq_source src, bool enable);
  592. void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src);
  593. enum dc_irq_source dc_get_hpd_irq_source_at_index(
  594. struct dc *dc, uint32_t link_index);
  595. /*******************************************************************************
  596. * Power Interfaces
  597. ******************************************************************************/
  598. void dc_set_power_state(
  599. struct dc *dc,
  600. enum dc_acpi_cm_power_state power_state);
  601. void dc_resume(struct dc *dc);
  602. #endif /* DC_INTERFACE_H_ */