blob: 7733292d42f87f23d9a415d66dc2f4305a8a7011 [file] [log] [blame]
Harry Wentland45622362017-09-12 15:58:20 -04001/*
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
26#ifndef DC_INTERFACE_H_
27#define DC_INTERFACE_H_
28
29#include "dc_types.h"
30#include "dpcd_defs.h"
31#include "grph_object_defs.h"
32#include "logger_types.h"
33#include "gpio_types.h"
34#include "link_service_types.h"
35
36#define MAX_TARGETS 6
Harry Wentland091a97e2016-12-06 12:25:52 -050037#define MAX_SURFACES 3
Harry Wentland45622362017-09-12 15:58:20 -040038#define MAX_SINKS_PER_LINK 4
39
40/*******************************************************************************
41 * Display Core Interfaces
42 ******************************************************************************/
43
44struct dc_caps {
45 uint32_t max_targets;
46 uint32_t max_links;
47 uint32_t max_audios;
48 uint32_t max_slave_planes;
49 uint32_t max_downscale_ratio;
50 uint32_t i2c_speed_in_khz;
51};
52
53
54struct dc_dcc_surface_param {
55 enum surface_pixel_format format;
56 struct dc_size surface_size;
57 enum dc_scan_direction scan;
58};
59
60struct dc_dcc_setting {
61 unsigned int max_compressed_blk_size;
62 unsigned int max_uncompressed_blk_size;
63 bool independent_64b_blks;
64};
65
66struct dc_surface_dcc_cap {
67 bool capable;
68 bool const_color_support;
69
70 union {
71 struct {
72 struct dc_dcc_setting rgb;
73 } grph;
74
75 struct {
76 struct dc_dcc_setting luma;
77 struct dc_dcc_setting chroma;
78 } video;
79 };
80};
81
82/* Forward declaration*/
83struct dc;
84struct dc_surface;
85struct validate_context;
86
87struct dc_cap_funcs {
88 int i;
89};
90
91struct dc_stream_funcs {
92 bool (*adjust_vmin_vmax)(struct dc *dc,
93 const struct dc_stream **stream,
94 int num_streams,
95 int vmin,
96 int vmax);
97
98 void (*stream_update_scaling)(const struct dc *dc,
99 const struct dc_stream *dc_stream,
100 const struct rect *src,
101 const struct rect *dst);
102 bool (*set_gamut_remap)(struct dc *dc,
103 const struct dc_stream **stream, int num_streams);
104 bool (*set_backlight)(struct dc *dc, unsigned int backlight_level,
105 unsigned int frame_ramp, const struct dc_stream *stream);
106 bool (*init_dmcu_backlight_settings)(struct dc *dc);
107 bool (*set_abm_level)(struct dc *dc, unsigned int abm_level);
108 bool (*set_psr_enable)(struct dc *dc, bool enable);
109 bool (*setup_psr)(struct dc *dc, const struct dc_stream *stream);
110};
111
112struct link_training_settings;
113
114struct dc_link_funcs {
115 void (*set_drive_settings)(struct dc *dc,
116 struct link_training_settings *lt_settings);
117 void (*perform_link_training)(struct dc *dc,
118 struct dc_link_settings *link_setting,
119 bool skip_video_pattern);
120 void (*set_preferred_link_settings)(struct dc *dc,
121 struct dc_link_settings *link_setting);
122 void (*enable_hpd)(const struct dc_link *link);
123 void (*disable_hpd)(const struct dc_link *link);
124 void (*set_test_pattern)(
125 const struct dc_link *link,
126 enum dp_test_pattern test_pattern,
127 const struct link_training_settings *p_link_settings,
128 const unsigned char *p_custom_pattern,
129 unsigned int cust_pattern_size);
130};
131
132/* Structure to hold configuration flags set by dm at dc creation. */
133struct dc_config {
134 bool gpu_vm_support;
135 bool disable_disp_pll_sharing;
136};
137
138struct dc_debug {
139 bool surface_visual_confirm;
140 bool max_disp_clk;
141 bool target_trace;
142 bool surface_trace;
Yongqiang Sun94749802016-12-08 09:47:11 -0500143 bool timing_trace;
Harry Wentland45622362017-09-12 15:58:20 -0400144 bool validation_trace;
145 bool disable_stutter;
146 bool disable_dcc;
147 bool disable_dfs_bypass;
148 bool disable_power_gate;
149 bool disable_clock_gate;
150};
151
152struct dc {
153 struct dc_caps caps;
154 struct dc_cap_funcs cap_funcs;
155 struct dc_stream_funcs stream_funcs;
156 struct dc_link_funcs link_funcs;
157 struct dc_config config;
158 struct dc_debug debug;
159};
160
161enum frame_buffer_mode {
162 FRAME_BUFFER_MODE_LOCAL_ONLY = 0,
163 FRAME_BUFFER_MODE_ZFB_ONLY,
164 FRAME_BUFFER_MODE_MIXED_ZFB_AND_LOCAL,
165} ;
166
167struct dchub_init_data {
168 bool dchub_initialzied;
169 bool dchub_info_valid;
170 int64_t zfb_phys_addr_base;
171 int64_t zfb_mc_base_addr;
172 uint64_t zfb_size_in_byte;
173 enum frame_buffer_mode fb_mode;
174};
175
176struct dc_init_data {
177 struct hw_asic_id asic_id;
178 void *driver; /* ctx */
179 struct cgs_device *cgs_device;
180
181 int num_virtual_links;
182 /*
183 * If 'vbios_override' not NULL, it will be called instead
184 * of the real VBIOS. Intended use is Diagnostics on FPGA.
185 */
186 struct dc_bios *vbios_override;
187 enum dce_environment dce_environment;
188
189 struct dc_config flags;
190};
191
192struct dc *dc_create(const struct dc_init_data *init_params);
193
194void dc_destroy(struct dc **dc);
195
196bool dc_init_dchub(struct dc *dc, struct dchub_init_data *dh_data);
197
198/*******************************************************************************
199 * Surface Interfaces
200 ******************************************************************************/
201
202enum {
203 RGB_256X3X16 = 256,
204 FLOAT_GAMMA_RAMP_MAX = 1025
205};
206
207enum dc_gamma_ramp_type {
208 GAMMA_RAMP_RBG256X3X16,
209 GAMMA_RAMP_FLOAT,
210};
211
212struct float_rgb {
213 struct fixed32_32 red;
214 struct fixed32_32 green;
215 struct fixed32_32 blue;
216};
217
218struct dc_gamma_ramp_float {
219 struct float_rgb scale;
220 struct float_rgb offset;
221 struct float_rgb gamma_curve[FLOAT_GAMMA_RAMP_MAX];
222};
223
224struct dc_gamma_ramp_rgb256x3x16 {
225 uint16_t red[RGB_256X3X16];
226 uint16_t green[RGB_256X3X16];
227 uint16_t blue[RGB_256X3X16];
228};
229
230struct dc_gamma {
231 enum dc_gamma_ramp_type type;
232 union {
233 struct dc_gamma_ramp_rgb256x3x16 gamma_ramp_rgb256x3x16;
234 struct dc_gamma_ramp_float gamma_ramp_float;
235 };
236 uint32_t size;
237};
238
239struct dc_surface {
240 bool visible;
241 bool flip_immediate;
242 struct dc_plane_address address;
243
244 struct scaling_taps scaling_quality;
245 struct rect src_rect;
246 struct rect dst_rect;
247 struct rect clip_rect;
248
249 union plane_size plane_size;
250 union dc_tiling_info tiling_info;
251 struct dc_plane_dcc_param dcc;
252 enum dc_color_space color_space;
253
254 enum surface_pixel_format format;
255 enum dc_rotation_angle rotation;
256 bool horizontal_mirror;
257 enum plane_stereo_format stereo_format;
258
259 const struct dc_gamma *gamma_correction;
260};
261
262struct dc_plane_info {
263 union plane_size plane_size;
264 union dc_tiling_info tiling_info;
265 enum surface_pixel_format format;
266 enum dc_rotation_angle rotation;
267 bool horizontal_mirror;
268 enum plane_stereo_format stereo_format;
269 enum dc_color_space color_space; /*todo: wrong place, fits in scaling info*/
270 bool visible;
271};
272
273struct dc_scaling_info {
274 struct rect src_rect;
275 struct rect dst_rect;
276 struct rect clip_rect;
277 struct scaling_taps scaling_quality;
278};
279
280struct dc_surface_update {
281 const struct dc_surface *surface;
282
283 /* isr safe update parameters. null means no updates */
284 struct dc_flip_addrs *flip_addr;
285 struct dc_plane_info *plane_info;
286 struct dc_scaling_info *scaling_info;
287 /* following updates require alloc/sleep/spin that is not isr safe,
288 * null means no updates
289 */
290 struct dc_gamma *gamma;
291
292
293};
294/*
295 * This structure is filled in by dc_surface_get_status and contains
296 * the last requested address and the currently active address so the called
297 * can determine if there are any outstanding flips
298 */
299struct dc_surface_status {
300 struct dc_plane_address requested_address;
301 struct dc_plane_address current_address;
302 bool is_flip_pending;
303};
304
305/*
306 * Create a new surface with default parameters;
307 */
308struct dc_surface *dc_create_surface(const struct dc *dc);
309const struct dc_surface_status *dc_surface_get_status(
310 const struct dc_surface *dc_surface);
311
312void dc_surface_retain(const struct dc_surface *dc_surface);
313void dc_surface_release(const struct dc_surface *dc_surface);
314
Amy Zhang89e89632016-12-12 10:32:24 -0500315void dc_gamma_retain(const struct dc_gamma *dc_gamma);
Harry Wentland45622362017-09-12 15:58:20 -0400316void dc_gamma_release(const struct dc_gamma *dc_gamma);
317struct dc_gamma *dc_create_gamma(void);
318
319/*
320 * This structure holds a surface address. There could be multiple addresses
321 * in cases such as Stereo 3D, Planar YUV, etc. Other per-flip attributes such
322 * as frame durations and DCC format can also be set.
323 */
324struct dc_flip_addrs {
325 struct dc_plane_address address;
326 bool flip_immediate;
327 /* TODO: DCC format info */
328 /* TODO: add flip duration for FreeSync */
329};
330
331/*
332 * Optimized flip address update function.
333 *
334 * After this call:
335 * Surface addresses and flip attributes are programmed.
336 * Surface flip occur at next configured time (h_sync or v_sync flip)
337 */
338void dc_flip_surface_addrs(struct dc *dc,
339 const struct dc_surface *const surfaces[],
340 struct dc_flip_addrs flip_addrs[],
341 uint32_t count);
342
343/*
344 * Set up surface attributes and associate to a target
345 * The surfaces parameter is an absolute set of all surface active for the target.
346 * If no surfaces are provided, the target will be blanked; no memory read.
347 * Any flip related attribute changes must be done through this interface.
348 *
349 * After this call:
350 * Surfaces attributes are programmed and configured to be composed into target.
351 * This does not trigger a flip. No surface address is programmed.
352 */
353
354bool dc_commit_surfaces_to_target(
355 struct dc *dc,
356 const struct dc_surface **dc_surfaces,
357 uint8_t surface_count,
358 struct dc_target *dc_target);
359
360bool dc_pre_update_surfaces_to_target(
361 struct dc *dc,
362 const struct dc_surface *const *new_surfaces,
363 uint8_t new_surface_count,
364 struct dc_target *dc_target);
365
366bool dc_post_update_surfaces_to_target(
367 struct dc *dc);
368
369void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *updates,
370 int surface_count, struct dc_target *dc_target);
371
372/*******************************************************************************
373 * Target Interfaces
374 ******************************************************************************/
375#define MAX_STREAM_NUM 1
376
377struct dc_target {
378 uint8_t stream_count;
379 const struct dc_stream *streams[MAX_STREAM_NUM];
380};
381
382/*
383 * Target status is returned from dc_target_get_status in order to get the
384 * the IRQ source, current frame counter and currently attached surfaces.
385 */
386struct dc_target_status {
387 int primary_otg_inst;
388 int cur_frame_count;
389 int surface_count;
390 const struct dc_surface *surfaces[MAX_SURFACE_NUM];
391};
392
393struct dc_target *dc_create_target_for_streams(
394 struct dc_stream *dc_streams[],
395 uint8_t stream_count);
396
397/*
398 * Get the current target status.
399 */
400const struct dc_target_status *dc_target_get_status(
401 const struct dc_target* dc_target);
402
403void dc_target_retain(const struct dc_target *dc_target);
404void dc_target_release(const struct dc_target *dc_target);
405void dc_target_log(
406 const struct dc_target *dc_target,
407 struct dal_logger *dc_logger,
408 enum dc_log_type log_type);
409
410uint8_t dc_get_current_target_count(const struct dc *dc);
411struct dc_target *dc_get_target_at_index(const struct dc *dc, uint8_t i);
412
413bool dc_target_is_connected_to_sink(
414 const struct dc_target *dc_target,
415 const struct dc_sink *dc_sink);
416
417uint32_t dc_target_get_vblank_counter(const struct dc_target *dc_target);
418
419/* TODO: Return parsed values rather than direct register read
420 * This has a dependency on the caller (amdgpu_get_crtc_scanoutpos)
421 * being refactored properly to be dce-specific
422 */
423uint32_t dc_target_get_scanoutpos(
424 const struct dc_target *dc_target,
425 uint32_t *vbl,
426 uint32_t *position);
427
428/*
429 * Structure to store surface/target associations for validation
430 */
431struct dc_validation_set {
432 const struct dc_target *target;
433 const struct dc_surface *surfaces[MAX_SURFACES];
434 uint8_t surface_count;
435};
436
437/*
438 * This function takes a set of resources and checks that they are cofunctional.
439 *
440 * After this call:
441 * No hardware is programmed for call. Only validation is done.
442 */
443bool dc_validate_resources(
444 const struct dc *dc,
445 const struct dc_validation_set set[],
446 uint8_t set_count);
447
448/*
449 * This function takes a target and checks if it is guaranteed to be supported.
450 * Guaranteed means that MAX_COFUNC*target is supported.
451 *
452 * After this call:
453 * No hardware is programmed for call. Only validation is done.
454 */
455
456bool dc_validate_guaranteed(
457 const struct dc *dc,
458 const struct dc_target *dc_target);
459
460/*
461 * Set up streams and links associated to targets to drive sinks
462 * The targets parameter is an absolute set of all active targets.
463 *
464 * After this call:
465 * Phy, Encoder, Timing Generator are programmed and enabled.
466 * New targets are enabled with blank stream; no memory read.
467 */
468bool dc_commit_targets(
469 struct dc *dc,
470 struct dc_target *targets[],
471 uint8_t target_count);
472
473/*******************************************************************************
474 * Stream Interfaces
475 ******************************************************************************/
476struct dc_stream {
477 const struct dc_sink *sink;
478 struct dc_crtc_timing timing;
479
480 enum dc_color_space output_color_space;
481
482 struct rect src; /* viewport in target space*/
483 struct rect dst; /* stream addressable area */
484
485 struct audio_info audio_info;
486
487 bool ignore_msa_timing_param;
488
489 struct freesync_context freesync_ctx;
490
491 /* TODO: dithering */
492 /* TODO: transfer function (CSC/regamma/gamut remap) */
493 struct colorspace_transform gamut_remap_matrix;
494 struct csc_transform csc_color_matrix;
495 /* TODO: custom INFO packets */
496 /* TODO: ABM info (DMCU) */
497 /* TODO: PSR info */
498 /* TODO: CEA VIC */
499};
500
501/**
502 * Create a new default stream for the requested sink
503 */
504struct dc_stream *dc_create_stream_for_sink(const struct dc_sink *dc_sink);
505
506void dc_stream_retain(const struct dc_stream *dc_stream);
507void dc_stream_release(const struct dc_stream *dc_stream);
508
509struct dc_stream_status {
510 /*
511 * link this stream passes through
512 */
513 const struct dc_link *link;
514};
515
516const struct dc_stream_status *dc_stream_get_status(
517 const struct dc_stream *dc_stream);
518
519/*******************************************************************************
520 * Link Interfaces
521 ******************************************************************************/
522
523/*
524 * A link contains one or more sinks and their connected status.
525 * The currently active signal type (HDMI, DP-SST, DP-MST) is also reported.
526 */
527struct dc_link {
528 const struct dc_sink *remote_sinks[MAX_SINKS_PER_LINK];
529 unsigned int sink_count;
530 const struct dc_sink *local_sink;
531 unsigned int link_index;
532 enum dc_connection_type type;
533 enum signal_type connector_signal;
534 enum dc_irq_source irq_source_hpd;
535 enum dc_irq_source irq_source_hpd_rx;/* aka DP Short Pulse */
536 /* caps is the same as reported_link_cap. link_traing use
537 * reported_link_cap. Will clean up. TODO
538 */
539 struct dc_link_settings reported_link_cap;
540 struct dc_link_settings verified_link_cap;
541 struct dc_link_settings max_link_setting;
542 struct dc_link_settings cur_link_settings;
543 struct dc_lane_settings cur_lane_setting;
544
545 uint8_t ddc_hw_inst;
546 uint8_t link_enc_hw_inst;
547
548 struct psr_caps psr_caps;
549 bool test_pattern_enabled;
550 union compliance_test_state compliance_test_state;
551};
552
553struct dpcd_caps {
554 union dpcd_rev dpcd_rev;
555 union max_lane_count max_ln_count;
556 union max_down_spread max_down_spread;
557
558 /* dongle type (DP converter, CV smart dongle) */
559 enum display_dongle_type dongle_type;
560 /* Dongle's downstream count. */
561 union sink_count sink_count;
562 /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
563 indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
564 bool is_dp_hdmi_s3d_converter;
565
566 bool allow_invalid_MSA_timing_param;
567 bool panel_mode_edp;
568 uint32_t sink_dev_id;
569 uint32_t branch_dev_id;
570 int8_t branch_dev_name[6];
571 int8_t branch_hw_revision;
572};
573
574struct dc_link_status {
575 struct dpcd_caps *dpcd_caps;
576};
577
578const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link);
579
580/*
581 * Return an enumerated dc_link. dc_link order is constant and determined at
582 * boot time. They cannot be created or destroyed.
583 * Use dc_get_caps() to get number of links.
584 */
585const struct dc_link *dc_get_link_at_index(const struct dc *dc, uint32_t link_index);
586
587/* Return id of physical connector represented by a dc_link at link_index.*/
588const struct graphics_object_id dc_get_link_id_at_index(
589 struct dc *dc, uint32_t link_index);
590
591/* Set backlight level of an embedded panel (eDP, LVDS). */
592bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
593 uint32_t frame_ramp, const struct dc_stream *stream);
594
595bool dc_link_init_dmcu_backlight_settings(const struct dc_link *dc_link);
596
597bool dc_link_set_abm_level(const struct dc_link *dc_link, uint32_t level);
598
599bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable);
600
601bool dc_link_setup_psr(const struct dc_link *dc_link,
602 const struct dc_stream *stream);
603
604/* Request DC to detect if there is a Panel connected.
605 * boot - If this call is during initial boot.
606 * Return false for any type of detection failure or MST detection
607 * true otherwise. True meaning further action is required (status update
608 * and OS notification).
609 */
610bool dc_link_detect(const struct dc_link *dc_link, bool boot);
611
612/* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
613 * Return:
614 * true - Downstream port status changed. DM should call DC to do the
615 * detection.
616 * false - no change in Downstream port status. No further action required
617 * from DM. */
618bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link);
619
620struct dc_sink_init_data;
621
622struct dc_sink *dc_link_add_remote_sink(
623 const struct dc_link *dc_link,
624 const uint8_t *edid,
625 int len,
626 struct dc_sink_init_data *init_data);
627
628void dc_link_remove_remote_sink(
629 const struct dc_link *link,
630 const struct dc_sink *sink);
631
632/* Used by diagnostics for virtual link at the moment */
633void dc_link_set_sink(const struct dc_link *link, struct dc_sink *sink);
634
635void dc_link_dp_set_drive_settings(
636 struct dc_link *link,
637 struct link_training_settings *lt_settings);
638
639bool dc_link_dp_perform_link_training(
640 struct dc_link *link,
641 const struct dc_link_settings *link_setting,
642 bool skip_video_pattern);
643
644void dc_link_dp_enable_hpd(const struct dc_link *link);
645
646void dc_link_dp_disable_hpd(const struct dc_link *link);
647
648bool dc_link_dp_set_test_pattern(
649 const struct dc_link *link,
650 enum dp_test_pattern test_pattern,
651 const struct link_training_settings *p_link_settings,
652 const unsigned char *p_custom_pattern,
653 unsigned int cust_pattern_size);
654
655/*******************************************************************************
656 * Sink Interfaces - A sink corresponds to a display output device
657 ******************************************************************************/
658
659/*
660 * The sink structure contains EDID and other display device properties
661 */
662struct dc_sink {
663 enum signal_type sink_signal;
664 struct dc_edid dc_edid; /* raw edid */
665 struct dc_edid_caps edid_caps; /* parse display caps */
666};
667
668void dc_sink_retain(const struct dc_sink *sink);
669void dc_sink_release(const struct dc_sink *sink);
670
671const struct audio **dc_get_audios(struct dc *dc);
672
673struct dc_sink_init_data {
674 enum signal_type sink_signal;
675 const struct dc_link *link;
676 uint32_t dongle_max_pix_clk;
677 bool converter_disable_audio;
678};
679
680struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);
681
682/*******************************************************************************
683 * Cursor interfaces - To manages the cursor within a target
684 ******************************************************************************/
685/* TODO: Deprecated once we switch to dc_set_cursor_position */
686bool dc_target_set_cursor_attributes(
687 struct dc_target *dc_target,
688 const struct dc_cursor_attributes *attributes);
689
690bool dc_target_set_cursor_position(
691 struct dc_target *dc_target,
692 const struct dc_cursor_position *position);
693
694/* Newer interfaces */
695struct dc_cursor {
696 struct dc_plane_address address;
697 struct dc_cursor_attributes attributes;
698};
699
700/*
701 * Create a new cursor with default values for a given target.
702 */
703struct dc_cursor *dc_create_cursor_for_target(
704 const struct dc *dc,
705 struct dc_target *dc_target);
706
707/**
708 * Commit cursor attribute changes such as pixel format and dimensions and
709 * surface address.
710 *
711 * After this call:
712 * Cursor address and format is programmed to the new values.
713 * Cursor position is unmodified.
714 */
715bool dc_commit_cursor(
716 const struct dc *dc,
717 struct dc_cursor *cursor);
718
719/*
720 * Optimized cursor position update
721 *
722 * After this call:
723 * Cursor position will be programmed as well as enable/disable bit.
724 */
725bool dc_set_cursor_position(
726 const struct dc *dc,
727 struct dc_cursor *cursor,
728 struct dc_cursor_position *pos);
729
730/*******************************************************************************
731 * Interrupt interfaces
732 ******************************************************************************/
733enum dc_irq_source dc_interrupt_to_irq_source(
734 struct dc *dc,
735 uint32_t src_id,
736 uint32_t ext_id);
737void dc_interrupt_set(const struct dc *dc, enum dc_irq_source src, bool enable);
738void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src);
739enum dc_irq_source dc_get_hpd_irq_source_at_index(
740 struct dc *dc, uint32_t link_index);
741
742/*******************************************************************************
743 * Power Interfaces
744 ******************************************************************************/
745
746void dc_set_power_state(
747 struct dc *dc,
748 enum dc_acpi_cm_power_state power_state,
749 enum dc_video_power_state video_power_state);
750void dc_resume(const struct dc *dc);
751
752/*******************************************************************************
753 * DDC Interfaces
754 ******************************************************************************/
755
756const struct ddc_service *dc_get_ddc_at_index(
757 struct dc *dc, uint32_t link_index);
758
759/*
760 * DPCD access interfaces
761 */
762
763bool dc_read_dpcd(
764 struct dc *dc,
765 uint32_t link_index,
766 uint32_t address,
767 uint8_t *data,
768 uint32_t size);
769
770bool dc_write_dpcd(
771 struct dc *dc,
772 uint32_t link_index,
773 uint32_t address,
774 const uint8_t *data,
775 uint32_t size);
776
777bool dc_submit_i2c(
778 struct dc *dc,
779 uint32_t link_index,
780 struct i2c_command *cmd);
781
782#endif /* DC_INTERFACE_H_ */