mirror of
https://github.com/torvalds/linux.git
synced 2026-04-20 07:43:57 -04:00
Merge drm/drm-next into drm-misc-next
Bring rc1 to start the new release dev. Signed-off-by: Maxime Ripard <mripard@kernel.org>
This commit is contained in:
@@ -98,6 +98,7 @@
|
||||
#include <drm/drm_audio_component.h>
|
||||
#include <drm/drm_gem_atomic_helper.h>
|
||||
|
||||
#include <media/cec-notifier.h>
|
||||
#include <acpi/video.h>
|
||||
|
||||
#include "ivsrcid/dcn/irqsrcs_dcn_1_0.h"
|
||||
@@ -956,13 +957,13 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)
|
||||
}
|
||||
}
|
||||
|
||||
static int dm_set_clockgating_state(void *handle,
|
||||
static int dm_set_clockgating_state(struct amdgpu_ip_block *ip_block,
|
||||
enum amd_clockgating_state state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dm_set_powergating_state(void *handle,
|
||||
static int dm_set_powergating_state(struct amdgpu_ip_block *ip_block,
|
||||
enum amd_powergating_state state)
|
||||
{
|
||||
return 0;
|
||||
@@ -2033,6 +2034,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
|
||||
if (amdgpu_dc_debug_mask & DC_FORCE_SUBVP_MCLK_SWITCH)
|
||||
adev->dm.dc->debug.force_subvp_mclk_switch = true;
|
||||
|
||||
if (amdgpu_dc_debug_mask & DC_DISABLE_SUBVP)
|
||||
adev->dm.dc->debug.force_disable_subvp = true;
|
||||
|
||||
if (amdgpu_dc_debug_mask & DC_ENABLE_DML2) {
|
||||
adev->dm.dc->debug.using_dml2 = true;
|
||||
adev->dm.dc->debug.using_dml21 = true;
|
||||
@@ -2155,9 +2159,13 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
adev->dm.secure_display_ctxs = amdgpu_dm_crtc_secure_display_create_contexts(adev);
|
||||
if (!adev->dm.secure_display_ctxs)
|
||||
amdgpu_dm_crtc_secure_display_create_contexts(adev);
|
||||
if (!adev->dm.secure_display_ctx.crtc_ctx)
|
||||
DRM_ERROR("amdgpu: failed to initialize secure display contexts.\n");
|
||||
|
||||
if (amdgpu_ip_version(adev, DCE_HWIP, 0) >= IP_VERSION(4, 0, 1))
|
||||
adev->dm.secure_display_ctx.support_mul_roi = true;
|
||||
|
||||
#endif
|
||||
|
||||
DRM_DEBUG_DRIVER("KMS initialized.\n");
|
||||
@@ -2200,15 +2208,15 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
|
||||
amdgpu_dm_destroy_drm_device(&adev->dm);
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
if (adev->dm.secure_display_ctxs) {
|
||||
if (adev->dm.secure_display_ctx.crtc_ctx) {
|
||||
for (i = 0; i < adev->mode_info.num_crtc; i++) {
|
||||
if (adev->dm.secure_display_ctxs[i].crtc) {
|
||||
flush_work(&adev->dm.secure_display_ctxs[i].notify_ta_work);
|
||||
flush_work(&adev->dm.secure_display_ctxs[i].forward_roi_work);
|
||||
if (adev->dm.secure_display_ctx.crtc_ctx[i].crtc) {
|
||||
flush_work(&adev->dm.secure_display_ctx.crtc_ctx[i].notify_ta_work);
|
||||
flush_work(&adev->dm.secure_display_ctx.crtc_ctx[i].forward_roi_work);
|
||||
}
|
||||
}
|
||||
kfree(adev->dm.secure_display_ctxs);
|
||||
adev->dm.secure_display_ctxs = NULL;
|
||||
kfree(adev->dm.secure_display_ctx.crtc_ctx);
|
||||
adev->dm.secure_display_ctx.crtc_ctx = NULL;
|
||||
}
|
||||
#endif
|
||||
if (adev->dm.hdcp_workqueue) {
|
||||
@@ -2341,7 +2349,8 @@ static int load_dmcu_fw(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = amdgpu_ucode_request(adev, &adev->dm.fw_dmcu, "%s", fw_name_dmcu);
|
||||
r = amdgpu_ucode_request(adev, &adev->dm.fw_dmcu, AMDGPU_UCODE_REQUIRED,
|
||||
"%s", fw_name_dmcu);
|
||||
if (r == -ENODEV) {
|
||||
/* DMCU firmware is not necessary, so don't raise a fuss if it's missing */
|
||||
DRM_DEBUG_KMS("dm: DMCU firmware not found\n");
|
||||
@@ -2749,6 +2758,48 @@ out_fail:
|
||||
mutex_unlock(&mgr->lock);
|
||||
}
|
||||
|
||||
void hdmi_cec_unset_edid(struct amdgpu_dm_connector *aconnector)
|
||||
{
|
||||
struct cec_notifier *n = aconnector->notifier;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
cec_notifier_phys_addr_invalidate(n);
|
||||
}
|
||||
|
||||
void hdmi_cec_set_edid(struct amdgpu_dm_connector *aconnector)
|
||||
{
|
||||
struct drm_connector *connector = &aconnector->base;
|
||||
struct cec_notifier *n = aconnector->notifier;
|
||||
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
cec_notifier_set_phys_addr(n,
|
||||
connector->display_info.source_physical_address);
|
||||
}
|
||||
|
||||
static void s3_handle_hdmi_cec(struct drm_device *ddev, bool suspend)
|
||||
{
|
||||
struct amdgpu_dm_connector *aconnector;
|
||||
struct drm_connector *connector;
|
||||
struct drm_connector_list_iter conn_iter;
|
||||
|
||||
drm_connector_list_iter_begin(ddev, &conn_iter);
|
||||
drm_for_each_connector_iter(connector, &conn_iter) {
|
||||
if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)
|
||||
continue;
|
||||
|
||||
aconnector = to_amdgpu_dm_connector(connector);
|
||||
if (suspend)
|
||||
hdmi_cec_unset_edid(aconnector);
|
||||
else
|
||||
hdmi_cec_set_edid(aconnector);
|
||||
}
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
}
|
||||
|
||||
static void s3_handle_mst(struct drm_device *dev, bool suspend)
|
||||
{
|
||||
struct amdgpu_dm_connector *aconnector;
|
||||
@@ -3020,6 +3071,8 @@ static int dm_suspend(struct amdgpu_ip_block *ip_block)
|
||||
if (IS_ERR(adev->dm.cached_state))
|
||||
return PTR_ERR(adev->dm.cached_state);
|
||||
|
||||
s3_handle_hdmi_cec(adev_to_drm(adev), true);
|
||||
|
||||
s3_handle_mst(adev_to_drm(adev), true);
|
||||
|
||||
amdgpu_dm_irq_suspend(adev);
|
||||
@@ -3292,6 +3345,8 @@ static int dm_resume(struct amdgpu_ip_block *ip_block)
|
||||
*/
|
||||
amdgpu_dm_irq_resume_early(adev);
|
||||
|
||||
s3_handle_hdmi_cec(ddev, false);
|
||||
|
||||
/* On resume we need to rewrite the MSTM control bits to enable MST*/
|
||||
s3_handle_mst(ddev, false);
|
||||
|
||||
@@ -3606,6 +3661,7 @@ void amdgpu_dm_update_connector_after_detect(
|
||||
dc_sink_retain(aconnector->dc_sink);
|
||||
if (sink->dc_edid.length == 0) {
|
||||
aconnector->drm_edid = NULL;
|
||||
hdmi_cec_unset_edid(aconnector);
|
||||
if (aconnector->dc_link->aux_mode) {
|
||||
drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);
|
||||
}
|
||||
@@ -3615,6 +3671,7 @@ void amdgpu_dm_update_connector_after_detect(
|
||||
aconnector->drm_edid = drm_edid_alloc(edid, sink->dc_edid.length);
|
||||
drm_edid_connector_update(connector, aconnector->drm_edid);
|
||||
|
||||
hdmi_cec_set_edid(aconnector);
|
||||
if (aconnector->dc_link->aux_mode)
|
||||
drm_dp_cec_attach(&aconnector->dm_dp_aux.aux,
|
||||
connector->display_info.source_physical_address);
|
||||
@@ -3631,6 +3688,7 @@ void amdgpu_dm_update_connector_after_detect(
|
||||
amdgpu_dm_update_freesync_caps(connector, aconnector->drm_edid);
|
||||
update_connector_ext_caps(aconnector);
|
||||
} else {
|
||||
hdmi_cec_unset_edid(aconnector);
|
||||
drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);
|
||||
amdgpu_dm_update_freesync_caps(connector, NULL);
|
||||
aconnector->num_modes = 0;
|
||||
@@ -5314,7 +5372,8 @@ static int dm_init_microcode(struct amdgpu_device *adev)
|
||||
/* ASIC doesn't support DMUB. */
|
||||
return 0;
|
||||
}
|
||||
r = amdgpu_ucode_request(adev, &adev->dm.dmub_fw, "%s", fw_name_dmub);
|
||||
r = amdgpu_ucode_request(adev, &adev->dm.dmub_fw, AMDGPU_UCODE_REQUIRED,
|
||||
"%s", fw_name_dmub);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -5530,8 +5589,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
|
||||
const u64 tiling_flags,
|
||||
struct dc_plane_info *plane_info,
|
||||
struct dc_plane_address *address,
|
||||
bool tmz_surface,
|
||||
bool force_disable_dcc)
|
||||
bool tmz_surface)
|
||||
{
|
||||
const struct drm_framebuffer *fb = plane_state->fb;
|
||||
const struct amdgpu_framebuffer *afb =
|
||||
@@ -5630,7 +5688,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
|
||||
&plane_info->tiling_info,
|
||||
&plane_info->plane_size,
|
||||
&plane_info->dcc, address,
|
||||
tmz_surface, force_disable_dcc);
|
||||
tmz_surface);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -5651,7 +5709,6 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev,
|
||||
struct dc_scaling_info scaling_info;
|
||||
struct dc_plane_info plane_info;
|
||||
int ret;
|
||||
bool force_disable_dcc = false;
|
||||
|
||||
ret = amdgpu_dm_plane_fill_dc_scaling_info(adev, plane_state, &scaling_info);
|
||||
if (ret)
|
||||
@@ -5662,13 +5719,11 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev,
|
||||
dc_plane_state->clip_rect = scaling_info.clip_rect;
|
||||
dc_plane_state->scaling_quality = scaling_info.scaling_quality;
|
||||
|
||||
force_disable_dcc = adev->asic_type == CHIP_RAVEN && adev->in_suspend;
|
||||
ret = fill_dc_plane_info_and_addr(adev, plane_state,
|
||||
afb->tiling_flags,
|
||||
&plane_info,
|
||||
&dc_plane_state->address,
|
||||
afb->tmz_surface,
|
||||
force_disable_dcc);
|
||||
afb->tmz_surface);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -7050,6 +7105,7 @@ static void amdgpu_dm_connector_unregister(struct drm_connector *connector)
|
||||
if (amdgpu_dm_should_create_sysfs(amdgpu_dm_connector))
|
||||
sysfs_remove_group(&connector->kdev->kobj, &amdgpu_group);
|
||||
|
||||
cec_notifier_conn_unregister(amdgpu_dm_connector->notifier);
|
||||
drm_dp_aux_unregister(&amdgpu_dm_connector->dm_dp_aux.aux);
|
||||
}
|
||||
|
||||
@@ -8292,6 +8348,27 @@ create_i2c(struct ddc_service *ddc_service,
|
||||
return i2c;
|
||||
}
|
||||
|
||||
int amdgpu_dm_initialize_hdmi_connector(struct amdgpu_dm_connector *aconnector)
|
||||
{
|
||||
struct cec_connector_info conn_info;
|
||||
struct drm_device *ddev = aconnector->base.dev;
|
||||
struct device *hdmi_dev = ddev->dev;
|
||||
|
||||
if (amdgpu_dc_debug_mask & DC_DISABLE_HDMI_CEC) {
|
||||
drm_info(ddev, "HDMI-CEC feature masked\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cec_fill_conn_info_from_drm(&conn_info, &aconnector->base);
|
||||
aconnector->notifier =
|
||||
cec_notifier_conn_register(hdmi_dev, NULL, &conn_info);
|
||||
if (!aconnector->notifier) {
|
||||
drm_err(ddev, "Failed to create cec notifier\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: this function assumes that dc_link_detect() was called for the
|
||||
@@ -8355,6 +8432,10 @@ static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
|
||||
drm_connector_attach_encoder(
|
||||
&aconnector->base, &aencoder->base);
|
||||
|
||||
if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
|
||||
connector_type == DRM_MODE_CONNECTOR_HDMIB)
|
||||
amdgpu_dm_initialize_hdmi_connector(aconnector);
|
||||
|
||||
if (connector_type == DRM_MODE_CONNECTOR_DisplayPort
|
||||
|| connector_type == DRM_MODE_CONNECTOR_eDP)
|
||||
amdgpu_dm_initialize_dp_connector(dm, aconnector, link->link_index);
|
||||
@@ -8414,16 +8495,6 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
|
||||
struct amdgpu_crtc *acrtc,
|
||||
struct dm_crtc_state *acrtc_state)
|
||||
{
|
||||
/*
|
||||
* We have no guarantee that the frontend index maps to the same
|
||||
* backend index - some even map to more than one.
|
||||
*
|
||||
* TODO: Use a different interrupt or check DC itself for the mapping.
|
||||
*/
|
||||
int irq_type =
|
||||
amdgpu_display_crtc_idx_to_irq_type(
|
||||
adev,
|
||||
acrtc->crtc_id);
|
||||
struct drm_vblank_crtc_config config = {0};
|
||||
struct dc_crtc_timing *timing;
|
||||
int offdelay;
|
||||
@@ -8449,28 +8520,7 @@ static void manage_dm_interrupts(struct amdgpu_device *adev,
|
||||
|
||||
drm_crtc_vblank_on_config(&acrtc->base,
|
||||
&config);
|
||||
|
||||
amdgpu_irq_get(
|
||||
adev,
|
||||
&adev->pageflip_irq,
|
||||
irq_type);
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
amdgpu_irq_get(
|
||||
adev,
|
||||
&adev->vline0_irq,
|
||||
irq_type);
|
||||
#endif
|
||||
} else {
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
amdgpu_irq_put(
|
||||
adev,
|
||||
&adev->vline0_irq,
|
||||
irq_type);
|
||||
#endif
|
||||
amdgpu_irq_put(
|
||||
adev,
|
||||
&adev->pageflip_irq,
|
||||
irq_type);
|
||||
drm_crtc_vblank_off(&acrtc->base);
|
||||
}
|
||||
}
|
||||
@@ -8941,6 +8991,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
|
||||
struct replay_settings *pr = &acrtc_state->stream->link->replay_settings;
|
||||
struct amdgpu_dm_connector *aconn =
|
||||
(struct amdgpu_dm_connector *)acrtc_state->stream->dm_stream_context;
|
||||
bool vrr_active = amdgpu_dm_crtc_vrr_active(acrtc_state);
|
||||
|
||||
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
|
||||
if (pr->config.replay_supported && !pr->replay_feature_enabled)
|
||||
@@ -8967,14 +9018,15 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
|
||||
* adequate number of fast atomic commits to notify KMD
|
||||
* of update events. See `vblank_control_worker()`.
|
||||
*/
|
||||
if (acrtc_attach->dm_irq_params.allow_sr_entry &&
|
||||
if (!vrr_active &&
|
||||
acrtc_attach->dm_irq_params.allow_sr_entry &&
|
||||
#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
|
||||
!amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&
|
||||
#endif
|
||||
(current_ts - psr->psr_dirty_rects_change_timestamp_ns) > 500000000) {
|
||||
if (pr->replay_feature_enabled && !pr->replay_allow_active)
|
||||
amdgpu_dm_replay_enable(acrtc_state->stream, true);
|
||||
if (psr->psr_version >= DC_PSR_VERSION_SU_1 &&
|
||||
if (psr->psr_version == DC_PSR_VERSION_SU_1 &&
|
||||
!psr->psr_allow_active && !aconn->disallow_edp_enter_psr)
|
||||
amdgpu_dm_psr_enable(acrtc_state->stream);
|
||||
}
|
||||
@@ -9111,7 +9163,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
|
||||
afb->tiling_flags,
|
||||
&bundle->plane_infos[planes_count],
|
||||
&bundle->flip_addrs[planes_count].address,
|
||||
afb->tmz_surface, false);
|
||||
afb->tmz_surface);
|
||||
|
||||
drm_dbg_state(state->dev, "plane: id=%d dcc_en=%d\n",
|
||||
new_plane_state->plane->index,
|
||||
@@ -9145,7 +9197,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
|
||||
acrtc_state->stream->link->psr_settings.psr_dirty_rects_change_timestamp_ns =
|
||||
timestamp_ns;
|
||||
if (acrtc_state->stream->link->psr_settings.psr_allow_active)
|
||||
amdgpu_dm_psr_disable(acrtc_state->stream);
|
||||
amdgpu_dm_psr_disable(acrtc_state->stream, true);
|
||||
mutex_unlock(&dm->dc_lock);
|
||||
}
|
||||
}
|
||||
@@ -9311,11 +9363,11 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
|
||||
bundle->stream_update.abm_level = &acrtc_state->abm_level;
|
||||
|
||||
mutex_lock(&dm->dc_lock);
|
||||
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
|
||||
if ((acrtc_state->update_type > UPDATE_TYPE_FAST) || vrr_active) {
|
||||
if (acrtc_state->stream->link->replay_settings.replay_allow_active)
|
||||
amdgpu_dm_replay_disable(acrtc_state->stream);
|
||||
if (acrtc_state->stream->link->psr_settings.psr_allow_active)
|
||||
amdgpu_dm_psr_disable(acrtc_state->stream);
|
||||
amdgpu_dm_psr_disable(acrtc_state->stream, true);
|
||||
}
|
||||
mutex_unlock(&dm->dc_lock);
|
||||
|
||||
@@ -10074,14 +10126,19 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
|
||||
if (amdgpu_dm_is_valid_crc_source(cur_crc_src)) {
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
if (amdgpu_dm_crc_window_is_activated(crtc)) {
|
||||
uint8_t cnt;
|
||||
spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags);
|
||||
acrtc->dm_irq_params.window_param.update_win = true;
|
||||
for (cnt = 0; cnt < MAX_CRC_WINDOW_NUM; cnt++) {
|
||||
if (acrtc->dm_irq_params.window_param[cnt].enable) {
|
||||
acrtc->dm_irq_params.window_param[cnt].update_win = true;
|
||||
|
||||
/**
|
||||
* It takes 2 frames for HW to stably generate CRC when
|
||||
* resuming from suspend, so we set skip_frame_cnt 2.
|
||||
*/
|
||||
acrtc->dm_irq_params.window_param.skip_frame_cnt = 2;
|
||||
/**
|
||||
* It takes 2 frames for HW to stably generate CRC when
|
||||
* resuming from suspend, so we set skip_frame_cnt 2.
|
||||
*/
|
||||
acrtc->dm_irq_params.window_param[cnt].skip_frame_cnt = 2;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags);
|
||||
}
|
||||
#endif
|
||||
@@ -11169,8 +11226,8 @@ dm_get_plane_scale(struct drm_plane_state *plane_state,
|
||||
int plane_src_w, plane_src_h;
|
||||
|
||||
dm_get_oriented_plane_size(plane_state, &plane_src_w, &plane_src_h);
|
||||
*out_plane_scale_w = plane_state->crtc_w * 1000 / plane_src_w;
|
||||
*out_plane_scale_h = plane_state->crtc_h * 1000 / plane_src_h;
|
||||
*out_plane_scale_w = plane_src_w ? plane_state->crtc_w * 1000 / plane_src_w : 0;
|
||||
*out_plane_scale_h = plane_src_h ? plane_state->crtc_h * 1000 / plane_src_h : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -11424,6 +11481,30 @@ static int dm_crtc_get_cursor_mode(struct amdgpu_device *adev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool amdgpu_dm_crtc_mem_type_changed(struct drm_device *dev,
|
||||
struct drm_atomic_state *state,
|
||||
struct drm_crtc_state *crtc_state)
|
||||
{
|
||||
struct drm_plane *plane;
|
||||
struct drm_plane_state *new_plane_state, *old_plane_state;
|
||||
|
||||
drm_for_each_plane_mask(plane, dev, crtc_state->plane_mask) {
|
||||
new_plane_state = drm_atomic_get_plane_state(state, plane);
|
||||
old_plane_state = drm_atomic_get_plane_state(state, plane);
|
||||
|
||||
if (IS_ERR(new_plane_state) || IS_ERR(old_plane_state)) {
|
||||
DRM_ERROR("Failed to get plane state for plane %s\n", plane->name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (old_plane_state->fb && new_plane_state->fb &&
|
||||
get_mem_type(old_plane_state->fb) != get_mem_type(new_plane_state->fb))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_dm_atomic_check() - Atomic check implementation for AMDgpu DM.
|
||||
*
|
||||
@@ -11621,10 +11702,6 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
|
||||
|
||||
/* Remove exiting planes if they are modified */
|
||||
for_each_oldnew_plane_in_descending_zpos(state, plane, old_plane_state, new_plane_state) {
|
||||
if (old_plane_state->fb && new_plane_state->fb &&
|
||||
get_mem_type(old_plane_state->fb) !=
|
||||
get_mem_type(new_plane_state->fb))
|
||||
lock_and_validation_needed = true;
|
||||
|
||||
ret = dm_update_plane_state(dc, state, plane,
|
||||
old_plane_state,
|
||||
@@ -11919,9 +11996,11 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
|
||||
|
||||
/*
|
||||
* Only allow async flips for fast updates that don't change
|
||||
* the FB pitch, the DCC state, rotation, etc.
|
||||
* the FB pitch, the DCC state, rotation, mem_type, etc.
|
||||
*/
|
||||
if (new_crtc_state->async_flip && lock_and_validation_needed) {
|
||||
if (new_crtc_state->async_flip &&
|
||||
(lock_and_validation_needed ||
|
||||
amdgpu_dm_crtc_mem_type_changed(dev, state, new_crtc_state))) {
|
||||
drm_dbg_atomic(crtc->dev,
|
||||
"[CRTC:%d:%s] async flips are only supported for fast updates\n",
|
||||
crtc->base.id, crtc->name);
|
||||
@@ -12253,10 +12332,14 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
|
||||
|
||||
if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
|
||||
sink->sink_signal == SIGNAL_TYPE_EDP)) {
|
||||
amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
|
||||
amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
|
||||
if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq > 10)
|
||||
freesync_capable = true;
|
||||
if (amdgpu_dm_connector->dc_link &&
|
||||
amdgpu_dm_connector->dc_link->dpcd_caps.allow_invalid_MSA_timing_param) {
|
||||
amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
|
||||
amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
|
||||
if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq > 10)
|
||||
freesync_capable = true;
|
||||
}
|
||||
|
||||
parse_amd_vsdb(amdgpu_dm_connector, edid, &vsdb_info);
|
||||
|
||||
if (vsdb_info.replay_mode) {
|
||||
|
||||
Reference in New Issue
Block a user