Skip to content

Commit

Permalink
Merge tag 'v5.19.13' into 5.19
Browse files Browse the repository at this point in the history
This is the 5.19.13 stable release
  • Loading branch information
xanmod committed Oct 4, 2022
2 parents 8155aed + 1bae998 commit b417f3a
Show file tree
Hide file tree
Showing 23 changed files with 385 additions and 497 deletions.
2 changes: 1 addition & 1 deletion Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 19
SUBLEVEL = 12
SUBLEVEL = 13
EXTRAVERSION =
NAME = Superb Owl

Expand Down
22 changes: 20 additions & 2 deletions drivers/gpu/drm/i915/display/g4x_dp.c
Expand Up @@ -395,8 +395,26 @@ static void intel_dp_get_config(struct intel_encoder *encoder,
intel_dotclock_calculate(pipe_config->port_clock,
&pipe_config->dp_m_n);

if (intel_dp_is_edp(intel_dp))
intel_edp_fixup_vbt_bpp(encoder, pipe_config->pipe_bpp);
if (intel_dp_is_edp(intel_dp) && dev_priv->vbt.edp.bpp &&
pipe_config->pipe_bpp > dev_priv->vbt.edp.bpp) {
/*
* This is a big fat ugly hack.
*
* Some machines in UEFI boot mode provide us a VBT that has 18
* bpp and 1.62 GHz link bandwidth for eDP, which for reasons
* unknown we fail to light up. Yet the same BIOS boots up with
* 24 bpp and 2.7 GHz link. Use the same bpp as the BIOS uses as
* max, not what it tells us to use.
*
* Note: This will still be broken if the eDP panel is not lit
* up by the BIOS, and thus we can't get the mode at module
* load.
*/
drm_dbg_kms(&dev_priv->drm,
"pipe has %d bpp for eDP panel, overriding BIOS-provided max %d bpp\n",
pipe_config->pipe_bpp, dev_priv->vbt.edp.bpp);
dev_priv->vbt.edp.bpp = pipe_config->pipe_bpp;
}
}

static void
Expand Down
18 changes: 4 additions & 14 deletions drivers/gpu/drm/i915/display/icl_dsi.c
Expand Up @@ -1864,8 +1864,7 @@ static void icl_dphy_param_init(struct intel_dsi *intel_dsi)
{
struct drm_device *dev = intel_dsi->base.base.dev;
struct drm_i915_private *dev_priv = to_i915(dev);
struct intel_connector *connector = intel_dsi->attached_connector;
struct mipi_config *mipi_config = connector->panel.vbt.dsi.config;
struct mipi_config *mipi_config = dev_priv->vbt.dsi.config;
u32 tlpx_ns;
u32 prepare_cnt, exit_zero_cnt, clk_zero_cnt, trail_cnt;
u32 ths_prepare_ns, tclk_trail_ns;
Expand Down Expand Up @@ -2052,8 +2051,6 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
/* attach connector to encoder */
intel_connector_attach_encoder(intel_connector, encoder);

intel_bios_init_panel(dev_priv, &intel_connector->panel);

mutex_lock(&dev->mode_config.mutex);
intel_panel_add_vbt_lfp_fixed_mode(intel_connector);
mutex_unlock(&dev->mode_config.mutex);
Expand All @@ -2067,20 +2064,13 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)

intel_backlight_setup(intel_connector, INVALID_PIPE);

if (intel_connector->panel.vbt.dsi.config->dual_link)
if (dev_priv->vbt.dsi.config->dual_link)
intel_dsi->ports = BIT(PORT_A) | BIT(PORT_B);
else
intel_dsi->ports = BIT(port);

if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.bl_ports & ~intel_dsi->ports))
intel_connector->panel.vbt.dsi.bl_ports &= intel_dsi->ports;

intel_dsi->dcs_backlight_ports = intel_connector->panel.vbt.dsi.bl_ports;

if (drm_WARN_ON(&dev_priv->drm, intel_connector->panel.vbt.dsi.cabc_ports & ~intel_dsi->ports))
intel_connector->panel.vbt.dsi.cabc_ports &= intel_dsi->ports;

intel_dsi->dcs_cabc_ports = intel_connector->panel.vbt.dsi.cabc_ports;
intel_dsi->dcs_backlight_ports = dev_priv->vbt.dsi.bl_ports;
intel_dsi->dcs_cabc_ports = dev_priv->vbt.dsi.cabc_ports;

for_each_dsi_port(port, intel_dsi->ports) {
struct intel_dsi_host *host;
Expand Down
23 changes: 11 additions & 12 deletions drivers/gpu/drm/i915/display/intel_backlight.c
Expand Up @@ -1158,10 +1158,9 @@ static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
return DIV_ROUND_CLOSEST(clock, pwm_freq_hz * mul);
}

static u16 get_vbt_pwm_freq(struct intel_connector *connector)
static u16 get_vbt_pwm_freq(struct drm_i915_private *dev_priv)
{
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
u16 pwm_freq_hz = connector->panel.vbt.backlight.pwm_freq_hz;
u16 pwm_freq_hz = dev_priv->vbt.backlight.pwm_freq_hz;

if (pwm_freq_hz) {
drm_dbg_kms(&dev_priv->drm,
Expand All @@ -1181,7 +1180,7 @@ static u32 get_backlight_max_vbt(struct intel_connector *connector)
{
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
struct intel_panel *panel = &connector->panel;
u16 pwm_freq_hz = get_vbt_pwm_freq(connector);
u16 pwm_freq_hz = get_vbt_pwm_freq(dev_priv);
u32 pwm;

if (!panel->backlight.pwm_funcs->hz_to_pwm) {
Expand Down Expand Up @@ -1218,11 +1217,11 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector)
* against this by letting the minimum be at most (arbitrarily chosen)
* 25% of the max.
*/
min = clamp_t(int, connector->panel.vbt.backlight.min_brightness, 0, 64);
if (min != connector->panel.vbt.backlight.min_brightness) {
min = clamp_t(int, dev_priv->vbt.backlight.min_brightness, 0, 64);
if (min != dev_priv->vbt.backlight.min_brightness) {
drm_dbg_kms(&dev_priv->drm,
"clamping VBT min backlight %d/255 to %d/255\n",
connector->panel.vbt.backlight.min_brightness, min);
dev_priv->vbt.backlight.min_brightness, min);
}

/* vbt value is a coefficient in range [0..255] */
Expand Down Expand Up @@ -1411,7 +1410,7 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
struct intel_panel *panel = &connector->panel;
u32 pwm_ctl, val;

panel->backlight.controller = connector->panel.vbt.backlight.controller;
panel->backlight.controller = dev_priv->vbt.backlight.controller;

pwm_ctl = intel_de_read(dev_priv,
BXT_BLC_PWM_CTL(panel->backlight.controller));
Expand Down Expand Up @@ -1484,7 +1483,7 @@ static int ext_pwm_setup_backlight(struct intel_connector *connector,
u32 level;

/* Get the right PWM chip for DSI backlight according to VBT */
if (connector->panel.vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
panel->backlight.pwm = pwm_get(dev->dev, "pwm_pmic_backlight");
desc = "PMIC";
} else {
Expand Down Expand Up @@ -1513,11 +1512,11 @@ static int ext_pwm_setup_backlight(struct intel_connector *connector,

drm_dbg_kms(&dev_priv->drm, "PWM already enabled at freq %ld, VBT freq %d, level %d\n",
NSEC_PER_SEC / (unsigned long)panel->backlight.pwm_state.period,
get_vbt_pwm_freq(connector), level);
get_vbt_pwm_freq(dev_priv), level);
} else {
/* Set period from VBT frequency, leave other settings at 0. */
panel->backlight.pwm_state.period =
NSEC_PER_SEC / get_vbt_pwm_freq(connector);
NSEC_PER_SEC / get_vbt_pwm_freq(dev_priv);
}

drm_info(&dev_priv->drm, "Using %s PWM for LCD backlight control\n",
Expand Down Expand Up @@ -1602,7 +1601,7 @@ int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe)
struct intel_panel *panel = &connector->panel;
int ret;

if (!connector->panel.vbt.backlight.present) {
if (!dev_priv->vbt.backlight.present) {
if (dev_priv->quirks & QUIRK_BACKLIGHT_PRESENT) {
drm_dbg_kms(&dev_priv->drm,
"no backlight present per VBT, but present per quirk\n");
Expand Down

0 comments on commit b417f3a

Please sign in to comment.