Skip to content

Commit a687efe

Browse files
committed
Merge tag 'drm-intel-fixes-2021-12-02' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
- Fixing a regression where the backlight brightness control stopped working. - Fix the Intel HDR backlight support detection. - Reverting a w/a to fix a gpu Hang in TGL. The w/a itself was also for a hang, but in a much rarer scenario. The proper solution need to be done with help from user space and it will be addressed later. Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 1152b16 + 72641d8 commit a687efe

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,9 @@ struct intel_dp {
16401640
struct intel_dp_pcon_frl frl;
16411641

16421642
struct intel_psr psr;
1643+
1644+
/* When we last wrote the OUI for eDP */
1645+
unsigned long last_oui_write;
16431646
};
16441647

16451648
enum lspcon_vendor {

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/i2c.h>
3030
#include <linux/notifier.h>
3131
#include <linux/slab.h>
32+
#include <linux/timekeeping.h>
3233
#include <linux/types.h>
3334

3435
#include <asm/byteorder.h>
@@ -1955,6 +1956,16 @@ intel_edp_init_source_oui(struct intel_dp *intel_dp, bool careful)
19551956

19561957
if (drm_dp_dpcd_write(&intel_dp->aux, DP_SOURCE_OUI, oui, sizeof(oui)) < 0)
19571958
drm_err(&i915->drm, "Failed to write source OUI\n");
1959+
1960+
intel_dp->last_oui_write = jiffies;
1961+
}
1962+
1963+
void intel_dp_wait_source_oui(struct intel_dp *intel_dp)
1964+
{
1965+
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1966+
1967+
drm_dbg_kms(&i915->drm, "Performing OUI wait\n");
1968+
wait_remaining_ms_from_jiffies(intel_dp->last_oui_write, 30);
19581969
}
19591970

19601971
/* If the device supports it, try to set the power state appropriately */

drivers/gpu/drm/i915/display/intel_dp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,6 @@ void intel_dp_pcon_dsc_configure(struct intel_dp *intel_dp,
119119
const struct intel_crtc_state *crtc_state);
120120
void intel_dp_phy_test(struct intel_encoder *encoder);
121121

122+
void intel_dp_wait_source_oui(struct intel_dp *intel_dp);
123+
122124
#endif /* __INTEL_DP_H__ */

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
#include "intel_backlight.h"
3838
#include "intel_display_types.h"
39+
#include "intel_dp.h"
3940
#include "intel_dp_aux_backlight.h"
4041

4142
/* TODO:
@@ -106,6 +107,8 @@ intel_dp_aux_supports_hdr_backlight(struct intel_connector *connector)
106107
int ret;
107108
u8 tcon_cap[4];
108109

110+
intel_dp_wait_source_oui(intel_dp);
111+
109112
ret = drm_dp_dpcd_read(aux, INTEL_EDP_HDR_TCON_CAP0, tcon_cap, sizeof(tcon_cap));
110113
if (ret != sizeof(tcon_cap))
111114
return false;
@@ -204,6 +207,8 @@ intel_dp_aux_hdr_enable_backlight(const struct intel_crtc_state *crtc_state,
204207
int ret;
205208
u8 old_ctrl, ctrl;
206209

210+
intel_dp_wait_source_oui(intel_dp);
211+
207212
ret = drm_dp_dpcd_readb(&intel_dp->aux, INTEL_EDP_HDR_GETSET_CTRL_PARAMS, &old_ctrl);
208213
if (ret != 1) {
209214
drm_err(&i915->drm, "Failed to read current backlight control mode: %d\n", ret);
@@ -293,6 +298,13 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state,
293298
struct intel_panel *panel = &connector->panel;
294299
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
295300

301+
if (!panel->backlight.edp.vesa.info.aux_enable) {
302+
u32 pwm_level = intel_backlight_invert_pwm_level(connector,
303+
panel->backlight.pwm_level_max);
304+
305+
panel->backlight.pwm_funcs->enable(crtc_state, conn_state, pwm_level);
306+
}
307+
296308
drm_edp_backlight_enable(&intel_dp->aux, &panel->backlight.edp.vesa.info, level);
297309
}
298310

@@ -304,6 +316,10 @@ static void intel_dp_aux_vesa_disable_backlight(const struct drm_connector_state
304316
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
305317

306318
drm_edp_backlight_disable(&intel_dp->aux, &panel->backlight.edp.vesa.info);
319+
320+
if (!panel->backlight.edp.vesa.info.aux_enable)
321+
panel->backlight.pwm_funcs->disable(old_conn_state,
322+
intel_backlight_invert_pwm_level(connector, 0));
307323
}
308324

309325
static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector, enum pipe pipe)
@@ -321,6 +337,15 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
321337
if (ret < 0)
322338
return ret;
323339

340+
if (!panel->backlight.edp.vesa.info.aux_enable) {
341+
ret = panel->backlight.pwm_funcs->setup(connector, pipe);
342+
if (ret < 0) {
343+
drm_err(&i915->drm,
344+
"Failed to setup PWM backlight controls for eDP backlight: %d\n",
345+
ret);
346+
return ret;
347+
}
348+
}
324349
panel->backlight.max = panel->backlight.edp.vesa.info.max;
325350
panel->backlight.min = 0;
326351
if (current_mode == DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD) {
@@ -340,12 +365,7 @@ intel_dp_aux_supports_vesa_backlight(struct intel_connector *connector)
340365
struct intel_dp *intel_dp = intel_attached_dp(connector);
341366
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
342367

343-
/* TODO: We currently only support AUX only backlight configurations, not backlights which
344-
* require a mix of PWM and AUX controls to work. In the mean time, these machines typically
345-
* work just fine using normal PWM controls anyway.
346-
*/
347-
if ((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
348-
drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
368+
if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
349369
drm_dbg_kms(&i915->drm, "AUX Backlight Control Supported!\n");
350370
return true;
351371
}

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,6 @@ static void gen12_ctx_workarounds_init(struct intel_engine_cs *engine,
621621
FF_MODE2_GS_TIMER_MASK,
622622
FF_MODE2_GS_TIMER_224,
623623
0, false);
624-
625-
/*
626-
* Wa_14012131227:dg1
627-
* Wa_1508744258:tgl,rkl,dg1,adl-s,adl-p
628-
*/
629-
wa_masked_en(wal, GEN7_COMMON_SLICE_CHICKEN1,
630-
GEN9_RHWO_OPTIMIZATION_DISABLE);
631624
}
632625

633626
static void dg1_ctx_workarounds_init(struct intel_engine_cs *engine,

0 commit comments

Comments
 (0)