linux_dsm_epyc7002/drivers/gpu/drm/i915/display
Lyude Paul 7994672309 drm/i915: Assume 100% brightness when not in DPCD control mode
Currently we always determine the initial panel brightness level by
simply reading the value from DP_EDP_BACKLIGHT_BRIGHTNESS_MSB/LSB. This
seems wrong though, because if the panel is not currently in DPCD
control mode there's not really any reason why there would be any
brightness value programmed in the first place.

This appears to be the case on the Lenovo ThinkPad X1 Extreme 2nd
Generation, where the default value in these registers is always 0 on
boot despite the fact the panel runs at max brightness by default.
Getting the initial brightness value correct here is important as well,
since the panel on this laptop doesn't behave well if it's ever put into
DPCD control mode while the brightness level is programmed to 0.

So, let's fix this by checking what the current backlight control mode
is before reading the brightness level. If it's in DPCD control mode, we
return the programmed brightness level. Otherwise we assume 100%
brightness and return the highest possible brightness level. This also
prevents us from accidentally programming a brightness level of 0.

This is one of the many fixes that gets backlight controls working on
the ThinkPad X1 Extreme 2nd Generation with optional 4K AMOLED screen.

Changes since v1:
* s/DP_EDP_DISPLAY_CONTROL_REGISTER/DP_EDP_BACKLIGHT_MODE_SET_REGISTER/
  - Jani

Tested-by: AceLan Kao <acelan.kao@canonical.com>
Tested-by: Perry Yuan <pyuan@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200116211623.53799-3-lyude@redhat.com
2020-01-17 13:41:03 +02:00
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c
dvo_sil164.c
dvo_tfp410.c
icl_dsi.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_acpi.c
intel_acpi.h
intel_atomic_plane.c drm/i915: Make sure CCS YUV semiplanar format checks work 2019-12-23 13:51:02 +02:00
intel_atomic_plane.h drm/i915: Remove special case slave handling during hw programming, v3. 2019-11-01 14:51:21 +01:00
intel_atomic.c drm/i915/display: Force the state compute phase once to enable PSR 2020-01-08 08:12:01 -08:00
intel_atomic.h drm/i915/tgl: Select master transcoder for MST stream 2019-12-23 09:26:41 -08:00
intel_audio.c drm/i915: Use the passed in encoder 2020-01-13 20:12:46 +02:00
intel_audio.h
intel_bios.c drm/i915/vbt: Rename BDB_LVDS_POWER to BDB_LFP_POWER 2020-01-14 12:38:59 -08:00
intel_bios.h drm/i915/bios: add support for querying DSC details for encoder 2019-12-11 07:39:47 +02:00
intel_bw.c drm/i915/display: cleanup intel_bw_state on i915 module removal 2019-12-24 15:01:50 +05:30
intel_bw.h drm/i915/display: cleanup intel_bw_state on i915 module removal 2019-12-24 15:01:50 +05:30
intel_cdclk.c drm/i915: Bump up CDCLK to eliminate underruns on TGL 2020-01-13 13:44:11 +02:00
intel_cdclk.h
intel_color.c drm/i915: Preload LUTs if the hw isn't currently using them 2019-11-18 09:20:27 -08:00
intel_color.h
intel_combo_phy.c
intel_combo_phy.h
intel_connector.c drm/i915/dp: Attach colorspace property 2019-10-15 16:24:59 +03:00
intel_connector.h
intel_crt.c drm/i915: Pass intel_connector to intel_attached_*() 2020-01-13 19:33:34 +02:00
intel_crt.h
intel_ddi.c drm/i915/dp/tgl+: Update combo phy vswing tables 2020-01-14 12:28:21 -08:00
intel_ddi.h drm/i915: Call hsw_fdi_link_train() directly() 2019-12-18 16:47:34 +02:00
intel_display_power.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_display_power.h drm/i915: fix comment for POWER_DOMAIN_TRANSCODER_VDSC_PW2 2019-12-23 11:58:49 +02:00
intel_display_types.h drm/i915: Fix eDP DPCD aux max backlight calculations 2020-01-17 13:41:00 +02:00
intel_display.c drm/i915/fbc: Move the plane state check into the fbc functions 2020-01-15 17:16:32 +02:00
intel_display.h drm/i915/tgl: Gen-12 display can decompress surfaces compressed by the media engine 2020-01-07 13:16:49 +02:00
intel_dp_aux_backlight.c drm/i915: Assume 100% brightness when not in DPCD control mode 2020-01-17 13:41:03 +02:00
intel_dp_aux_backlight.h
intel_dp_link_training.c
intel_dp_link_training.h
intel_dp_mst.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dp_mst.h drm/i915/tgl: Select master transcoder for MST stream 2019-12-23 09:26:41 -08:00
intel_dp.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dp.h drm/i915/dp: Program an Infoframe SDP Header and DB for HDR Static Metadata 2019-10-15 16:24:59 +03:00
intel_dpio_phy.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dpio_phy.h
intel_dpll_mgr.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dpll_mgr.h drm/i915/tgl: Fix doc not corresponding to code 2019-10-29 15:33:12 -07:00
intel_dsb.c drm/i915/dsb: fix cmd_buf being wrongly set 2019-12-02 10:06:25 -08:00
intel_dsb.h drm/i915/dsb: remove atomic operations 2019-11-18 13:27:09 -08:00
intel_dsi_dcs_backlight.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dsi_dcs_backlight.h
intel_dsi_vbt.c drm/i915/dsi: Lookup the i2c bus from ACPI NS only if CONFIG_ACPI=y (v2) 2020-01-17 13:12:33 +02:00
intel_dsi.c
intel_dsi.h drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_dvo_dev.h
intel_dvo.c drm/i915: Pass intel_connector to intel_attached_*() 2020-01-13 19:33:34 +02:00
intel_dvo.h
intel_fbc.c drm/i915/fbc: Add fbc tracepoints 2020-01-15 17:19:59 +02:00
intel_fbc.h drm/i915/fbc: Move the plane state check into the fbc functions 2020-01-15 17:16:32 +02:00
intel_fbdev.c drm-misc-next for v5.6: 2019-12-17 13:57:54 +01:00
intel_fbdev.h
intel_fifo_underrun.c drm/i915: prefer 3-letter acronym for ivybridge 2019-12-28 13:38:08 -08:00
intel_fifo_underrun.h
intel_frontbuffer.c drm/i915: Hold reference to intel_frontbuffer as we track activity 2019-12-18 12:09:57 +00:00
intel_frontbuffer.h drm/i915: Hold reference to intel_frontbuffer as we track activity 2019-12-18 12:09:57 +00:00
intel_gmbus.c
intel_gmbus.h
intel_hdcp.c drm/i915/hdcp: Nuke intel_hdcp_transcoder_config() 2019-12-10 12:37:53 +02:00
intel_hdcp.h drm/i915/hdcp: Nuke intel_hdcp_transcoder_config() 2019-12-10 12:37:53 +02:00
intel_hdmi.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_hdmi.h drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_hotplug.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_hotplug.h
intel_lpe_audio.c
intel_lpe_audio.h
intel_lspcon.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_lspcon.h
intel_lvds.c drm/i915: Perform automated conversions for crtc uapi/hw split, base -> uapi. 2019-11-01 14:51:21 +01:00
intel_lvds.h
intel_opregion.c drm/i915: opregion: set opregion chpd value to indicate the driver handles hotplug 2019-12-16 21:38:05 +01:00
intel_opregion.h
intel_overlay.c drm/i915/gt: Pull GT initialisation under intel_gt_init() 2019-12-22 12:51:32 +00:00
intel_overlay.h
intel_panel.c drm/i915: DSI: select correct PWM controller to use based on the VBT 2019-12-17 11:24:48 +01:00
intel_panel.h
intel_pipe_crc.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_pipe_crc.h
intel_psr.c drm/i915/psr: Share the computation of idle frames 2020-01-16 10:22:39 -08:00
intel_psr.h drm/i915/display: Force the state compute phase once to enable PSR 2020-01-08 08:12:01 -08:00
intel_quirks.c
intel_quirks.h
intel_sdvo_regs.h
intel_sdvo.c drm/i915: Pass intel_connector to intel_attached_*() 2020-01-13 19:33:34 +02:00
intel_sdvo.h
intel_sprite.c drm/i915/tgl: Gen-12 display can decompress surfaces compressed by the media engine 2020-01-07 13:16:49 +02:00
intel_sprite.h drm/i915: Allow planes to declare their minimum acceptable cdclk 2019-10-24 21:22:25 +03:00
intel_tc.c
intel_tc.h
intel_tv.c drm/i915: Pass intel_connector to intel_attached_*() 2020-01-13 19:33:34 +02:00
intel_tv.h
intel_vbt_defs.h drm/i915/vbt: Rename BDB_LVDS_POWER to BDB_LFP_POWER 2020-01-14 12:38:59 -08:00
intel_vdsc.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
intel_vdsc.h drm/i915/dsc: add basic hardware state readout support 2019-12-11 08:16:16 +02:00
intel_vga.c
intel_vga.h
vlv_dsi_pll.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00
vlv_dsi.c drm/i915: Pass intel_encoder to enc_to_*() 2020-01-13 20:10:51 +02:00