disp: msm: remove use of drm_display_mode vrefresh
Use of drm_display_mode vrefresh is being deprecated in upstream DRM framework. Downstream driver need to use drm_mode_vrefresh API from now on. This change removes dependency on drm_display_mode vrefresh and replaces it with drm_mode_vrefresh API in SDE, DSI and DP driver. In addition, it also modifies drm_display_mode clock to align with upstream approach where an uncompressed mode clock is required to match drm_mode_vrefresh API. Change-Id: Ie972a2e140adfd81c4e68df8e7bc69feaaca22e1 Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org> Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
@@ -994,7 +994,7 @@ static ssize_t dp_debug_read_edid_modes(struct file *file,
|
|||||||
list_for_each_entry(mode, &connector->modes, head) {
|
list_for_each_entry(mode, &connector->modes, head) {
|
||||||
ret = snprintf(buf + len, max_size,
|
ret = snprintf(buf + len, max_size,
|
||||||
"%s %d %d %d %d %d 0x%x\n",
|
"%s %d %d %d %d %d 0x%x\n",
|
||||||
mode->name, mode->vrefresh, mode->picture_aspect_ratio,
|
mode->name, drm_mode_vrefresh(mode), mode->picture_aspect_ratio,
|
||||||
mode->htotal, mode->vtotal, mode->clock, mode->flags);
|
mode->htotal, mode->vtotal, mode->clock, mode->flags);
|
||||||
if (dp_debug_check_buffer_overflow(ret, &max_size, &len))
|
if (dp_debug_check_buffer_overflow(ret, &max_size, &len))
|
||||||
break;
|
break;
|
||||||
@@ -1069,7 +1069,7 @@ static ssize_t dp_debug_read_edid_modes_mst(struct file *file,
|
|||||||
list_for_each_entry(mode, &connector->modes, head) {
|
list_for_each_entry(mode, &connector->modes, head) {
|
||||||
ret = snprintf(buf + len, max_size,
|
ret = snprintf(buf + len, max_size,
|
||||||
"%s %d %d %d %d %d 0x%x\n",
|
"%s %d %d %d %d %d 0x%x\n",
|
||||||
mode->name, mode->vrefresh,
|
mode->name, drm_mode_vrefresh(mode),
|
||||||
mode->picture_aspect_ratio, mode->htotal,
|
mode->picture_aspect_ratio, mode->htotal,
|
||||||
mode->vtotal, mode->clock, mode->flags);
|
mode->vtotal, mode->clock, mode->flags);
|
||||||
if (dp_debug_check_buffer_overflow(ret, &max_size, &len))
|
if (dp_debug_check_buffer_overflow(ret, &max_size, &len))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
@@ -2824,7 +2824,7 @@ static void dp_display_validate_mst_connectors(struct dp_debug *debug,
|
|||||||
|
|
||||||
_hdis = mode->hdisplay;
|
_hdis = mode->hdisplay;
|
||||||
_vdis = mode->vdisplay;
|
_vdis = mode->vdisplay;
|
||||||
_vref = mode->vrefresh;
|
_vref = drm_mode_vrefresh(mode);
|
||||||
_ar = mode->picture_aspect_ratio;
|
_ar = mode->picture_aspect_ratio;
|
||||||
|
|
||||||
if (hdis == _hdis && vdis == _vdis && vref == _vref &&
|
if (hdis == _hdis && vdis == _vdis && vref == _vref &&
|
||||||
@@ -2912,7 +2912,7 @@ static enum drm_mode_status dp_display_validate_mode(
|
|||||||
|
|
||||||
if (debug->debug_en && (mode->hdisplay != debug->hdisplay ||
|
if (debug->debug_en && (mode->hdisplay != debug->hdisplay ||
|
||||||
mode->vdisplay != debug->vdisplay ||
|
mode->vdisplay != debug->vdisplay ||
|
||||||
mode->vrefresh != debug->vrefresh ||
|
drm_mode_vrefresh(mode) != debug->vrefresh ||
|
||||||
mode->picture_aspect_ratio != debug->aspect_ratio))
|
mode->picture_aspect_ratio != debug->aspect_ratio))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
@@ -40,8 +40,8 @@ void convert_to_drm_mode(const struct dp_display_mode *dp_mode,
|
|||||||
dp_mode->timing.v_sync_width;
|
dp_mode->timing.v_sync_width;
|
||||||
drm_mode->vtotal = drm_mode->vsync_end + dp_mode->timing.v_back_porch;
|
drm_mode->vtotal = drm_mode->vsync_end + dp_mode->timing.v_back_porch;
|
||||||
|
|
||||||
drm_mode->vrefresh = dp_mode->timing.refresh_rate;
|
drm_mode->clock = drm_mode->htotal * drm_mode->vtotal * dp_mode->timing.refresh_rate;
|
||||||
drm_mode->clock = dp_mode->timing.pixel_clk_khz;
|
drm_mode->clock /= 1000;
|
||||||
|
|
||||||
if (dp_mode->timing.h_active_low)
|
if (dp_mode->timing.h_active_low)
|
||||||
flags |= DRM_MODE_FLAG_NHSYNC;
|
flags |= DRM_MODE_FLAG_NHSYNC;
|
||||||
@@ -423,7 +423,7 @@ int dp_connector_get_mode_info(struct drm_connector *connector,
|
|||||||
topology->num_enc = no_enc;
|
topology->num_enc = no_enc;
|
||||||
topology->num_intf = single_intf;
|
topology->num_intf = single_intf;
|
||||||
|
|
||||||
mode_info->frame_rate = drm_mode->vrefresh;
|
mode_info->frame_rate = drm_mode_vrefresh(drm_mode);
|
||||||
mode_info->vtotal = drm_mode->vtotal;
|
mode_info->vtotal = drm_mode->vtotal;
|
||||||
|
|
||||||
mode_info->wide_bus_en = dp_panel->widebus_en;
|
mode_info->wide_bus_en = dp_panel->widebus_en;
|
||||||
@@ -671,7 +671,6 @@ enum drm_mode_status dp_connector_mode_valid(struct drm_connector *connector,
|
|||||||
}
|
}
|
||||||
|
|
||||||
dp_disp = display;
|
dp_disp = display;
|
||||||
mode->vrefresh = drm_mode_vrefresh(mode);
|
|
||||||
|
|
||||||
rc = dp_disp->get_available_dp_resources(dp_disp, avail_res,
|
rc = dp_disp->get_available_dp_resources(dp_disp, avail_res,
|
||||||
&avail_dp_res);
|
&avail_dp_res);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1074,7 +1074,7 @@ static void dp_mst_bridge_pre_enable(struct drm_bridge *drm_bridge)
|
|||||||
|
|
||||||
DP_MST_INFO("conn:%d mode:%s fps:%d dsc:%d vcpi:%d slots:%d to %d\n",
|
DP_MST_INFO("conn:%d mode:%s fps:%d dsc:%d vcpi:%d slots:%d to %d\n",
|
||||||
DP_MST_CONN_ID(bridge), bridge->drm_mode.name,
|
DP_MST_CONN_ID(bridge), bridge->drm_mode.name,
|
||||||
bridge->drm_mode.vrefresh,
|
drm_mode_vrefresh(&bridge->drm_mode),
|
||||||
bridge->dp_mode.timing.comp_info.comp_ratio,
|
bridge->dp_mode.timing.comp_info.comp_ratio,
|
||||||
bridge->vcpi, bridge->start_slot,
|
bridge->vcpi, bridge->start_slot,
|
||||||
bridge->start_slot + bridge->num_slots);
|
bridge->start_slot + bridge->num_slots);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dp_panel.h"
|
#include "dp_panel.h"
|
||||||
@@ -2944,8 +2944,7 @@ static void dp_panel_convert_to_dp_mode(struct dp_panel *dp_panel,
|
|||||||
dp_mode->timing.v_front_porch = drm_mode->vsync_start -
|
dp_mode->timing.v_front_porch = drm_mode->vsync_start -
|
||||||
drm_mode->vdisplay;
|
drm_mode->vdisplay;
|
||||||
|
|
||||||
dp_mode->timing.refresh_rate = drm_mode->vrefresh;
|
dp_mode->timing.refresh_rate = drm_mode_vrefresh(drm_mode);
|
||||||
|
|
||||||
dp_mode->timing.pixel_clk_khz = drm_mode->clock;
|
dp_mode->timing.pixel_clk_khz = drm_mode->clock;
|
||||||
|
|
||||||
dp_mode->timing.v_active_low =
|
dp_mode->timing.v_active_low =
|
||||||
|
@@ -6149,7 +6149,7 @@ static int dsi_display_ext_get_mode_info(struct drm_connector *connector,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
memset(mode_info, 0, sizeof(*mode_info));
|
memset(mode_info, 0, sizeof(*mode_info));
|
||||||
mode_info->frame_rate = drm_mode->vrefresh;
|
mode_info->frame_rate = drm_mode_vrefresh(drm_mode);
|
||||||
mode_info->vtotal = drm_mode->vtotal;
|
mode_info->vtotal = drm_mode->vtotal;
|
||||||
|
|
||||||
topology = &mode_info->topology;
|
topology = &mode_info->topology;
|
||||||
@@ -7040,8 +7040,7 @@ int dsi_display_find_mode(struct dsi_display *display,
|
|||||||
|
|
||||||
if (cmp->timing.v_active == m->timing.v_active &&
|
if (cmp->timing.v_active == m->timing.v_active &&
|
||||||
cmp->timing.h_active == m->timing.h_active &&
|
cmp->timing.h_active == m->timing.h_active &&
|
||||||
cmp->timing.refresh_rate == m->timing.refresh_rate &&
|
cmp->timing.refresh_rate == m->timing.refresh_rate) {
|
||||||
cmp->pixel_clk_khz == m->pixel_clk_khz) {
|
|
||||||
*out_mode = m;
|
*out_mode = m;
|
||||||
rc = 0;
|
rc = 0;
|
||||||
break;
|
break;
|
||||||
|
@@ -51,9 +51,7 @@ static void convert_to_dsi_mode(const struct drm_display_mode *drm_mode,
|
|||||||
dsi_mode->timing.v_front_porch = drm_mode->vsync_start -
|
dsi_mode->timing.v_front_porch = drm_mode->vsync_start -
|
||||||
drm_mode->vdisplay;
|
drm_mode->vdisplay;
|
||||||
|
|
||||||
dsi_mode->timing.refresh_rate = drm_mode->vrefresh;
|
dsi_mode->timing.refresh_rate = drm_mode_vrefresh(drm_mode);
|
||||||
|
|
||||||
dsi_mode->pixel_clk_khz = drm_mode->clock;
|
|
||||||
|
|
||||||
dsi_mode->timing.h_sync_polarity =
|
dsi_mode->timing.h_sync_polarity =
|
||||||
!!(drm_mode->flags & DRM_MODE_FLAG_PHSYNC);
|
!!(drm_mode->flags & DRM_MODE_FLAG_PHSYNC);
|
||||||
@@ -123,8 +121,8 @@ void dsi_convert_to_drm_mode(const struct dsi_display_mode *dsi_mode,
|
|||||||
dsi_mode->timing.v_sync_width;
|
dsi_mode->timing.v_sync_width;
|
||||||
drm_mode->vtotal = drm_mode->vsync_end + dsi_mode->timing.v_back_porch;
|
drm_mode->vtotal = drm_mode->vsync_end + dsi_mode->timing.v_back_porch;
|
||||||
|
|
||||||
drm_mode->vrefresh = dsi_mode->timing.refresh_rate;
|
drm_mode->clock = drm_mode->htotal * drm_mode->vtotal * dsi_mode->timing.refresh_rate;
|
||||||
drm_mode->clock = dsi_mode->pixel_clk_khz;
|
drm_mode->clock /= 1000;
|
||||||
|
|
||||||
if (dsi_mode->timing.h_sync_polarity)
|
if (dsi_mode->timing.h_sync_polarity)
|
||||||
drm_mode->flags |= DRM_MODE_FLAG_PHSYNC;
|
drm_mode->flags |= DRM_MODE_FLAG_PHSYNC;
|
||||||
@@ -132,9 +130,9 @@ void dsi_convert_to_drm_mode(const struct dsi_display_mode *dsi_mode,
|
|||||||
drm_mode->flags |= DRM_MODE_FLAG_PVSYNC;
|
drm_mode->flags |= DRM_MODE_FLAG_PVSYNC;
|
||||||
|
|
||||||
/* set mode name */
|
/* set mode name */
|
||||||
snprintf(drm_mode->name, DRM_DISPLAY_MODE_LEN, "%dx%dx%dx%d%s",
|
snprintf(drm_mode->name, DRM_DISPLAY_MODE_LEN, "%dx%dx%dx%u%s",
|
||||||
drm_mode->hdisplay, drm_mode->vdisplay,
|
drm_mode->hdisplay, drm_mode->vdisplay,
|
||||||
drm_mode->vrefresh, drm_mode->clock,
|
drm_mode_vrefresh(drm_mode), dsi_mode->pixel_clk_khz,
|
||||||
panel_caps);
|
panel_caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,6 +419,7 @@ static bool dsi_bridge_mode_fixup(struct drm_bridge *bridge,
|
|||||||
}
|
}
|
||||||
|
|
||||||
convert_to_dsi_mode(mode, &dsi_mode);
|
convert_to_dsi_mode(mode, &dsi_mode);
|
||||||
|
msm_parse_mode_priv_info(&conn_state->msm_mode, &dsi_mode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* retrieve dsi mode from dsi driver's cache since not safe to take
|
* retrieve dsi mode from dsi driver's cache since not safe to take
|
||||||
@@ -536,7 +535,7 @@ u64 dsi_drm_find_bit_clk_rate(void *display,
|
|||||||
if ((dsi_mode->timing.v_active == drm_mode->vdisplay) &&
|
if ((dsi_mode->timing.v_active == drm_mode->vdisplay) &&
|
||||||
(dsi_mode->timing.h_active == drm_mode->hdisplay) &&
|
(dsi_mode->timing.h_active == drm_mode->hdisplay) &&
|
||||||
(dsi_mode->pixel_clk_khz == drm_mode->clock) &&
|
(dsi_mode->pixel_clk_khz == drm_mode->clock) &&
|
||||||
(dsi_mode->timing.refresh_rate == drm_mode->vrefresh)) {
|
(dsi_mode->timing.refresh_rate == drm_mode_vrefresh(drm_mode))) {
|
||||||
bit_clk_rate = dsi_mode->timing.clk_rate_hz;
|
bit_clk_rate = dsi_mode->timing.clk_rate_hz;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -571,7 +570,7 @@ int dsi_conn_get_mode_info(struct drm_connector *connector,
|
|||||||
mode_info->jitter_numer = dsi_mode->priv_info->panel_jitter_numer;
|
mode_info->jitter_numer = dsi_mode->priv_info->panel_jitter_numer;
|
||||||
mode_info->jitter_denom = dsi_mode->priv_info->panel_jitter_denom;
|
mode_info->jitter_denom = dsi_mode->priv_info->panel_jitter_denom;
|
||||||
mode_info->dfps_maxfps = dsi_drm_get_dfps_maxfps(display);
|
mode_info->dfps_maxfps = dsi_drm_get_dfps_maxfps(display);
|
||||||
mode_info->clk_rate = dsi_drm_find_bit_clk_rate(display, drm_mode);
|
mode_info->clk_rate = dsi_mode->timing.clk_rate_hz;
|
||||||
mode_info->panel_mode_caps = dsi_mode->panel_mode_caps;
|
mode_info->panel_mode_caps = dsi_mode->panel_mode_caps;
|
||||||
mode_info->mdp_transfer_time_us =
|
mode_info->mdp_transfer_time_us =
|
||||||
dsi_mode->priv_info->mdp_transfer_time_us;
|
dsi_mode->priv_info->mdp_transfer_time_us;
|
||||||
@@ -1004,6 +1003,7 @@ enum drm_mode_status dsi_conn_mode_valid(struct drm_connector *connector,
|
|||||||
{
|
{
|
||||||
struct dsi_display_mode dsi_mode;
|
struct dsi_display_mode dsi_mode;
|
||||||
struct dsi_display_mode *full_dsi_mode = NULL;
|
struct dsi_display_mode *full_dsi_mode = NULL;
|
||||||
|
struct sde_connector_state *conn_state;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (!connector || !mode) {
|
if (!connector || !mode) {
|
||||||
@@ -1012,6 +1012,11 @@ enum drm_mode_status dsi_conn_mode_valid(struct drm_connector *connector,
|
|||||||
}
|
}
|
||||||
|
|
||||||
convert_to_dsi_mode(mode, &dsi_mode);
|
convert_to_dsi_mode(mode, &dsi_mode);
|
||||||
|
|
||||||
|
conn_state = to_sde_connector_state(connector->state);
|
||||||
|
if (conn_state)
|
||||||
|
msm_parse_mode_priv_info(&conn_state->msm_mode, &dsi_mode);
|
||||||
|
|
||||||
rc = dsi_display_find_mode(display, &dsi_mode, &full_dsi_mode);
|
rc = dsi_display_find_mode(display, &dsi_mode, &full_dsi_mode);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
DSI_ERR("could not find mode %s\n", mode->name);
|
DSI_ERR("could not find mode %s\n", mode->name);
|
||||||
|
@@ -1019,8 +1019,9 @@ static int sde_encoder_virt_atomic_check(
|
|||||||
|
|
||||||
SDE_EVT32(DRMID(drm_enc), adj_mode->flags,
|
SDE_EVT32(DRMID(drm_enc), adj_mode->flags,
|
||||||
sde_conn_state->msm_mode.private_flags,
|
sde_conn_state->msm_mode.private_flags,
|
||||||
old_top, adj_mode->vrefresh, adj_mode->hdisplay,
|
old_top, drm_mode_vrefresh(adj_mode), adj_mode->hdisplay,
|
||||||
adj_mode->vdisplay, adj_mode->htotal, adj_mode->vtotal);
|
adj_mode->vdisplay, adj_mode->htotal, adj_mode->vtotal);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
|
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
|
||||||
@@ -947,7 +947,7 @@ static int _get_tearcheck_threshold(struct sde_encoder_phys *phys_enc)
|
|||||||
|
|
||||||
if (mode && (qsync_mode == SDE_RM_QSYNC_CONTINUOUS_MODE)) {
|
if (mode && (qsync_mode == SDE_RM_QSYNC_CONTINUOUS_MODE)) {
|
||||||
u32 qsync_min_fps = 0;
|
u32 qsync_min_fps = 0;
|
||||||
u32 default_fps = mode->vrefresh;
|
u32 default_fps = drm_mode_vrefresh(mode);
|
||||||
u32 yres = mode->vtotal;
|
u32 yres = mode->vtotal;
|
||||||
u32 slow_time_ns;
|
u32 slow_time_ns;
|
||||||
u32 default_time_ns;
|
u32 default_time_ns;
|
||||||
@@ -1013,6 +1013,7 @@ static void sde_encoder_phys_cmd_tearcheck_config(
|
|||||||
struct drm_display_mode *mode;
|
struct drm_display_mode *mode;
|
||||||
bool tc_enable = true;
|
bool tc_enable = true;
|
||||||
u32 vsync_hz;
|
u32 vsync_hz;
|
||||||
|
int vrefresh;
|
||||||
struct msm_drm_private *priv;
|
struct msm_drm_private *priv;
|
||||||
struct sde_kms *sde_kms;
|
struct sde_kms *sde_kms;
|
||||||
|
|
||||||
@@ -1047,6 +1048,7 @@ static void sde_encoder_phys_cmd_tearcheck_config(
|
|||||||
}
|
}
|
||||||
priv = sde_kms->dev->dev_private;
|
priv = sde_kms->dev->dev_private;
|
||||||
|
|
||||||
|
vrefresh = drm_mode_vrefresh(mode);
|
||||||
/*
|
/*
|
||||||
* TE default: dsi byte clock calculated base on 70 fps;
|
* TE default: dsi byte clock calculated base on 70 fps;
|
||||||
* around 14 ms to complete a kickoff cycle if te disabled;
|
* around 14 ms to complete a kickoff cycle if te disabled;
|
||||||
@@ -1057,14 +1059,14 @@ static void sde_encoder_phys_cmd_tearcheck_config(
|
|||||||
* frequency divided by the no. of rows (lines) in the LCDpanel.
|
* frequency divided by the no. of rows (lines) in the LCDpanel.
|
||||||
*/
|
*/
|
||||||
vsync_hz = sde_power_clk_get_rate(&priv->phandle, "vsync_clk");
|
vsync_hz = sde_power_clk_get_rate(&priv->phandle, "vsync_clk");
|
||||||
if (!vsync_hz || !mode->vtotal || !mode->vrefresh) {
|
if (!vsync_hz || !mode->vtotal || vrefresh) {
|
||||||
SDE_DEBUG_CMDENC(cmd_enc,
|
SDE_DEBUG_CMDENC(cmd_enc,
|
||||||
"invalid params - vsync_hz %u vtot %u vrefresh %u\n",
|
"invalid params - vsync_hz %u vtot %u vrefresh %u\n",
|
||||||
vsync_hz, mode->vtotal, mode->vrefresh);
|
vsync_hz, mode->vtotal, vrefresh);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tc_cfg.vsync_count = vsync_hz / (mode->vtotal * mode->vrefresh);
|
tc_cfg.vsync_count = vsync_hz / (mode->vtotal * vrefresh);
|
||||||
|
|
||||||
/* enable external TE after kickoff to avoid premature autorefresh */
|
/* enable external TE after kickoff to avoid premature autorefresh */
|
||||||
tc_cfg.hw_vsync_mode = 0;
|
tc_cfg.hw_vsync_mode = 0;
|
||||||
@@ -1086,7 +1088,7 @@ static void sde_encoder_phys_cmd_tearcheck_config(
|
|||||||
"tc %d intf %d vsync_clk_speed_hz %u vtotal %u vrefresh %u\n",
|
"tc %d intf %d vsync_clk_speed_hz %u vtotal %u vrefresh %u\n",
|
||||||
phys_enc->hw_pp->idx - PINGPONG_0,
|
phys_enc->hw_pp->idx - PINGPONG_0,
|
||||||
phys_enc->hw_intf->idx - INTF_0,
|
phys_enc->hw_intf->idx - INTF_0,
|
||||||
vsync_hz, mode->vtotal, mode->vrefresh);
|
vsync_hz, mode->vtotal, vrefresh);
|
||||||
SDE_DEBUG_CMDENC(cmd_enc,
|
SDE_DEBUG_CMDENC(cmd_enc,
|
||||||
"tc %d intf %d enable %u start_pos %u rd_ptr_irq %u wr_ptr_irq %u\n",
|
"tc %d intf %d enable %u start_pos %u rd_ptr_irq %u wr_ptr_irq %u\n",
|
||||||
phys_enc->hw_pp->idx - PINGPONG_0,
|
phys_enc->hw_pp->idx - PINGPONG_0,
|
||||||
|
@@ -92,7 +92,7 @@ static void drm_mode_to_intf_timing_params(
|
|||||||
timing->underflow_clr = 0xff;
|
timing->underflow_clr = 0xff;
|
||||||
timing->hsync_skew = mode->hskew;
|
timing->hsync_skew = mode->hskew;
|
||||||
timing->v_front_porch_fixed = vid_enc->base.vfp_cached;
|
timing->v_front_porch_fixed = vid_enc->base.vfp_cached;
|
||||||
timing->vrefresh = mode->vrefresh;
|
timing->vrefresh = drm_mode_vrefresh(mode);
|
||||||
|
|
||||||
if (vid_enc->base.comp_type != MSM_DISPLAY_COMPRESSION_NONE) {
|
if (vid_enc->base.comp_type != MSM_DISPLAY_COMPRESSION_NONE) {
|
||||||
timing->compression_en = true;
|
timing->compression_en = true;
|
||||||
@@ -328,13 +328,11 @@ static void _sde_encoder_phys_vid_setup_avr(
|
|||||||
struct sde_encoder_phys *phys_enc, u32 qsync_min_fps)
|
struct sde_encoder_phys *phys_enc, u32 qsync_min_fps)
|
||||||
{
|
{
|
||||||
struct sde_encoder_phys_vid *vid_enc;
|
struct sde_encoder_phys_vid *vid_enc;
|
||||||
struct drm_display_mode mode;
|
|
||||||
|
|
||||||
vid_enc = to_sde_encoder_phys_vid(phys_enc);
|
vid_enc = to_sde_encoder_phys_vid(phys_enc);
|
||||||
mode = phys_enc->cached_mode;
|
|
||||||
if (vid_enc->base.hw_intf->ops.avr_setup) {
|
if (vid_enc->base.hw_intf->ops.avr_setup) {
|
||||||
struct intf_avr_params avr_params = {0};
|
struct intf_avr_params avr_params = {0};
|
||||||
u32 default_fps = mode.vrefresh;
|
u32 default_fps = drm_mode_vrefresh(&phys_enc->cached_mode);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!default_fps) {
|
if (!default_fps) {
|
||||||
@@ -473,7 +471,8 @@ static void sde_encoder_phys_vid_setup_timing_engine(
|
|||||||
exit:
|
exit:
|
||||||
if (phys_enc->parent_ops.get_qsync_fps)
|
if (phys_enc->parent_ops.get_qsync_fps)
|
||||||
phys_enc->parent_ops.get_qsync_fps(
|
phys_enc->parent_ops.get_qsync_fps(
|
||||||
phys_enc->parent, &qsync_min_fps, mode.vrefresh);
|
phys_enc->parent, &qsync_min_fps,
|
||||||
|
drm_mode_vrefresh(&phys_enc->cached_mode));
|
||||||
|
|
||||||
/* only panels which support qsync will have a non-zero min fps */
|
/* only panels which support qsync will have a non-zero min fps */
|
||||||
if (qsync_min_fps) {
|
if (qsync_min_fps) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
|
#define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
|
||||||
@@ -84,7 +84,7 @@ static void sde_encoder_phys_wb_set_ot_limit(
|
|||||||
ot_params.width = wb_enc->wb_roi.w;
|
ot_params.width = wb_enc->wb_roi.w;
|
||||||
ot_params.height = wb_enc->wb_roi.h;
|
ot_params.height = wb_enc->wb_roi.h;
|
||||||
ot_params.is_wfd = true;
|
ot_params.is_wfd = true;
|
||||||
ot_params.frame_rate = phys_enc->cached_mode.vrefresh;
|
ot_params.frame_rate = drm_mode_vrefresh(&phys_enc->cached_mode);
|
||||||
ot_params.vbif_idx = hw_wb->caps->vbif_idx;
|
ot_params.vbif_idx = hw_wb->caps->vbif_idx;
|
||||||
ot_params.clk_ctrl = hw_wb->caps->clk_ctrl;
|
ot_params.clk_ctrl = hw_wb->caps->clk_ctrl;
|
||||||
ot_params.rd = false;
|
ot_params.rd = false;
|
||||||
@@ -164,7 +164,7 @@ static void sde_encoder_phys_wb_set_qos(struct sde_encoder_phys *phys_enc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
perf = &phys_enc->sde_kms->catalog->perf;
|
perf = &phys_enc->sde_kms->catalog->perf;
|
||||||
frame_rate = phys_enc->cached_mode.vrefresh;
|
frame_rate = drm_mode_vrefresh(&phys_enc->cached_mode);
|
||||||
|
|
||||||
hw_wb = wb_enc->hw_wb;
|
hw_wb = wb_enc->hw_wb;
|
||||||
qos_count = perf->qos_refresh_count;
|
qos_count = perf->qos_refresh_count;
|
||||||
|
@@ -926,13 +926,13 @@ static void _sde_kms_drm_check_dpms(struct drm_atomic_state *old_state,
|
|||||||
if (!crtc)
|
if (!crtc)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
new_fps = crtc->state->mode.vrefresh;
|
new_fps = drm_mode_vrefresh(&crtc->state->mode);
|
||||||
new_mode = _sde_kms_get_blank(crtc->state, connector->state);
|
new_mode = _sde_kms_get_blank(crtc->state, connector->state);
|
||||||
if (old_conn_state->crtc) {
|
if (old_conn_state->crtc) {
|
||||||
old_crtc_state = drm_atomic_get_existing_crtc_state(
|
old_crtc_state = drm_atomic_get_existing_crtc_state(
|
||||||
old_state, old_conn_state->crtc);
|
old_state, old_conn_state->crtc);
|
||||||
|
|
||||||
old_fps = old_crtc_state->mode.vrefresh;
|
old_fps = drm_mode_vrefresh(&old_crtc_state->mode);
|
||||||
old_mode = _sde_kms_get_blank(old_crtc_state,
|
old_mode = _sde_kms_get_blank(old_crtc_state,
|
||||||
old_conn_state);
|
old_conn_state);
|
||||||
} else {
|
} else {
|
||||||
@@ -3291,7 +3291,7 @@ static int sde_kms_get_mixer_count(const struct msm_kms *kms,
|
|||||||
hdisplay_fp = drm_int2fixp(mode->hdisplay);
|
hdisplay_fp = drm_int2fixp(mode->hdisplay);
|
||||||
htotal_fp = drm_int2fixp(mode->htotal);
|
htotal_fp = drm_int2fixp(mode->htotal);
|
||||||
vtotal_fp = drm_int2fixp(mode->vtotal);
|
vtotal_fp = drm_int2fixp(mode->vtotal);
|
||||||
vrefresh_fp = drm_int2fixp(mode->vrefresh);
|
vrefresh_fp = drm_int2fixp(drm_mode_vrefresh(mode));
|
||||||
mdp_fudge_factor = drm_fixp_from_fraction(105, 100);
|
mdp_fudge_factor = drm_fixp_from_fraction(105, 100);
|
||||||
|
|
||||||
/* mode clock = [(h * v * fps * 1.05) / (num_lm)] */
|
/* mode clock = [(h * v * fps * 1.05) / (num_lm)] */
|
||||||
@@ -3319,7 +3319,7 @@ static int sde_kms_get_mixer_count(const struct msm_kms *kms,
|
|||||||
mode_clock_hz = lm_clk_fp;
|
mode_clock_hz = lm_clk_fp;
|
||||||
}
|
}
|
||||||
SDE_DEBUG("[%s] h=%d v=%d fps=%d lm=%d mode_clk=%llu max_clk=%llu\n",
|
SDE_DEBUG("[%s] h=%d v=%d fps=%d lm=%d mode_clk=%llu max_clk=%llu\n",
|
||||||
mode->name, mode->htotal, mode->vtotal, mode->vrefresh,
|
mode->name, mode->htotal, mode->vtotal, drm_mode_vrefresh(mode),
|
||||||
*num_lm, drm_fixp2int(mode_clock_hz),
|
*num_lm, drm_fixp2int(mode_clock_hz),
|
||||||
sde_kms->perf.max_core_clk_rate);
|
sde_kms->perf.max_core_clk_rate);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -3327,7 +3327,7 @@ static int sde_kms_get_mixer_count(const struct msm_kms *kms,
|
|||||||
error:
|
error:
|
||||||
SDE_ERROR("required mode clk exceeds max mdp clk\n");
|
SDE_ERROR("required mode clk exceeds max mdp clk\n");
|
||||||
SDE_ERROR("[%s] h=%d v=%d fps=%d lm=%d mode_clk=%llu max_clk=%llu\n",
|
SDE_ERROR("[%s] h=%d v=%d fps=%d lm=%d mode_clk=%llu max_clk=%llu\n",
|
||||||
mode->name, mode->htotal, mode->vtotal, mode->vrefresh,
|
mode->name, mode->htotal, mode->vtotal, drm_mode_vrefresh(mode),
|
||||||
*num_lm, drm_fixp2int(mode_clock_hz),
|
*num_lm, drm_fixp2int(mode_clock_hz),
|
||||||
sde_kms->perf.max_core_clk_rate);
|
sde_kms->perf.max_core_clk_rate);
|
||||||
return rc;
|
return rc;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2014-2020 The Linux Foundation. All rights reserved.
|
* Copyright (C) 2014-2021 The Linux Foundation. All rights reserved.
|
||||||
* Copyright (C) 2013 Red Hat
|
* Copyright (C) 2013 Red Hat
|
||||||
* Author: Rob Clark <robdclark@gmail.com>
|
* Author: Rob Clark <robdclark@gmail.com>
|
||||||
*
|
*
|
||||||
@@ -279,7 +279,7 @@ void _sde_plane_set_qos_lut(struct drm_plane *plane,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
frame_rate = crtc->mode.vrefresh;
|
frame_rate = drm_mode_vrefresh(&crtc->mode);
|
||||||
perf = &psde->catalog->perf;
|
perf = &psde->catalog->perf;
|
||||||
qos_count = perf->qos_refresh_count;
|
qos_count = perf->qos_refresh_count;
|
||||||
while ((fps_index < qos_count) && perf->qos_refresh_rate) {
|
while ((fps_index < qos_count) && perf->qos_refresh_rate) {
|
||||||
@@ -470,7 +470,7 @@ static void _sde_plane_set_ot_limit(struct drm_plane *plane,
|
|||||||
ot_params.width = psde->pipe_cfg.src_rect.w;
|
ot_params.width = psde->pipe_cfg.src_rect.w;
|
||||||
ot_params.height = psde->pipe_cfg.src_rect.h;
|
ot_params.height = psde->pipe_cfg.src_rect.h;
|
||||||
ot_params.is_wfd = !psde->is_rt_pipe;
|
ot_params.is_wfd = !psde->is_rt_pipe;
|
||||||
ot_params.frame_rate = crtc->mode.vrefresh;
|
ot_params.frame_rate = drm_mode_vrefresh(&crtc->mode);
|
||||||
ot_params.vbif_idx = VBIF_RT;
|
ot_params.vbif_idx = VBIF_RT;
|
||||||
ot_params.clk_ctrl = psde->pipe_hw->cap->clk_ctrl;
|
ot_params.clk_ctrl = psde->pipe_hw->cap->clk_ctrl;
|
||||||
ot_params.rd = true;
|
ot_params.rd = true;
|
||||||
|
Viittaa uudesa ongelmassa
Block a user