DPCD Backlight Control
Subsystems (3)
cover DPCD Backlight Control
These patches add support for Backlight Control using DPCD registers on eDP displays.
- Patch 1 Adds macro for DPCD registers capability size to drm_dp_helper.h
- Patch 2 Reads the eDP DPCD Display Control capability registers.
- Patch 2 Implements functionaly for DPCD Backlight Control
Yetunde Adebisi (3):
drm/dp: Add definition for Display Control DPCD Registers capability
size
drm/i915: Read eDP Display control capability registers drm/i915: Add Backlight Control using DPCD for eDP connectors (v9)
drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_params.c | 4 + drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_dp.c | 15 ++- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 173 ++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 4 + drivers/gpu/drm/i915/intel_panel.c | 4 + include/drm/drm_dp_helper.h | 1 + 8 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_dp_aux_backlight.c
Signature · 6 lines
1.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/3 drm/dp: Add definition for Display Control DPCD Registers capability size
This is used when reading Display Control capability Registers on the sink device.
--- include/drm/drm_dp_helper.h | 1 + 1 file changed, 1 insertion(+)
include/drm/drm_dp_helper.h +1 -0
@@ -621,6 +621,7 @@ u8 drm_dp_get_adjust_request_pre_emphasis(const u8 link_status[DP_LINK_STATUS_SI#define DP_BRANCH_OUI_HEADER_SIZE 0xc#define DP_RECEIVER_CAP_SIZE 0xf#define EDP_PSR_RECEIVER_CAP_SIZE 2 +#define EDP_DISPLAY_CTL_CAP_SIZE 3void drm_dp_link_train_clock_recovery_delay (const u8 dpcd[DP_RECEIVER_CAP_SIZE ]);void drm_dp_link_train_channel_eq_delay (const u8 dpcd[DP_RECEIVER_CAP_SIZE ]);
Signature · 6 lines
1.9.3 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/3 drm/i915: Read eDP Display control capability registers
In reply to Yetunde AdebisiAdd new edp_dpcd variable to intel_dp.
Read and save eDP Display control capability registers to edp_dpcd.
--- drivers/gpu/drm/i915/intel_dp.c | 15 ++++++++++----- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +10 -5
@@ -3777,7 +3777,6 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)struct intel_digital_port *dig_port =dp_to_dig_port (intel_dp);struct drm_device *dev = dig_port->base.base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -uint8_t rev;if (intel_dp_dpcd_read_wake (&intel_dp->aux,0x000 , intel_dp->dpcd,sizeof (intel_dp->dpcd)) <0 )
@@ -3834,6 +3833,15 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)DRM_DEBUG_KMS ("PSR2 %s on sink" , dev_priv->psr.psr2_support ?"supported" :"not supported" ); } + +/* Read the eDP Display control capabilities registers */ +memset (intel_dp->edp_dpcd,0 ,sizeof (intel_dp->edp_dpcd)); +if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP ] &DP_DPCD_DISPLAY_CONTROL_CAPABLE ) && + (intel_dp_dpcd_read_wake (&intel_dp->aux,DP_EDP_DPCD_REV , + intel_dp->edp_dpcd,sizeof (intel_dp->edp_dpcd)) == +sizeof (intel_dp->edp_dpcd))) +DRM_DEBUG_KMS ("EDP DPCD : %*ph\n" , (int )sizeof (intel_dp->edp_dpcd), + intel_dp->edp_dpcd); } DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n",
@@ -3841,10 +3849,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) yesno(drm_dp_tps3_supported(intel_dp->dpcd)));/* Intermediate frequency support */ -if (is_edp (intel_dp) && - (intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP ] &DP_DPCD_DISPLAY_CONTROL_CAPABLE ) && - (intel_dp_dpcd_read_wake (&intel_dp->aux,DP_EDP_DPCD_REV , &rev,1 ) ==1 ) && - (rev >=0x03 )) {/* eDp v1.4 or higher */ +if (is_edp (intel_dp) && (intel_dp->edp_dpcd[0 ] >=0x03 )) {/* eDp v1.4 or higher */ __le16 sink_rates[DP_MAX_SUPPORTED_RATES ];int i;
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -805,6 +805,7 @@ struct intel_dp {uint8_t dpcd[DP_RECEIVER_CAP_SIZE ];uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE ];uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS ]; +uint8_t edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE ];/* sink rates as reported by DP_SUPPORTED_LINK_RATES */ uint8_t num_sink_rates;int sink_rates[DP_MAX_SUPPORTED_RATES ];
Signature · 6 lines
1.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 drm/i915: Add Backlight Control using DPCD for eDP connectors (v9)
In reply to Yetunde AdebisiThis patch adds support for eDP backlight control using DPCD registers to backlight hooks in intel_panel.
It checks for backlight control over AUX channel capability and sets up function pointers to get and set the backlight brightness level if supported.
v2: Moved backlight functions from intel_dp.c into a new file intel_dp_aux_backlight.c. Also moved reading of eDP display control registers to intel_dp_get_dpcd
v3: Correct some formatting mistakes
v4: Updated to use AUX backlight control if PWM control is not possible
(Jani)
v5: Moved call to initialize backlight registers to dp_aux_setup_backlight
v6: Check DP_EDP_BACKLIGHT_PIN_ENABLE_CAP is disabled before setting up AUX backlight control. To fix BLM_PWM_ENABLE igt test warnings on bdw_ultra
v7: Add enable_dpcd_backlight module parameter.
v8: Rebase onto latest drm-intel-nightly branch
v9: Remove changes to intel_dp_dpcd_read_wake
Split addition edp_dpcd variable into a separate patch
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_params.c | 4 + drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 173 ++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 3 + drivers/gpu/drm/i915/intel_panel.c | 4 + 6 files changed, 186 insertions(+) create mode 100644 drivers/gpu/drm/i915/intel_dp_aux_backlight.c
drivers/gpu/drm/i915/Makefile +1 -0
@@ -79,6 +79,7 @@ i915-y += dvo_ch7017.o \ dvo_tfp410.o \ intel_crt.o \ intel_ddi.o \ + intel_dp_aux_backlight.o \ intel_dp_link_training.o \ intel_dp_mst.o \ intel_dp.o \
drivers/gpu/drm/i915/i915_params.c +4 -0
@@ -58,6 +58,7 @@ struct i915_params i915 __read_mostly = { .guc_log_level = -1, .enable_dp_mst = true, .inject_load_failure = 0, + .enable_dpcd_backlight = false, };module_param_named (modeset, i915.modeset, int,0400 );
@@ -210,3 +211,6 @@ MODULE_PARM_DESC(enable_dp_mst,module_param_named_unsafe (inject_load_failure, i915.inject_load_failure, uint,0400 );MODULE_PARM_DESC (inject_load_failure,"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)" ); +module_param_named (enable_dpcd_backlight, i915.enable_dpcd_backlight, bool,0600 ); +MODULE_PARM_DESC (enable_dpcd_backlight, +"Enable support for DPCD backlight control (default:false)" );
drivers/gpu/drm/i915/i915_params.h +1 -0
@@ -61,6 +61,7 @@ struct i915_params {bool verbose_state_checks;bool nuclear_pageflip;bool enable_dp_mst; +bool enable_dpcd_backlight; };extern struct i915_params i915__read_mostly ;
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +173 -0
173 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +3 -0
@@ -1322,6 +1322,9 @@ bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);bool intel_dp_get_link_status (struct intel_dp *intel_dp,uint8_t link_status[DP_LINK_STATUS_SIZE ]); +/* intel_dp_aux_backlight.c */ +int intel_dp_aux_init_backlight_funcs (struct intel_connector *intel_connector); +/* intel_dp_mst.c */ int intel_dp_mst_encoder_init (struct intel_digital_port *intel_dig_port,int conn_id);void intel_dp_mst_encoder_cleanup (struct intel_digital_port *intel_dig_port);
drivers/gpu/drm/i915/intel_panel.c +4 -0
@@ -1718,6 +1718,10 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel) container_of(panel, struct intel_connector, panel);struct drm_i915_private *dev_priv =to_i915 (connector->base.dev); +if (connector->base.connector_type == DRM_MODE_CONNECTOR_eDP && +intel_dp_aux_init_backlight_funcs (connector) ==0 ) +return ; +if (IS_BROXTON (dev_priv)) { panel->backlight.setup = bxt_setup_backlight; panel->backlight.enable = bxt_enable_backlight;
Signature · 6 lines
1.9.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for DPCD Backlight Control
In reply to Yetunde Adebisi== Series Details ==
== Series Details ==
Series: DPCD Backlight Control
URL : https://patchwork.freedesktop.org/series/5333/
State : success
== Summary ==
Series 5333v1 DPCD Backlight Control
http://patchwork.freedesktop.org/api/1.0/series/5333/revisions/1/mbox/
Test gem_sync:
Subgroup basic-all:
dmesg-fail -> PASS (bsw-nuc-2)
Test kms_force_connector_basic:
Subgroup force-connector-state:
pass -> SKIP (ilk-hp8440p)
Subgroup prune-stale-modes:
skip -> PASS (ivb-t430s)
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
dmesg-warn -> PASS (bsw-nuc-2)bdw-nuci7 total:196 pass:184 dwarn:0 dfail:0 fail:0 skip:12 bdw-ultra total:196 pass:175 dwarn:0 dfail:0 fail:0 skip:21 bsw-nuc-2 total:196 pass:159 dwarn:0 dfail:0 fail:0 skip:37 byt-nuc total:196 pass:161 dwarn:0 dfail:0 fail:0 skip:35 hsw-brixbox total:196 pass:174 dwarn:0 dfail:0 fail:0 skip:22 hsw-gt2 total:196 pass:179 dwarn:0 dfail:0 fail:0 skip:17 ilk-hp8440p total:196 pass:130 dwarn:1 dfail:0 fail:0 skip:65 ivb-t430s total:196 pass:171 dwarn:0 dfail:0 fail:0 skip:25 skl-i7k-2 total:196 pass:173 dwarn:0 dfail:0 fail:0 skip:23 skl-nuci5 total:196 pass:185 dwarn:0 dfail:0 fail:0 skip:11 snb-dellxps total:196 pass:162 dwarn:0 dfail:0 fail:0 skip:34 snb-x220t total:196 pass:162 dwarn:0 dfail:0 fail:1 skip:33
Results at /archive/results/CI_IGT_test/Patchwork_1808/
12899f13b8ee9a4944f167a08e4db0526a3f3855 drm-intel-nightly: 2016y-04m-05d-19h-09m-25s UTC integration manifest 74e213a89715dd42332ea4e0add08c1f2323adc2 drm/i915: Add Backlight Control using DPCD for eDP connectors (v9) 80bf6984cb710bd893e26f5baba60f2759f3393b drm/i915: Read eDP Display control capability registers 17f5d0aeffb048c446b007a6440828ed9d4e6f10 drm/dp: Add definition for Display Control DPCD Registers capability size
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 2 lines · Yetunde Adebisi
These patches add support for Backlight Control using DPCD registers on eDP displays.
Pushed to drm-intel-next-queued, thanks for the patches, and, again, apologies for the way too long delay with getting these merged.
I fixed some whitespace issues while applying. Please learn to use scripts/checkpatch.pl to get the details right next time.
BR,
Jani.
Quoted 21 lines
- Patch 1 Adds macro for DPCD registers capability size to
drm_dp_helper.h
- Patch 2 Reads the eDP DPCD Display Control capability registers.
- Patch 2 Implements functionaly for DPCD Backlight ControlYetunde Adebisi (3):
drm/dp: Add definition for Display Control DPCD Registers capability
size
drm/i915: Read eDP Display control capability registers drm/i915: Add Backlight Control using DPCD for eDP connectors (v9)drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_params.c | 4 + drivers/gpu/drm/i915/i915_params.h | 1 + drivers/gpu/drm/i915/intel_dp.c | 15 ++- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 173 ++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_drv.h | 4 + drivers/gpu/drm/i915/intel_panel.c | 4 + include/drm/drm_dp_helper.h | 1 + 8 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_dp_aux_backlight.c
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx