* FAILED: patch "[PATCH] drm/i915: Add support for panels with VESA backlights with" failed to apply to 5.15-stable tree
@ 2021-12-05 12:31 gregkh
2021-12-07 23:23 ` Lyude Paul
0 siblings, 1 reply; 5+ messages in thread
From: gregkh @ 2021-12-05 12:31 UTC (permalink / raw)
To: lyude, rodrigo.vivi, stable, ville.syrjala; +Cc: stable
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 61e29a0956bdb09eac8aca7d9add9f902baff08b Mon Sep 17 00:00:00 2001
From: Lyude Paul <lyude@redhat.com>
Date: Fri, 5 Nov 2021 14:33:38 -0400
Subject: [PATCH] drm/i915: Add support for panels with VESA backlights with
PWM enable/disable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This simply adds proper support for panel backlights that can be controlled
via VESA's backlight control protocol, but which also require that we
enable and disable the backlight via PWM instead of via the DPCD interface.
We also enable this by default, in order to fix some people's backlights
that were broken by not having this enabled.
For reference, backlights that require this and use VESA's backlight
interface tend to be laptops with hybrid GPUs, but this very well may
change in the future.
v4:
* Make sure that we call intel_backlight_level_to_pwm() in
intel_dp_aux_vesa_enable_backlight() - vsyrjala
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://gitlab.freedesktop.org/drm/intel/-/issues/3680
Fixes: fe7d52bccab6 ("drm/i915/dp: Don't use DPCD backlights that need PWM enable/disable")
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.12+
Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-2-lyude@redhat.com
(cherry picked from commit 04f0d6cc62cc1eaf9242c081520c024a17ba86a3)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index 569d17b4d00f..f05b71c01b8e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -293,6 +293,13 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state,
struct intel_panel *panel = &connector->panel;
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
+ if (!panel->backlight.edp.vesa.info.aux_enable) {
+ u32 pwm_level = intel_backlight_invert_pwm_level(connector,
+ panel->backlight.pwm_level_max);
+
+ panel->backlight.pwm_funcs->enable(crtc_state, conn_state, pwm_level);
+ }
+
drm_edp_backlight_enable(&intel_dp->aux, &panel->backlight.edp.vesa.info, level);
}
@@ -304,6 +311,10 @@ static void intel_dp_aux_vesa_disable_backlight(const struct drm_connector_state
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
drm_edp_backlight_disable(&intel_dp->aux, &panel->backlight.edp.vesa.info);
+
+ if (!panel->backlight.edp.vesa.info.aux_enable)
+ panel->backlight.pwm_funcs->disable(old_conn_state,
+ intel_backlight_invert_pwm_level(connector, 0));
}
static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector, enum pipe pipe)
@@ -321,6 +332,15 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
if (ret < 0)
return ret;
+ if (!panel->backlight.edp.vesa.info.aux_enable) {
+ ret = panel->backlight.pwm_funcs->setup(connector, pipe);
+ if (ret < 0) {
+ drm_err(&i915->drm,
+ "Failed to setup PWM backlight controls for eDP backlight: %d\n",
+ ret);
+ return ret;
+ }
+ }
panel->backlight.max = panel->backlight.edp.vesa.info.max;
panel->backlight.min = 0;
if (current_mode == DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD) {
@@ -340,12 +360,7 @@ intel_dp_aux_supports_vesa_backlight(struct intel_connector *connector)
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
- /* TODO: We currently only support AUX only backlight configurations, not backlights which
- * require a mix of PWM and AUX controls to work. In the mean time, these machines typically
- * work just fine using normal PWM controls anyway.
- */
- if ((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
- drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
+ if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
drm_dbg_kms(&i915->drm, "AUX Backlight Control Supported!\n");
return true;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: FAILED: patch "[PATCH] drm/i915: Add support for panels with VESA backlights with" failed to apply to 5.15-stable tree
2021-12-05 12:31 gregkh
@ 2021-12-07 23:23 ` Lyude Paul
2021-12-08 12:57 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Lyude Paul @ 2021-12-07 23:23 UTC (permalink / raw)
To: gregkh, rodrigo.vivi, stable, ville.syrjala
Huh, well this is strange. I'm assuming that you send these emails out as part
of an automated script that tries applying patches and fails, but I think
something may have gone wrong here as I just tried cherry-picking
04f0d6cc62cc1eaf9242c081520c024a17ba86a3 onto v5.15.6, and it applied without
needing any manual conflict resolution. Any idea what might be going on?
On Sun, 2021-12-05 at 13:31 +0100, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 5.15-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 61e29a0956bdb09eac8aca7d9add9f902baff08b Mon Sep 17 00:00:00 2001
> From: Lyude Paul <lyude@redhat.com>
> Date: Fri, 5 Nov 2021 14:33:38 -0400
> Subject: [PATCH] drm/i915: Add support for panels with VESA backlights with
> PWM enable/disable
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> This simply adds proper support for panel backlights that can be controlled
> via VESA's backlight control protocol, but which also require that we
> enable and disable the backlight via PWM instead of via the DPCD interface.
> We also enable this by default, in order to fix some people's backlights
> that were broken by not having this enabled.
>
> For reference, backlights that require this and use VESA's backlight
> interface tend to be laptops with hybrid GPUs, but this very well may
> change in the future.
>
> v4:
> * Make sure that we call intel_backlight_level_to_pwm() in
> intel_dp_aux_vesa_enable_backlight() - vsyrjala
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Link: https://gitlab.freedesktop.org/drm/intel/-/issues/3680
> Fixes: fe7d52bccab6 ("drm/i915/dp: Don't use DPCD backlights that need PWM
> enable/disable")
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: <stable@vger.kernel.org> # v5.12+
> Link:
> https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-2-lyude@redhat.com
> (cherry picked from commit 04f0d6cc62cc1eaf9242c081520c024a17ba86a3)
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> index 569d17b4d00f..f05b71c01b8e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> @@ -293,6 +293,13 @@ intel_dp_aux_vesa_enable_backlight(const struct
> intel_crtc_state *crtc_state,
> struct intel_panel *panel = &connector->panel;
> struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
>
> + if (!panel->backlight.edp.vesa.info.aux_enable) {
> + u32 pwm_level = intel_backlight_invert_pwm_level(connector,
> + panel-
> >backlight.pwm_level_max);
> +
> + panel->backlight.pwm_funcs->enable(crtc_state, conn_state,
> pwm_level);
> + }
> +
> drm_edp_backlight_enable(&intel_dp->aux, &panel-
> >backlight.edp.vesa.info, level);
> }
>
> @@ -304,6 +311,10 @@ static void intel_dp_aux_vesa_disable_backlight(const
> struct drm_connector_state
> struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
>
> drm_edp_backlight_disable(&intel_dp->aux, &panel-
> >backlight.edp.vesa.info);
> +
> + if (!panel->backlight.edp.vesa.info.aux_enable)
> + panel->backlight.pwm_funcs->disable(old_conn_state,
> +
> intel_backlight_invert_pwm_level(connector, 0));
> }
>
> static int intel_dp_aux_vesa_setup_backlight(struct intel_connector
> *connector, enum pipe pipe)
> @@ -321,6 +332,15 @@ static int intel_dp_aux_vesa_setup_backlight(struct
> intel_connector *connector,
> if (ret < 0)
> return ret;
>
> + if (!panel->backlight.edp.vesa.info.aux_enable) {
> + ret = panel->backlight.pwm_funcs->setup(connector, pipe);
> + if (ret < 0) {
> + drm_err(&i915->drm,
> + "Failed to setup PWM backlight controls for
> eDP backlight: %d\n",
> + ret);
> + return ret;
> + }
> + }
> panel->backlight.max = panel->backlight.edp.vesa.info.max;
> panel->backlight.min = 0;
> if (current_mode == DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD) {
> @@ -340,12 +360,7 @@ intel_dp_aux_supports_vesa_backlight(struct
> intel_connector *connector)
> struct intel_dp *intel_dp = intel_attached_dp(connector);
> struct drm_i915_private *i915 = dp_to_i915(intel_dp);
>
> - /* TODO: We currently only support AUX only backlight
> configurations, not backlights which
> - * require a mix of PWM and AUX controls to work. In the mean time,
> these machines typically
> - * work just fine using normal PWM controls anyway.
> - */
> - if ((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
> - drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
> + if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
> drm_dbg_kms(&i915->drm, "AUX Backlight Control
> Supported!\n");
> return true;
> }
>
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: FAILED: patch "[PATCH] drm/i915: Add support for panels with VESA backlights with" failed to apply to 5.15-stable tree
2021-12-07 23:23 ` Lyude Paul
@ 2021-12-08 12:57 ` Greg KH
2021-12-08 17:45 ` Lyude Paul
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2021-12-08 12:57 UTC (permalink / raw)
To: Lyude Paul; +Cc: rodrigo.vivi, stable, ville.syrjala
On Tue, Dec 07, 2021 at 06:23:49PM -0500, Lyude Paul wrote:
> Huh, well this is strange. I'm assuming that you send these emails out as part
> of an automated script that tries applying patches and fails, but I think
> something may have gone wrong here as I just tried cherry-picking
> 04f0d6cc62cc1eaf9242c081520c024a17ba86a3 onto v5.15.6, and it applied without
> needing any manual conflict resolution. Any idea what might be going on?
You mean 61e29a0956bd ("drm/i915: Add support for panels with VESA
backlights with PWM enable/disable"), right?
Anyway, yes, it fails to build:
CC [M] drivers/gpu/drm/i915/display/intel_dp_aux_backlight.o
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c: In function ‘intel_dp_aux_vesa_enable_backlight’:
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c:302:33: error: implicit declaration of function ‘intel_backlight_invert_pwm_level’; did you mean ‘intel_panel_invert_pwm_level’? [-Werror=implicit-function-declaration]
302 | u32 pwm_level = intel_backlight_invert_pwm_level(connector,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| intel_panel_invert_pwm_level
cc1: all warnings being treated as errors
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: FAILED: patch "[PATCH] drm/i915: Add support for panels with VESA backlights with" failed to apply to 5.15-stable tree
2021-12-08 12:57 ` Greg KH
@ 2021-12-08 17:45 ` Lyude Paul
0 siblings, 0 replies; 5+ messages in thread
From: Lyude Paul @ 2021-12-08 17:45 UTC (permalink / raw)
To: Greg KH; +Cc: rodrigo.vivi, stable, ville.syrjala
On Wed, 2021-12-08 at 13:57 +0100, Greg KH wrote:
> On Tue, Dec 07, 2021 at 06:23:49PM -0500, Lyude Paul wrote:
> > Huh, well this is strange. I'm assuming that you send these emails out as
> > part
> > of an automated script that tries applying patches and fails, but I think
> > something may have gone wrong here as I just tried cherry-picking
> > 04f0d6cc62cc1eaf9242c081520c024a17ba86a3 onto v5.15.6, and it applied
> > without
> > needing any manual conflict resolution. Any idea what might be going on?
>
> You mean 61e29a0956bd ("drm/i915: Add support for panels with VESA
> backlights with PWM enable/disable"), right?
>
> Anyway, yes, it fails to build:
>
> CC [M] drivers/gpu/drm/i915/display/intel_dp_aux_backlight.o
> drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c: In function
> ‘intel_dp_aux_vesa_enable_backlight’:
> drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c:302:33: error:
> implicit declaration of function ‘intel_backlight_invert_pwm_level’; did you
> mean ‘intel_panel_invert_pwm_level’? [-Werror=implicit-function-declaration]
> 302 | u32 pwm_level =
> intel_backlight_invert_pwm_level(connector,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | intel_panel_invert_pwm_level
> cc1: all warnings being treated as errors
a-ha, totally forgot to build test it :P. Will fixup and send you a new
version in a bit, sorry for the noise!
>
> thanks,
>
> greg k-h
>
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
* FAILED: patch "[PATCH] drm/i915: Add support for panels with VESA backlights with" failed to apply to 5.15-stable tree
@ 2022-01-23 16:50 gregkh
0 siblings, 0 replies; 5+ messages in thread
From: gregkh @ 2022-01-23 16:50 UTC (permalink / raw)
To: lyude, stable, ville.syrjala; +Cc: stable
The patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 04f0d6cc62cc1eaf9242c081520c024a17ba86a3 Mon Sep 17 00:00:00 2001
From: Lyude Paul <lyude@redhat.com>
Date: Fri, 5 Nov 2021 14:33:38 -0400
Subject: [PATCH] drm/i915: Add support for panels with VESA backlights with
PWM enable/disable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This simply adds proper support for panel backlights that can be controlled
via VESA's backlight control protocol, but which also require that we
enable and disable the backlight via PWM instead of via the DPCD interface.
We also enable this by default, in order to fix some people's backlights
that were broken by not having this enabled.
For reference, backlights that require this and use VESA's backlight
interface tend to be laptops with hybrid GPUs, but this very well may
change in the future.
v4:
* Make sure that we call intel_backlight_level_to_pwm() in
intel_dp_aux_vesa_enable_backlight() - vsyrjala
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://gitlab.freedesktop.org/drm/intel/-/issues/3680
Fixes: fe7d52bccab6 ("drm/i915/dp: Don't use DPCD backlights that need PWM enable/disable")
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.12+
Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-2-lyude@redhat.com
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index 569d17b4d00f..f05b71c01b8e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -293,6 +293,13 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state,
struct intel_panel *panel = &connector->panel;
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
+ if (!panel->backlight.edp.vesa.info.aux_enable) {
+ u32 pwm_level = intel_backlight_invert_pwm_level(connector,
+ panel->backlight.pwm_level_max);
+
+ panel->backlight.pwm_funcs->enable(crtc_state, conn_state, pwm_level);
+ }
+
drm_edp_backlight_enable(&intel_dp->aux, &panel->backlight.edp.vesa.info, level);
}
@@ -304,6 +311,10 @@ static void intel_dp_aux_vesa_disable_backlight(const struct drm_connector_state
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
drm_edp_backlight_disable(&intel_dp->aux, &panel->backlight.edp.vesa.info);
+
+ if (!panel->backlight.edp.vesa.info.aux_enable)
+ panel->backlight.pwm_funcs->disable(old_conn_state,
+ intel_backlight_invert_pwm_level(connector, 0));
}
static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector, enum pipe pipe)
@@ -321,6 +332,15 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
if (ret < 0)
return ret;
+ if (!panel->backlight.edp.vesa.info.aux_enable) {
+ ret = panel->backlight.pwm_funcs->setup(connector, pipe);
+ if (ret < 0) {
+ drm_err(&i915->drm,
+ "Failed to setup PWM backlight controls for eDP backlight: %d\n",
+ ret);
+ return ret;
+ }
+ }
panel->backlight.max = panel->backlight.edp.vesa.info.max;
panel->backlight.min = 0;
if (current_mode == DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD) {
@@ -340,12 +360,7 @@ intel_dp_aux_supports_vesa_backlight(struct intel_connector *connector)
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
- /* TODO: We currently only support AUX only backlight configurations, not backlights which
- * require a mix of PWM and AUX controls to work. In the mean time, these machines typically
- * work just fine using normal PWM controls anyway.
- */
- if ((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
- drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
+ if (drm_edp_backlight_supported(intel_dp->edp_dpcd)) {
drm_dbg_kms(&i915->drm, "AUX Backlight Control Supported!\n");
return true;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-01-23 16:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-23 16:50 FAILED: patch "[PATCH] drm/i915: Add support for panels with VESA backlights with" failed to apply to 5.15-stable tree gregkh
-- strict thread matches above, loose matches on Subject: below --
2021-12-05 12:31 gregkh
2021-12-07 23:23 ` Lyude Paul
2021-12-08 12:57 ` Greg KH
2021-12-08 17:45 ` Lyude Paul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).