2017-09-12 19:58:20 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
|
|
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* Authors: AMD
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DC_HW_SEQUENCER_H__
|
|
|
|
#define __DC_HW_SEQUENCER_H__
|
2017-08-01 19:00:25 +00:00
|
|
|
#include "dc_types.h"
|
|
|
|
#include "clock_source.h"
|
|
|
|
#include "inc/hw/timing_generator.h"
|
2017-12-04 21:58:11 +00:00
|
|
|
#include "inc/hw/opp.h"
|
2017-09-25 22:03:14 +00:00
|
|
|
#include "inc/hw/link_encoder.h"
|
2017-08-01 19:00:25 +00:00
|
|
|
#include "core_status.h"
|
2017-09-12 19:58:20 +00:00
|
|
|
|
|
|
|
enum pipe_gating_control {
|
|
|
|
PIPE_GATING_CONTROL_DISABLE = 0,
|
|
|
|
PIPE_GATING_CONTROL_ENABLE,
|
|
|
|
PIPE_GATING_CONTROL_INIT
|
|
|
|
};
|
|
|
|
|
2019-01-25 19:40:14 +00:00
|
|
|
enum vline_select {
|
|
|
|
VLINE0,
|
|
|
|
VLINE1
|
|
|
|
};
|
|
|
|
|
2017-02-28 20:23:38 +00:00
|
|
|
struct dce_hwseq_wa {
|
|
|
|
bool blnd_crtc_trigger;
|
2017-11-06 19:40:31 +00:00
|
|
|
bool DEGVIDCN10_253;
|
2017-11-15 21:21:34 +00:00
|
|
|
bool false_optc_underflow;
|
2018-06-05 17:14:13 +00:00
|
|
|
bool DEGVIDCN10_254;
|
2017-11-06 19:40:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct hwseq_wa_state {
|
|
|
|
bool DEGVIDCN10_253_applied;
|
2017-02-28 20:23:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dce_hwseq {
|
|
|
|
struct dc_context *ctx;
|
|
|
|
const struct dce_hwseq_registers *regs;
|
|
|
|
const struct dce_hwseq_shift *shifts;
|
|
|
|
const struct dce_hwseq_mask *masks;
|
|
|
|
struct dce_hwseq_wa wa;
|
2017-11-06 19:40:31 +00:00
|
|
|
struct hwseq_wa_state wa_state;
|
2017-09-12 19:58:20 +00:00
|
|
|
};
|
|
|
|
|
2017-08-01 19:00:25 +00:00
|
|
|
struct pipe_ctx;
|
2017-08-25 20:16:10 +00:00
|
|
|
struct dc_state;
|
2019-02-22 21:52:08 +00:00
|
|
|
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
|
|
|
|
struct dc_stream_status;
|
|
|
|
struct dc_writeback_info;
|
|
|
|
#endif
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dchub_init_data;
|
|
|
|
struct dc_static_screen_events;
|
|
|
|
struct resource_pool;
|
|
|
|
struct resource_context;
|
2018-04-09 21:19:27 +00:00
|
|
|
struct stream_resource;
|
2019-02-22 21:52:08 +00:00
|
|
|
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
|
2019-05-22 22:05:41 +00:00
|
|
|
struct dc_phy_addr_space_config;
|
|
|
|
struct dc_virtual_addr_space_config;
|
2019-02-22 21:52:08 +00:00
|
|
|
#endif
|
2017-09-12 19:58:20 +00:00
|
|
|
|
|
|
|
struct hw_sequencer_funcs {
|
|
|
|
|
2019-01-25 23:04:14 +00:00
|
|
|
void (*disable_stream_gating)(struct dc *dc, struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
|
|
void (*enable_stream_gating)(struct dc *dc, struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2017-08-01 19:00:25 +00:00
|
|
|
void (*init_hw)(struct dc *dc);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2019-01-20 06:23:07 +00:00
|
|
|
void (*init_pipes)(struct dc *dc, struct dc_state *context);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
enum dc_status (*apply_ctx_to_hw)(
|
2017-08-25 20:16:10 +00:00
|
|
|
struct dc *dc, struct dc_state *context);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
|
|
|
void (*reset_hw_ctx_wrap)(
|
2017-08-25 20:16:10 +00:00
|
|
|
struct dc *dc, struct dc_state *context);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
|
|
|
void (*apply_ctx_for_surface)(
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc,
|
2017-08-03 04:22:25 +00:00
|
|
|
const struct dc_stream_state *stream,
|
|
|
|
int num_planes,
|
2017-08-25 20:16:10 +00:00
|
|
|
struct dc_state *context);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2017-06-02 21:25:49 +00:00
|
|
|
void (*program_gamut_remap)(
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2018-04-09 19:47:42 +00:00
|
|
|
void (*program_output_csc)(struct dc *dc,
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
|
|
|
enum dc_color_space colorspace,
|
|
|
|
uint16_t *matrix,
|
|
|
|
int opp_id);
|
|
|
|
|
2019-02-22 21:52:08 +00:00
|
|
|
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
|
|
|
|
void (*program_triplebuffer)(
|
|
|
|
const struct dc *dc,
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
|
|
|
bool enableTripleBuffer);
|
|
|
|
void (*set_flip_control_gsl)(
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
|
|
|
bool flip_immediate);
|
|
|
|
#endif
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*update_plane_addr)(
|
2017-08-01 19:00:25 +00:00
|
|
|
const struct dc *dc,
|
2017-09-12 19:58:20 +00:00
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2018-05-16 20:19:50 +00:00
|
|
|
void (*plane_atomic_disconnect)(
|
|
|
|
struct dc *dc,
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2017-07-23 22:30:15 +00:00
|
|
|
void (*update_dchub)(
|
|
|
|
struct dce_hwseq *hws,
|
|
|
|
struct dchub_init_data *dh_data);
|
|
|
|
|
2019-02-22 21:52:08 +00:00
|
|
|
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
|
2019-05-22 22:05:41 +00:00
|
|
|
int (*init_sys_ctx)(
|
|
|
|
struct dce_hwseq *hws,
|
|
|
|
struct dc *dc,
|
|
|
|
struct dc_phy_addr_space_config *pa_config);
|
|
|
|
void (*init_vm_ctx)(
|
|
|
|
struct dce_hwseq *hws,
|
|
|
|
struct dc *dc,
|
|
|
|
struct dc_virtual_addr_space_config *va_config,
|
|
|
|
int vmid);
|
2019-02-22 21:52:08 +00:00
|
|
|
#endif
|
2018-05-16 20:19:50 +00:00
|
|
|
void (*update_mpcc)(
|
|
|
|
struct dc *dc,
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*update_pending_status)(
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2016-12-15 17:09:46 +00:00
|
|
|
bool (*set_input_transfer_func)(
|
2016-12-13 18:59:41 +00:00
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-07-27 13:55:38 +00:00
|
|
|
const struct dc_plane_state *plane_state);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2016-12-15 17:09:46 +00:00
|
|
|
bool (*set_output_transfer_func)(
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-07-27 13:33:33 +00:00
|
|
|
const struct dc_stream_state *stream);
|
2016-12-15 17:09:46 +00:00
|
|
|
|
2017-08-01 19:00:25 +00:00
|
|
|
void (*power_down)(struct dc *dc);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2017-12-19 16:51:40 +00:00
|
|
|
void (*enable_accelerated_mode)(struct dc *dc, struct dc_state *context);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
|
|
|
void (*enable_timing_synchronization)(
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc,
|
2017-09-12 19:58:20 +00:00
|
|
|
int group_index,
|
|
|
|
int group_size,
|
|
|
|
struct pipe_ctx *grouped_pipes[]);
|
|
|
|
|
2017-10-17 19:29:22 +00:00
|
|
|
void (*enable_per_frame_crtc_position_reset)(
|
|
|
|
struct dc *dc,
|
|
|
|
int group_size,
|
|
|
|
struct pipe_ctx *grouped_pipes[]);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*enable_display_pipe_clock_gating)(
|
|
|
|
struct dc_context *ctx,
|
|
|
|
bool clock_gating);
|
|
|
|
|
|
|
|
bool (*enable_display_power_gating)(
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc,
|
2017-09-12 19:58:20 +00:00
|
|
|
uint8_t controller_id,
|
|
|
|
struct dc_bios *dcb,
|
|
|
|
enum pipe_gating_control power_gating);
|
|
|
|
|
2017-11-06 19:40:31 +00:00
|
|
|
void (*disable_plane)(struct dc *dc, struct pipe_ctx *pipe_ctx);
|
2017-03-23 14:34:06 +00:00
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2019-04-16 15:07:22 +00:00
|
|
|
void (*send_immediate_sdp_message)(
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
|
|
|
const uint8_t *custom_sdp_message,
|
|
|
|
unsigned int sdp_message_size);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*enable_stream)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
2017-09-28 03:23:16 +00:00
|
|
|
void (*disable_stream)(struct pipe_ctx *pipe_ctx,
|
|
|
|
int option);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
|
|
|
void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
|
|
|
|
struct dc_link_settings *link_settings);
|
|
|
|
|
2018-01-11 20:31:26 +00:00
|
|
|
void (*blank_stream)(struct pipe_ctx *pipe_ctx);
|
2018-05-10 18:21:47 +00:00
|
|
|
|
|
|
|
void (*enable_audio_stream)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
|
|
void (*disable_audio_stream)(struct pipe_ctx *pipe_ctx, int option);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*pipe_control_lock)(
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc,
|
2017-02-28 20:23:38 +00:00
|
|
|
struct pipe_ctx *pipe,
|
2019-03-06 00:28:10 +00:00
|
|
|
bool lock);
|
2019-03-06 00:28:10 +00:00
|
|
|
|
2019-03-06 00:28:10 +00:00
|
|
|
void (*pipe_control_lock_global)(
|
|
|
|
struct dc *dc,
|
|
|
|
struct pipe_ctx *pipe,
|
2017-09-12 19:58:20 +00:00
|
|
|
bool lock);
|
2018-04-09 21:19:27 +00:00
|
|
|
void (*blank_pixel_data)(
|
|
|
|
struct dc *dc,
|
2018-05-01 19:21:42 +00:00
|
|
|
struct pipe_ctx *pipe_ctx,
|
2018-04-09 21:19:27 +00:00
|
|
|
bool blank);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2018-09-18 19:00:49 +00:00
|
|
|
void (*prepare_bandwidth)(
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc,
|
2018-09-18 19:00:49 +00:00
|
|
|
struct dc_state *context);
|
|
|
|
void (*optimize_bandwidth)(
|
|
|
|
struct dc *dc,
|
|
|
|
struct dc_state *context);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2019-02-22 21:52:08 +00:00
|
|
|
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
|
|
|
|
bool (*update_bandwidth)(
|
|
|
|
struct dc *dc,
|
|
|
|
struct dc_state *context);
|
2019-07-03 17:59:26 +00:00
|
|
|
void (*program_dmdata_engine)(struct pipe_ctx *pipe_ctx);
|
2019-02-22 21:52:08 +00:00
|
|
|
bool (*dmdata_status_done)(struct pipe_ctx *pipe_ctx);
|
|
|
|
#endif
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
|
|
|
|
int vmin, int vmax);
|
|
|
|
|
2017-04-18 19:24:50 +00:00
|
|
|
void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
|
|
|
|
struct crtc_position *position);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
|
2017-04-21 19:29:55 +00:00
|
|
|
int num_pipes, const struct dc_static_screen_events *events);
|
2017-09-12 19:58:20 +00:00
|
|
|
|
2018-04-09 21:19:27 +00:00
|
|
|
enum dc_status (*enable_stream_timing)(
|
2017-09-12 19:58:20 +00:00
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-08-25 20:16:10 +00:00
|
|
|
struct dc_state *context,
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc);
|
2017-06-07 17:23:59 +00:00
|
|
|
|
|
|
|
void (*setup_stereo)(
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-08-01 19:00:25 +00:00
|
|
|
struct dc *dc);
|
2017-07-17 20:04:02 +00:00
|
|
|
|
|
|
|
void (*set_avmute)(struct pipe_ctx *pipe_ctx, bool enable);
|
2017-07-20 04:12:20 +00:00
|
|
|
|
2018-08-15 16:00:23 +00:00
|
|
|
void (*log_hw_state)(struct dc *dc,
|
|
|
|
struct dc_log_buffer_ctx *log_ctx);
|
2018-08-08 15:53:39 +00:00
|
|
|
void (*get_hw_state)(struct dc *dc, char *pBuf, unsigned int bufSize, unsigned int mask);
|
2018-10-23 16:12:50 +00:00
|
|
|
void (*clear_status_bits)(struct dc *dc, unsigned int mask);
|
2017-07-23 19:18:57 +00:00
|
|
|
|
2017-08-01 19:00:25 +00:00
|
|
|
void (*wait_for_mpcc_disconnect)(struct dc *dc,
|
2017-07-24 14:47:02 +00:00
|
|
|
struct resource_pool *res_pool,
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
2017-08-24 21:40:00 +00:00
|
|
|
|
2017-09-25 22:03:14 +00:00
|
|
|
void (*edp_power_control)(
|
2017-09-26 23:45:43 +00:00
|
|
|
struct dc_link *link,
|
2017-09-25 22:03:14 +00:00
|
|
|
bool enable);
|
|
|
|
void (*edp_backlight_control)(
|
2017-09-15 21:42:20 +00:00
|
|
|
struct dc_link *link,
|
|
|
|
bool enable);
|
2017-11-24 21:31:03 +00:00
|
|
|
void (*edp_wait_for_hpd_ready)(struct dc_link *link, bool power_up);
|
2017-10-31 19:55:15 +00:00
|
|
|
|
2018-01-19 00:07:54 +00:00
|
|
|
void (*set_cursor_position)(struct pipe_ctx *pipe);
|
|
|
|
void (*set_cursor_attribute)(struct pipe_ctx *pipe);
|
2018-06-27 22:23:37 +00:00
|
|
|
void (*set_cursor_sdr_white_level)(struct pipe_ctx *pipe);
|
2018-04-09 19:47:42 +00:00
|
|
|
|
2019-01-25 19:40:14 +00:00
|
|
|
void (*setup_periodic_interrupt)(struct pipe_ctx *pipe_ctx, enum vline_select vline);
|
|
|
|
void (*setup_vupdate_interrupt)(struct pipe_ctx *pipe_ctx);
|
2019-04-29 20:05:42 +00:00
|
|
|
bool (*did_underflow_occur)(struct dc *dc, struct pipe_ctx *pipe_ctx);
|
2019-01-25 19:40:14 +00:00
|
|
|
|
2019-02-22 21:52:08 +00:00
|
|
|
#if defined(CONFIG_DRM_AMD_DC_DCN2_0)
|
|
|
|
void (*update_odm)(struct dc *dc, struct dc_state *context, struct pipe_ctx *pipe_ctx);
|
|
|
|
void (*program_all_writeback_pipes_in_tree)(
|
|
|
|
struct dc *dc,
|
|
|
|
const struct dc_stream_state *stream,
|
|
|
|
struct dc_state *context);
|
|
|
|
void (*update_writeback)(struct dc *dc,
|
|
|
|
const struct dc_stream_status *stream_status,
|
|
|
|
struct dc_writeback_info *wb_info);
|
|
|
|
void (*enable_writeback)(struct dc *dc,
|
|
|
|
const struct dc_stream_status *stream_status,
|
|
|
|
struct dc_writeback_info *wb_info);
|
|
|
|
void (*disable_writeback)(struct dc *dc,
|
|
|
|
unsigned int dwb_pipe_inst);
|
|
|
|
#endif
|
2019-06-27 22:16:21 +00:00
|
|
|
enum dc_status (*set_clock)(struct dc *dc,
|
|
|
|
enum dc_clock_type clock_type,
|
|
|
|
uint32_t clk_khz,
|
|
|
|
uint32_t stepping);
|
|
|
|
|
|
|
|
void (*get_clock)(struct dc *dc,
|
|
|
|
enum dc_clock_type clock_type,
|
|
|
|
struct dc_clock_config *clock_cfg);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void color_space_to_black_color(
|
2017-08-01 19:00:25 +00:00
|
|
|
const struct dc *dc,
|
2017-09-12 19:58:20 +00:00
|
|
|
enum dc_color_space colorspace,
|
|
|
|
struct tg_color *black_color);
|
|
|
|
|
2017-01-06 21:23:18 +00:00
|
|
|
bool hwss_wait_for_blank_complete(
|
|
|
|
struct timing_generator *tg);
|
|
|
|
|
2017-12-01 17:42:18 +00:00
|
|
|
const uint16_t *find_color_matrix(
|
|
|
|
enum dc_color_space color_space,
|
|
|
|
uint32_t *array_size);
|
|
|
|
|
2017-09-12 19:58:20 +00:00
|
|
|
#endif /* __DC_HW_SEQUENCER_H__ */
|