From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915: Pick the backlight controller based on VBT on ICP+
Date: Tue, 07 Feb 2023 11:32:45 +0200 [thread overview]
Message-ID: <87zg9pyg5e.fsf@intel.com> (raw)
In-Reply-To: <20230207064337.18697-4-ville.syrjala@linux.intel.com>
On Tue, 07 Feb 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/8016
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> .../gpu/drm/i915/display/intel_backlight.c | 34 +++++++++++++++++--
> 1 file changed, 31 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
> index 5b7da72c95b8..a4e4b7f79e4d 100644
> --- a/drivers/gpu/drm/i915/display/intel_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_backlight.c
> @@ -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;
> +}
At some point I think we should clean this up between backlight and
pps. There's already intel_num_pps(). But let's get this merged as-is
now.
> +
> +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;
I got a bit confused that MTP has two controllers but it doesn't have
that bit. I first thought you were off by one with that < PCH_MTP. But
looks like it's correct.
Anyway,
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> +
> + 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));
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-02-07 9:32 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 6:43 [Intel-gfx] [PATCH 0/3] drm/i915: Fix eDP+DSI dual panel systems Ville Syrjala
2023-02-07 6:43 ` [Intel-gfx] [PATCH 1/3] drm/i915: Fix VBT DSI DVO port handling Ville Syrjala
2023-02-07 8:59 ` Jani Nikula
2023-02-07 9:05 ` Ville Syrjälä
2023-02-07 9:33 ` Jani Nikula
2023-02-07 6:43 ` [Intel-gfx] [PATCH 2/3] drm/i915: Populate encoder->devdata for DSI on icl+ Ville Syrjala
2023-02-07 9:06 ` Jani Nikula
2023-02-08 1:27 ` Ville Syrjälä
2023-02-07 6:43 ` [Intel-gfx] [PATCH 3/3] drm/i915: Pick the backlight controller based on VBT on ICP+ Ville Syrjala
2023-02-07 9:32 ` Jani Nikula [this message]
2023-02-08 15:23 ` Rodrigo Vivi
2023-02-08 16:19 ` Ville Syrjälä
2023-02-09 10:14 ` Jani Nikula
2023-02-07 7:24 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Fix eDP+DSI dual panel systems Patchwork
2023-02-07 7:41 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-02-07 10:22 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Fix eDP+DSI dual panel systems (rev2) Patchwork
2023-02-07 22:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Fix eDP+DSI dual panel systems (rev3) Patchwork
2023-02-08 0:20 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zg9pyg5e.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox