blob: bb7cdde3e37bc2ef0abfff211c2608120f04f2e1 [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
315void dc_gamma_release(const struct dc_gamma *dc_gamma);
316struct dc_gamma *dc_create_gamma(void);
317
318/*
319 * This structure holds a surface address. There could be multiple addresses
320 * in cases such as Stereo 3D, Planar YUV, etc. Other per-flip attributes such
321 * as frame durations and DCC format can also be set.
322 */
323struct dc_flip_addrs {
324 struct dc_plane_address address;
325 bool flip_immediate;
326 /* TODO: DCC format info */
327 /* TODO: add flip duration for FreeSync */
328};
329
330/*
331 * Optimized flip address update function.
332 *
333 * After this call:
334 * Surface addresses and flip attributes are programmed.
335 * Surface flip occur at next configured time (h_sync or v_sync flip)
336 */
337void dc_flip_surface_addrs(struct dc *dc,
338 const struct dc_surface *const surfaces[],
339 struct dc_flip_addrs flip_addrs[],
340 uint32_t count);
341
342/*
343 * Set up surface attributes and associate to a target
344 * The surfaces parameter is an absolute set of all surface active for the target.
345 * If no surfaces are provided, the target will be blanked; no memory read.
346 * Any flip related attribute changes must be done through this interface.
347 *
348 * After this call:
349 * Surfaces attributes are programmed and configured to be composed into target.
350 * This does not trigger a flip. No surface address is programmed.
351 */
352
353bool dc_commit_surfaces_to_target(
354 struct dc *dc,
355 const struct dc_surface **dc_surfaces,
356 uint8_t surface_count,
357 struct dc_target *dc_target);
358
359bool dc_pre_update_surfaces_to_target(
360 struct dc *dc,
361 const struct dc_surface *const *new_surfaces,
362 uint8_t new_surface_count,
363 struct dc_target *dc_target);
364
365bool dc_post_update_surfaces_to_target(
366 struct dc *dc);
367
368void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *updates,
369 int surface_count, struct dc_target *dc_target);
370
371/*******************************************************************************
372 * Target Interfaces
373 ******************************************************************************/
374#define MAX_STREAM_NUM 1
375
376struct dc_target {
377 uint8_t stream_count;
378 const struct dc_stream *streams[MAX_STREAM_NUM];
379};
380
381/*
382 * Target status is returned from dc_target_get_status in order to get the
383 * the IRQ source, current frame counter and currently attached surfaces.
384 */
385struct dc_target_status {
386 int primary_otg_inst;
387 int cur_frame_count;
388 int surface_count;
389 const struct dc_surface *surfaces[MAX_SURFACE_NUM];
390};
391
392struct dc_target *dc_create_target_for_streams(
393 struct dc_stream *dc_streams[],
394 uint8_t stream_count);
395
396/*
397 * Get the current target status.
398 */
399const struct dc_target_status *dc_target_get_status(
400 const struct dc_target* dc_target);
401
402void dc_target_retain(const struct dc_target *dc_target);
403void dc_target_release(const struct dc_target *dc_target);
404void dc_target_log(
405 const struct dc_target *dc_target,
406 struct dal_logger *dc_logger,
407 enum dc_log_type log_type);
408
409uint8_t dc_get_current_target_count(const struct dc *dc);
410struct dc_target *dc_get_target_at_index(const struct dc *dc, uint8_t i);
411
412bool dc_target_is_connected_to_sink(
413 const struct dc_target *dc_target,
414 const struct dc_sink *dc_sink);
415
416uint32_t dc_target_get_vblank_counter(const struct dc_target *dc_target);
417
418/* TODO: Return parsed values rather than direct register read
419 * This has a dependency on the caller (amdgpu_get_crtc_scanoutpos)
420 * being refactored properly to be dce-specific
421 */
422uint32_t dc_target_get_scanoutpos(
423 const struct dc_target *dc_target,
424 uint32_t *vbl,
425 uint32_t *position);
426
427/*
428 * Structure to store surface/target associations for validation
429 */
430struct dc_validation_set {
431 const struct dc_target *target;
432 const struct dc_surface *surfaces[MAX_SURFACES];
433 uint8_t surface_count;
434};
435
436/*
437 * This function takes a set of resources and checks that they are cofunctional.
438 *
439 * After this call:
440 * No hardware is programmed for call. Only validation is done.
441 */
442bool dc_validate_resources(
443 const struct dc *dc,
444 const struct dc_validation_set set[],
445 uint8_t set_count);
446
447/*
448 * This function takes a target and checks if it is guaranteed to be supported.
449 * Guaranteed means that MAX_COFUNC*target is supported.
450 *
451 * After this call:
452 * No hardware is programmed for call. Only validation is done.
453 */
454
455bool dc_validate_guaranteed(
456 const struct dc *dc,
457 const struct dc_target *dc_target);
458
459/*
460 * Set up streams and links associated to targets to drive sinks
461 * The targets parameter is an absolute set of all active targets.
462 *
463 * After this call:
464 * Phy, Encoder, Timing Generator are programmed and enabled.
465 * New targets are enabled with blank stream; no memory read.
466 */
467bool dc_commit_targets(
468 struct dc *dc,
469 struct dc_target *targets[],
470 uint8_t target_count);
471
472/*******************************************************************************
473 * Stream Interfaces
474 ******************************************************************************/
475struct dc_stream {
476 const struct dc_sink *sink;
477 struct dc_crtc_timing timing;
478
479 enum dc_color_space output_color_space;
480
481 struct rect src; /* viewport in target space*/
482 struct rect dst; /* stream addressable area */
483
484 struct audio_info audio_info;
485
486 bool ignore_msa_timing_param;
487
488 struct freesync_context freesync_ctx;
489
490 /* TODO: dithering */
491 /* TODO: transfer function (CSC/regamma/gamut remap) */
492 struct colorspace_transform gamut_remap_matrix;
493 struct csc_transform csc_color_matrix;
494 /* TODO: custom INFO packets */
495 /* TODO: ABM info (DMCU) */
496 /* TODO: PSR info */
497 /* TODO: CEA VIC */
498};
499
500/**
501 * Create a new default stream for the requested sink
502 */
503struct dc_stream *dc_create_stream_for_sink(const struct dc_sink *dc_sink);
504
505void dc_stream_retain(const struct dc_stream *dc_stream);
506void dc_stream_release(const struct dc_stream *dc_stream);
507
508struct dc_stream_status {
509 /*
510 * link this stream passes through
511 */
512 const struct dc_link *link;
513};
514
515const struct dc_stream_status *dc_stream_get_status(
516 const struct dc_stream *dc_stream);
517
518/*******************************************************************************
519 * Link Interfaces
520 ******************************************************************************/
521
522/*
523 * A link contains one or more sinks and their connected status.
524 * The currently active signal type (HDMI, DP-SST, DP-MST) is also reported.
525 */
526struct dc_link {
527 const struct dc_sink *remote_sinks[MAX_SINKS_PER_LINK];
528 unsigned int sink_count;
529 const struct dc_sink *local_sink;
530 unsigned int link_index;
531 enum dc_connection_type type;
532 enum signal_type connector_signal;
533 enum dc_irq_source irq_source_hpd;
534 enum dc_irq_source irq_source_hpd_rx;/* aka DP Short Pulse */
535 /* caps is the same as reported_link_cap. link_traing use
536 * reported_link_cap. Will clean up. TODO
537 */
538 struct dc_link_settings reported_link_cap;
539 struct dc_link_settings verified_link_cap;
540 struct dc_link_settings max_link_setting;
541 struct dc_link_settings cur_link_settings;
542 struct dc_lane_settings cur_lane_setting;
543
544 uint8_t ddc_hw_inst;
545 uint8_t link_enc_hw_inst;
546
547 struct psr_caps psr_caps;
548 bool test_pattern_enabled;
549 union compliance_test_state compliance_test_state;
550};
551
552struct dpcd_caps {
553 union dpcd_rev dpcd_rev;
554 union max_lane_count max_ln_count;
555 union max_down_spread max_down_spread;
556
557 /* dongle type (DP converter, CV smart dongle) */
558 enum display_dongle_type dongle_type;
559 /* Dongle's downstream count. */
560 union sink_count sink_count;
561 /* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
562 indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
563 bool is_dp_hdmi_s3d_converter;
564
565 bool allow_invalid_MSA_timing_param;
566 bool panel_mode_edp;
567 uint32_t sink_dev_id;
568 uint32_t branch_dev_id;
569 int8_t branch_dev_name[6];
570 int8_t branch_hw_revision;
571};
572
573struct dc_link_status {
574 struct dpcd_caps *dpcd_caps;
575};
576
577const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link);
578
579/*
580 * Return an enumerated dc_link. dc_link order is constant and determined at
581 * boot time. They cannot be created or destroyed.
582 * Use dc_get_caps() to get number of links.
583 */
584const struct dc_link *dc_get_link_at_index(const struct dc *dc, uint32_t link_index);
585
586/* Return id of physical connector represented by a dc_link at link_index.*/
587const struct graphics_object_id dc_get_link_id_at_index(
588 struct dc *dc, uint32_t link_index);
589
590/* Set backlight level of an embedded panel (eDP, LVDS). */
591bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
592 uint32_t frame_ramp, const struct dc_stream *stream);
593
594bool dc_link_init_dmcu_backlight_settings(const struct dc_link *dc_link);
595
596bool dc_link_set_abm_level(const struct dc_link *dc_link, uint32_t level);
597
598bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable);
599
600bool dc_link_setup_psr(const struct dc_link *dc_link,
601 const struct dc_stream *stream);
602
603/* Request DC to detect if there is a Panel connected.
604 * boot - If this call is during initial boot.
605 * Return false for any type of detection failure or MST detection
606 * true otherwise. True meaning further action is required (status update
607 * and OS notification).
608 */
609bool dc_link_detect(const struct dc_link *dc_link, bool boot);
610
611/* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
612 * Return:
613 * true - Downstream port status changed. DM should call DC to do the
614 * detection.
615 * false - no change in Downstream port status. No further action required
616 * from DM. */
617bool dc_link_handle_hpd_rx_irq(const struct dc_link *dc_link);
618
619struct dc_sink_init_data;
620
621struct dc_sink *dc_link_add_remote_sink(
622 const struct dc_link *dc_link,
623 const uint8_t *edid,
624 int len,
625 struct dc_sink_init_data *init_data);
626
627void dc_link_remove_remote_sink(
628 const struct dc_link *link,
629 const struct dc_sink *sink);
630
631/* Used by diagnostics for virtual link at the moment */
632void dc_link_set_sink(const struct dc_link *link, struct dc_sink *sink);
633
634void dc_link_dp_set_drive_settings(
635 struct dc_link *link,
636 struct link_training_settings *lt_settings);
637
638bool dc_link_dp_perform_link_training(
639 struct dc_link *link,
640 const struct dc_link_settings *link_setting,
641 bool skip_video_pattern);
642
643void dc_link_dp_enable_hpd(const struct dc_link *link);
644
645void dc_link_dp_disable_hpd(const struct dc_link *link);
646
647bool dc_link_dp_set_test_pattern(
648 const struct dc_link *link,
649 enum dp_test_pattern test_pattern,
650 const struct link_training_settings *p_link_settings,
651 const unsigned char *p_custom_pattern,
652 unsigned int cust_pattern_size);
653
654/*******************************************************************************
655 * Sink Interfaces - A sink corresponds to a display output device
656 ******************************************************************************/
657
658/*
659 * The sink structure contains EDID and other display device properties
660 */
661struct dc_sink {
662 enum signal_type sink_signal;
663 struct dc_edid dc_edid; /* raw edid */
664 struct dc_edid_caps edid_caps; /* parse display caps */
665};
666
667void dc_sink_retain(const struct dc_sink *sink);
668void dc_sink_release(const struct dc_sink *sink);
669
670const struct audio **dc_get_audios(struct dc *dc);
671
672struct dc_sink_init_data {
673 enum signal_type sink_signal;
674 const struct dc_link *link;
675 uint32_t dongle_max_pix_clk;
676 bool converter_disable_audio;
677};
678
679struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);
680
681/*******************************************************************************
682 * Cursor interfaces - To manages the cursor within a target
683 ******************************************************************************/
684/* TODO: Deprecated once we switch to dc_set_cursor_position */
685bool dc_target_set_cursor_attributes(
686 struct dc_target *dc_target,
687 const struct dc_cursor_attributes *attributes);
688
689bool dc_target_set_cursor_position(
690 struct dc_target *dc_target,
691 const struct dc_cursor_position *position);
692
693/* Newer interfaces */
694struct dc_cursor {
695 struct dc_plane_address address;
696 struct dc_cursor_attributes attributes;
697};
698
699/*
700 * Create a new cursor with default values for a given target.
701 */
702struct dc_cursor *dc_create_cursor_for_target(
703 const struct dc *dc,
704 struct dc_target *dc_target);
705
706/**
707 * Commit cursor attribute changes such as pixel format and dimensions and
708 * surface address.
709 *
710 * After this call:
711 * Cursor address and format is programmed to the new values.
712 * Cursor position is unmodified.
713 */
714bool dc_commit_cursor(
715 const struct dc *dc,
716 struct dc_cursor *cursor);
717
718/*
719 * Optimized cursor position update
720 *
721 * After this call:
722 * Cursor position will be programmed as well as enable/disable bit.
723 */
724bool dc_set_cursor_position(
725 const struct dc *dc,
726 struct dc_cursor *cursor,
727 struct dc_cursor_position *pos);
728
729/*******************************************************************************
730 * Interrupt interfaces
731 ******************************************************************************/
732enum dc_irq_source dc_interrupt_to_irq_source(
733 struct dc *dc,
734 uint32_t src_id,
735 uint32_t ext_id);
736void dc_interrupt_set(const struct dc *dc, enum dc_irq_source src, bool enable);
737void dc_interrupt_ack(struct dc *dc, enum dc_irq_source src);
738enum dc_irq_source dc_get_hpd_irq_source_at_index(
739 struct dc *dc, uint32_t link_index);
740
741/*******************************************************************************
742 * Power Interfaces
743 ******************************************************************************/
744
745void dc_set_power_state(
746 struct dc *dc,
747 enum dc_acpi_cm_power_state power_state,
748 enum dc_video_power_state video_power_state);
749void dc_resume(const struct dc *dc);
750
751/*******************************************************************************
752 * DDC Interfaces
753 ******************************************************************************/
754
755const struct ddc_service *dc_get_ddc_at_index(
756 struct dc *dc, uint32_t link_index);
757
758/*
759 * DPCD access interfaces
760 */
761
762bool dc_read_dpcd(
763 struct dc *dc,
764 uint32_t link_index,
765 uint32_t address,
766 uint8_t *data,
767 uint32_t size);
768
769bool dc_write_dpcd(
770 struct dc *dc,
771 uint32_t link_index,
772 uint32_t address,
773 const uint8_t *data,
774 uint32_t size);
775
776bool dc_submit_i2c(
777 struct dc *dc,
778 uint32_t link_index,
779 struct i2c_command *cmd);
780
781#endif /* DC_INTERFACE_H_ */