2 * Copyright 2019 Advanced Micro Devices, Inc.
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:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
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.
30 * DOC: DMUB interface and operation
32 * DMUB is the interface to the display DMCUB microcontroller on DCN hardware.
33 * It delegates hardware initialization and command submission to the
34 * microcontroller. DMUB is the shortname for DMCUB.
36 * This interface is not thread-safe. Ensure that all access to the interface
37 * is properly synchronized by the caller.
39 * Initialization and usage of the DMUB service should be done in the
42 * 1. dmub_srv_create()
43 * 2. dmub_srv_has_hw_support()
44 * 3. dmub_srv_calc_region_info()
45 * 4. dmub_srv_hw_init()
47 * The call to dmub_srv_create() is required to use the server.
49 * The calls to dmub_srv_has_hw_support() and dmub_srv_calc_region_info()
50 * are helpers to query cache window size and allocate framebuffer(s)
51 * for the cache windows.
53 * The call to dmub_srv_hw_init() programs the DMCUB registers to prepare
54 * for command submission. Commands can be queued via dmub_srv_cmd_queue()
55 * and executed via dmub_srv_cmd_execute().
57 * If the queue is full the dmub_srv_wait_for_idle() call can be used to
58 * wait until the queue has been cleared.
60 * Destroying the DMUB service can be done by calling dmub_srv_destroy().
61 * This does not clear DMUB hardware state, only software state.
63 * The interface is intended to be standalone and should not depend on any
64 * other component within DAL.
67 #include "inc/dmub_cmd.h"
68 #include "dc/dc_types.h"
70 #if defined(__cplusplus)
74 /* Forward declarations */
76 struct dmub_srv_common_regs;
77 struct dmub_srv_dcn31_regs;
79 struct dmcub_trace_buf_entry;
81 /* enum dmub_status - return code for dmcub functions */
85 DMUB_STATUS_QUEUE_FULL,
88 DMUB_STATUS_HW_FAILURE,
91 /* enum dmub_asic - dmub asic identifier */
111 /* enum dmub_window_id - dmub window identifier */
112 enum dmub_window_id {
113 DMUB_WINDOW_0_INST_CONST = 0,
115 DMUB_WINDOW_2_BSS_DATA,
117 DMUB_WINDOW_4_MAILBOX,
118 DMUB_WINDOW_5_TRACEBUFF,
119 DMUB_WINDOW_6_FW_STATE,
120 DMUB_WINDOW_7_SCRATCH_MEM,
124 /* enum dmub_notification_type - dmub outbox notification identifier */
125 enum dmub_notification_type {
126 DMUB_NOTIFICATION_NO_DATA = 0,
127 DMUB_NOTIFICATION_AUX_REPLY,
128 DMUB_NOTIFICATION_HPD,
129 DMUB_NOTIFICATION_HPD_IRQ,
130 DMUB_NOTIFICATION_SET_CONFIG_REPLY,
131 DMUB_NOTIFICATION_DPIA_NOTIFICATION,
132 DMUB_NOTIFICATION_MAX
136 * DPIA NOTIFICATION Response Type
138 enum dpia_notify_bw_alloc_status {
140 DPIA_BW_REQ_FAILED = 0,
143 DPIA_BW_ALLOC_CAPS_CHANGED
146 /* enum dmub_memory_access_type - memory access method */
147 enum dmub_memory_access_type {
148 DMUB_MEMORY_ACCESS_DEFAULT,
149 DMUB_MEMORY_ACCESS_CPU = DMUB_MEMORY_ACCESS_DEFAULT,
150 DMUB_MEMORY_ACCESS_DMA
154 * struct dmub_region - dmub hw memory region
155 * @base: base address for region, must be 256 byte aligned
156 * @top: top address for region
164 * struct dmub_window - dmub hw cache window
165 * @off: offset to the fb memory in gpu address space
166 * @r: region in uc address space for cache window
169 union dmub_addr offset;
170 struct dmub_region region;
174 * struct dmub_fb - defines a dmub framebuffer memory region
175 * @cpu_addr: cpu virtual address for the region, NULL if invalid
176 * @gpu_addr: gpu virtual address for the region, NULL if invalid
177 * @size: size of the region in bytes, zero if invalid
186 * struct dmub_srv_region_params - params used for calculating dmub regions
187 * @inst_const_size: size of the fw inst const section
188 * @bss_data_size: size of the fw bss data section
189 * @vbios_size: size of the vbios data
190 * @fw_bss_data: raw firmware bss data section
192 struct dmub_srv_region_params {
193 uint32_t inst_const_size;
194 uint32_t bss_data_size;
196 const uint8_t *fw_inst_const;
197 const uint8_t *fw_bss_data;
201 * struct dmub_srv_region_info - output region info from the dmub service
202 * @fb_size: required minimum fb size for all regions, aligned to 4096 bytes
203 * @num_regions: number of regions used by the dmub service
204 * @regions: region info
206 * The regions are aligned such that they can be all placed within the
207 * same framebuffer but they can also be placed into different framebuffers.
209 * The size of each region can be calculated by the caller:
210 * size = reg.top - reg.base
212 * Care must be taken when performing custom allocations to ensure that each
213 * region base address is 256 byte aligned.
215 struct dmub_srv_region_info {
218 struct dmub_region regions[DMUB_WINDOW_TOTAL];
222 * struct dmub_srv_fb_params - parameters used for driver fb setup
223 * @region_info: region info calculated by dmub service
224 * @cpu_addr: base cpu address for the framebuffer
225 * @gpu_addr: base gpu virtual address for the framebuffer
227 struct dmub_srv_fb_params {
228 const struct dmub_srv_region_info *region_info;
234 * struct dmub_srv_fb_info - output fb info from the dmub service
235 * @num_fbs: number of required dmub framebuffers
236 * @fbs: fb data for each region
238 * Output from the dmub service helper that can be used by the
239 * driver to prepare dmub_fb that can be passed into the dmub
242 * Assumes that all regions are within the same framebuffer
243 * and have been setup according to the region_info generated
244 * by the dmub service.
246 struct dmub_srv_fb_info {
248 struct dmub_fb fb[DMUB_WINDOW_TOTAL];
252 * struct dmub_srv_hw_params - params for dmub hardware initialization
253 * @fb: framebuffer info for each region
254 * @fb_base: base of the framebuffer aperture
255 * @fb_offset: offset of the framebuffer aperture
256 * @psp_version: psp version to pass for DMCU init
257 * @load_inst_const: true if DMUB should load inst const fw
259 struct dmub_srv_hw_params {
260 struct dmub_fb *fb[DMUB_WINDOW_TOTAL];
263 uint32_t psp_version;
264 bool load_inst_const;
265 bool skip_panel_power_sequence;
267 bool power_optimization;
270 bool usb4_cm_version;
271 bool fw_in_system_memory;
272 bool dpia_hpd_int_enable_supported;
273 bool disable_clock_gate;
274 bool disallow_dispclk_dppclk_ds;
275 enum dmub_memory_access_type mem_access_type;
276 enum dmub_ips_disable_type disable_ips;
280 * struct dmub_diagnostic_data - Diagnostic data retrieved from DMCUB for
281 * debugging purposes, including logging, crash analysis, etc.
283 struct dmub_diagnostic_data {
284 uint32_t dmcub_version;
285 uint32_t scratch[17];
287 uint32_t undefined_address_fault_addr;
288 uint32_t inst_fetch_fault_addr;
289 uint32_t data_write_fault_addr;
290 uint32_t inbox1_rptr;
291 uint32_t inbox1_wptr;
292 uint32_t inbox1_size;
293 uint32_t inbox0_rptr;
294 uint32_t inbox0_wptr;
295 uint32_t inbox0_size;
296 uint32_t gpint_datain0;
297 uint8_t is_dmcub_enabled : 1;
298 uint8_t is_dmcub_soft_reset : 1;
299 uint8_t is_dmcub_secure_reset : 1;
300 uint8_t is_traceport_en : 1;
301 uint8_t is_cw0_enabled : 1;
302 uint8_t is_cw6_enabled : 1;
306 * struct dmub_srv_base_funcs - Driver specific base callbacks
308 struct dmub_srv_base_funcs {
312 * Hook for reading a register.
314 * Return: The 32-bit register value from the given address.
316 uint32_t (*reg_read)(void *ctx, uint32_t address);
321 * Hook for writing a value to the register specified by address.
323 void (*reg_write)(void *ctx, uint32_t address, uint32_t value);
327 * struct dmub_srv_hw_funcs - hardware sequencer funcs for dmub
329 struct dmub_srv_hw_funcs {
330 /* private: internal use only */
332 void (*init)(struct dmub_srv *dmub);
334 void (*reset)(struct dmub_srv *dmub);
336 void (*reset_release)(struct dmub_srv *dmub);
338 void (*backdoor_load)(struct dmub_srv *dmub,
339 const struct dmub_window *cw0,
340 const struct dmub_window *cw1);
342 void (*backdoor_load_zfb_mode)(struct dmub_srv *dmub,
343 const struct dmub_window *cw0,
344 const struct dmub_window *cw1);
345 void (*setup_windows)(struct dmub_srv *dmub,
346 const struct dmub_window *cw2,
347 const struct dmub_window *cw3,
348 const struct dmub_window *cw4,
349 const struct dmub_window *cw5,
350 const struct dmub_window *cw6);
352 void (*setup_mailbox)(struct dmub_srv *dmub,
353 const struct dmub_region *inbox1);
355 uint32_t (*get_inbox1_wptr)(struct dmub_srv *dmub);
357 uint32_t (*get_inbox1_rptr)(struct dmub_srv *dmub);
359 void (*set_inbox1_wptr)(struct dmub_srv *dmub, uint32_t wptr_offset);
361 void (*setup_out_mailbox)(struct dmub_srv *dmub,
362 const struct dmub_region *outbox1);
364 uint32_t (*get_outbox1_wptr)(struct dmub_srv *dmub);
366 void (*set_outbox1_rptr)(struct dmub_srv *dmub, uint32_t rptr_offset);
368 void (*setup_outbox0)(struct dmub_srv *dmub,
369 const struct dmub_region *outbox0);
371 uint32_t (*get_outbox0_wptr)(struct dmub_srv *dmub);
373 void (*set_outbox0_rptr)(struct dmub_srv *dmub, uint32_t rptr_offset);
375 uint32_t (*emul_get_inbox1_rptr)(struct dmub_srv *dmub);
377 void (*emul_set_inbox1_wptr)(struct dmub_srv *dmub, uint32_t wptr_offset);
379 bool (*is_supported)(struct dmub_srv *dmub);
381 bool (*is_psrsu_supported)(struct dmub_srv *dmub);
383 bool (*is_hw_init)(struct dmub_srv *dmub);
384 bool (*is_hw_powered_up)(struct dmub_srv *dmub);
386 void (*enable_dmub_boot_options)(struct dmub_srv *dmub,
387 const struct dmub_srv_hw_params *params);
389 void (*skip_dmub_panel_power_sequence)(struct dmub_srv *dmub, bool skip);
391 union dmub_fw_boot_status (*get_fw_status)(struct dmub_srv *dmub);
393 union dmub_fw_boot_options (*get_fw_boot_option)(struct dmub_srv *dmub);
395 void (*set_gpint)(struct dmub_srv *dmub,
396 union dmub_gpint_data_register reg);
398 bool (*is_gpint_acked)(struct dmub_srv *dmub,
399 union dmub_gpint_data_register reg);
401 uint32_t (*get_gpint_response)(struct dmub_srv *dmub);
403 uint32_t (*get_gpint_dataout)(struct dmub_srv *dmub);
405 void (*configure_dmub_in_system_memory)(struct dmub_srv *dmub);
406 void (*clear_inbox0_ack_register)(struct dmub_srv *dmub);
407 uint32_t (*read_inbox0_ack_register)(struct dmub_srv *dmub);
408 void (*send_inbox0_cmd)(struct dmub_srv *dmub, union dmub_inbox0_data_register data);
409 uint32_t (*get_current_time)(struct dmub_srv *dmub);
411 void (*get_diagnostic_data)(struct dmub_srv *dmub, struct dmub_diagnostic_data *dmub_oca);
413 bool (*should_detect)(struct dmub_srv *dmub);
414 void (*init_reg_offsets)(struct dmub_srv *dmub, struct dc_context *ctx);
416 void (*subvp_save_surf_addr)(struct dmub_srv *dmub, const struct dc_plane_address *addr, uint8_t subvp_index);
420 * struct dmub_srv_create_params - params for dmub service creation
421 * @base_funcs: driver supplied base routines
422 * @hw_funcs: optional overrides for hw funcs
423 * @user_ctx: context data for callback funcs
424 * @asic: driver supplied asic
425 * @fw_version: the current firmware version, if any
426 * @is_virtual: false for hw support only
428 struct dmub_srv_create_params {
429 struct dmub_srv_base_funcs funcs;
430 struct dmub_srv_hw_funcs *hw_funcs;
432 struct dc_context *dc_ctx;
439 * struct dmub_srv - software state for dmcub
440 * @asic: dmub asic identifier
441 * @user_ctx: user provided context for the dmub_srv
442 * @fw_version: the current firmware version, if any
443 * @is_virtual: false if hardware support only
444 * @fw_state: dmub firmware state pointer
451 struct dmub_fb scratch_mem_fb;
452 volatile const struct dmub_fw_state *fw_state;
454 /* private: internal use only */
455 const struct dmub_srv_common_regs *regs;
456 const struct dmub_srv_dcn31_regs *regs_dcn31;
457 struct dmub_srv_dcn32_regs *regs_dcn32;
458 struct dmub_srv_dcn35_regs *regs_dcn35;
460 struct dmub_srv_base_funcs funcs;
461 struct dmub_srv_hw_funcs hw_funcs;
462 struct dmub_rb inbox1_rb;
463 uint32_t inbox1_last_wptr;
465 * outbox1_rb is accessed without locks (dal & dc)
466 * and to be used only in dmub_srv_stat_get_notification()
468 struct dmub_rb outbox1_rb;
470 struct dmub_rb outbox0_rb;
477 uint32_t psp_version;
479 /* Feature capabilities reported by fw */
480 struct dmub_feature_caps feature_caps;
481 struct dmub_visual_confirm_color visual_confirm_color;
485 * struct dmub_notification - dmub notification data
486 * @type: dmub notification type
487 * @link_index: link index to identify aux connection
488 * @result: USB4 status returned from dmub
489 * @pending_notification: Indicates there are other pending notifications
490 * @aux_reply: aux reply
491 * @hpd_status: hpd status
492 * @bw_alloc_reply: BW Allocation reply from CM/DPIA
494 struct dmub_notification {
495 enum dmub_notification_type type;
498 bool pending_notification;
500 struct aux_reply_data aux_reply;
501 enum dp_hpd_status hpd_status;
502 enum set_config_status sc_status;
504 * DPIA notification command.
506 struct dmub_rb_cmd_dpia_notification dpia_notification;
511 * DMUB firmware version helper macro - useful for checking if the version
512 * of a firmware to know if feature or functionality is supported or present.
514 #define DMUB_FW_VERSION(major, minor, revision) \
515 ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | (((revision) & 0xFF) << 8))
518 * dmub_srv_create() - creates the DMUB service.
519 * @dmub: the dmub service
520 * @params: creation parameters for the service
523 * DMUB_STATUS_OK - success
524 * DMUB_STATUS_INVALID - unspecified error
526 enum dmub_status dmub_srv_create(struct dmub_srv *dmub,
527 const struct dmub_srv_create_params *params);
530 * dmub_srv_destroy() - destroys the DMUB service.
531 * @dmub: the dmub service
533 void dmub_srv_destroy(struct dmub_srv *dmub);
536 * dmub_srv_calc_region_info() - retreives region info from the dmub service
537 * @dmub: the dmub service
538 * @params: parameters used to calculate region locations
539 * @info_out: the output region info from dmub
541 * Calculates the base and top address for all relevant dmub regions
542 * using the parameters given (if any).
545 * DMUB_STATUS_OK - success
546 * DMUB_STATUS_INVALID - unspecified error
549 dmub_srv_calc_region_info(struct dmub_srv *dmub,
550 const struct dmub_srv_region_params *params,
551 struct dmub_srv_region_info *out);
554 * dmub_srv_calc_region_info() - retreives fb info from the dmub service
555 * @dmub: the dmub service
556 * @params: parameters used to calculate fb locations
557 * @info_out: the output fb info from dmub
559 * Calculates the base and top address for all relevant dmub regions
560 * using the parameters given (if any).
563 * DMUB_STATUS_OK - success
564 * DMUB_STATUS_INVALID - unspecified error
566 enum dmub_status dmub_srv_calc_fb_info(struct dmub_srv *dmub,
567 const struct dmub_srv_fb_params *params,
568 struct dmub_srv_fb_info *out);
571 * dmub_srv_has_hw_support() - returns hw support state for dmcub
572 * @dmub: the dmub service
573 * @is_supported: hw support state
575 * Queries the hardware for DMCUB support and returns the result.
577 * Can be called before dmub_srv_hw_init().
580 * DMUB_STATUS_OK - success
581 * DMUB_STATUS_INVALID - unspecified error
583 enum dmub_status dmub_srv_has_hw_support(struct dmub_srv *dmub,
587 * dmub_srv_is_hw_init() - returns hardware init state
590 * DMUB_STATUS_OK - success
591 * DMUB_STATUS_INVALID - unspecified error
593 enum dmub_status dmub_srv_is_hw_init(struct dmub_srv *dmub, bool *is_hw_init);
596 * dmub_srv_hw_init() - initializes the underlying DMUB hardware
597 * @dmub: the dmub service
598 * @params: params for hardware initialization
600 * Resets the DMUB hardware and performs backdoor loading of the
601 * required cache regions based on the input framebuffer regions.
604 * DMUB_STATUS_OK - success
605 * DMUB_STATUS_NO_CTX - dmcub context not initialized
606 * DMUB_STATUS_INVALID - unspecified error
608 enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,
609 const struct dmub_srv_hw_params *params);
612 * dmub_srv_hw_reset() - puts the DMUB hardware in reset state if initialized
613 * @dmub: the dmub service
615 * Before destroying the DMUB service or releasing the backing framebuffer
616 * memory we'll need to put the DMCUB into reset first.
618 * A subsequent call to dmub_srv_hw_init() will re-enable the DMCUB.
621 * DMUB_STATUS_OK - success
622 * DMUB_STATUS_INVALID - unspecified error
624 enum dmub_status dmub_srv_hw_reset(struct dmub_srv *dmub);
627 * dmub_srv_sync_inbox1() - sync sw state with hw state
628 * @dmub: the dmub service
630 * Sync sw state with hw state when resume from S0i3
633 * DMUB_STATUS_OK - success
634 * DMUB_STATUS_INVALID - unspecified error
636 enum dmub_status dmub_srv_sync_inbox1(struct dmub_srv *dmub);
639 * dmub_srv_cmd_queue() - queues a command to the DMUB
640 * @dmub: the dmub service
641 * @cmd: the command to queue
643 * Queues a command to the DMUB service but does not begin execution
647 * DMUB_STATUS_OK - success
648 * DMUB_STATUS_QUEUE_FULL - no remaining room in queue
649 * DMUB_STATUS_INVALID - unspecified error
651 enum dmub_status dmub_srv_cmd_queue(struct dmub_srv *dmub,
652 const union dmub_rb_cmd *cmd);
655 * dmub_srv_cmd_execute() - Executes a queued sequence to the dmub
656 * @dmub: the dmub service
658 * Begins execution of queued commands on the dmub.
661 * DMUB_STATUS_OK - success
662 * DMUB_STATUS_INVALID - unspecified error
664 enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub);
667 * dmub_srv_wait_for_hw_pwr_up() - Waits for firmware hardware power up is completed
668 * @dmub: the dmub service
669 * @timeout_us: the maximum number of microseconds to wait
671 * Waits until firmware hardware is powered up. The maximum
672 * wait time is given in microseconds to prevent spinning forever.
675 * DMUB_STATUS_OK - success
676 * DMUB_STATUS_TIMEOUT - timed out
677 * DMUB_STATUS_INVALID - unspecified error
679 enum dmub_status dmub_srv_wait_for_hw_pwr_up(struct dmub_srv *dmub,
680 uint32_t timeout_us);
682 bool dmub_srv_is_hw_pwr_up(struct dmub_srv *dmub);
685 * dmub_srv_wait_for_auto_load() - Waits for firmware auto load to complete
686 * @dmub: the dmub service
687 * @timeout_us: the maximum number of microseconds to wait
689 * Waits until firmware has been autoloaded by the DMCUB. The maximum
690 * wait time is given in microseconds to prevent spinning forever.
692 * On ASICs without firmware autoload support this function will return
696 * DMUB_STATUS_OK - success
697 * DMUB_STATUS_TIMEOUT - wait for phy init timed out
698 * DMUB_STATUS_INVALID - unspecified error
700 enum dmub_status dmub_srv_wait_for_auto_load(struct dmub_srv *dmub,
701 uint32_t timeout_us);
704 * dmub_srv_wait_for_phy_init() - Waits for DMUB PHY init to complete
705 * @dmub: the dmub service
706 * @timeout_us: the maximum number of microseconds to wait
708 * Waits until the PHY has been initialized by the DMUB. The maximum
709 * wait time is given in microseconds to prevent spinning forever.
711 * On ASICs without PHY init support this function will return
715 * DMUB_STATUS_OK - success
716 * DMUB_STATUS_TIMEOUT - wait for phy init timed out
717 * DMUB_STATUS_INVALID - unspecified error
719 enum dmub_status dmub_srv_wait_for_phy_init(struct dmub_srv *dmub,
720 uint32_t timeout_us);
723 * dmub_srv_wait_for_idle() - Waits for the DMUB to be idle
724 * @dmub: the dmub service
725 * @timeout_us: the maximum number of microseconds to wait
727 * Waits until the DMUB buffer is empty and all commands have
728 * finished processing. The maximum wait time is given in
729 * microseconds to prevent spinning forever.
732 * DMUB_STATUS_OK - success
733 * DMUB_STATUS_TIMEOUT - wait for buffer to flush timed out
734 * DMUB_STATUS_INVALID - unspecified error
736 enum dmub_status dmub_srv_wait_for_idle(struct dmub_srv *dmub,
737 uint32_t timeout_us);
740 * dmub_srv_send_gpint_command() - Sends a GPINT based command.
741 * @dmub: the dmub service
742 * @command_code: the command code to send
743 * @param: the command parameter to send
744 * @timeout_us: the maximum number of microseconds to wait
746 * Sends a command via the general purpose interrupt (GPINT).
747 * Waits for the number of microseconds specified by timeout_us
748 * for the command ACK before returning.
750 * Can be called after software initialization.
753 * DMUB_STATUS_OK - success
754 * DMUB_STATUS_TIMEOUT - wait for ACK timed out
755 * DMUB_STATUS_INVALID - unspecified error
758 dmub_srv_send_gpint_command(struct dmub_srv *dmub,
759 enum dmub_gpint_command command_code,
760 uint16_t param, uint32_t timeout_us);
763 * dmub_srv_get_gpint_response() - Queries the GPINT response.
764 * @dmub: the dmub service
765 * @response: the response for the last GPINT
767 * Returns the response code for the last GPINT interrupt.
769 * Can be called after software initialization.
772 * DMUB_STATUS_OK - success
773 * DMUB_STATUS_INVALID - unspecified error
775 enum dmub_status dmub_srv_get_gpint_response(struct dmub_srv *dmub,
779 * dmub_srv_get_gpint_dataout() - Queries the GPINT DATAOUT.
780 * @dmub: the dmub service
781 * @dataout: the data for the GPINT DATAOUT
783 * Returns the response code for the last GPINT DATAOUT interrupt.
785 * Can be called after software initialization.
788 * DMUB_STATUS_OK - success
789 * DMUB_STATUS_INVALID - unspecified error
791 enum dmub_status dmub_srv_get_gpint_dataout(struct dmub_srv *dmub,
795 * dmub_flush_buffer_mem() - Read back entire frame buffer region.
796 * This ensures that the write from x86 has been flushed and will not
798 * @fb: frame buffer to flush
800 * Can be called after software initialization.
802 void dmub_flush_buffer_mem(const struct dmub_fb *fb);
805 * dmub_srv_get_fw_boot_status() - Returns the DMUB boot status bits.
807 * @dmub: the dmub service
808 * @status: out pointer for firmware status
811 * DMUB_STATUS_OK - success
812 * DMUB_STATUS_INVALID - unspecified error, unsupported
814 enum dmub_status dmub_srv_get_fw_boot_status(struct dmub_srv *dmub,
815 union dmub_fw_boot_status *status);
817 enum dmub_status dmub_srv_get_fw_boot_option(struct dmub_srv *dmub,
818 union dmub_fw_boot_options *option);
820 enum dmub_status dmub_srv_cmd_with_reply_data(struct dmub_srv *dmub,
821 union dmub_rb_cmd *cmd);
823 enum dmub_status dmub_srv_set_skip_panel_power_sequence(struct dmub_srv *dmub,
826 bool dmub_srv_get_outbox0_msg(struct dmub_srv *dmub, struct dmcub_trace_buf_entry *entry);
828 bool dmub_srv_get_diagnostic_data(struct dmub_srv *dmub, struct dmub_diagnostic_data *diag_data);
830 bool dmub_srv_should_detect(struct dmub_srv *dmub);
833 * dmub_srv_send_inbox0_cmd() - Send command to DMUB using INBOX0
834 * @dmub: the dmub service
835 * @data: the data to be sent in the INBOX0 command
837 * Send command by writing directly to INBOX0 WPTR
840 * DMUB_STATUS_OK - success
841 * DMUB_STATUS_INVALID - hw_init false or hw function does not exist
843 enum dmub_status dmub_srv_send_inbox0_cmd(struct dmub_srv *dmub, union dmub_inbox0_data_register data);
846 * dmub_srv_wait_for_inbox0_ack() - wait for DMUB to ACK INBOX0 command
847 * @dmub: the dmub service
848 * @timeout_us: the maximum number of microseconds to wait
850 * Wait for DMUB to ACK the INBOX0 message
853 * DMUB_STATUS_OK - success
854 * DMUB_STATUS_INVALID - hw_init false or hw function does not exist
855 * DMUB_STATUS_TIMEOUT - wait for ack timed out
857 enum dmub_status dmub_srv_wait_for_inbox0_ack(struct dmub_srv *dmub, uint32_t timeout_us);
860 * dmub_srv_wait_for_inbox0_ack() - clear ACK register for INBOX0
861 * @dmub: the dmub service
863 * Clear ACK register for INBOX0
866 * DMUB_STATUS_OK - success
867 * DMUB_STATUS_INVALID - hw_init false or hw function does not exist
869 enum dmub_status dmub_srv_clear_inbox0_ack(struct dmub_srv *dmub);
872 * dmub_srv_subvp_save_surf_addr() - Save primary and meta address for subvp on each flip
873 * @dmub: The dmub service
874 * @addr: The surface address to be programmed on the current flip
875 * @subvp_index: Index of subvp pipe, indicates which subvp pipe the address should be saved for
877 * Function to save the surface flip addr into scratch registers. This is to fix a race condition
878 * between FW and driver reading / writing to the surface address at the same time. This is
879 * required because there is no EARLIEST_IN_USE_META.
884 void dmub_srv_subvp_save_surf_addr(struct dmub_srv *dmub, const struct dc_plane_address *addr, uint8_t subvp_index);
886 #if defined(__cplusplus)
890 #endif /* _DMUB_SRV_H_ */