mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
drm/i915: Pick the backlight controller based on VBT on ICP+
Use the second backlight controller on ICP+ if the VBT asks us to do so. On pre-MTP we also check the chicken bit to make sure the pins have been correctly muxed by the firmware. Cc: stable@vger.kernel.org Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8016 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230207064337.18697-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
ba00eb6a4b
commit
b337715463
|
|
@ -1431,6 +1431,30 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int cnp_num_backlight_controllers(struct drm_i915_private *i915)
|
||||
{
|
||||
if (INTEL_PCH_TYPE(i915) >= PCH_DG1)
|
||||
return 1;
|
||||
|
||||
if (INTEL_PCH_TYPE(i915) >= PCH_ICP)
|
||||
return 2;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool cnp_backlight_controller_is_valid(struct drm_i915_private *i915, int controller)
|
||||
{
|
||||
if (controller < 0 || controller >= cnp_num_backlight_controllers(i915))
|
||||
return false;
|
||||
|
||||
if (controller == 1 &&
|
||||
INTEL_PCH_TYPE(i915) >= PCH_ICP &&
|
||||
INTEL_PCH_TYPE(i915) < PCH_MTP)
|
||||
return intel_de_read(i915, SOUTH_CHICKEN1) & ICP_SECOND_PPS_IO_SELECT;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static int
|
||||
cnp_setup_backlight(struct intel_connector *connector, enum pipe unused)
|
||||
{
|
||||
|
|
@ -1440,10 +1464,14 @@ cnp_setup_backlight(struct intel_connector *connector, enum pipe unused)
|
|||
|
||||
/*
|
||||
* CNP has the BXT implementation of backlight, but with only one
|
||||
* controller. TODO: ICP has multiple controllers but we only use
|
||||
* controller 0 for now.
|
||||
* controller. ICP+ can have two controllers, depending on pin muxing.
|
||||
*/
|
||||
panel->backlight.controller = 0;
|
||||
panel->backlight.controller = connector->panel.vbt.backlight.controller;
|
||||
if (!cnp_backlight_controller_is_valid(i915, panel->backlight.controller)) {
|
||||
drm_dbg_kms(&i915->drm, "Invalid backlight controller %d, assuming 0\n",
|
||||
panel->backlight.controller);
|
||||
panel->backlight.controller = 0;
|
||||
}
|
||||
|
||||
pwm_ctl = intel_de_read(i915,
|
||||
BXT_BLC_PWM_CTL(panel->backlight.controller));
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user