From: Jani Nikula <jani.nikula@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Puthikorn Voravootivat <puthik@chromium.org>
Subject: Re: [PATCH 1/5] drm/i915: Fix condition check for backlight control via DPCD
Date: Thu, 09 Mar 2017 11:50:18 +0200 [thread overview]
Message-ID: <87r326hj8l.fsf@intel.com> (raw)
In-Reply-To: <20170308213053.194062-2-puthik@chromium.org>
On Wed, 08 Mar 2017, Puthikorn Voravootivat <puthik@chromium.org> wrote:
> Currently the intel_dp_aux_backlight driver requires eDP panel
> to support these conditions to allow the backlight adjust via
> dpcd register.
> 1) DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP
> 2) DP_EDP_BACKLIGHT_AUX_ENABLE_CAP
> 3) not DP_EDP_BACKLIGHT_PIN_ENABLE_CAP
> 4) not DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP
>
> Condition 2,3,4 are incorect because of the following reasons.
> For 2), "backlight can be enabled via AUX" is not "brightness
> can be adjusted via AUX". For 3) and 4), this requires panel
> to not support backlight adjustment via eDP BL_PWM_DIM pin,
> but there are some panels that support both AUX and eDP pin.
>
> This patch fixes the condition by checking for these instead.
> 1) DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP
> 2) DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP
I understand your point, but IIRC the goal with the current code was to
support DPCD backlight control *only* when PWM pin backlight control was
not possible. Your patch turns it around, and enables DPCD backlight
control whenever it's possible.
> This patch also add a check to DP_EDP_BACKLIGHT_AUX_ENABLE_CAP
> in set_aux_backlight_enable() since the backlight enablement
> can be done via BL_ENABLE eDP connector pin in the case that
> it does not support doing that via AUX.
It's also true that the current code conflates backlight enable and
adjustment caps. But that's largely because we also currently do not
support any type of mixed mode. And that would require quite a bit more
code. With your patch, you could end up with DPCD backlight adjustment
with no backligt enable/disable capability.
So I acknowledge the limitations in the current code, but I'm also not
convinced this patch series would be sufficient.
BR,
Jani.
>
> Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
> ---
> drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
> index 6532e226db29..abfb09c1269f 100644
> --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
> +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
> @@ -28,6 +28,10 @@ static void set_aux_backlight_enable(struct intel_dp *intel_dp, bool enable)
> {
> uint8_t reg_val = 0;
>
> + /* Early return when display use other mechanism to enable backlight. */
> + if (!(intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP))
> + return;
> +
> if (drm_dp_dpcd_readb(&intel_dp->aux, DP_EDP_DISPLAY_CONTROL_REGISTER,
> ®_val) < 0) {
> DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
> @@ -142,10 +146,8 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector)
> /* Check the eDP Display control capabilities registers to determine if
> * the panel can support backlight control over the aux channel
> */
> - if (intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&
> - (intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
> - !((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_PIN_ENABLE_CAP) ||
> - (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP))) {
> + if ((intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP) &&
> + (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP)) {
> DRM_DEBUG_KMS("AUX Backlight Control Supported!\n");
> return true;
> }
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-09 9:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 21:30 [PATCH 0/5] Enchancement to intel_dp_aux_backlight driver Puthikorn Voravootivat
2017-03-08 21:30 ` [PATCH 1/5] drm/i915: Fix condition check for backlight control via DPCD Puthikorn Voravootivat
2017-03-09 9:50 ` Jani Nikula [this message]
2017-03-09 21:15 ` Puthikorn Voravootivat
2017-03-08 21:30 ` [PATCH 2/5] drm/i915: Correctly enable blacklight adjustment " Puthikorn Voravootivat
2017-03-09 10:03 ` Jani Nikula
2017-03-08 21:30 ` [PATCH 3/5] drm/i915: Support dynamic backlight via DPCD register Puthikorn Voravootivat
2017-03-09 10:10 ` Jani Nikula
2017-03-08 21:30 ` [PATCH 4/5] drm/i915: Use highest frequency divider for PWM Puthikorn Voravootivat
2017-03-09 10:40 ` Jani Nikula
2017-03-09 21:18 ` Puthikorn Voravootivat
2017-03-08 21:30 ` [PATCH 5/5] drm/i915: Store brightness level in aux backlight driver Puthikorn Voravootivat
2017-03-08 22:17 ` ✓ Fi.CI.BAT: success for Enchancement to intel_dp_aux_backlight driver 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=87r326hj8l.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=puthik@chromium.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.