mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
Merge tag 'drm-next-2018-12-14' of git://anongit.freedesktop.org/drm/drm
Pull drm updates from Dave Airlie: "Core: - shared fencing staging removal - drop transactional atomic helpers and move helpers to new location - DP/MST atomic cleanup - Leasing cleanups and drop EXPORT_SYMBOL - Convert drivers to atomic helpers and generic fbdev. - removed deprecated obj_ref/unref in favour of get/put - Improve dumb callback documentation - MODESET_LOCK_BEGIN/END helpers panels: - CDTech panels, Banana Pi Panel, DLC1010GIG, - Olimex LCD-O-LinuXino, Samsung S6D16D0, Truly NT35597 WQXGA, - Himax HX8357D, simulated RTSM AEMv8. - GPD Win2 panel - AUO G101EVN010 vgem: - render node support ttm: - move global init out of drivers - fix LRU handling for ghost objects - Support for simultaneous submissions to multiple engines scheduler: - timeout/fault handling changes to help GPU recovery - helpers for hw with preemption support i915: - Scaler/Watermark fixes - DP MST + powerwell fixes - PSR fixes - Break long get/put shmemfs pages - Icelake fixes - Icelake DSI video mode enablement - Engine workaround improvements amdgpu: - freesync support - GPU reset enabled on CI, VI, SOC15 dGPUs - ABM support in DC - KFD support for vega12/polaris12 - SDMA paging queue on vega - More amdkfd code sharing - DCC scanout on GFX9 - DC kerneldoc - Updated SMU firmware for GFX8 chips - XGMI PSP + hive reset support - GPU reset - DC trace support - Powerplay updates for newer Polaris - Cursor plane update fast path - kfd dma-buf support virtio-gpu: - add EDID support vmwgfx: - pageflip with damage support nouveau: - Initial Turing TU104/TU106 modesetting support msm: - a2xx gpu support for apq8060 and imx5 - a2xx gpummu support - mdp4 display support for apq8060 - DPU fixes and cleanups - enhanced profiling support - debug object naming interface - get_iova/page pinning decoupling tegra: - Tegra194 host1x, VIC and display support enabled - Audio over HDMI for Tegra186 and Tegra194 exynos: - DMA/IOMMU refactoring - plane alpha + blend mode support - Color format fixes for mixer driver rcar-du: - R8A7744 and R8A77470 support - R8A77965 LVDS support imx: - fbdev emulation fix - multi-tiled scalling fixes - SPDX identifiers rockchip - dw_hdmi support - dw-mipi-dsi + dual dsi support - mailbox read size fix qxl: - fix cursor pinning vc4: - YUV support (scaling + cursor) v3d: - enable TFU (Texture Formatting Unit) mali-dp: - add support for linear tiled formats sun4i: - Display Engine 3 support - H6 DE3 mixer 0 support - H6 display engine support - dw-hdmi support - H6 HDMI phy support - implicit fence waiting - BGRX8888 support meson: - Overlay plane support - implicit fence waiting - HDMI 1.4 4k modes bridge: - i2c fixes for sii902x" * tag 'drm-next-2018-12-14' of git://anongit.freedesktop.org/drm/drm: (1403 commits) drm/amd/display: Add fast path for cursor plane updates drm/amdgpu: Enable GPU recovery by default for CI drm/amd/display: Fix duplicating scaling/underscan connector state drm/amd/display: Fix unintialized max_bpc state values Revert "drm/amd/display: Set RMX_ASPECT as default" drm/amdgpu: Fix stub function name drm/msm/dpu: Fix clock issue after bind failure drm/msm/dpu: Clean up dpu_media_info.h static inline functions drm/msm/dpu: Further cleanups for static inline functions drm/msm/dpu: Cleanup the debugfs functions drm/msm/dpu: Remove dpu_irq and unused functions drm/msm: Make irq_postinstall optional drm/msm/dpu: Cleanup callers of dpu_hw_blk_init drm/msm/dpu: Remove unused functions drm/msm/dpu: Remove dpu_crtc_is_enabled() drm/msm/dpu: Remove dpu_crtc_get_mixer_height drm/msm/dpu: Remove dpu_dbg drm/msm: dpu: Remove crtc_lock drm/msm: dpu: Remove vblank_requested flag from dpu_crtc drm/msm: dpu: Separate crtc assignment from vblank enable ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -59,60 +59,140 @@ struct common_irq_params {
|
||||
enum dc_irq_source irq_src;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct irq_list_head - Linked-list for low context IRQ handlers.
|
||||
*
|
||||
* @head: The list_head within &struct handler_data
|
||||
* @work: A work_struct containing the deferred handler work
|
||||
*/
|
||||
struct irq_list_head {
|
||||
struct list_head head;
|
||||
/* In case this interrupt needs post-processing, 'work' will be queued*/
|
||||
struct work_struct work;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dm_compressor_info - Buffer info used by frame buffer compression
|
||||
* @cpu_addr: MMIO cpu addr
|
||||
* @bo_ptr: Pointer to the buffer object
|
||||
* @gpu_addr: MMIO gpu addr
|
||||
*/
|
||||
struct dm_comressor_info {
|
||||
void *cpu_addr;
|
||||
struct amdgpu_bo *bo_ptr;
|
||||
uint64_t gpu_addr;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct amdgpu_dm_backlight_caps - Usable range of backlight values from ACPI
|
||||
* @min_input_signal: minimum possible input in range 0-255
|
||||
* @max_input_signal: maximum possible input in range 0-255
|
||||
* @caps_valid: true if these values are from the ACPI interface
|
||||
*/
|
||||
struct amdgpu_dm_backlight_caps {
|
||||
int min_input_signal;
|
||||
int max_input_signal;
|
||||
bool caps_valid;
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @cached_state: Caches device atomic state for suspend/resume
|
||||
* @compressor: Frame buffer compression buffer. See &struct dm_comressor_info
|
||||
*/
|
||||
struct amdgpu_display_manager {
|
||||
|
||||
struct dc *dc;
|
||||
|
||||
/**
|
||||
* @cgs_device:
|
||||
*
|
||||
* The Common Graphics Services device. It provides an interface for
|
||||
* accessing registers.
|
||||
*/
|
||||
struct cgs_device *cgs_device;
|
||||
|
||||
struct amdgpu_device *adev; /*AMD base driver*/
|
||||
struct drm_device *ddev; /*DRM base driver*/
|
||||
struct amdgpu_device *adev;
|
||||
struct drm_device *ddev;
|
||||
u16 display_indexes_num;
|
||||
|
||||
/*
|
||||
* 'irq_source_handler_table' holds a list of handlers
|
||||
* per (DAL) IRQ source.
|
||||
/**
|
||||
* @atomic_obj
|
||||
*
|
||||
* Each IRQ source may need to be handled at different contexts.
|
||||
* By 'context' we mean, for example:
|
||||
* - The ISR context, which is the direct interrupt handler.
|
||||
* - The 'deferred' context - this is the post-processing of the
|
||||
* interrupt, but at a lower priority.
|
||||
* 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;
|
||||
|
||||
struct drm_modeset_lock atomic_obj_lock;
|
||||
|
||||
/**
|
||||
* @dc_lock:
|
||||
*
|
||||
* Guards access to DC functions that can issue register write
|
||||
* sequences.
|
||||
*/
|
||||
struct mutex dc_lock;
|
||||
|
||||
/**
|
||||
* @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 irq_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];
|
||||
|
||||
/**
|
||||
* @pflip_params:
|
||||
*
|
||||
* Page flip IRQ parameters, passed to registered handlers when
|
||||
* triggered.
|
||||
*/
|
||||
struct common_irq_params
|
||||
pflip_params[DC_IRQ_SOURCE_PFLIP_LAST - DC_IRQ_SOURCE_PFLIP_FIRST + 1];
|
||||
|
||||
/**
|
||||
* @vblank_params:
|
||||
*
|
||||
* Vertical blanking IRQ parameters, passed to registered handlers when
|
||||
* triggered.
|
||||
*/
|
||||
struct common_irq_params
|
||||
vblank_params[DC_IRQ_SOURCE_VBLANK6 - DC_IRQ_SOURCE_VBLANK1 + 1];
|
||||
|
||||
/* this spin lock synchronizes access to 'irq_handler_list_table' */
|
||||
spinlock_t irq_handler_list_table_lock;
|
||||
|
||||
struct backlight_device *backlight_dev;
|
||||
|
||||
const struct dc_link *backlight_link;
|
||||
struct amdgpu_dm_backlight_caps backlight_caps;
|
||||
|
||||
struct mod_freesync *freesync_module;
|
||||
|
||||
/**
|
||||
* Caches device atomic state for suspend/resume
|
||||
*/
|
||||
struct drm_atomic_state *cached_state;
|
||||
|
||||
struct dm_comressor_info compressor;
|
||||
@@ -183,15 +263,21 @@ struct dm_crtc_state {
|
||||
int crc_skip_count;
|
||||
bool crc_enabled;
|
||||
|
||||
bool freesync_enabled;
|
||||
bool freesync_timing_changed;
|
||||
bool freesync_vrr_info_changed;
|
||||
|
||||
bool vrr_supported;
|
||||
struct mod_freesync_config freesync_config;
|
||||
struct dc_crtc_timing_adjust adjust;
|
||||
struct dc_info_packet vrr_infopacket;
|
||||
|
||||
int abm_level;
|
||||
};
|
||||
|
||||
#define to_dm_crtc_state(x) container_of(x, struct dm_crtc_state, base)
|
||||
|
||||
struct dm_atomic_state {
|
||||
struct drm_atomic_state base;
|
||||
struct drm_private_state base;
|
||||
|
||||
struct dc_state *context;
|
||||
};
|
||||
@@ -206,8 +292,8 @@ struct dm_connector_state {
|
||||
uint8_t underscan_hborder;
|
||||
uint8_t max_bpc;
|
||||
bool underscan_enable;
|
||||
bool freesync_enable;
|
||||
bool freesync_capable;
|
||||
uint8_t abm_level;
|
||||
};
|
||||
|
||||
#define to_dm_connector_state(x)\
|
||||
|
||||
@@ -164,7 +164,7 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc)
|
||||
*/
|
||||
stream->out_transfer_func->type = TF_TYPE_DISTRIBUTED_POINTS;
|
||||
ret = mod_color_calculate_regamma_params(stream->out_transfer_func,
|
||||
gamma, true, adev->asic_type <= CHIP_RAVEN);
|
||||
gamma, true, adev->asic_type <= CHIP_RAVEN, NULL);
|
||||
dc_gamma_release(&gamma);
|
||||
if (!ret) {
|
||||
stream->out_transfer_func->type = old_type;
|
||||
|
||||
@@ -75,6 +75,11 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!stream_state) {
|
||||
DRM_ERROR("No stream state for CRTC%d\n", crtc->index);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* When enabling CRC, we should also disable dithering. */
|
||||
if (source == AMDGPU_DM_PIPE_CRC_SOURCE_AUTO) {
|
||||
if (dc_stream_configure_crc(stream_state->ctx->dc,
|
||||
|
||||
@@ -32,16 +32,55 @@
|
||||
#include "amdgpu_dm.h"
|
||||
#include "amdgpu_dm_irq.h"
|
||||
|
||||
/**
|
||||
* DOC: overview
|
||||
*
|
||||
* DM provides another layer of IRQ management on top of what the base driver
|
||||
* already provides. This is something that could be cleaned up, and is a
|
||||
* future TODO item.
|
||||
*
|
||||
* The base driver provides IRQ source registration with DRM, handler
|
||||
* registration into the base driver's IRQ table, and a handler callback
|
||||
* amdgpu_irq_handler(), with which DRM calls on interrupts. This generic
|
||||
* handler looks up the IRQ table, and calls the respective
|
||||
* &amdgpu_irq_src_funcs.process hookups.
|
||||
*
|
||||
* What DM provides on top are two IRQ tables specifically for top-half and
|
||||
* bottom-half IRQ handling, with the bottom-half implementing workqueues:
|
||||
*
|
||||
* - &amdgpu_display_manager.irq_handler_list_high_tab
|
||||
* - &amdgpu_display_manager.irq_handler_list_low_tab
|
||||
*
|
||||
* They override the base driver's IRQ table, and the effect can be seen
|
||||
* in the hooks that DM provides for &amdgpu_irq_src_funcs.process. They
|
||||
* are all set to the DM generic handler amdgpu_dm_irq_handler(), which looks up
|
||||
* DM's IRQ tables. However, in order for base driver to recognize this hook, DM
|
||||
* still needs to register the IRQ with the base driver. See
|
||||
* dce110_register_irq_handlers() and dcn10_register_irq_handlers().
|
||||
*
|
||||
* To expose DC's hardware interrupt toggle to the base driver, DM implements
|
||||
* &amdgpu_irq_src_funcs.set hooks. Base driver calls it through
|
||||
* amdgpu_irq_update() to enable or disable the interrupt.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* Private declarations.
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* struct amdgpu_dm_irq_handler_data - Data for DM interrupt handlers.
|
||||
*
|
||||
* @list: Linked list entry referencing the next/previous handler
|
||||
* @handler: Handler function
|
||||
* @handler_arg: Argument passed to the handler when triggered
|
||||
* @dm: DM which this handler belongs to
|
||||
* @irq_source: DC interrupt source that this handler is registered for
|
||||
*/
|
||||
struct amdgpu_dm_irq_handler_data {
|
||||
struct list_head list;
|
||||
interrupt_handler handler;
|
||||
void *handler_arg;
|
||||
|
||||
/* DM which this handler belongs to */
|
||||
struct amdgpu_display_manager *dm;
|
||||
/* DAL irq source which registered for this interrupt. */
|
||||
enum dc_irq_source irq_source;
|
||||
@@ -68,7 +107,7 @@ static void init_handler_common_data(struct amdgpu_dm_irq_handler_data *hcd,
|
||||
}
|
||||
|
||||
/**
|
||||
* dm_irq_work_func - Handle an IRQ outside of the interrupt handler proper.
|
||||
* dm_irq_work_func() - Handle an IRQ outside of the interrupt handler proper.
|
||||
*
|
||||
* @work: work struct
|
||||
*/
|
||||
@@ -99,8 +138,8 @@ static void dm_irq_work_func(struct work_struct *work)
|
||||
* (The most common use is HPD interrupt) */
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a handler and return a pointer to hander list from which the
|
||||
/*
|
||||
* Remove a handler and return a pointer to handler list from which the
|
||||
* handler was removed.
|
||||
*/
|
||||
static struct list_head *remove_irq_handler(struct amdgpu_device *adev,
|
||||
@@ -203,6 +242,24 @@ static bool validate_irq_unregistration_params(enum dc_irq_source irq_source,
|
||||
* Note: caller is responsible for input validation.
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
* amdgpu_dm_irq_register_interrupt() - Register a handler within DM.
|
||||
* @adev: The base driver device containing the DM device.
|
||||
* @int_params: Interrupt parameters containing the source, and handler context
|
||||
* @ih: Function pointer to the interrupt handler to register
|
||||
* @handler_args: Arguments passed to the handler when the interrupt occurs
|
||||
*
|
||||
* Register an interrupt handler for the given IRQ source, under the given
|
||||
* context. The context can either be high or low. High context handlers are
|
||||
* executed directly within ISR context, while low context is executed within a
|
||||
* workqueue, thereby allowing operations that sleep.
|
||||
*
|
||||
* Registered handlers are called in a FIFO manner, i.e. the most recently
|
||||
* registered handler will be called first.
|
||||
*
|
||||
* Return: Handler data &struct amdgpu_dm_irq_handler_data containing the IRQ
|
||||
* source, handler function, and args
|
||||
*/
|
||||
void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,
|
||||
struct dc_interrupt_params *int_params,
|
||||
void (*ih)(void *),
|
||||
@@ -261,6 +318,15 @@ void *amdgpu_dm_irq_register_interrupt(struct amdgpu_device *adev,
|
||||
return handler_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_dm_irq_unregister_interrupt() - Remove a handler from the DM IRQ table
|
||||
* @adev: The base driver device containing the DM device
|
||||
* @irq_source: IRQ source to remove the given handler from
|
||||
* @ih: Function pointer to the interrupt handler to unregister
|
||||
*
|
||||
* Go through both low and high context IRQ tables, and find the given handler
|
||||
* for the given irq source. If found, remove it. Otherwise, do nothing.
|
||||
*/
|
||||
void amdgpu_dm_irq_unregister_interrupt(struct amdgpu_device *adev,
|
||||
enum dc_irq_source irq_source,
|
||||
void *ih)
|
||||
@@ -295,6 +361,20 @@ void amdgpu_dm_irq_unregister_interrupt(struct amdgpu_device *adev,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_dm_irq_init() - Initialize DM IRQ management
|
||||
* @adev: The base driver device containing the DM device
|
||||
*
|
||||
* Initialize DM's high and low context IRQ tables.
|
||||
*
|
||||
* The N by M table contains N IRQ sources, with M
|
||||
* &struct amdgpu_dm_irq_handler_data hooked together in a linked list. The
|
||||
* list_heads are initialized here. When an interrupt n is triggered, all m
|
||||
* handlers are called in sequence, FIFO according to registration order.
|
||||
*
|
||||
* The low context table requires special steps to initialize, since handlers
|
||||
* will be deferred to a workqueue. See &struct irq_list_head.
|
||||
*/
|
||||
int amdgpu_dm_irq_init(struct amdgpu_device *adev)
|
||||
{
|
||||
int src;
|
||||
@@ -317,7 +397,12 @@ int amdgpu_dm_irq_init(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* DM IRQ and timer resource release */
|
||||
/**
|
||||
* amdgpu_dm_irq_fini() - Tear down DM IRQ management
|
||||
* @adev: The base driver device containing the DM device
|
||||
*
|
||||
* Flush all work within the low context IRQ table.
|
||||
*/
|
||||
void amdgpu_dm_irq_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
int src;
|
||||
@@ -414,7 +499,7 @@ int amdgpu_dm_irq_resume_late(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* amdgpu_dm_irq_schedule_work - schedule all work items registered for the
|
||||
* "irq_source".
|
||||
*/
|
||||
@@ -439,8 +524,9 @@ static void amdgpu_dm_irq_schedule_work(struct amdgpu_device *adev,
|
||||
|
||||
}
|
||||
|
||||
/** amdgpu_dm_irq_immediate_work
|
||||
* Callback high irq work immediately, don't send to work queue
|
||||
/*
|
||||
* amdgpu_dm_irq_immediate_work
|
||||
* Callback high irq work immediately, don't send to work queue
|
||||
*/
|
||||
static void amdgpu_dm_irq_immediate_work(struct amdgpu_device *adev,
|
||||
enum dc_irq_source irq_source)
|
||||
@@ -467,11 +553,14 @@ static void amdgpu_dm_irq_immediate_work(struct amdgpu_device *adev,
|
||||
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* amdgpu_dm_irq_handler
|
||||
/**
|
||||
* amdgpu_dm_irq_handler - Generic DM IRQ handler
|
||||
* @adev: amdgpu base driver device containing the DM device
|
||||
* @source: Unused
|
||||
* @entry: Data about the triggered interrupt
|
||||
*
|
||||
* Generic IRQ handler, calls all registered high irq work immediately, and
|
||||
* schedules work for low irq
|
||||
* Calls all registered high irq work immediately, and schedules work for low
|
||||
* irq. The DM IRQ table is used to find the corresponding handlers.
|
||||
*/
|
||||
static int amdgpu_dm_irq_handler(struct amdgpu_device *adev,
|
||||
struct amdgpu_irq_src *source,
|
||||
@@ -613,7 +702,7 @@ void amdgpu_dm_set_irq_funcs(struct amdgpu_device *adev)
|
||||
adev->hpd_irq.funcs = &dm_hpd_irq_funcs;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* amdgpu_dm_hpd_init - hpd setup callback.
|
||||
*
|
||||
* @adev: amdgpu_device pointer
|
||||
|
||||
@@ -485,11 +485,11 @@ void pp_rv_set_display_requirement(struct pp_smu *pp,
|
||||
return;
|
||||
|
||||
clock.clock_type = amd_pp_dcf_clock;
|
||||
clock.clock_freq_in_khz = req->hard_min_dcefclk_khz;
|
||||
clock.clock_freq_in_khz = req->hard_min_dcefclk_mhz * 1000;
|
||||
pp_funcs->display_clock_voltage_request(pp_handle, &clock);
|
||||
|
||||
clock.clock_type = amd_pp_f_clock;
|
||||
clock.clock_freq_in_khz = req->hard_min_fclk_khz;
|
||||
clock.clock_freq_in_khz = req->hard_min_fclk_mhz * 1000;
|
||||
pp_funcs->display_clock_voltage_request(pp_handle, &clock);
|
||||
}
|
||||
|
||||
@@ -518,13 +518,13 @@ void pp_rv_set_wm_ranges(struct pp_smu *pp,
|
||||
wm_dce_clocks[i].wm_set_id =
|
||||
ranges->reader_wm_sets[i].wm_inst;
|
||||
wm_dce_clocks[i].wm_max_dcfclk_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].max_drain_clk_khz;
|
||||
ranges->reader_wm_sets[i].max_drain_clk_mhz * 1000;
|
||||
wm_dce_clocks[i].wm_min_dcfclk_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].min_drain_clk_khz;
|
||||
ranges->reader_wm_sets[i].min_drain_clk_mhz * 1000;
|
||||
wm_dce_clocks[i].wm_max_mem_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].max_fill_clk_khz;
|
||||
ranges->reader_wm_sets[i].max_fill_clk_mhz * 1000;
|
||||
wm_dce_clocks[i].wm_min_mem_clk_in_khz =
|
||||
ranges->reader_wm_sets[i].min_fill_clk_khz;
|
||||
ranges->reader_wm_sets[i].min_fill_clk_mhz * 1000;
|
||||
}
|
||||
|
||||
for (i = 0; i < wm_with_clock_ranges.num_wm_mcif_sets; i++) {
|
||||
@@ -534,13 +534,13 @@ void pp_rv_set_wm_ranges(struct pp_smu *pp,
|
||||
wm_soc_clocks[i].wm_set_id =
|
||||
ranges->writer_wm_sets[i].wm_inst;
|
||||
wm_soc_clocks[i].wm_max_socclk_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].max_fill_clk_khz;
|
||||
ranges->writer_wm_sets[i].max_fill_clk_mhz * 1000;
|
||||
wm_soc_clocks[i].wm_min_socclk_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].min_fill_clk_khz;
|
||||
ranges->writer_wm_sets[i].min_fill_clk_mhz * 1000;
|
||||
wm_soc_clocks[i].wm_max_mem_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].max_drain_clk_khz;
|
||||
ranges->writer_wm_sets[i].max_drain_clk_mhz * 1000;
|
||||
wm_soc_clocks[i].wm_min_mem_clk_in_khz =
|
||||
ranges->writer_wm_sets[i].min_drain_clk_khz;
|
||||
ranges->writer_wm_sets[i].min_drain_clk_mhz * 1000;
|
||||
}
|
||||
|
||||
pp_funcs->set_watermarks_for_clocks_ranges(pp_handle, &wm_with_clock_ranges);
|
||||
|
||||
104
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
Normal file
104
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_trace.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright 2018 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
|
||||
*
|
||||
*/
|
||||
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM amdgpu_dm
|
||||
|
||||
#if !defined(_AMDGPU_DM_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _AMDGPU_DM_TRACE_H_
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
TRACE_EVENT(amdgpu_dc_rreg,
|
||||
TP_PROTO(unsigned long *read_count, uint32_t reg, uint32_t value),
|
||||
TP_ARGS(read_count, reg, value),
|
||||
TP_STRUCT__entry(
|
||||
__field(uint32_t, reg)
|
||||
__field(uint32_t, value)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->reg = reg;
|
||||
__entry->value = value;
|
||||
*read_count = *read_count + 1;
|
||||
),
|
||||
TP_printk("reg=0x%08lx, value=0x%08lx",
|
||||
(unsigned long)__entry->reg,
|
||||
(unsigned long)__entry->value)
|
||||
);
|
||||
|
||||
TRACE_EVENT(amdgpu_dc_wreg,
|
||||
TP_PROTO(unsigned long *write_count, uint32_t reg, uint32_t value),
|
||||
TP_ARGS(write_count, reg, value),
|
||||
TP_STRUCT__entry(
|
||||
__field(uint32_t, reg)
|
||||
__field(uint32_t, value)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->reg = reg;
|
||||
__entry->value = value;
|
||||
*write_count = *write_count + 1;
|
||||
),
|
||||
TP_printk("reg=0x%08lx, value=0x%08lx",
|
||||
(unsigned long)__entry->reg,
|
||||
(unsigned long)__entry->value)
|
||||
);
|
||||
|
||||
|
||||
TRACE_EVENT(amdgpu_dc_performance,
|
||||
TP_PROTO(unsigned long read_count, unsigned long write_count,
|
||||
unsigned long *last_read, unsigned long *last_write,
|
||||
const char *func, unsigned int line),
|
||||
TP_ARGS(read_count, write_count, last_read, last_write, func, line),
|
||||
TP_STRUCT__entry(
|
||||
__field(uint32_t, reads)
|
||||
__field(uint32_t, writes)
|
||||
__field(uint32_t, read_delta)
|
||||
__field(uint32_t, write_delta)
|
||||
__string(func, func)
|
||||
__field(uint32_t, line)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->reads = read_count;
|
||||
__entry->writes = write_count;
|
||||
__entry->read_delta = read_count - *last_read;
|
||||
__entry->write_delta = write_count - *last_write;
|
||||
__assign_str(func, func);
|
||||
__entry->line = line;
|
||||
*last_read = read_count;
|
||||
*last_write = write_count;
|
||||
),
|
||||
TP_printk("%s:%d reads=%08ld (%08ld total), writes=%08ld (%08ld total)",
|
||||
__get_str(func), __entry->line,
|
||||
(unsigned long)__entry->read_delta,
|
||||
(unsigned long)__entry->reads,
|
||||
(unsigned long)__entry->write_delta,
|
||||
(unsigned long)__entry->writes)
|
||||
);
|
||||
#endif /* _AMDGPU_DM_TRACE_H_ */
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH .
|
||||
#define TRACE_INCLUDE_FILE amdgpu_dm_trace
|
||||
#include <trace/define_trace.h>
|
||||
Reference in New Issue
Block a user