#define CREATE_TRACE_POINTS
#include "dm_services_types.h"
#include "dc.h"
#include "link_enc_cfg.h"
#include "dc/inc/core_types.h"
#include "dal_asic_id.h"
#include "dmub/dmub_srv.h"
#include "dc/inc/hw/dmcu.h"
#include "dc/inc/hw/abm.h"
#include "dc/dc_dmub_srv.h"
#include "dc/dc_edid_parser.h"
#include "dc/dc_stat.h"
#include "dc/dc_state.h"
#include "amdgpu_dm_trace.h"
#include "dpcd_defs.h"
#include "link/protocols/link_dpcd.h"
#include "link_service_types.h"
#include "link/protocols/link_dp_capability.h"
#include "link/protocols/link_ddc.h"
#include "vid.h"
#include "amdgpu.h"
#include "amdgpu_display.h"
#include "amdgpu_ucode.h"
#include "atom.h"
#include "amdgpu_dm.h"
#include "amdgpu_dm_plane.h"
#include "amdgpu_dm_crtc.h"
#include "amdgpu_dm_hdcp.h"
#include <drm/display/drm_hdcp_helper.h>
#include "amdgpu_dm_wb.h"
#include "amdgpu_pm.h"
#include "amdgpu_atombios.h"
#include "amd_shared.h"
#include "amdgpu_dm_irq.h"
#include "dm_helpers.h"
#include "amdgpu_dm_mst_types.h"
#if defined(CONFIG_DEBUG_FS)
#include "amdgpu_dm_debugfs.h"
#endif
#include "amdgpu_dm_psr.h"
#include "amdgpu_dm_replay.h"
#include "ivsrcid/ivsrcid_vislands30.h"
#include <linux/backlight.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/pm_runtime.h>
#include <linux/pci.h>
#include <linux/power_supply.h>
#include <linux/firmware.h>
#include <linux/component.h>
#include <linux/dmi.h>
#include <linux/sort.h>
#include <drm/display/drm_dp_mst_helper.h>
#include <drm/display/drm_hdmi_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_uapi.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h>
#include <drm/drm_fixed.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_edid.h>
#include <drm/drm_eld.h>
#include <drm/drm_vblank.h>
#include <drm/drm_audio_component.h>
#include <drm/drm_gem_atomic_helper.h>
#include <acpi/video.h>
#include "ivsrcid/dcn/irqsrcs_dcn_1_0.h"
#include "dcn/dcn_1_0_offset.h"
#include "dcn/dcn_1_0_sh_mask.h"
#include "soc15_hw_ip.h"
#include "soc15_common.h"
#include "vega10_ip_offset.h"
#include "gc/gc_11_0_0_offset.h"
#include "gc/gc_11_0_0_sh_mask.h"
#include "modules/inc/mod_freesync.h"
#include "modules/power/power_helpers.h"
#define FIRMWARE_RENOIR_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_SIENNA_CICHLID_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_NAVY_FLOUNDER_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_GREEN_SARDINE_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_VANGOGH_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DIMGREY_CAVEFISH_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_BEIGE_GOBY_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_YELLOW_CARP_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_314_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_315_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN316_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_V3_2_0_DMCUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_V3_2_1_DMCUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_RAVEN_DMCU …
MODULE_FIRMWARE(…);
#define FIRMWARE_NAVI12_DMCU …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_35_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_351_DMUB …
MODULE_FIRMWARE(…);
#define FIRMWARE_DCN_401_DMUB …
MODULE_FIRMWARE(…);
#define PSP_HEADER_BYTES …
#define PSP_FOOTER_BYTES …
static int amdgpu_dm_init(struct amdgpu_device *adev);
static void amdgpu_dm_fini(struct amdgpu_device *adev);
static bool is_freesync_video_mode(const struct drm_display_mode *mode, struct amdgpu_dm_connector *aconnector);
static enum drm_mode_subconnector get_subconnector_type(struct dc_link *link)
{ … }
static void update_subconnector_property(struct amdgpu_dm_connector *aconnector)
{ … }
static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev);
static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm);
static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
struct amdgpu_dm_connector *amdgpu_dm_connector,
u32 link_index,
struct amdgpu_encoder *amdgpu_encoder);
static int amdgpu_dm_encoder_init(struct drm_device *dev,
struct amdgpu_encoder *aencoder,
uint32_t link_index);
static int amdgpu_dm_connector_get_modes(struct drm_connector *connector);
static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state);
static int amdgpu_dm_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state);
static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector);
static void handle_hpd_rx_irq(void *param);
static bool
is_timing_unchanged_for_freesync(struct drm_crtc_state *old_crtc_state,
struct drm_crtc_state *new_crtc_state);
static u32 dm_vblank_get_counter(struct amdgpu_device *adev, int crtc)
{ … }
static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc,
u32 *vbl, u32 *position)
{ … }
static bool dm_is_idle(void *handle)
{ … }
static int dm_wait_for_idle(void *handle)
{ … }
static bool dm_check_soft_reset(void *handle)
{ … }
static int dm_soft_reset(void *handle)
{ … }
static struct amdgpu_crtc *
get_crtc_by_otg_inst(struct amdgpu_device *adev,
int otg_inst)
{ … }
static inline bool is_dc_timing_adjust_needed(struct dm_crtc_state *old_state,
struct dm_crtc_state *new_state)
{ … }
static int dm_plane_layer_index_cmp(const void *a, const void *b)
{ … }
static inline bool update_planes_and_stream_adapter(struct dc *dc,
int update_type,
int planes_count,
struct dc_stream_state *stream,
struct dc_stream_update *stream_update,
struct dc_surface_update *array_of_surface_update)
{ … }
static void dm_pflip_high_irq(void *interrupt_params)
{ … }
static void dm_vupdate_high_irq(void *interrupt_params)
{ … }
static void dm_crtc_high_irq(void *interrupt_params)
{ … }
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
static void dm_dcn_vertical_interrupt0_high_irq(void *interrupt_params)
{ … }
#endif
static void dmub_aux_setconfig_callback(struct amdgpu_device *adev,
struct dmub_notification *notify)
{ … }
static void dmub_hpd_callback(struct amdgpu_device *adev,
struct dmub_notification *notify)
{ … }
static bool register_dmub_notify_callback(struct amdgpu_device *adev,
enum dmub_notification_type type,
dmub_notify_interrupt_callback_t callback,
bool dmub_int_thread_offload)
{ … }
static void dm_handle_hpd_work(struct work_struct *work)
{ … }
#define DMUB_TRACE_MAX_READ …
static void dm_dmub_outbox1_low_irq(void *interrupt_params)
{ … }
static int dm_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{ … }
static int dm_set_powergating_state(void *handle,
enum amd_powergating_state state)
{ … }
static int dm_early_init(void *handle);
static void amdgpu_dm_fbc_init(struct drm_connector *connector)
{ … }
static int amdgpu_dm_audio_component_get_eld(struct device *kdev, int port,
int pipe, bool *enabled,
unsigned char *buf, int max_bytes)
{ … }
static const struct drm_audio_component_ops amdgpu_dm_audio_component_ops = …;
static int amdgpu_dm_audio_component_bind(struct device *kdev,
struct device *hda_kdev, void *data)
{ … }
static void amdgpu_dm_audio_component_unbind(struct device *kdev,
struct device *hda_kdev, void *data)
{ … }
static const struct component_ops amdgpu_dm_audio_component_bind_ops = …;
static int amdgpu_dm_audio_init(struct amdgpu_device *adev)
{ … }
static void amdgpu_dm_audio_fini(struct amdgpu_device *adev)
{ … }
static void amdgpu_dm_audio_eld_notify(struct amdgpu_device *adev, int pin)
{ … }
static int dm_dmub_hw_init(struct amdgpu_device *adev)
{ … }
static void dm_dmub_hw_resume(struct amdgpu_device *adev)
{ … }
static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_addr_space_config *pa_config)
{ … }
static void force_connector_state(
struct amdgpu_dm_connector *aconnector,
enum drm_connector_force force_state)
{ … }
static void dm_handle_hpd_rx_offload_work(struct work_struct *work)
{ … }
static struct hpd_rx_irq_offload_work_queue *hpd_rx_irq_create_workqueue(struct dc *dc)
{ … }
struct amdgpu_stutter_quirk { … };
static const struct amdgpu_stutter_quirk amdgpu_stutter_quirk_list[] = …;
static bool dm_should_disable_stutter(struct pci_dev *pdev)
{ … }
static const struct dmi_system_id hpd_disconnect_quirk_table[] = …;
static void retrieve_dmi_info(struct amdgpu_display_manager *dm)
{ … }
void*
dm_allocate_gpu_mem(
struct amdgpu_device *adev,
enum dc_gpu_mem_alloc_type type,
size_t size,
long long *addr)
{ … }
static enum dmub_status
dm_dmub_send_vbios_gpint_command(struct amdgpu_device *adev,
enum dmub_gpint_command command_code,
uint16_t param,
uint32_t timeout_us)
{ … }
static struct dml2_soc_bb *dm_dmub_get_vbios_bounding_box(struct amdgpu_device *adev)
{ … }
static int amdgpu_dm_init(struct amdgpu_device *adev)
{ … }
static int amdgpu_dm_early_fini(void *handle)
{ … }
static void amdgpu_dm_fini(struct amdgpu_device *adev)
{ … }
static int load_dmcu_fw(struct amdgpu_device *adev)
{ … }
static uint32_t amdgpu_dm_dmub_reg_read(void *ctx, uint32_t address)
{ … }
static void amdgpu_dm_dmub_reg_write(void *ctx, uint32_t address,
uint32_t value)
{ … }
static int dm_dmub_sw_init(struct amdgpu_device *adev)
{ … }
static int dm_sw_init(void *handle)
{ … }
static int dm_sw_fini(void *handle)
{ … }
static int detect_mst_link_for_all_connectors(struct drm_device *dev)
{ … }
static int dm_late_init(void *handle)
{ … }
static void resume_mst_branch_status(struct drm_dp_mst_topology_mgr *mgr)
{ … }
static void s3_handle_mst(struct drm_device *dev, bool suspend)
{ … }
static int amdgpu_dm_smu_write_watermarks_table(struct amdgpu_device *adev)
{ … }
static int dm_hw_init(void *handle)
{ … }
static int dm_hw_fini(void *handle)
{ … }
static void dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,
struct dc_state *state, bool enable)
{ … }
static enum dc_status amdgpu_dm_commit_zero_streams(struct dc *dc)
{ … }
static void hpd_rx_irq_work_suspend(struct amdgpu_display_manager *dm)
{ … }
static int dm_suspend(void *handle)
{ … }
struct drm_connector *
amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state,
struct drm_crtc *crtc)
{ … }
static void emulated_link_detect(struct dc_link *link)
{ … }
static void dm_gpureset_commit_state(struct dc_state *dc_state,
struct amdgpu_display_manager *dm)
{ … }
static int dm_resume(void *handle)
{ … }
static const struct amd_ip_funcs amdgpu_dm_funcs = …;
const struct amdgpu_ip_block_version dm_ip_block = …;
static const struct drm_mode_config_funcs amdgpu_dm_mode_funcs = …;
static struct drm_mode_config_helper_funcs amdgpu_dm_mode_config_helperfuncs = …;
static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
{ … }
void amdgpu_dm_update_connector_after_detect(
struct amdgpu_dm_connector *aconnector)
{ … }
static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector)
{ … }
static void handle_hpd_irq(void *param)
{ … }
static void schedule_hpd_rx_offload_work(struct hpd_rx_irq_offload_work_queue *offload_wq,
union hpd_irq_data hpd_irq_data)
{ … }
static void handle_hpd_rx_irq(void *param)
{ … }
static int register_hpd_handlers(struct amdgpu_device *adev)
{ … }
#if defined(CONFIG_DRM_AMD_DC_SI)
static int dce60_register_irq_handlers(struct amdgpu_device *adev)
{ … }
#endif
static int dce110_register_irq_handlers(struct amdgpu_device *adev)
{ … }
static int dcn10_register_irq_handlers(struct amdgpu_device *adev)
{ … }
static int register_outbox_irq_handlers(struct amdgpu_device *adev)
{ … }
int dm_atomic_get_state(struct drm_atomic_state *state,
struct dm_atomic_state **dm_state)
{ … }
static struct dm_atomic_state *
dm_atomic_get_new_state(struct drm_atomic_state *state)
{ … }
static struct drm_private_state *
dm_atomic_duplicate_state(struct drm_private_obj *obj)
{ … }
static void dm_atomic_destroy_state(struct drm_private_obj *obj,
struct drm_private_state *state)
{ … }
static struct drm_private_state_funcs dm_atomic_state_funcs = …;
static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev)
{ … }
#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT …
#define AMDGPU_DM_DEFAULT_MAX_BACKLIGHT …
#define AUX_BL_DEFAULT_TRANSITION_TIME_MS …
static void amdgpu_dm_update_backlight_caps(struct amdgpu_display_manager *dm,
int bl_idx)
{ … }
static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps,
unsigned int *min, unsigned int *max)
{ … }
static u32 convert_brightness_from_user(const struct amdgpu_dm_backlight_caps *caps,
uint32_t brightness)
{ … }
static u32 convert_brightness_to_user(const struct amdgpu_dm_backlight_caps *caps,
uint32_t brightness)
{ … }
static void amdgpu_dm_backlight_set_level(struct amdgpu_display_manager *dm,
int bl_idx,
u32 user_brightness)
{ … }
static int amdgpu_dm_backlight_update_status(struct backlight_device *bd)
{ … }
static u32 amdgpu_dm_backlight_get_level(struct amdgpu_display_manager *dm,
int bl_idx)
{ … }
static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd)
{ … }
static const struct backlight_ops amdgpu_dm_backlight_ops = …;
static void
amdgpu_dm_register_backlight_device(struct amdgpu_dm_connector *aconnector)
{ … }
static int initialize_plane(struct amdgpu_display_manager *dm,
struct amdgpu_mode_info *mode_info, int plane_id,
enum drm_plane_type plane_type,
const struct dc_plane_cap *plane_cap)
{ … }
static void setup_backlight_device(struct amdgpu_display_manager *dm,
struct amdgpu_dm_connector *aconnector)
{ … }
static void amdgpu_set_panel_orientation(struct drm_connector *connector);
static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
{ … }
static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm)
{ … }
static void dm_bandwidth_update(struct amdgpu_device *adev)
{ … }
static const struct amdgpu_display_funcs dm_display_funcs = …;
#if defined(CONFIG_DEBUG_KERNEL_DC)
static ssize_t s3_debug_store(struct device *device,
struct device_attribute *attr,
const char *buf,
size_t count)
{ … }
DEVICE_ATTR_WO(…);
#endif
static int dm_init_microcode(struct amdgpu_device *adev)
{ … }
static int dm_early_init(void *handle)
{ … }
static bool modereset_required(struct drm_crtc_state *crtc_state)
{ … }
static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
{ … }
static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = …;
static int
fill_plane_color_attributes(const struct drm_plane_state *plane_state,
const enum surface_pixel_format format,
enum dc_color_space *color_space)
{ … }
static int
fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
const struct drm_plane_state *plane_state,
const u64 tiling_flags,
struct dc_plane_info *plane_info,
struct dc_plane_address *address,
bool tmz_surface,
bool force_disable_dcc)
{ … }
static int fill_dc_plane_attributes(struct amdgpu_device *adev,
struct dc_plane_state *dc_plane_state,
struct drm_plane_state *plane_state,
struct drm_crtc_state *crtc_state)
{ … }
static inline void fill_dc_dirty_rect(struct drm_plane *plane,
struct rect *dirty_rect, int32_t x,
s32 y, s32 width, s32 height,
int *i, bool ffu)
{ … }
static void fill_dc_dirty_rects(struct drm_plane *plane,
struct drm_plane_state *old_plane_state,
struct drm_plane_state *new_plane_state,
struct drm_crtc_state *crtc_state,
struct dc_flip_addrs *flip_addrs,
bool is_psr_su,
bool *dirty_regions_changed)
{ … }
static void update_stream_scaling_settings(const struct drm_display_mode *mode,
const struct dm_connector_state *dm_state,
struct dc_stream_state *stream)
{ … }
static enum dc_color_depth
convert_color_depth_from_display_info(const struct drm_connector *connector,
bool is_y420, int requested_bpc)
{ … }
static enum dc_aspect_ratio
get_aspect_ratio(const struct drm_display_mode *mode_in)
{ … }
static enum dc_color_space
get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing,
const struct drm_connector_state *connector_state)
{ … }
static enum display_content_type
get_output_content_type(const struct drm_connector_state *connector_state)
{ … }
static bool adjust_colour_depth_from_display_info(
struct dc_crtc_timing *timing_out,
const struct drm_display_info *info)
{ … }
static void fill_stream_properties_from_drm_display_mode(
struct dc_stream_state *stream,
const struct drm_display_mode *mode_in,
const struct drm_connector *connector,
const struct drm_connector_state *connector_state,
const struct dc_stream_state *old_stream,
int requested_bpc)
{ … }
static void fill_audio_info(struct audio_info *audio_info,
const struct drm_connector *drm_connector,
const struct dc_sink *dc_sink)
{ … }
static void
copy_crtc_timing_for_drm_display_mode(const struct drm_display_mode *src_mode,
struct drm_display_mode *dst_mode)
{ … }
static void
decide_crtc_timing_for_drm_display_mode(struct drm_display_mode *drm_mode,
const struct drm_display_mode *native_mode,
bool scale_enabled)
{ … }
static struct dc_sink *
create_fake_sink(struct dc_link *link)
{ … }
static void set_multisync_trigger_params(
struct dc_stream_state *stream)
{ … }
static void set_master_stream(struct dc_stream_state *stream_set[],
int stream_count)
{ … }
static void dm_enable_per_frame_crtc_master_sync(struct dc_state *context)
{ … }
static struct drm_display_mode *
get_highest_refresh_rate_mode(struct amdgpu_dm_connector *aconnector,
bool use_probed_modes)
{ … }
static bool is_freesync_video_mode(const struct drm_display_mode *mode,
struct amdgpu_dm_connector *aconnector)
{ … }
#if defined(CONFIG_DRM_AMD_DC_FP)
static void update_dsc_caps(struct amdgpu_dm_connector *aconnector,
struct dc_sink *sink, struct dc_stream_state *stream,
struct dsc_dec_dpcd_caps *dsc_caps)
{ … }
static void apply_dsc_policy_for_edp(struct amdgpu_dm_connector *aconnector,
struct dc_sink *sink, struct dc_stream_state *stream,
struct dsc_dec_dpcd_caps *dsc_caps,
uint32_t max_dsc_target_bpp_limit_override)
{ … }
static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector,
struct dc_sink *sink, struct dc_stream_state *stream,
struct dsc_dec_dpcd_caps *dsc_caps)
{ … }
#endif
static struct dc_stream_state *
create_stream_for_sink(struct drm_connector *connector,
const struct drm_display_mode *drm_mode,
const struct dm_connector_state *dm_state,
const struct dc_stream_state *old_stream,
int requested_bpc)
{ … }
static enum drm_connector_status
amdgpu_dm_connector_detect(struct drm_connector *connector, bool force)
{ … }
int amdgpu_dm_connector_atomic_set_property(struct drm_connector *connector,
struct drm_connector_state *connector_state,
struct drm_property *property,
uint64_t val)
{ … }
int amdgpu_dm_connector_atomic_get_property(struct drm_connector *connector,
const struct drm_connector_state *state,
struct drm_property *property,
uint64_t *val)
{ … }
static ssize_t panel_power_savings_show(struct device *device,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t panel_power_savings_store(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(panel_power_savings);
static struct attribute *amdgpu_attrs[] = …;
static const struct attribute_group amdgpu_group = …;
static bool
amdgpu_dm_should_create_sysfs(struct amdgpu_dm_connector *amdgpu_dm_connector)
{ … }
static void amdgpu_dm_connector_unregister(struct drm_connector *connector)
{ … }
static void amdgpu_dm_connector_destroy(struct drm_connector *connector)
{ … }
void amdgpu_dm_connector_funcs_reset(struct drm_connector *connector)
{ … }
struct drm_connector_state *
amdgpu_dm_connector_atomic_duplicate_state(struct drm_connector *connector)
{ … }
static int
amdgpu_dm_connector_late_register(struct drm_connector *connector)
{ … }
static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
{ … }
static const struct drm_connector_funcs amdgpu_dm_connector_funcs = …;
static int get_modes(struct drm_connector *connector)
{ … }
static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
{ … }
static void handle_edid_mgmt(struct amdgpu_dm_connector *aconnector)
{ … }
static enum dc_status dm_validate_stream_and_context(struct dc *dc,
struct dc_stream_state *stream)
{ … }
struct dc_stream_state *
create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector,
const struct drm_display_mode *drm_mode,
const struct dm_connector_state *dm_state,
const struct dc_stream_state *old_stream)
{ … }
enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{ … }
static int fill_hdr_info_packet(const struct drm_connector_state *state,
struct dc_info_packet *out)
{ … }
static int
amdgpu_dm_connector_atomic_check(struct drm_connector *conn,
struct drm_atomic_state *state)
{ … }
static const struct drm_connector_helper_funcs
amdgpu_dm_connector_helper_funcs = …;
static void dm_encoder_helper_disable(struct drm_encoder *encoder)
{ … }
int convert_dc_color_depth_into_bpc(enum dc_color_depth display_color_depth)
{ … }
static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{ … }
const struct drm_encoder_helper_funcs amdgpu_dm_encoder_helper_funcs = …;
static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state,
struct dc_state *dc_state,
struct dsc_mst_fairness_vars *vars)
{ … }
static int to_drm_connector_type(enum signal_type st)
{ … }
static struct drm_encoder *amdgpu_dm_connector_to_encoder(struct drm_connector *connector)
{ … }
static void amdgpu_dm_get_native_mode(struct drm_connector *connector)
{ … }
static struct drm_display_mode *
amdgpu_dm_create_common_mode(struct drm_encoder *encoder,
char *name,
int hdisplay, int vdisplay)
{ … }
static void amdgpu_dm_connector_add_common_modes(struct drm_encoder *encoder,
struct drm_connector *connector)
{ … }
static void amdgpu_set_panel_orientation(struct drm_connector *connector)
{ … }
static void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,
struct edid *edid)
{ … }
static bool is_duplicate_mode(struct amdgpu_dm_connector *aconnector,
struct drm_display_mode *mode)
{ … }
static uint add_fs_modes(struct amdgpu_dm_connector *aconnector)
{ … }
static void amdgpu_dm_connector_add_freesync_modes(struct drm_connector *connector,
struct edid *edid)
{ … }
static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
{ … }
static const u32 supported_colorspaces = …;
void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
struct amdgpu_dm_connector *aconnector,
int connector_type,
struct dc_link *link,
int link_index)
{ … }
static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
struct i2c_msg *msgs, int num)
{ … }
static u32 amdgpu_dm_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm amdgpu_dm_i2c_algo = …;
static struct amdgpu_i2c_adapter *
create_i2c(struct ddc_service *ddc_service,
int link_index,
int *res)
{ … }
static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
struct amdgpu_dm_connector *aconnector,
u32 link_index,
struct amdgpu_encoder *aencoder)
{ … }
int amdgpu_dm_get_encoder_crtc_mask(struct amdgpu_device *adev)
{ … }
static int amdgpu_dm_encoder_init(struct drm_device *dev,
struct amdgpu_encoder *aencoder,
uint32_t link_index)
{ … }
static void manage_dm_interrupts(struct amdgpu_device *adev,
struct amdgpu_crtc *acrtc,
bool enable)
{ … }
static void dm_update_pflip_irq_state(struct amdgpu_device *adev,
struct amdgpu_crtc *acrtc)
{ … }
static bool
is_scaling_state_different(const struct dm_connector_state *dm_state,
const struct dm_connector_state *old_dm_state)
{ … }
static bool is_content_protection_different(struct drm_crtc_state *new_crtc_state,
struct drm_crtc_state *old_crtc_state,
struct drm_connector_state *new_conn_state,
struct drm_connector_state *old_conn_state,
const struct drm_connector *connector,
struct hdcp_workqueue *hdcp_w)
{ … }
static void remove_stream(struct amdgpu_device *adev,
struct amdgpu_crtc *acrtc,
struct dc_stream_state *stream)
{ … }
static void prepare_flip_isr(struct amdgpu_crtc *acrtc)
{ … }
static void update_freesync_state_on_stream(
struct amdgpu_display_manager *dm,
struct dm_crtc_state *new_crtc_state,
struct dc_stream_state *new_stream,
struct dc_plane_state *surface,
u32 flip_timestamp_in_us)
{ … }
static void update_stream_irq_parameters(
struct amdgpu_display_manager *dm,
struct dm_crtc_state *new_crtc_state)
{ … }
static void amdgpu_dm_handle_vrr_transition(struct dm_crtc_state *old_state,
struct dm_crtc_state *new_state)
{ … }
static void amdgpu_dm_commit_cursors(struct drm_atomic_state *state)
{ … }
static inline uint32_t get_mem_type(struct drm_framebuffer *fb)
{ … }
static void amdgpu_dm_update_cursor(struct drm_plane *plane,
struct drm_plane_state *old_plane_state,
struct dc_stream_update *update)
{ … }
static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
struct drm_device *dev,
struct amdgpu_display_manager *dm,
struct drm_crtc *pcrtc,
bool wait_for_vblank)
{ … }
static void amdgpu_dm_commit_audio(struct drm_device *dev,
struct drm_atomic_state *state)
{ … }
static void amdgpu_dm_crtc_copy_transient_flags(struct drm_crtc_state *crtc_state,
struct dc_stream_state *stream_state)
{ … }
static void dm_clear_writeback(struct amdgpu_display_manager *dm,
struct dm_crtc_state *crtc_state)
{ … }
static void amdgpu_dm_commit_streams(struct drm_atomic_state *state,
struct dc_state *dc_state)
{ … }
static void dm_set_writeback(struct amdgpu_display_manager *dm,
struct dm_crtc_state *crtc_state,
struct drm_connector *connector,
struct drm_connector_state *new_con_state)
{ … }
static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
{ … }
static int dm_force_atomic_commit(struct drm_connector *connector)
{ … }
void dm_restore_drm_connector_state(struct drm_device *dev,
struct drm_connector *connector)
{ … }
static int do_aquire_global_lock(struct drm_device *dev,
struct drm_atomic_state *state)
{ … }
static void get_freesync_config_for_crtc(
struct dm_crtc_state *new_crtc_state,
struct dm_connector_state *new_con_state)
{ … }
static void reset_freesync_config_for_crtc(
struct dm_crtc_state *new_crtc_state)
{ … }
static bool
is_timing_unchanged_for_freesync(struct drm_crtc_state *old_crtc_state,
struct drm_crtc_state *new_crtc_state)
{ … }
static void set_freesync_fixed_config(struct dm_crtc_state *dm_new_crtc_state)
{ … }
static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
struct drm_atomic_state *state,
struct drm_crtc *crtc,
struct drm_crtc_state *old_crtc_state,
struct drm_crtc_state *new_crtc_state,
bool enable,
bool *lock_and_validation_needed)
{ … }
static bool should_reset_plane(struct drm_atomic_state *state,
struct drm_plane *plane,
struct drm_plane_state *old_plane_state,
struct drm_plane_state *new_plane_state)
{ … }
static int dm_check_cursor_fb(struct amdgpu_crtc *new_acrtc,
struct drm_plane_state *new_plane_state,
struct drm_framebuffer *fb)
{ … }
static int dm_check_native_cursor_state(struct drm_crtc *new_plane_crtc,
struct drm_plane *plane,
struct drm_plane_state *new_plane_state,
bool enable)
{ … }
static bool dm_should_update_native_cursor(struct drm_atomic_state *state,
struct drm_crtc *old_plane_crtc,
struct drm_crtc *new_plane_crtc,
bool enable)
{ … }
static int dm_update_plane_state(struct dc *dc,
struct drm_atomic_state *state,
struct drm_plane *plane,
struct drm_plane_state *old_plane_state,
struct drm_plane_state *new_plane_state,
bool enable,
bool *lock_and_validation_needed,
bool *is_top_most_overlay)
{ … }
static void dm_get_oriented_plane_size(struct drm_plane_state *plane_state,
int *src_w, int *src_h)
{ … }
static void
dm_get_plane_scale(struct drm_plane_state *plane_state,
int *out_plane_scale_w, int *out_plane_scale_h)
{ … }
static inline struct __drm_planes_state *__get_next_zpos(
struct drm_atomic_state *state,
struct __drm_planes_state *prev)
{ … }
#define for_each_oldnew_plane_in_descending_zpos(__state, plane, old_plane_state, new_plane_state) …
static int add_affected_mst_dsc_crtcs(struct drm_atomic_state *state, struct drm_crtc *crtc)
{ … }
static int dm_crtc_get_cursor_mode(struct amdgpu_device *adev,
struct drm_atomic_state *state,
struct dm_crtc_state *dm_crtc_state,
enum amdgpu_dm_cursor_mode *cursor_mode)
{ … }
static int amdgpu_dm_atomic_check(struct drm_device *dev,
struct drm_atomic_state *state)
{ … }
static bool is_dp_capable_without_timing_msa(struct dc *dc,
struct amdgpu_dm_connector *amdgpu_dm_connector)
{ … }
static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm,
unsigned int offset,
unsigned int total_length,
u8 *data,
unsigned int length,
struct amdgpu_hdmi_vsdb_info *vsdb)
{ … }
static bool parse_edid_cea_dmcu(struct amdgpu_display_manager *dm,
u8 *edid_ext, int len,
struct amdgpu_hdmi_vsdb_info *vsdb_info)
{ … }
static bool parse_edid_cea_dmub(struct amdgpu_display_manager *dm,
u8 *edid_ext, int len,
struct amdgpu_hdmi_vsdb_info *vsdb_info)
{ … }
static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,
u8 *edid_ext, int len,
struct amdgpu_hdmi_vsdb_info *vsdb_info)
{ … }
static void parse_edid_displayid_vrr(struct drm_connector *connector,
struct edid *edid)
{ … }
static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector,
struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)
{ … }
static int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)
{ … }
void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
struct edid *edid)
{ … }
void amdgpu_dm_trigger_timing_sync(struct drm_device *dev)
{ … }
static inline void amdgpu_dm_exit_ips_for_hw_access(struct dc *dc)
{ … }
void dm_write_reg_func(const struct dc_context *ctx, uint32_t address,
u32 value, const char *func_name)
{ … }
uint32_t dm_read_reg_func(const struct dc_context *ctx, uint32_t address,
const char *func_name)
{ … }
int amdgpu_dm_process_dmub_aux_transfer_sync(
struct dc_context *ctx,
unsigned int link_index,
struct aux_payload *payload,
enum aux_return_code_type *operation_result)
{ … }
int amdgpu_dm_process_dmub_set_config_sync(
struct dc_context *ctx,
unsigned int link_index,
struct set_config_cmd_payload *payload,
enum set_config_status *operation_result)
{ … }
bool dm_execute_dmub_cmd(const struct dc_context *ctx, union dmub_rb_cmd *cmd, enum dm_dmub_wait_type wait_type)
{ … }
bool dm_execute_dmub_cmd_list(const struct dc_context *ctx, unsigned int count, union dmub_rb_cmd *cmd, enum dm_dmub_wait_type wait_type)
{ … }