On Mon, 10 Jun 2019, "Lee, Shawn C" <shawn.c.lee@xxxxxxxxx> wrote: > The latest VBT support backlight control via aux. We have to > check VBT's setting before doing backlight initialization. > Then Driver will assign correct callback function for eDP > backlight control. > > Cc: Jani Nikula <jani.nikula@xxxxxxxxx> > Cc: Jose Roberto de Souza <jose.souza@xxxxxxxxx> > Cc: Cooper Chiou <cooper.chiou@xxxxxxxxx> > > Signed-off-by: Lee, Shawn C <shawn.c.lee@xxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_bios.c | 3 ++- > drivers/gpu/drm/i915/intel_vbt_defs.h | 6 ++++-- > 2 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c > index 1c037dfa83f5..27bda45520ec 100644 > --- a/drivers/gpu/drm/i915/intel_bios.c > +++ b/drivers/gpu/drm/i915/intel_bios.c > @@ -317,7 +317,8 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv, > > entry = &backlight_data->data[panel_type]; > > - dev_priv->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_PWM; > + dev_priv->vbt.backlight.present = (entry->type == BDB_BACKLIGHT_TYPE_PWM_SOC || > + entry->type == BDB_BACKLIGHT_TYPE_PWM_VESA_EDP_AUX); > if (!dev_priv->vbt.backlight.present) { > DRM_DEBUG_KMS("PWM backlight not present in VBT (type %u)\n", > entry->type); > diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h > index 89ef14cafb6b..710f539f17de 100644 > --- a/drivers/gpu/drm/i915/intel_vbt_defs.h > +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h > @@ -760,8 +760,10 @@ struct bdb_lvds_lfp_data { > * Block 43 - LFP Backlight Control Data Block > */ > > -#define BDB_BACKLIGHT_TYPE_NONE 0 > -#define BDB_BACKLIGHT_TYPE_PWM 2 > +#define BDB_BACKLIGHT_TYPE_NONE 0 > +#define BDB_BACKLIGHT_TYPE_PWM_SOC 2 > +#define BDB_BACKLIGHT_TYPE_PWM_PANEL_DRIVER_OLED 4 > +#define BDB_BACKLIGHT_TYPE_PWM_VESA_EDP_AUX 5 entry->type is two bits, 0-1 in the Features byte of the Backlight Data Structure in the spec. BDB_BACKLIGHT_TYPE_PWM_VESA_EDP_AUX will never match, so this was also never tested. There are no updates to the VBT spec to reflect the above change (and if I saw one, I'd reject it as backward incompatible). Please don't tell me you have some product specific spec and VBT there, because it's not flying upstream. The brightness control method structure does have a more detailed way of describing the method, and it probably already covers what you need. BR, Jani. > > struct lfp_backlight_data_entry { > u8 type:2; -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx