/* * Copyright (C) 2015-2020 Advanced Micro Devices, Inc. All rights reserved. * * 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 *
*/
/* * This file contains the definition for amdgpu_display_manager * and its API for amdgpu driver's use. * This component provides all the display related functionality * and this is the only component that calls DAL API. * The API contained here intended for amdgpu driver use. * The API that is called directly from KMS framework is located * in amdgpu_dm_kms.h file
*/
/** * struct dmub_hpd_work - Handle time consuming work in low priority outbox IRQ * * @handle_hpd_work: Work to be executed in a separate thread to handle hpd_low_irq * @dmub_notify: notification for callback function * @adev: amdgpu_device pointer
*/ struct dmub_hpd_work { struct work_struct handle_hpd_work; struct dmub_notification *dmub_notify; struct amdgpu_device *adev;
};
/** * struct vblank_control_work - Work data for vblank control * @work: Kernel work data for the work event * @dm: amdgpu display manager device * @acrtc: amdgpu CRTC instance for which the event has occurred * @stream: DC stream for which the event has occurred * @enable: true if enabling vblank
*/ struct vblank_control_work { struct work_struct work; struct amdgpu_display_manager *dm; struct amdgpu_crtc *acrtc; struct dc_stream_state *stream; bool enable;
};
/** * struct idle_workqueue - Work data for periodic action in idle * @work: Kernel work data for the work event * @dm: amdgpu display manager device * @enable: true if idle worker is enabled * @running: true if idle worker is running
*/ struct idle_workqueue { struct work_struct work; struct amdgpu_display_manager *dm; bool enable; bool running;
};
/** * struct vupdate_offload_work - Work data for offloading task from vupdate handler * @work: Kernel work data for the work event * @adev: amdgpu_device back pointer * @stream: DC stream associated with the crtc * @adjust: DC CRTC timing adjust to be applied to the crtc
*/ struct vupdate_offload_work { struct work_struct work; struct amdgpu_device *adev; struct dc_stream_state *stream; struct dc_crtc_timing_adjust *adjust;
};
#define MAX_LUMINANCE_DATA_POINTS 99
/** * struct amdgpu_dm_luminance_data - Custom luminance data * @luminance: Luminance in percent * @input_signal: Input signal in range 0-255
*/ struct amdgpu_dm_luminance_data {
u8 luminance;
u8 input_signal;
} __packed;
/** * struct amdgpu_dm_backlight_caps - Information about backlight * * Describe the backlight support for ACPI or eDP AUX.
*/ struct amdgpu_dm_backlight_caps { /** * @ext_caps: Keep the data struct with all the information about the * display support for HDR.
*/ union dpcd_sink_ext_caps *ext_caps; /** * @aux_min_input_signal: Min brightness value supported by the display
*/
u32 aux_min_input_signal; /** * @aux_max_input_signal: Max brightness value supported by the display * in nits.
*/
u32 aux_max_input_signal; /** * @min_input_signal: minimum possible input in range 0-255.
*/ int min_input_signal; /** * @max_input_signal: maximum possible input in range 0-255.
*/ int max_input_signal; /** * @caps_valid: true if these values are from the ACPI interface.
*/ bool caps_valid; /** * @aux_support: Describes if the display supports AUX backlight.
*/ bool aux_support; /** * @ac_level: the default brightness if booted on AC
*/
u8 ac_level; /** * @dc_level: the default brightness if booted on DC
*/
u8 dc_level; /** * @data_points: the number of custom luminance data points
*/
u8 data_points; /** * @luminance_data: custom luminance data
*/ struct amdgpu_dm_luminance_data luminance_data[MAX_LUMINANCE_DATA_POINTS];
};
/** * struct dal_allocation - Tracks mapped FB memory for SMU communication * @list: list of dal allocations * @bo: GPU buffer object * @cpu_ptr: CPU virtual address of the GPU buffer object * @gpu_addr: GPU virtual address of the GPU buffer object
*/ struct dal_allocation { struct list_head list; struct amdgpu_bo *bo; void *cpu_ptr;
u64 gpu_addr;
};
/** * struct hpd_rx_irq_offload_work_queue - Work queue to handle hpd_rx_irq * offload work
*/ struct hpd_rx_irq_offload_work_queue { /** * @wq: workqueue structure to queue offload work.
*/ struct workqueue_struct *wq; /** * @offload_lock: To protect fields of offload work queue.
*/
spinlock_t offload_lock; /** * @is_handling_link_loss: Used to prevent inserting link loss event when * we're handling link loss
*/ bool is_handling_link_loss; /** * @is_handling_mst_msg_rdy_event: Used to prevent inserting mst message * ready event when we're already handling mst message ready event
*/ bool is_handling_mst_msg_rdy_event; /** * @aconnector: The aconnector that this work queue is attached to
*/ struct amdgpu_dm_connector *aconnector;
};
/** * struct hpd_rx_irq_offload_work - hpd_rx_irq offload work structure
*/ struct hpd_rx_irq_offload_work { /** * @work: offload work
*/ struct work_struct work; /** * @data: reference irq data which is used while handling offload work
*/ union hpd_irq_data data; /** * @offload_wq: offload work queue that this work is queued to
*/ struct hpd_rx_irq_offload_work_queue *offload_wq; /** * @adev: amdgpu_device pointer
*/ struct amdgpu_device *adev;
};
/** * struct amdgpu_display_manager - Central amdgpu display manager device * * @dc: Display Core control structure * @adev: AMDGPU base driver structure * @ddev: DRM base driver structure * @display_indexes_num: Max number of display streams supported * @irq_handler_list_table_lock: Synchronizes access to IRQ tables * @backlight_dev: Backlight control device * @backlight_link: Link on which to control backlight * @backlight_caps: Capabilities of the backlight device * @freesync_module: Module handling freesync calculations * @hdcp_workqueue: AMDGPU content protection queue * @fw_dmcu: Reference to DMCU firmware * @dmcu_fw_version: Version of the DMCU firmware * @soc_bounding_box: SOC bounding box values provided by gpu_info FW * @cached_state: Caches device atomic state for suspend/resume * @cached_dc_state: Cached state of content streams * @compressor: Frame buffer compression buffer. See &struct dm_compressor_info * @force_timing_sync: set via debugfs. When set, indicates that all connected * displays will be forced to synchronize. * @dmcub_trace_event_en: enable dmcub trace events * @dmub_outbox_params: DMUB Outbox parameters * @num_of_edps: number of backlight eDPs * @disable_hpd_irq: disables all HPD and HPD RX interrupt handling in the * driver when true * @dmub_aux_transfer_done: struct completion used to indicate when DMUB * transfers are done * @delayed_hpd_wq: work queue used to delay DMUB HPD work
*/ struct amdgpu_display_manager {
struct dc *dc;
/** * @dmub_srv: * * DMUB service, used for controlling the DMUB on hardware * that supports it. The pointer to the dmub_srv will be * NULL on hardware that does not support it.
*/ struct dmub_srv *dmub_srv;
/** * @dmub_notify: * * Notification from DMUB.
*/
struct dmub_notification *dmub_notify;
/** * @dmub_callback: * * Callback functions to handle notification from DMUB.
*/
/** * @atomic_obj: * * In combination with &dm_atomic_state it helps manage * global atomic state that doesn't map cleanly into existing * drm resources, like &dc_context.
*/ struct drm_private_obj atomic_obj;
/** * @dc_lock: * * Guards access to DC functions that can issue register write * sequences.
*/ struct mutex dc_lock;
/** * @audio_component: * * Used to notify ELD changes to sound driver.
*/ struct drm_audio_component *audio_component;
/** * @audio_registered: * * True if the audio component has been registered * successfully, false otherwise.
*/ bool audio_registered;
/** * @irq_handler_list_low_tab: * * Low priority IRQ handler table. * * It is a n*m table consisting of n IRQ sources, and m handlers per IRQ * source. Low priority IRQ handlers are deferred to a workqueue to be * processed. Hence, they can sleep. * * Note that handlers are called in the same order as they were * registered (FIFO).
*/ struct list_head irq_handler_list_low_tab[DAL_IRQ_SOURCES_NUMBER];
/** * @irq_handler_list_high_tab: * * High priority IRQ handler table. * * It is a n*m table, same as &irq_handler_list_low_tab. However, * handlers in this table are not deferred and are called immediately.
*/ struct list_head irq_handler_list_high_tab[DAL_IRQ_SOURCES_NUMBER];
conststruct firmware *fw_dmcu;
uint32_t dmcu_fw_version; /** * @soc_bounding_box: * * gpu_info FW provided soc bounding box struct or 0 if not * available in FW
*/ conststruct gpu_info_soc_bounding_box_v1_0 *soc_bounding_box;
/** * @active_vblank_irq_count: * * number of currently active vblank irqs
*/
uint32_t active_vblank_irq_count;
#ifdefined(CONFIG_DRM_AMD_SECURE_DISPLAY) /** * @secure_display_ctx: * * Store secure display relevant info. e.g. the ROI information * , the work_struct to command dmub, etc.
*/ struct secure_display_context secure_display_ctx; #endif /** * @hpd_rx_offload_wq: * * Work queue to offload works of hpd_rx_irq
*/ struct hpd_rx_irq_offload_work_queue *hpd_rx_offload_wq; /** * @mst_encoders: * * fake encoders used for DP MST.
*/ struct amdgpu_encoder mst_encoders[AMDGPU_DM_MAX_CRTC]; bool force_timing_sync; bool disable_hpd_irq; bool dmcub_trace_event_en; /** * @da_list: * * DAL fb memory allocation list, for communication with SMU.
*/ struct list_head da_list; struct completion dmub_aux_transfer_done; struct workqueue_struct *delayed_hpd_wq;
/** * @aux_hpd_discon_quirk: * * quirk for hpd discon while aux is on-going. * occurred on certain intel platform
*/ bool aux_hpd_discon_quirk;
/** * @edp0_on_dp1_quirk: * * quirk for platforms that put edp0 on DP1.
*/ bool edp0_on_dp1_quirk;
/** * @dpia_aux_lock: * * Guards access to DPIA AUX
*/ struct mutex dpia_aux_lock;
/** * @bb_from_dmub: * * Bounding box data read from dmub during early initialization for DCN4+ * Data is stored as a byte array that should be casted to the appropriate bb struct
*/ void *bb_from_dmub;
/** * struct amdgpu_hdmi_vsdb_info - Keep track of the VSDB info * * AMDGPU supports FreeSync over HDMI by using the VSDB section, and this * struct is useful to keep track of the display-specific information about * FreeSync.
*/ struct amdgpu_hdmi_vsdb_info { /** * @amd_vsdb_version: Vendor Specific Data Block Version, should be * used to determine which Vendor Specific InfoFrame (VSIF) to send.
*/ unsignedint amd_vsdb_version;
/* TODO see if we can merge with ddc_bus or make a dm_connector */ struct amdgpu_i2c_adapter *i2c;
/* Monitor range limits */ /** * @min_vfreq: Minimal frequency supported by the display in Hz. This * value is set to zero when there is no FreeSync support.
*/ int min_vfreq;
/** * @max_vfreq: Maximum frequency supported by the display in Hz. This * value is set to zero when there is no FreeSync support.
*/ int max_vfreq ;
/* Audio instance - protected by audio_lock. */ int audio_inst;
/* enum amdgpu_transfer_function: pre-defined transfer function supported by AMD. * * It includes standardized transfer functions and pure power functions. The * transfer function coefficients are available at modules/color/color_gamma.c
*/ enum amdgpu_transfer_function {
AMDGPU_TRANSFER_FUNCTION_DEFAULT,
AMDGPU_TRANSFER_FUNCTION_SRGB_EOTF,
AMDGPU_TRANSFER_FUNCTION_BT709_INV_OETF,
AMDGPU_TRANSFER_FUNCTION_PQ_EOTF,
AMDGPU_TRANSFER_FUNCTION_IDENTITY,
AMDGPU_TRANSFER_FUNCTION_GAMMA22_EOTF,
AMDGPU_TRANSFER_FUNCTION_GAMMA24_EOTF,
AMDGPU_TRANSFER_FUNCTION_GAMMA26_EOTF,
AMDGPU_TRANSFER_FUNCTION_SRGB_INV_EOTF,
AMDGPU_TRANSFER_FUNCTION_BT709_OETF,
AMDGPU_TRANSFER_FUNCTION_PQ_INV_EOTF,
AMDGPU_TRANSFER_FUNCTION_GAMMA22_INV_EOTF,
AMDGPU_TRANSFER_FUNCTION_GAMMA24_INV_EOTF,
AMDGPU_TRANSFER_FUNCTION_GAMMA26_INV_EOTF,
AMDGPU_TRANSFER_FUNCTION_COUNT
};
/* Plane color mgmt */ /** * @degamma_lut: * * 1D LUT for mapping framebuffer/plane pixel data before sampling or * blending operations. It's usually applied to linearize input space. * The blob (if not NULL) is an array of &struct drm_color_lut.
*/ struct drm_property_blob *degamma_lut; /** * @degamma_tf: * * Predefined transfer function to tell DC driver the input space to * linearize.
*/ enum amdgpu_transfer_function degamma_tf; /** * @hdr_mult: * * Multiplier to 'gain' the plane. When PQ is decoded using the fixed * func transfer function to the internal FP16 fb, 1.0 -> 80 nits (on * AMD at least). When sRGB is decoded, 1.0 -> 1.0, obviously. * Therefore, 1.0 multiplier = 80 nits for SDR content. So if you * want, 203 nits for SDR content, pass in (203.0 / 80.0). Format is * S31.32 sign-magnitude. * * HDR multiplier can wide range beyond [0.0, 1.0]. This means that PQ * TF is needed for any subsequent linear-to-non-linear transforms.
*/
__u64 hdr_mult; /** * @ctm: * * Color transformation matrix. The blob (if not NULL) is a &struct * drm_color_ctm_3x4.
*/ struct drm_property_blob *ctm; /** * @shaper_lut: shaper lookup table blob. The blob (if not NULL) is an * array of &struct drm_color_lut.
*/ struct drm_property_blob *shaper_lut; /** * @shaper_tf: * * Predefined transfer function to delinearize color space.
*/ enum amdgpu_transfer_function shaper_tf; /** * @lut3d: 3D lookup table blob. The blob (if not NULL) is an array of * &struct drm_color_lut.
*/ struct drm_property_blob *lut3d; /** * @blend_lut: blend lut lookup table blob. The blob (if not NULL) is an * array of &struct drm_color_lut.
*/ struct drm_property_blob *blend_lut; /** * @blend_tf: * * Pre-defined transfer function for converting plane pixel data before * applying blend LUT.
*/ enum amdgpu_transfer_function blend_tf;
};
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.