From: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
To: "puthik@chromium.org" <puthik@chromium.org>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH v6 4/9] drm/i915: Allow choosing how to adjust brightness if both supported
Date: Thu, 11 May 2017 00:50:20 +0000 [thread overview]
Message-ID: <1494465014.14696.40.camel@dk-H97M-D3H> (raw)
In-Reply-To: <20170509234052.189575-5-puthik@chromium.org>
On Tue, 2017-05-09 at 16:40 -0700, Puthikorn Voravootivat wrote:
> Add option to allow choosing how to adjust brightness if
> panel supports both PWM pin and AUX channel.
>
> Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
> ---
> drivers/gpu/drm/i915/i915_params.c | 8 +++++---
> drivers/gpu/drm/i915/i915_params.h | 2 +-
> drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 23 ++++++++++++++++++-----
> 3 files changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index b6a7e363d076..13cf3f1572ab 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -63,7 +63,7 @@ struct i915_params i915 __read_mostly = {
> .huc_firmware_path = NULL,
> .enable_dp_mst = true,
> .inject_load_failure = 0,
> - .enable_dpcd_backlight = false,
> + .enable_dpcd_backlight = -1,
> .enable_gvt = false,
> };
>
> @@ -246,9 +246,11 @@ MODULE_PARM_DESC(enable_dp_mst,
> module_param_named_unsafe(inject_load_failure, i915.inject_load_failure, uint, 0400);
> MODULE_PARM_DESC(inject_load_failure,
> "Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
> -module_param_named(enable_dpcd_backlight, i915.enable_dpcd_backlight, bool, 0600);
> +module_param_named(enable_dpcd_backlight, i915.enable_dpcd_backlight, int, 0600);
> MODULE_PARM_DESC(enable_dpcd_backlight,
> - "Enable support for DPCD backlight control (default:false)");
> + "Enable support for DPCD backlight control "
> + "(-1:disable (default), 0:Use PWM pin if both supported, "
> + "1:Use DPCD if both supported");
>
> module_param_named(enable_gvt, i915.enable_gvt, bool, 0400);
> MODULE_PARM_DESC(enable_gvt,
> diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
> index 34148cc8637c..ac02efce6e22 100644
> --- a/drivers/gpu/drm/i915/i915_params.h
> +++ b/drivers/gpu/drm/i915/i915_params.h
> @@ -66,7 +66,7 @@
> func(bool, verbose_state_checks); \
> func(bool, nuclear_pageflip); \
> func(bool, enable_dp_mst); \
> - func(bool, enable_dpcd_backlight); \
> + func(int, enable_dpcd_backlight); \
> func(bool, enable_gvt)
>
> #define MEMBER(T, member) T member
> diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
> index c22712762957..e82f7cb9a7af 100644
> --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
> +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c
> @@ -167,21 +167,34 @@ 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[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_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;
> }
> return false;
> }
>
> +static bool
> +intel_dp_pwm_pin_display_control_capable(struct intel_connector *connector)
> +{
> + struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
> +
> + /* Check the eDP Display control capabilities registers to determine if
> + * the panel can support backlight control via BL_PWM_DIM eDP pin
> + */
> + return intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP;
This is not right. The bits in DPCD 0x702 don't mean anything if
DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP in 0x701 is not set.
-DK
> +}
> +
> int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
> {
> struct intel_panel *panel = &intel_connector->panel;
>
> - if (!i915.enable_dpcd_backlight)
> + if (i915.enable_dpcd_backlight == -1)
> + return -ENODEV;
> +
> + if (i915.enable_dpcd_backlight == 0 &&
> + intel_dp_pwm_pin_display_control_capable(intel_connector))
> return -ENODEV;
>
> if (!intel_dp_aux_display_control_capable(intel_connector))
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-05-11 0:50 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 23:40 [PATCH v6 0/9] Enhancement to intel_dp_aux_backlight driver Puthikorn Voravootivat
2017-05-09 23:40 ` [PATCH v6 1/9] drm/i915: Fix cap check for " Puthikorn Voravootivat
2017-05-11 0:14 ` Pandiyan, Dhinakaran
2017-05-09 23:40 ` [PATCH v6 2/9] drm/i915: Correctly enable backlight brightness adjustment via DPCD Puthikorn Voravootivat
2017-05-09 23:40 ` [PATCH v6 3/9] drm/i915: Drop AUX backlight enable check for backlight control Puthikorn Voravootivat
2017-05-11 0:39 ` Pandiyan, Dhinakaran
2017-05-11 21:01 ` Puthikorn Voravootivat
2017-05-09 23:40 ` [PATCH v6 4/9] drm/i915: Allow choosing how to adjust brightness if both supported Puthikorn Voravootivat
2017-05-11 0:50 ` Pandiyan, Dhinakaran [this message]
2017-05-09 23:40 ` [PATCH v6 5/9] drm/i915: Set backlight mode before enable backlight Puthikorn Voravootivat
2017-05-09 23:40 ` [PATCH v6 6/9] drm/i915: Support dynamic backlight via DPCD register Puthikorn Voravootivat
2017-05-11 5:45 ` Pandiyan, Dhinakaran
2017-05-09 23:40 ` [PATCH v6 7/9] drm/i915: Restore brightness level in aux backlight driver Puthikorn Voravootivat
2017-05-09 23:40 ` [PATCH v6 8/9] drm: Add definition for eDP backlight frequency Puthikorn Voravootivat
2017-05-11 1:09 ` Pandiyan, Dhinakaran
2017-05-09 23:40 ` [PATCH v6 9/9] drm/i915: Set PWM divider to match desired frequency in vbt Puthikorn Voravootivat
2017-05-10 7:45 ` ✗ Fi.CI.BAT: failure for Enhancement to intel_dp_aux_backlight driver (rev5) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2017-05-05 17:46 [PATCH v6 4/9] drm/i915: Allow choosing how to adjust brightness if both supported Puthikorn Voravootivat
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=1494465014.14696.40.camel@dk-H97M-D3H \
--to=dhinakaran.pandiyan@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox