drm/i915: make backlight functions take a connector
Subsystems (2)
PATCH 1/2 drm/i915: make backlight functions take a connector
On VLV/BYT, backlight controls a per-pipe, so when adjusting the backlight we need to pass the correct info. So make the externally visible backlight functions take a connector argument, which can be used internally to figure out the pipe backlight to adjust.
--- drivers/gpu/drm/i915/intel_display.c | 8 +++++ drivers/gpu/drm/i915/intel_dp.c | 5 ++- drivers/gpu/drm/i915/intel_drv.h | 8 +++-- drivers/gpu/drm/i915/intel_lvds.c | 9 +++-- drivers/gpu/drm/i915/intel_opregion.c | 28 ++++++++++++++- drivers/gpu/drm/i915/intel_panel.c | 66 +++++++++++++++++++++-------------- 6 files changed, 88 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/intel_display.c +8 -0
@@ -9716,6 +9716,14 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)drm_crtc_helper_add (&intel_crtc->base, &intel_helper_funcs); } +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector) +{ +struct intel_encoder *encoder = connector->encoder; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +return crtc->pipe; +} +int intel_get_pipe_from_crtc_id (struct drm_device *dev,void *data,struct drm_file *file) {
drivers/gpu/drm/i915/intel_dp.c +2 -3
@@ -1252,7 +1252,6 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp);struct drm_device *dev = intel_dig_port->base.base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -int pipe =to_intel_crtc (intel_dig_port->base.base.crtc)->pipe;u32 pp;u32 pp_ctrl_reg;
@@ -1275,7 +1274,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)I915_WRITE (pp_ctrl_reg, pp);POSTING_READ (pp_ctrl_reg); -intel_panel_enable_backlight (dev, pipe); +intel_panel_enable_backlight (intel_dp->attached_connector); }void ironlake_edp_backlight_off (struct intel_dp *intel_dp)
@@ -1288,7 +1287,7 @@ void ironlake_edp_backlight_off(struct intel_dp *intel_dp)if (!is_edp (intel_dp))return ; -intel_panel_disable_backlight (dev); +intel_panel_disable_backlight (intel_dp->attached_connector);DRM_DEBUG_KMS ("\n" ); pp =ironlake_get_pp_control (intel_dp);
drivers/gpu/drm/i915/intel_drv.h +5 -3
@@ -619,6 +619,7 @@ void intel_connector_attach_encoder(struct intel_connector *connector,struct drm_encoder *intel_best_encoder (struct drm_connector *connector);struct drm_display_mode *intel_crtc_mode_get (struct drm_device *dev,struct drm_crtc *crtc); +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector);int intel_get_pipe_from_crtc_id (struct drm_device *dev,void *data,struct drm_file *file_priv); enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,
@@ -767,10 +768,11 @@ void intel_pch_panel_fitting(struct intel_crtc *crtc,void intel_gmch_panel_fitting (struct intel_crtc *crtc,struct intel_crtc_config *pipe_config,int fitting_mode); -void intel_panel_set_backlight (struct drm_device *dev,u32 level,u32 max); +void intel_panel_set_backlight (struct intel_connector *connector,u32 level, +u32 max);int intel_panel_setup_backlight (struct drm_connector *connector); -void intel_panel_enable_backlight (struct drm_device *dev,enum pipe pipe); -void intel_panel_disable_backlight (struct drm_device *dev); +void intel_panel_enable_backlight (struct intel_connector *connector); +void intel_panel_disable_backlight (struct intel_connector *connector);void intel_panel_destroy_backlight (struct drm_device *dev);enum drm_connector_status intel_panel_detect (struct drm_device *dev);
drivers/gpu/drm/i915/intel_lvds.c +6 -3
@@ -206,7 +206,8 @@ static void intel_enable_lvds(struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +struct intel_connector *intel_connector = + &lvds_encoder->attached_connector->base;struct drm_i915_private *dev_priv = dev->dev_private;u32 ctl_reg, stat_reg;
@@ -225,13 +226,15 @@ static void intel_enable_lvds(struct intel_encoder *encoder)if (wait_for ((I915_READ (stat_reg) &PP_ON ) !=0 ,1000 ))DRM_ERROR ("timed out waiting for panel to power on\n" ); -intel_panel_enable_backlight (dev, intel_crtc->pipe); +intel_panel_enable_backlight (intel_connector); }static void intel_disable_lvds (struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); +struct intel_connector *intel_connector = + &lvds_encoder->attached_connector->base;struct drm_i915_private *dev_priv = dev->dev_private;u32 ctl_reg, stat_reg;
@@ -243,7 +246,7 @@ static void intel_disable_lvds(struct intel_encoder *encoder) stat_reg =PP_STATUS ; } -intel_panel_disable_backlight (dev); +intel_panel_disable_backlight (intel_connector);I915_WRITE (ctl_reg,I915_READ (ctl_reg) & ~POWER_TARGET_ON );if (wait_for ((I915_READ (stat_reg) &PP_ON ) ==0 ,1000 ))
drivers/gpu/drm/i915/intel_opregion.c +27 -1
@@ -395,6 +395,11 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) {struct drm_i915_private *dev_priv = dev->dev_private;struct opregion_asle __iomem *asle = dev_priv->opregion.asle; +struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[0 ]; +struct drm_encoder *encoder; +struct drm_connector *connector; +struct intel_connector *intel_connector =NULL ; +bool found = false;DRM_DEBUG_DRIVER ("bclp = 0x%08x\n" , bclp);
@@ -405,7 +410,28 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)if (bclp >255 )return ASLC_BACKLIGHT_FAILED ; -intel_panel_set_backlight (dev, bclp,255 ); +/* +* Could match the OpRegion connector here instead, but we'd +* also need to verify the connector could handle a backlight +* call. +*/ +list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) +if (encoder->crtc == crtc) { + found = true; +break ; + } + +if (!found) +return ASLC_BACKLIGHT_FAILED ; + +list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) + intel_connector =to_intel_connector (connector); + +if (!found) +return ASLC_BACKLIGHT_FAILED ; + +intel_panel_set_backlight (intel_connector, bclp,255 );iowrite32 (DIV_ROUND_UP (bclp *100 ,255 ) |ASLE_CBLV_VALID , &asle->cblv);return 0 ;
drivers/gpu/drm/i915/intel_panel.c +40 -26
207 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH 2/2 drm/i915/vlv: use per-pipe backlight controls
With the connector and pipe passed around, we can now set the backlight on the right pipe on VLV/BYT.
--- drivers/gpu/drm/i915/i915_reg.h | 10 ++++++ drivers/gpu/drm/i915/intel_panel.c | 65 +++++++++++++++++++++++++++++++------- 2 files changed, 63 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +10 -0
@@ -2295,6 +2295,16 @@#define PFIT_AUTO_RATIOS (dev_priv->info->display_mmio_offset + 0x61238) +#define _VLV_BLC_PWM_CTL2_A (dev_priv->info->display_mmio_offset + 0x61250) +#define _VLV_BLC_PWM_CTL2_B (dev_priv->info->display_mmio_offset + 0x61350) +#define VLV_BLC_PWM_CTL2 (pipe) _PIPE(pipe, _VLV_BLC_PWM_CTL2_A, \ + _VLV_BLC_PWM_CTL2_B) + +#define _VLV_BLC_PWM_CTL_A (dev_priv->info->display_mmio_offset + 0x61254) +#define _VLV_BLC_PWM_CTL_B (dev_priv->info->display_mmio_offset + 0x61354) +#define VLV_BLC_PWM_CTL (pipe) _PIPE(pipe, _VLV_BLC_PWM_CTL_A, \ + _VLV_BLC_PWM_CTL_B) +/* Backlight control */ #define BLC_PWM_CTL2 (dev_priv->info->display_mmio_offset + 0x61250)/* 965+ only */ #define BLM_PWM_ENABLE (1 << 31)
drivers/gpu/drm/i915/intel_panel.c +53 -12
128 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Jani Nikula
maintainerRe: [PATCH 2/2] drm/i915/vlv: use per-pipe backlight controls
Quoted 35 lines · Jesse Barnes
With the connector and pipe passed around, we can now set the backlight on the right pipe on VLV/BYT.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 10 ++++++ drivers/gpu/drm/i915/intel_panel.c | 65 +++++++++++++++++++++++++++++++------- 2 files changed, 63 insertions(+), 12 deletions(-)drivers/gpu/drm/i915/i915_reg.h +10
-0@@ -2295,6 +2295,16 @@#define PFIT_AUTO_RATIOS (dev_priv->info->display_mmio_offset + 0x61238) +#define _VLV_BLC_PWM_CTL2_A (dev_priv->info->display_mmio_offset + 0x61250) +#define _VLV_BLC_PWM_CTL2_B (dev_priv->info->display_mmio_offset + 0x61350) +#define VLV_BLC_PWM_CTL2 (pipe) _PIPE(pipe, _VLV_BLC_PWM_CTL2_A, \ + _VLV_BLC_PWM_CTL2_B) + +#define _VLV_BLC_PWM_CTL_A (dev_priv->info->display_mmio_offset + 0x61254) +#define _VLV_BLC_PWM_CTL_B (dev_priv->info->display_mmio_offset + 0x61354) +#define VLV_BLC_PWM_CTL (pipe) _PIPE(pipe, _VLV_BLC_PWM_CTL_A, \ + _VLV_BLC_PWM_CTL_B) +/* Backlight control */ #define BLC_PWM_CTL2 (dev_priv->info->display_mmio_offset + 0x61250)/* 965+ only */ #define BLM_PWM_ENABLE (1 << 31)drivers/gpu/drm/i915/intel_panel.c +0
-0
drivers/gpu/drm/i915/intel_panel.c static int is_backlight_combination_mode(struct drm_device *dev) · line 334
Quoted 6 lines
drivers/gpu/drm/i915/intel_panel.c +3
-0@@ -329,6 +329,9 @@ static int is_backlight_combination_mode(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private; +if (IS_VALLEYVIEW (dev)) +return 0 ; +
Superfluous since
commit d17d711d3e34d71dada5da5b508738197d749112
Author: Jani Nikula <[email protected]> Date: Tue Sep 24 16:44:39 2013 +0300
drm/i915: backlight combination mode bit is gen4 only
Quoted 12 lines
drivers/gpu/drm/i915/intel_panel.c +5
-0if (IS_GEN4 (dev))return I915_READ (BLC_PWM_CTL2 ) &BLM_COMBINATION_MODE ;@@ -358,6 +361,21 @@ static u32 i915_read_blc_pwm_ctl(struct drm_device *dev, enum pipe pipe) val = dev_priv->regfile.saveBLC_PWM_CTL2;I915_WRITE (BLC_PWM_PCH_CTL2 , val); } + }else if (IS_VALLEYVIEW (dev)) { + val =I915_READ (VLV_BLC_PWM_CTL (pipe)); +if (dev_priv->regfile.saveBLC_PWM_CTL ==0 ) { + dev_priv->regfile.saveBLC_PWM_CTL = val; + dev_priv->regfile.saveBLC_PWM_CTL2 =
drivers/gpu/drm/i915/intel_panel.c static u32 i915_read_blc_pwm_ctl(struct drm_device *dev, enum pipe pipe) · line 378
Quoted 10 lines
drivers/gpu/drm/i915/intel_panel.c +10
-0+I915_READ (VLV_BLC_PWM_CTL2 (pipe)); + }else if (val ==0 ) { + val = dev_priv->regfile.saveBLC_PWM_CTL; +I915_WRITE (VLV_BLC_PWM_CTL (pipe), val); +I915_WRITE (VLV_BLC_PWM_CTL2 (pipe), + dev_priv->regfile.saveBLC_PWM_CTL2); + } + +if (!val) + val =0x0f42ffff ;
I really really wish I knew what this stuff in this function is (was) really needed for.
commit 0b0b053a3949f5c467c3b3ba135d4c161f9fbd00
Author: Chris Wilson <[email protected]> Date: Tue Nov 23 09:45:50 2010 +0000
drm/i915/panel: Restore saved value of BLC_PWM_CTL
After a GPU reset, the backlight controller registers may be also reset to 0. In that case we should restore those to the original values programmed by the BIOS. Note that we still lack the code to handle the case where the BIOS failed to program those registers at all...
...if backlight controller registers _may_ be reset to 0, what else can?
Anyway, I think you need to add per pipe save/restore to i915_save_display/i915_restore_display too.
Quoted 95 lines
drivers/gpu/drm/i915/intel_panel.c +27
-10}else { val =I915_READ (BLC_PWM_CTL );if (dev_priv->regfile.saveBLC_PWM_CTL ==0 ) {@@ -372,9 +390,6 @@ static u32 i915_read_blc_pwm_ctl(struct drm_device *dev, enum pipe pipe)I915_WRITE (BLC_PWM_CTL2 , dev_priv->regfile.saveBLC_PWM_CTL2); } - -if (IS_VALLEYVIEW (dev) && !val) - val =0x0f42ffff ; }return val;@@ -435,13 +450,19 @@ static u32 intel_panel_get_backlight(struct drm_device *dev,struct drm_i915_private *dev_priv = dev->dev_private;u32 val;unsigned long flags; +int reg;spin_lock_irqsave (&dev_priv->backlight.lock, flags);if (HAS_PCH_SPLIT (dev)) { val =I915_READ (BLC_PWM_CPU_CTL ) &BACKLIGHT_DUTY_CYCLE_MASK ; }else { - val =I915_READ (BLC_PWM_CTL ) &BACKLIGHT_DUTY_CYCLE_MASK ; +if (IS_VALLEYVIEW (dev)) + reg =VLV_BLC_PWM_CTL (pipe); +else + reg =BLC_PWM_CTL ; + + val =I915_READ (reg) &BACKLIGHT_DUTY_CYCLE_MASK ;if (INTEL_INFO (dev)->gen <4 ) val >>=1 ;@@ -473,6 +494,7 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, {struct drm_i915_private *dev_priv = dev->dev_private;u32 tmp; +int reg;DRM_DEBUG_DRIVER ("set backlight PWM = %d\n" , level); level =intel_panel_compute_brightness (dev, pipe, level);@@ -493,11 +515,16 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev,pci_write_config_byte (dev->pdev,PCI_LBPC , lbpc); } - tmp =I915_READ (BLC_PWM_CTL ); +if (IS_VALLEYVIEW (dev)) + reg =VLV_BLC_PWM_CTL (pipe); +else + reg =BLC_PWM_CTL ; + + tmp =I915_READ (reg);if (INTEL_INFO (dev)->gen <4 ) level <<=1 ; tmp &= ~BACKLIGHT_DUTY_CYCLE_MASK ; -I915_WRITE (BLC_PWM_CTL , tmp | level); +I915_WRITE (reg, tmp | level); }/* set backlight brightness to level in range [0..max] */ @@ -560,7 +587,12 @@ void intel_panel_disable_backlight(struct intel_connector *connector)if (INTEL_INFO (dev)->gen >=4 ) {uint32_t reg, tmp; - reg =HAS_PCH_SPLIT (dev) ?BLC_PWM_CPU_CTL2 :BLC_PWM_CTL2 ; +if (HAS_PCH_SPLIT (dev)) + reg =BLC_PWM_CPU_CTL2 ; +else if (IS_VALLEYVIEW (dev)) + reg =VLV_BLC_PWM_CTL2 (pipe); +else + reg =BLC_PWM_CTL2 ;I915_WRITE (reg,I915_READ (reg) & ~BLM_PWM_ENABLE );@@ -596,8 +628,12 @@ void intel_panel_enable_backlight(struct intel_connector *connector)if (INTEL_INFO (dev)->gen >=4 ) {uint32_t reg, tmp; - reg =HAS_PCH_SPLIT (dev) ?BLC_PWM_CPU_CTL2 :BLC_PWM_CTL2 ; - +if (HAS_PCH_SPLIT (dev)) + reg =BLC_PWM_CPU_CTL2 ; +else if (IS_VALLEYVIEW (dev)) + reg =VLV_BLC_PWM_CTL2 (pipe); +else + reg =BLC_PWM_CTL2 ; tmp =I915_READ (reg);@@ -649,9 +685,14 @@ static void intel_panel_init_backlight_regs(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;if (IS_VALLEYVIEW (dev)) { - u32 cur_val = I915_READ(BLC_PWM_CTL) &
drivers/gpu/drm/i915/intel_panel.c static void intel_panel_init_backlight_regs(struct drm_device *dev) · line 695
Quoted 10 lines
drivers/gpu/drm/i915/intel_panel.c +8
-2-BACKLIGHT_DUTY_CYCLE_MASK ; -I915_WRITE (BLC_PWM_CTL , (0xf42 <<16 ) | cur_val); +enum pipe pipe; + +for_each_pipe (pipe) { +u32 cur_val =I915_READ (VLV_BLC_PWM_CTL (pipe)) & +BACKLIGHT_DUTY_CYCLE_MASK ; +I915_WRITE (VLV_BLC_PWM_CTL (pipe), (0xf42 <<16 ) | + cur_val); + }
As follow-up, we should probably check if the freq is there, and only write the magic value if it isn't.
BR,
Jani.
Quoted 10 lines
drivers/gpu/drm/i915/intel_panel.c +0
-0} }Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Re: [PATCH 2/2] drm/i915/vlv: use per-pipe backlight controls
Quoted 2 lines · Jani Nikula
Anyway, I think you need to add per pipe save/restore to i915_save_display/i915_restore_display too.
I'm trying (very slowly at that) to move the register save/restore stuff out of there into more suitable places. Either we should now what should go in there (like all the w/a bits we set in e.g. init_clock_gating) or we need to have an appropriate place to store it more localized to all the other relevant code/data.
People simply forget about save/restore_display when enabling new platforms or fixing up stuff since it's somewhere completely else. -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Jani Nikula
maintainerQuoted 20 lines · Jesse Barnes
On VLV/BYT, backlight controls a per-pipe, so when adjusting the backlight we need to pass the correct info. So make the externally visible backlight functions take a connector argument, which can be used internally to figure out the pipe backlight to adjust.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 8 +++++ drivers/gpu/drm/i915/intel_dp.c | 5 ++- drivers/gpu/drm/i915/intel_drv.h | 8 +++-- drivers/gpu/drm/i915/intel_lvds.c | 9 +++-- drivers/gpu/drm/i915/intel_opregion.c | 28 ++++++++++++++- drivers/gpu/drm/i915/intel_panel.c | 66 +++++++++++++++++++++-------------- 6 files changed, 88 insertions(+), 36 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c static void intel_crtc_init(struct drm_device *dev, int pipe) · line 9724
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +6
-0@@ -9716,6 +9716,14 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)drm_crtc_helper_add (&intel_crtc->base, &intel_helper_funcs); } +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector) +{ +struct intel_encoder *encoder = connector->encoder; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +return crtc->pipe;
What if crtc == NULL?
I guess this shouldn't happen on the backlight enable/disable call paths through encoder callbacks, but what about backlight sysfs and opregion?
Quoted 119 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+} +int intel_get_pipe_from_crtc_id (struct drm_device *dev,void *data,struct drm_file *file) {drivers/gpu/drm/i915/intel_dp.c +2
-3@@ -1252,7 +1252,6 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)struct intel_digital_port *intel_dig_port =dp_to_dig_port (intel_dp);struct drm_device *dev = intel_dig_port->base.base.dev;struct drm_i915_private *dev_priv = dev->dev_private; -int pipe =to_intel_crtc (intel_dig_port->base.base.crtc)->pipe;u32 pp;u32 pp_ctrl_reg;@@ -1275,7 +1274,7 @@ void ironlake_edp_backlight_on(struct intel_dp *intel_dp)I915_WRITE (pp_ctrl_reg, pp);POSTING_READ (pp_ctrl_reg); -intel_panel_enable_backlight (dev, pipe); +intel_panel_enable_backlight (intel_dp->attached_connector); }void ironlake_edp_backlight_off (struct intel_dp *intel_dp)@@ -1288,7 +1287,7 @@ void ironlake_edp_backlight_off(struct intel_dp *intel_dp)if (!is_edp (intel_dp))return ; -intel_panel_disable_backlight (dev); +intel_panel_disable_backlight (intel_dp->attached_connector);DRM_DEBUG_KMS ("\n" ); pp =ironlake_get_pp_control (intel_dp);drivers/gpu/drm/i915/intel_drv.h +5
-3@@ -619,6 +619,7 @@ void intel_connector_attach_encoder(struct intel_connector *connector,struct drm_encoder *intel_best_encoder (struct drm_connector *connector);struct drm_display_mode *intel_crtc_mode_get (struct drm_device *dev,struct drm_crtc *crtc); +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector);int intel_get_pipe_from_crtc_id (struct drm_device *dev,void *data,struct drm_file *file_priv); enum transcoder intel_pipe_to_cpu_transcoder(struct drm_i915_private *dev_priv,@@ -767,10 +768,11 @@ void intel_pch_panel_fitting(struct intel_crtc *crtc,void intel_gmch_panel_fitting (struct intel_crtc *crtc,struct intel_crtc_config *pipe_config,int fitting_mode); -void intel_panel_set_backlight (struct drm_device *dev,u32 level,u32 max); +void intel_panel_set_backlight (struct intel_connector *connector,u32 level, +u32 max);int intel_panel_setup_backlight (struct drm_connector *connector); -void intel_panel_enable_backlight (struct drm_device *dev,enum pipe pipe); -void intel_panel_disable_backlight (struct drm_device *dev); +void intel_panel_enable_backlight (struct intel_connector *connector); +void intel_panel_disable_backlight (struct intel_connector *connector);void intel_panel_destroy_backlight (struct drm_device *dev);enum drm_connector_status intel_panel_detect (struct drm_device *dev);drivers/gpu/drm/i915/intel_lvds.c +6
-3@@ -206,7 +206,8 @@ static void intel_enable_lvds(struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); -struct intel_crtc *intel_crtc =to_intel_crtc (encoder->base.crtc); +struct intel_connector *intel_connector = + &lvds_encoder->attached_connector->base;struct drm_i915_private *dev_priv = dev->dev_private;u32 ctl_reg, stat_reg;@@ -225,13 +226,15 @@ static void intel_enable_lvds(struct intel_encoder *encoder)if (wait_for ((I915_READ (stat_reg) &PP_ON ) !=0 ,1000 ))DRM_ERROR ("timed out waiting for panel to power on\n" ); -intel_panel_enable_backlight (dev, intel_crtc->pipe); +intel_panel_enable_backlight (intel_connector); }static void intel_disable_lvds (struct intel_encoder *encoder) {struct drm_device *dev = encoder->base.dev;struct intel_lvds_encoder *lvds_encoder =to_lvds_encoder (&encoder->base); +struct intel_connector *intel_connector = + &lvds_encoder->attached_connector->base;struct drm_i915_private *dev_priv = dev->dev_private;u32 ctl_reg, stat_reg;@@ -243,7 +246,7 @@ static void intel_disable_lvds(struct intel_encoder *encoder) stat_reg =PP_STATUS ; } -intel_panel_disable_backlight (dev); +intel_panel_disable_backlight (intel_connector);I915_WRITE (ctl_reg,I915_READ (ctl_reg) & ~POWER_TARGET_ON );if (wait_for ((I915_READ (stat_reg) &PP_ON ) ==0 ,1000 ))drivers/gpu/drm/i915/intel_opregion.c +5
-0@@ -395,6 +395,11 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) {struct drm_i915_private *dev_priv = dev->dev_private;struct opregion_asle __iomem *asle = dev_priv->opregion.asle; +struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[0 ]; +struct drm_encoder *encoder; +struct drm_connector *connector; +struct intel_connector *intel_connector =NULL ; +bool found = false;DRM_DEBUG_DRIVER ("bclp = 0x%08x\n" , bclp);
drivers/gpu/drm/i915/intel_opregion.c static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) · line 417
Quoted 9 lines
drivers/gpu/drm/i915/intel_opregion.c +5
-1@@ -405,7 +410,28 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)if (bclp >255 )return ASLC_BACKLIGHT_FAILED ; -intel_panel_set_backlight (dev, bclp,255 ); +/* +* Could match the OpRegion connector here instead, but we'd +* also need to verify the connector could handle a backlight +* call. +*/
Connector callbacks for backlight is the future?
Quoted 5 lines
drivers/gpu/drm/i915/intel_opregion.c +5
-0+list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) +if (encoder->crtc == crtc) { + found = true; +break ; + }
drivers/gpu/drm/i915/intel_opregion.c static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) · line 432
Quoted 10 lines
drivers/gpu/drm/i915/intel_opregion.c +10
-0+ +if (!found) +return ASLC_BACKLIGHT_FAILED ; + +list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) + intel_connector =to_intel_connector (connector); + +if (!found) +return ASLC_BACKLIGHT_FAILED ;
ITYM if (intel_connector == NULL).
It aches a little to realize you pick a fixed pipe here, go through all the trouble of finding the corresponding connector, only to have intel_panel_set_backlight() dig out the pipe from the connector again...
An alternative (not necessarily better, just different) approach might be changing backlight on all enabled pipes on requests coming from opregion or sysfs (and maybe disabling backlight on disabled pipes). This would let the backlight be adjusted via sysfs/opregion also on pipe B, which doesn't happen with the proposed patch.
Quoted 20 lines
drivers/gpu/drm/i915/intel_opregion.c +2
-0+ +intel_panel_set_backlight (intel_connector, bclp,255 );iowrite32 (DIV_ROUND_UP (bclp *100 ,255 ) |ASLE_CBLV_VALID , &asle->cblv);return 0 ;drivers/gpu/drm/i915/intel_panel.c +1
-1@@ -341,7 +341,7 @@ static int is_backlight_combination_mode(struct drm_device *dev)/* XXX: query mode clock or hardware clock and program max PWM appropriately * when it's 0. */ -static u32 i915_read_blc_pwm_ctl (struct drm_device *dev) +static u32 i915_read_blc_pwm_ctl (struct drm_device *dev,enum pipe pipe) {struct drm_i915_private *dev_priv = dev->dev_private;u32 val;@@ -380,11 +380,12 @@ static u32 i915_read_blc_pwm_ctl(struct drm_device *dev)return val;
drivers/gpu/drm/i915/intel_panel.c static u32 i915_read_blc_pwm_ctl(struct drm_device *dev) · line 388
Quoted 10 lines
drivers/gpu/drm/i915/intel_panel.c +3
-2} -static u32 intel_panel_get_max_backlight (struct drm_device *dev) +static u32 intel_panel_get_max_backlight (struct drm_device *dev, +enum pipe pipe) {u32 max; - max =i915_read_blc_pwm_ctl (dev); + max =i915_read_blc_pwm_ctl (dev, pipe);
Unrelated to this patch:
This reminds me again we should probably just pick an arbitrary backlight range we expose to the userspace, and scale right before we write the value to the duty cycle. There's a (somewhat theoretical) chance the two backlight PWMs happen to have different max values, and the max we expose shouldn't change depending on the pipe. Also we can't support changing the PWM frequency if we expose that as the backlight device max value.
BR,
Jani.
Quoted 209 lines
drivers/gpu/drm/i915/intel_panel.c +36
-23if (HAS_PCH_SPLIT (dev)) { max >>=16 ;@@ -410,7 +411,8 @@ MODULE_PARM_DESC(invert_brightness, "Invert backlight brightness ""to [email protected], if your machine needs it. " "It will then be included in an upcoming module version.");module_param_named (invert_brightness, i915_panel_invert_brightness, int,0600 ); -static u32 intel_panel_compute_brightness (struct drm_device *dev,u32 val) +static u32 intel_panel_compute_brightness (struct drm_device *dev, +enum pipe pipe,u32 val) {struct drm_i915_private *dev_priv = dev->dev_private;@@ -419,7 +421,7 @@ static u32 intel_panel_compute_brightness(struct drm_device *dev, u32 val)if (i915_panel_invert_brightness >0 || dev_priv->quirks &QUIRK_INVERT_BRIGHTNESS ) { -u32 max =intel_panel_get_max_backlight (dev); +u32 max =intel_panel_get_max_backlight (dev, pipe);if (max)return max - val; }@@ -427,7 +429,8 @@ static u32 intel_panel_compute_brightness(struct drm_device *dev, u32 val)return val; } -static u32 intel_panel_get_backlight (struct drm_device *dev) +static u32 intel_panel_get_backlight (struct drm_device *dev, +enum pipe pipe) {struct drm_i915_private *dev_priv = dev->dev_private;u32 val;@@ -450,7 +453,7 @@ static u32 intel_panel_get_backlight(struct drm_device *dev) } } - val =intel_panel_compute_brightness (dev, val); + val =intel_panel_compute_brightness (dev, pipe, val);spin_unlock_irqrestore (&dev_priv->backlight.lock, flags);@@ -466,19 +469,19 @@ static void intel_pch_panel_set_backlight(struct drm_device *dev, u32 level) }static void intel_panel_actually_set_backlight (struct drm_device *dev, -u32 level) +enum pipe pipe,u32 level) {struct drm_i915_private *dev_priv = dev->dev_private;u32 tmp;DRM_DEBUG_DRIVER ("set backlight PWM = %d\n" , level); - level =intel_panel_compute_brightness (dev, level); + level =intel_panel_compute_brightness (dev, pipe, level);if (HAS_PCH_SPLIT (dev))return intel_pch_panel_set_backlight (dev, level);if (is_backlight_combination_mode (dev)) { -u32 max =intel_panel_get_max_backlight (dev); +u32 max =intel_panel_get_max_backlight (dev, pipe);u8 lbpc;/* we're screwed, but keep behaviour backwards compatible */ @@ -498,15 +501,18 @@ static void intel_panel_actually_set_backlight(struct drm_device *dev, }/* set backlight brightness to level in range [0..max] */ -void intel_panel_set_backlight (struct drm_device *dev,u32 level,u32 max) +void intel_panel_set_backlight (struct intel_connector *connector,u32 level, +u32 max) { +struct drm_device *dev = connector->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; +enum pipe pipe =intel_get_pipe_from_connector (connector);u32 freq;unsigned long flags;spin_lock_irqsave (&dev_priv->backlight.lock, flags); - freq =intel_panel_get_max_backlight (dev); + freq =intel_panel_get_max_backlight (dev, pipe);if (!freq) {/* we are screwed, bail out */ goto out;@@ -523,14 +529,16 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level, u32 max) dev_priv->backlight.device->props.brightness = level;if (dev_priv->backlight.enabled) -intel_panel_actually_set_backlight (dev, level); +intel_panel_actually_set_backlight (dev, pipe, level); out:spin_unlock_irqrestore (&dev_priv->backlight.lock, flags); } -void intel_panel_disable_backlight (struct drm_device *dev) +void intel_panel_disable_backlight (struct intel_connector *connector) { +struct drm_device *dev = connector->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; +enum pipe pipe =intel_get_pipe_from_connector (connector);unsigned long flags;/* @@ -547,7 +555,7 @@ void intel_panel_disable_backlight(struct drm_device *dev)spin_lock_irqsave (&dev_priv->backlight.lock, flags); dev_priv->backlight.enabled = false; -intel_panel_actually_set_backlight (dev,0 ); +intel_panel_actually_set_backlight (dev, pipe,0 );if (INTEL_INFO (dev)->gen >=4 ) {uint32_t reg, tmp;@@ -566,10 +574,11 @@ void intel_panel_disable_backlight(struct drm_device *dev)spin_unlock_irqrestore (&dev_priv->backlight.lock, flags); } -void intel_panel_enable_backlight (struct drm_device *dev, -enum pipe pipe) +void intel_panel_enable_backlight (struct intel_connector *connector) { +struct drm_device *dev = connector->base.dev;struct drm_i915_private *dev_priv = dev->dev_private; +enum pipe pipe =intel_get_pipe_from_connector (connector);enum transcoder cpu_transcoder =intel_pipe_to_cpu_transcoder (dev_priv, pipe);unsigned long flags;@@ -577,7 +586,8 @@ void intel_panel_enable_backlight(struct drm_device *dev,spin_lock_irqsave (&dev_priv->backlight.lock, flags);if (dev_priv->backlight.level ==0 ) { - dev_priv->backlight.level =intel_panel_get_max_backlight (dev); + dev_priv->backlight.level =intel_panel_get_max_backlight (dev, + pipe);if (dev_priv->backlight.device) dev_priv->backlight.device->props.brightness = dev_priv->backlight.level;@@ -627,7 +637,8 @@ set_level:* registers are set. */ dev_priv->backlight.enabled = true; -intel_panel_actually_set_backlight (dev, dev_priv->backlight.level); +intel_panel_actually_set_backlight (dev, pipe, + dev_priv->backlight.level);spin_unlock_irqrestore (&dev_priv->backlight.lock, flags); }@@ -650,7 +661,7 @@ static void intel_panel_init_backlight(struct drm_device *dev)intel_panel_init_backlight_regs (dev); - dev_priv->backlight.level =intel_panel_get_backlight (dev); + dev_priv->backlight.level =intel_panel_get_backlight (dev,0 ); dev_priv->backlight.enabled = dev_priv->backlight.level !=0 ; }@@ -679,16 +690,17 @@ intel_panel_detect(struct drm_device *dev)#if IS_ENABLED (CONFIG_BACKLIGHT_CLASS_DEVICE )static int intel_panel_update_status (struct backlight_device *bd) { -struct drm_device *dev =bl_get_data (bd); -intel_panel_set_backlight (dev, bd->props.brightness, +struct intel_connector *connector =bl_get_data (bd); +intel_panel_set_backlight (connector, bd->props.brightness, bd->props.max_brightness);return 0 ; }static int intel_panel_get_brightness (struct backlight_device *bd) { -struct drm_device *dev =bl_get_data (bd); -return intel_panel_get_backlight (dev); +struct intel_connector *connector =bl_get_data (bd); +enum pipe pipe =intel_get_pipe_from_connector (connector); +return intel_panel_get_backlight (connector->base.dev, pipe); } static const struct backlight_ops intel_panel_bl_ops = {@@ -708,12 +720,13 @@ int intel_panel_setup_backlight(struct drm_connector *connector)if (WARN_ON (dev_priv->backlight.device))return -ENODEV ; +/* Just create a device for pipe 0 */ memset (&props,0 ,sizeof (props)); props.type =BACKLIGHT_RAW ; props.brightness = dev_priv->backlight.level;spin_lock_irqsave (&dev_priv->backlight.lock, flags); - props.max_brightness =intel_panel_get_max_backlight (dev); + props.max_brightness =intel_panel_get_max_backlight (dev,0 );spin_unlock_irqrestore (&dev_priv->backlight.lock, flags);if (props.max_brightness ==0 ) {@@ -722,7 +735,8 @@ int intel_panel_setup_backlight(struct drm_connector *connector) } dev_priv->backlight.device =backlight_device_register ("intel_backlight" , - &connector->kdev, dev, + &connector->kdev, +to_intel_connector (connector), &intel_panel_bl_ops, &props);if (IS_ERR (dev_priv->backlight.device)) {Signature · 6 lines
1.8.3.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
Quoted 33 lines · Jani Nikula
Quoted 20 lines · Jesse Barnes
On VLV/BYT, backlight controls a per-pipe, so when adjusting the backlight we need to pass the correct info. So make the externally visible backlight functions take a connector argument, which can be used internally to figure out the pipe backlight to adjust.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 8 +++++ drivers/gpu/drm/i915/intel_dp.c | 5 ++- drivers/gpu/drm/i915/intel_drv.h | 8 +++-- drivers/gpu/drm/i915/intel_lvds.c | 9 +++-- drivers/gpu/drm/i915/intel_opregion.c | 28 ++++++++++++++- drivers/gpu/drm/i915/intel_panel.c | 66 +++++++++++++++++++++-------------- 6 files changed, 88 insertions(+), 36 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0drivers/gpu/drm/i915/intel_display.c static void intel_crtc_init(struct drm_device *dev, int pipe) · line 9724
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +6
-0@@ -9716,6 +9716,14 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)drm_crtc_helper_add (&intel_crtc->base, &intel_helper_funcs); } +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector) +{ +struct intel_encoder *encoder = connector->encoder; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +return crtc->pipe;What if crtc == NULL?
Quoted 2 lines
I guess this shouldn't happen on the backlight enable/disable call paths through encoder callbacks, but what about backlight sysfs and opregion?
I was discussing things a bit with Jani, and I'll repeat my thoughts here for others to see. Feel free to kick me if I get things totally wrong as I don't know the backlight code, nor do I really want to.
We may need to handle backlight configuration requests when there's no pipe attached to the port, and we also want to be able to change the pipe<->port mapping, so my idea would be to shadow the backlight registers in the connector, and when we assign a pipe to the port, we write all the regs from the shadow copies to the real pipe blc registers. Otherwise I'm worried about all the rmw stuff we do to the registers, and leaving bits around in the registers from when the pipe was still used with some other port.
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 4 lines · Ville Syrjälä
I was discussing things a bit with Jani, and I'll repeat my thoughts here for others to see. Feel free to kick me if I get things totally wrong as I don't know the backlight code, nor do I really want to.
Quoted 8 lines
We may need to handle backlight configuration requests when there's no pipe attached to the port, and we also want to be able to change the pipe<->port mapping, so my idea would be to shadow the backlight registers in the connector, and when we assign a pipe to the port, we write all the regs from the shadow copies to the real pipe blc registers. Otherwise I'm worried about all the rmw stuff we do to the registers, and leaving bits around in the registers from when the pipe was still used with some other port.
I think that's the sanest approach (maybe keep the shadow values around in a backligh struct or intel_panel). Then we could also drop our reliance on the save/restore logic in i915_suspend.c, which will kill the 2nd copy of the fragile backlight register read/write code. Finally if we initialize the shadow values at module load time we can also ditch the imo fragile delayed register saving logic we currently have.
-Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 41 lines · On Mon, 30 Sep 2013 15:15:12 +0300 Ville Syrjälä…
Quoted 33 lines · Jani Nikula
Quoted 20 lines · Jesse Barnes
On VLV/BYT, backlight controls a per-pipe, so when adjusting the backlight we need to pass the correct info. So make the externally visible backlight functions take a connector argument, which can be used internally to figure out the pipe backlight to adjust.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 8 +++++ drivers/gpu/drm/i915/intel_dp.c | 5 ++- drivers/gpu/drm/i915/intel_drv.h | 8 +++-- drivers/gpu/drm/i915/intel_lvds.c | 9 +++-- drivers/gpu/drm/i915/intel_opregion.c | 28 ++++++++++++++- drivers/gpu/drm/i915/intel_panel.c | 66 +++++++++++++++++++++-------------- 6 files changed, 88 insertions(+), 36 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0drivers/gpu/drm/i915/intel_display.c static void intel_crtc_init(struct drm_device *dev, int pipe) · line 9724
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +6
-0@@ -9716,6 +9716,14 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)drm_crtc_helper_add (&intel_crtc->base, &intel_helper_funcs); } +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector) +{ +struct intel_encoder *encoder = connector->encoder; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +return crtc->pipe;What if crtc == NULL?
Quoted 2 lines
I guess this shouldn't happen on the backlight enable/disable call paths through encoder callbacks, but what about backlight sysfs and opregion?
I was discussing things a bit with Jani, and I'll repeat my thoughts here for others to see. Feel free to kick me if I get things totally wrong as I don't know the backlight code, nor do I really want to.
Quoted 8 lines
We may need to handle backlight configuration requests when there's no pipe attached to the port, and we also want to be able to change the pipe<->port mapping, so my idea would be to shadow the backlight registers in the connector, and when we assign a pipe to the port, we write all the regs from the shadow copies to the real pipe blc registers. Otherwise I'm worried about all the rmw stuff we do to the registers, and leaving bits around in the registers from when the pipe was still used with some other port.
Yeah it's definitely a gap with this hw design. Tracking those bits in the connector makes more sense than having the backlight level change if the panel gets moved between pipes.
Jesse
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 33 lines · On Mon, 30 Sep 2013 11:18:28 +0300 Jani Nikula <[email protected]>…
Quoted 20 lines · Jesse Barnes
On VLV/BYT, backlight controls a per-pipe, so when adjusting the backlight we need to pass the correct info. So make the externally visible backlight functions take a connector argument, which can be used internally to figure out the pipe backlight to adjust.
Signed-off-by Jesse Barnes <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 8 +++++ drivers/gpu/drm/i915/intel_dp.c | 5 ++- drivers/gpu/drm/i915/intel_drv.h | 8 +++-- drivers/gpu/drm/i915/intel_lvds.c | 9 +++-- drivers/gpu/drm/i915/intel_opregion.c | 28 ++++++++++++++- drivers/gpu/drm/i915/intel_panel.c | 66 +++++++++++++++++++++-------------- 6 files changed, 88 insertions(+), 36 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0drivers/gpu/drm/i915/intel_display.c static void intel_crtc_init(struct drm_device *dev, int pipe) · line 9724
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +6
-0@@ -9716,6 +9716,14 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)drm_crtc_helper_add (&intel_crtc->base, &intel_helper_funcs); } +enum pipe intel_get_pipe_from_connector (struct intel_connector *connector) +{ +struct intel_encoder *encoder = connector->encoder; +struct intel_crtc *crtc =to_intel_crtc (encoder->base.crtc); + +return crtc->pipe;What if crtc == NULL?
Quoted 2 lines
I guess this shouldn't happen on the backlight enable/disable call paths through encoder callbacks, but what about backlight sysfs and opregion?
Yeah, it's definitely worth checking on a generic function like this. I suppose we should return a negative value in that case and make sure the callers check for it.
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c static void intel_crtc_init(struct drm_device *dev, int pipe) · line 9729
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5
-0+/* +* Could match the OpRegion connector here instead, but we'd +* also need to verify the connector could handle a backlight +* call. +*/ Connector callbacks for backlight is the future?
Yeah we definitely need to deal with this case better somehow...
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) +if (encoder->crtc == crtc) { + found = true; +break ; + } + +if (!found) +return ASLC_BACKLIGHT_FAILED ; +
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +6
-0+list_for_each_entry (connector, &dev->mode_config.connector_list, head) +if (connector->encoder == encoder) + intel_connector =to_intel_connector (connector); + +if (!found) +return ASLC_BACKLIGHT_FAILED ;ITYM if (
intel_connector== NULL).
Oops yeah, cult & paste fail.
Quoted 9 lines
It aches a little to realize you pick a fixed pipe here, go through all the trouble of finding the corresponding connector, only to have
intel_panel_set_backlight()dig out the pipe from the connector again...An alternative (not necessarily better, just different) approach might be changing backlight on all enabled pipes on requests coming from opregion or sysfs (and maybe disabling backlight on disabled pipes). This would let the backlight be adjusted via sysfs/opregion also on pipe B, which doesn't happen with the proposed patch.
Yeah that might be better; I don't know how real hw will be wired up, but on the prototype board I have that would work fine (and should continue to work until someone builds a device with two panels and want independent backlight control).
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1
-1u32 max; - max =i915_read_blc_pwm_ctl (dev); + max =i915_read_blc_pwm_ctl (dev, pipe);Unrelated to this patch:
Quoted 7 lines
This reminds me again we should probably just pick an arbitrary backlight range we expose to the userspace, and scale right before we write the value to the duty cycle. There's a (somewhat theoretical) chance the two backlight PWMs happen to have different max values, and the max we expose shouldn't change depending on the pipe. Also we can't support changing the PWM frequency if we expose that as the backlight device max value.
Yeah that's a good point. Yet another thing to clean up in the backlight code.
Jesse