2017-09-12 15:58:20 -04: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 15:00:25 -04:00
|
|
|
#include "dc_types.h"
|
|
|
|
|
#include "clock_source.h"
|
|
|
|
|
#include "inc/hw/timing_generator.h"
|
2017-12-04 16:58:11 -05:00
|
|
|
#include "inc/hw/opp.h"
|
2017-09-25 18:03:14 -04:00
|
|
|
#include "inc/hw/link_encoder.h"
|
2017-08-01 15:00:25 -04:00
|
|
|
#include "core_status.h"
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
enum pipe_gating_control {
|
|
|
|
|
PIPE_GATING_CONTROL_DISABLE = 0,
|
|
|
|
|
PIPE_GATING_CONTROL_ENABLE,
|
|
|
|
|
PIPE_GATING_CONTROL_INIT
|
|
|
|
|
};
|
|
|
|
|
|
2019-01-25 14:40:14 -05:00
|
|
|
enum vline_select {
|
|
|
|
|
VLINE0,
|
|
|
|
|
VLINE1
|
|
|
|
|
};
|
|
|
|
|
|
2017-02-28 15:23:38 -05:00
|
|
|
struct dce_hwseq_wa {
|
|
|
|
|
bool blnd_crtc_trigger;
|
2017-11-06 14:40:31 -05:00
|
|
|
bool DEGVIDCN10_253;
|
2017-11-15 16:21:34 -05:00
|
|
|
bool false_optc_underflow;
|
2018-06-05 13:14:13 -04:00
|
|
|
bool DEGVIDCN10_254;
|
2017-11-06 14:40:31 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct hwseq_wa_state {
|
|
|
|
|
bool DEGVIDCN10_253_applied;
|
2017-02-28 15:23:38 -05: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 14:40:31 -05:00
|
|
|
struct hwseq_wa_state wa_state;
|
2017-09-12 15:58:20 -04:00
|
|
|
};
|
|
|
|
|
|
2017-08-01 15:00:25 -04:00
|
|
|
struct pipe_ctx;
|
2017-08-25 16:16:10 -04:00
|
|
|
struct dc_state;
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dchub_init_data;
|
|
|
|
|
struct dc_static_screen_events;
|
|
|
|
|
struct resource_pool;
|
|
|
|
|
struct resource_context;
|
2018-04-09 17:19:27 -04:00
|
|
|
struct stream_resource;
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
struct hw_sequencer_funcs {
|
|
|
|
|
|
2019-01-25 15:04:14 -08: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 15:00:25 -04:00
|
|
|
void (*init_hw)(struct dc *dc);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
2019-01-20 01:23:07 -05:00
|
|
|
void (*init_pipes)(struct dc *dc, struct dc_state *context);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
enum dc_status (*apply_ctx_to_hw)(
|
2017-08-25 16:16:10 -04:00
|
|
|
struct dc *dc, struct dc_state *context);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
void (*reset_hw_ctx_wrap)(
|
2017-08-25 16:16:10 -04:00
|
|
|
struct dc *dc, struct dc_state *context);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
void (*apply_ctx_for_surface)(
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc,
|
2017-08-03 00:22:25 -04:00
|
|
|
const struct dc_stream_state *stream,
|
|
|
|
|
int num_planes,
|
2017-08-25 16:16:10 -04:00
|
|
|
struct dc_state *context);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
2017-06-02 17:25:49 -04:00
|
|
|
void (*program_gamut_remap)(
|
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2018-04-09 15:47:42 -04:00
|
|
|
void (*program_output_csc)(struct dc *dc,
|
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
|
|
|
|
enum dc_color_space colorspace,
|
|
|
|
|
uint16_t *matrix,
|
|
|
|
|
int opp_id);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
void (*update_plane_addr)(
|
2017-08-01 15:00:25 -04:00
|
|
|
const struct dc *dc,
|
2017-09-12 15:58:20 -04:00
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2018-05-16 16:19:50 -04:00
|
|
|
void (*plane_atomic_disconnect)(
|
|
|
|
|
struct dc *dc,
|
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2017-07-23 18:30:15 -04:00
|
|
|
void (*update_dchub)(
|
|
|
|
|
struct dce_hwseq *hws,
|
|
|
|
|
struct dchub_init_data *dh_data);
|
|
|
|
|
|
2018-05-16 16:19:50 -04:00
|
|
|
void (*update_mpcc)(
|
|
|
|
|
struct dc *dc,
|
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
void (*update_pending_status)(
|
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2016-12-15 12:09:46 -05:00
|
|
|
bool (*set_input_transfer_func)(
|
2016-12-13 13:59:41 -05:00
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-07-27 09:55:38 -04:00
|
|
|
const struct dc_plane_state *plane_state);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
2016-12-15 12:09:46 -05:00
|
|
|
bool (*set_output_transfer_func)(
|
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-07-27 09:33:33 -04:00
|
|
|
const struct dc_stream_state *stream);
|
2016-12-15 12:09:46 -05:00
|
|
|
|
2017-08-01 15:00:25 -04:00
|
|
|
void (*power_down)(struct dc *dc);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
2017-12-19 11:51:40 -05:00
|
|
|
void (*enable_accelerated_mode)(struct dc *dc, struct dc_state *context);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
void (*enable_timing_synchronization)(
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc,
|
2017-09-12 15:58:20 -04:00
|
|
|
int group_index,
|
|
|
|
|
int group_size,
|
|
|
|
|
struct pipe_ctx *grouped_pipes[]);
|
|
|
|
|
|
2017-10-17 15:29:22 -04:00
|
|
|
void (*enable_per_frame_crtc_position_reset)(
|
|
|
|
|
struct dc *dc,
|
|
|
|
|
int group_size,
|
|
|
|
|
struct pipe_ctx *grouped_pipes[]);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
void (*enable_display_pipe_clock_gating)(
|
|
|
|
|
struct dc_context *ctx,
|
|
|
|
|
bool clock_gating);
|
|
|
|
|
|
|
|
|
|
bool (*enable_display_power_gating)(
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc,
|
2017-09-12 15:58:20 -04:00
|
|
|
uint8_t controller_id,
|
|
|
|
|
struct dc_bios *dcb,
|
|
|
|
|
enum pipe_gating_control power_gating);
|
|
|
|
|
|
2017-11-06 14:40:31 -05:00
|
|
|
void (*disable_plane)(struct dc *dc, struct pipe_ctx *pipe_ctx);
|
2017-03-23 10:34:06 -04:00
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
void (*update_info_frame)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
|
|
|
|
void (*enable_stream)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2017-09-27 23:23:16 -04:00
|
|
|
void (*disable_stream)(struct pipe_ctx *pipe_ctx,
|
|
|
|
|
int option);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
void (*unblank_stream)(struct pipe_ctx *pipe_ctx,
|
|
|
|
|
struct dc_link_settings *link_settings);
|
|
|
|
|
|
2018-01-11 15:31:26 -05:00
|
|
|
void (*blank_stream)(struct pipe_ctx *pipe_ctx);
|
2018-05-10 14:21:47 -04:00
|
|
|
|
|
|
|
|
void (*enable_audio_stream)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
|
|
|
|
void (*disable_audio_stream)(struct pipe_ctx *pipe_ctx, int option);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
void (*pipe_control_lock)(
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc,
|
2017-02-28 15:23:38 -05:00
|
|
|
struct pipe_ctx *pipe,
|
2019-03-05 19:28:10 -05:00
|
|
|
bool lock);
|
|
|
|
|
void (*pipe_control_lock_global)(
|
|
|
|
|
struct dc *dc,
|
|
|
|
|
struct pipe_ctx *pipe,
|
2017-09-12 15:58:20 -04:00
|
|
|
bool lock);
|
2018-04-09 17:19:27 -04:00
|
|
|
void (*blank_pixel_data)(
|
|
|
|
|
struct dc *dc,
|
2018-05-01 15:21:42 -04:00
|
|
|
struct pipe_ctx *pipe_ctx,
|
2018-04-09 17:19:27 -04:00
|
|
|
bool blank);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
2018-09-18 15:00:49 -04:00
|
|
|
void (*prepare_bandwidth)(
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc,
|
2018-09-18 15:00:49 -04:00
|
|
|
struct dc_state *context);
|
|
|
|
|
void (*optimize_bandwidth)(
|
|
|
|
|
struct dc *dc,
|
|
|
|
|
struct dc_state *context);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
|
|
|
|
void (*set_drr)(struct pipe_ctx **pipe_ctx, int num_pipes,
|
|
|
|
|
int vmin, int vmax);
|
|
|
|
|
|
2017-04-18 15:24:50 -04:00
|
|
|
void (*get_position)(struct pipe_ctx **pipe_ctx, int num_pipes,
|
|
|
|
|
struct crtc_position *position);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
void (*set_static_screen_control)(struct pipe_ctx **pipe_ctx,
|
2017-04-21 15:29:55 -04:00
|
|
|
int num_pipes, const struct dc_static_screen_events *events);
|
2017-09-12 15:58:20 -04:00
|
|
|
|
2018-04-09 17:19:27 -04:00
|
|
|
enum dc_status (*enable_stream_timing)(
|
2017-09-12 15:58:20 -04:00
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-08-25 16:16:10 -04:00
|
|
|
struct dc_state *context,
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc);
|
2017-06-07 12:23:59 -05:00
|
|
|
|
|
|
|
|
void (*setup_stereo)(
|
|
|
|
|
struct pipe_ctx *pipe_ctx,
|
2017-08-01 15:00:25 -04:00
|
|
|
struct dc *dc);
|
2017-07-17 16:04:02 -04:00
|
|
|
|
|
|
|
|
void (*set_avmute)(struct pipe_ctx *pipe_ctx, bool enable);
|
2017-07-20 00:12:20 -04:00
|
|
|
|
2018-08-15 12:00:23 -04:00
|
|
|
void (*log_hw_state)(struct dc *dc,
|
|
|
|
|
struct dc_log_buffer_ctx *log_ctx);
|
2018-08-08 11:53:39 -04:00
|
|
|
void (*get_hw_state)(struct dc *dc, char *pBuf, unsigned int bufSize, unsigned int mask);
|
2018-10-23 12:12:50 -04:00
|
|
|
void (*clear_status_bits)(struct dc *dc, unsigned int mask);
|
2017-07-23 15:18:57 -04:00
|
|
|
|
2017-08-01 15:00:25 -04:00
|
|
|
void (*wait_for_mpcc_disconnect)(struct dc *dc,
|
2017-07-24 10:47:02 -04:00
|
|
|
struct resource_pool *res_pool,
|
|
|
|
|
struct pipe_ctx *pipe_ctx);
|
2017-08-24 17:40:00 -04:00
|
|
|
|
2017-09-25 18:03:14 -04:00
|
|
|
void (*edp_power_control)(
|
2017-09-26 19:45:43 -04:00
|
|
|
struct dc_link *link,
|
2017-09-25 18:03:14 -04:00
|
|
|
bool enable);
|
|
|
|
|
void (*edp_backlight_control)(
|
2017-09-15 17:42:20 -04:00
|
|
|
struct dc_link *link,
|
|
|
|
|
bool enable);
|
2017-11-24 16:31:03 -05:00
|
|
|
void (*edp_wait_for_hpd_ready)(struct dc_link *link, bool power_up);
|
2017-10-31 15:55:15 -04:00
|
|
|
|
2018-01-18 19:07:54 -05:00
|
|
|
void (*set_cursor_position)(struct pipe_ctx *pipe);
|
|
|
|
|
void (*set_cursor_attribute)(struct pipe_ctx *pipe);
|
2018-06-27 18:23:37 -04:00
|
|
|
void (*set_cursor_sdr_white_level)(struct pipe_ctx *pipe);
|
2018-04-09 15:47:42 -04:00
|
|
|
|
2019-01-25 14:40:14 -05:00
|
|
|
void (*setup_periodic_interrupt)(struct pipe_ctx *pipe_ctx, enum vline_select vline);
|
|
|
|
|
void (*setup_vupdate_interrupt)(struct pipe_ctx *pipe_ctx);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void color_space_to_black_color(
|
2017-08-01 15:00:25 -04:00
|
|
|
const struct dc *dc,
|
2017-09-12 15:58:20 -04:00
|
|
|
enum dc_color_space colorspace,
|
|
|
|
|
struct tg_color *black_color);
|
|
|
|
|
|
2017-01-06 16:23:18 -05:00
|
|
|
bool hwss_wait_for_blank_complete(
|
|
|
|
|
struct timing_generator *tg);
|
|
|
|
|
|
2017-12-01 11:42:18 -06:00
|
|
|
const uint16_t *find_color_matrix(
|
|
|
|
|
enum dc_color_space color_space,
|
|
|
|
|
uint32_t *array_size);
|
|
|
|
|
|
2017-09-12 15:58:20 -04:00
|
|
|
#endif /* __DC_HW_SEQUENCER_H__ */
|