All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "drm/i915: skip modeset if compatible for everyone."
@ 2015-11-19  8:26 Jani Nikula
  2015-11-19  9:05 ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2015-11-19  8:26 UTC (permalink / raw)
  To: intel-gfx; +Cc: Olof Johansson, Daniel Vetter, jani.nikula

This reverts

commit 6764e9f8724f1231b4deac53b9a82286ac0830e7
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date:   Thu Aug 27 15:44:06 2015 +0200

    drm/i915: skip modeset if compatible for everyone.

Bring back the i915.fastboot module parameter, disabled by default, due
to backlight regression on Chromebook Pixel 2015.

Apparently the firmware of the Chromebook in question enables the panel
but disables backlight to avoid a brief garbage scanout upon loading the
kernel/module. With fastboot, we leave the backlight untouched, in this
case disabled. The user would have to do a modeset (i.e. not just crank
up the brightness) to enable the backlight.

There is no clean fix readily available, so get back to the drawing
board by reverting.

[N.B. The reference below is for when the thread was included on public
lists, and some of the context had already been dropped by then.]

Reported-and-tested-by: Olof Johansson <olof@lixom.net>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
References: http://marc.info/?i=CAKMK7uES7xk05ki92oeX6gmvZWAh9f2vL7yz=6T+fGK9J3X7cQ@mail.gmail.com
Fixes: 6764e9f8724f ("drm/i915: skip modeset if compatible for everyone.")
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      | 1 +
 drivers/gpu/drm/i915/i915_params.c   | 5 +++++
 drivers/gpu/drm/i915/intel_display.c | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 6db4e76dc7eb..a47e0f4fab56 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2656,6 +2656,7 @@ struct i915_params {
 	int enable_cmd_parser;
 	/* leave bools at the end to not create holes */
 	bool enable_hangcheck;
+	bool fastboot;
 	bool prefault_disable;
 	bool load_detect_test;
 	bool reset;
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 0f5af02e90e9..835d6099c769 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -41,6 +41,7 @@ struct i915_params i915 __read_mostly = {
 	.preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
 	.disable_power_well = -1,
 	.enable_ips = 1,
+	.fastboot = 0,
 	.prefault_disable = 0,
 	.load_detect_test = 0,
 	.reset = true,
@@ -139,6 +140,10 @@ MODULE_PARM_DESC(disable_power_well,
 module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
 MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
 
+module_param_named(fastboot, i915.fastboot, bool, 0600);
+MODULE_PARM_DESC(fastboot,
+	"Try to skip unnecessary mode sets at boot time (default: false)");
+
 module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
 MODULE_PARM_DESC(prefault_disable,
 	"Disable page prefaulting for pread/pwrite/reloc (default:false). "
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 9a1c1d48a7d8..46015af47c20 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13236,7 +13236,8 @@ static int intel_atomic_check(struct drm_device *dev,
 		if (ret)
 			return ret;
 
-		if (intel_pipe_config_compare(state->dev,
+		if (i915.fastboot &&
+		    intel_pipe_config_compare(state->dev,
 					to_intel_crtc_state(crtc->state),
 					pipe_config, true)) {
 			crtc_state->mode_changed = false;
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "drm/i915: skip modeset if compatible for everyone."
  2015-11-19  8:26 [PATCH] Revert "drm/i915: skip modeset if compatible for everyone." Jani Nikula
@ 2015-11-19  9:05 ` Jani Nikula
  2015-12-08  8:10   ` Maarten Lankhorst
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2015-11-19  9:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: Olof Johansson, Daniel Vetter

On Thu, 19 Nov 2015, Jani Nikula <jani.nikula@intel.com> wrote:
> This reverts
>
> commit 6764e9f8724f1231b4deac53b9a82286ac0830e7
> Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Date:   Thu Aug 27 15:44:06 2015 +0200
>
>     drm/i915: skip modeset if compatible for everyone.
>
> Bring back the i915.fastboot module parameter, disabled by default, due
> to backlight regression on Chromebook Pixel 2015.
>
> Apparently the firmware of the Chromebook in question enables the panel
> but disables backlight to avoid a brief garbage scanout upon loading the
> kernel/module. With fastboot, we leave the backlight untouched, in this
> case disabled. The user would have to do a modeset (i.e. not just crank
> up the brightness) to enable the backlight.
>
> There is no clean fix readily available, so get back to the drawing
> board by reverting.
>
> [N.B. The reference below is for when the thread was included on public
> lists, and some of the context had already been dropped by then.]
>
> Reported-and-tested-by: Olof Johansson <olof@lixom.net>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> References: http://marc.info/?i=CAKMK7uES7xk05ki92oeX6gmvZWAh9f2vL7yz=6T+fGK9J3X7cQ@mail.gmail.com
> Fixes: 6764e9f8724f ("drm/i915: skip modeset if compatible for everyone.")
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Pushed to drm-intel-fixes with IRC acks from Daniel and Maarten (*). I
took the liberty of adding Tested-by from Olof, as he reported reverting
the bad commit fixes the issue for him, and it's a clean revert.

BR,
Jani.


(*) In truth Maarten said "sigh", I presumed short for Sighed-off-by,
which I took to be close enough to Acked-by.


> ---
>  drivers/gpu/drm/i915/i915_drv.h      | 1 +
>  drivers/gpu/drm/i915/i915_params.c   | 5 +++++
>  drivers/gpu/drm/i915/intel_display.c | 3 ++-
>  3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 6db4e76dc7eb..a47e0f4fab56 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2656,6 +2656,7 @@ struct i915_params {
>  	int enable_cmd_parser;
>  	/* leave bools at the end to not create holes */
>  	bool enable_hangcheck;
> +	bool fastboot;
>  	bool prefault_disable;
>  	bool load_detect_test;
>  	bool reset;
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index 0f5af02e90e9..835d6099c769 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -41,6 +41,7 @@ struct i915_params i915 __read_mostly = {
>  	.preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
>  	.disable_power_well = -1,
>  	.enable_ips = 1,
> +	.fastboot = 0,
>  	.prefault_disable = 0,
>  	.load_detect_test = 0,
>  	.reset = true,
> @@ -139,6 +140,10 @@ MODULE_PARM_DESC(disable_power_well,
>  module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
>  MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
>  
> +module_param_named(fastboot, i915.fastboot, bool, 0600);
> +MODULE_PARM_DESC(fastboot,
> +	"Try to skip unnecessary mode sets at boot time (default: false)");
> +
>  module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
>  MODULE_PARM_DESC(prefault_disable,
>  	"Disable page prefaulting for pread/pwrite/reloc (default:false). "
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9a1c1d48a7d8..46015af47c20 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13236,7 +13236,8 @@ static int intel_atomic_check(struct drm_device *dev,
>  		if (ret)
>  			return ret;
>  
> -		if (intel_pipe_config_compare(state->dev,
> +		if (i915.fastboot &&
> +		    intel_pipe_config_compare(state->dev,
>  					to_intel_crtc_state(crtc->state),
>  					pipe_config, true)) {
>  			crtc_state->mode_changed = false;

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "drm/i915: skip modeset if compatible for everyone."
  2015-11-19  9:05 ` Jani Nikula
@ 2015-12-08  8:10   ` Maarten Lankhorst
  2015-12-10 17:36     ` [PATCH] drm/i915/backlight: handle enabled but zero duty cycle at module load Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Maarten Lankhorst @ 2015-12-08  8:10 UTC (permalink / raw)
  To: Jani Nikula, intel-gfx; +Cc: Olof Johansson, Daniel Vetter

Op 19-11-15 om 10:05 schreef Jani Nikula:
> On Thu, 19 Nov 2015, Jani Nikula <jani.nikula@intel.com> wrote:
>> This reverts
>>
>> commit 6764e9f8724f1231b4deac53b9a82286ac0830e7
>> Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Date:   Thu Aug 27 15:44:06 2015 +0200
>>
>>     drm/i915: skip modeset if compatible for everyone.
>>
>> Bring back the i915.fastboot module parameter, disabled by default, due
>> to backlight regression on Chromebook Pixel 2015.
>>
>> Apparently the firmware of the Chromebook in question enables the panel
>> but disables backlight to avoid a brief garbage scanout upon loading the
>> kernel/module. With fastboot, we leave the backlight untouched, in this
>> case disabled. The user would have to do a modeset (i.e. not just crank
>> up the brightness) to enable the backlight.
>>
>> There is no clean fix readily available, so get back to the drawing
>> board by reverting.
>>
>> [N.B. The reference below is for when the thread was included on public
>> lists, and some of the context had already been dropped by then.]
>>
>> Reported-and-tested-by: Olof Johansson <olof@lixom.net>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> References: http://marc.info/?i=CAKMK7uES7xk05ki92oeX6gmvZWAh9f2vL7yz=6T+fGK9J3X7cQ@mail.gmail.com
>> Fixes: 6764e9f8724f ("drm/i915: skip modeset if compatible for everyone.")
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> Pushed to drm-intel-fixes with IRC acks from Daniel and Maarten (*). I
> took the liberty of adding Tested-by from Olof, as he reported reverting
> the bad commit fixes the issue for him, and it's a clean revert.
>
I want to enable fast modeset again in the future, but that depends on chromebook pixel being fixed.
How do you want to handle fixing up the backlight on this machine?
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] drm/i915/backlight: handle enabled but zero duty cycle at module load
  2015-12-08  8:10   ` Maarten Lankhorst
@ 2015-12-10 17:36     ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2015-12-10 17:36 UTC (permalink / raw)
  To: Maarten Lankhorst, Jani Nikula, intel-gfx; +Cc: Olof Johansson, Daniel Vetter

Don't consider enabled but zero duty cycle backlight disabled. Clamp
level between min and max for sanity.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Olof, does this work for you with i915.fastboot=1 (assuming that fails
on vanilla upstream)?
---
 drivers/gpu/drm/i915/intel_panel.c | 40 +++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 72183a057c79..e20eae76b8e8 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -1473,10 +1473,11 @@ static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unus
 	panel->backlight.min = get_backlight_min_vbt(connector);
 
 	val = lpt_get_backlight(connector);
-	panel->backlight.level = intel_panel_compute_brightness(connector, val);
+	val = intel_panel_compute_brightness(connector, val);
+	panel->backlight.level = clamp(val, panel->backlight.min,
+				       panel->backlight.max);
 
-	panel->backlight.enabled = (pch_ctl1 & BLM_PCH_PWM_ENABLE) &&
-		panel->backlight.level != 0;
+	panel->backlight.enabled = pch_ctl1 & BLM_PCH_PWM_ENABLE;
 
 	return 0;
 }
@@ -1503,11 +1504,13 @@ static int pch_setup_backlight(struct intel_connector *connector, enum pipe unus
 	panel->backlight.min = get_backlight_min_vbt(connector);
 
 	val = pch_get_backlight(connector);
-	panel->backlight.level = intel_panel_compute_brightness(connector, val);
+	val = intel_panel_compute_brightness(connector, val);
+	panel->backlight.level = clamp(val, panel->backlight.min,
+				       panel->backlight.max);
 
 	cpu_ctl2 = I915_READ(BLC_PWM_CPU_CTL2);
 	panel->backlight.enabled = (cpu_ctl2 & BLM_PWM_ENABLE) &&
-		(pch_ctl1 & BLM_PCH_PWM_ENABLE) && panel->backlight.level != 0;
+		(pch_ctl1 & BLM_PCH_PWM_ENABLE);
 
 	return 0;
 }
@@ -1543,9 +1546,11 @@ static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unu
 	panel->backlight.min = get_backlight_min_vbt(connector);
 
 	val = i9xx_get_backlight(connector);
-	panel->backlight.level = intel_panel_compute_brightness(connector, val);
+	val = intel_panel_compute_brightness(connector, val);
+	panel->backlight.level = clamp(val, panel->backlight.min,
+				       panel->backlight.max);
 
-	panel->backlight.enabled = panel->backlight.level != 0;
+	panel->backlight.enabled = val != 0;
 
 	return 0;
 }
@@ -1576,10 +1581,11 @@ static int i965_setup_backlight(struct intel_connector *connector, enum pipe unu
 	panel->backlight.min = get_backlight_min_vbt(connector);
 
 	val = i9xx_get_backlight(connector);
-	panel->backlight.level = intel_panel_compute_brightness(connector, val);
+	val = intel_panel_compute_brightness(connector, val);
+	panel->backlight.level = clamp(val, panel->backlight.min,
+				       panel->backlight.max);
 
-	panel->backlight.enabled = (ctl2 & BLM_PWM_ENABLE) &&
-		panel->backlight.level != 0;
+	panel->backlight.enabled = ctl2 & BLM_PWM_ENABLE;
 
 	return 0;
 }
@@ -1609,10 +1615,11 @@ static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe
 	panel->backlight.min = get_backlight_min_vbt(connector);
 
 	val = _vlv_get_backlight(dev, pipe);
-	panel->backlight.level = intel_panel_compute_brightness(connector, val);
+	val = intel_panel_compute_brightness(connector, val);
+	panel->backlight.level = clamp(val, panel->backlight.min,
+				       panel->backlight.max);
 
-	panel->backlight.enabled = (ctl2 & BLM_PWM_ENABLE) &&
-		panel->backlight.level != 0;
+	panel->backlight.enabled = ctl2 & BLM_PWM_ENABLE;
 
 	return 0;
 }
@@ -1655,10 +1662,11 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
 		return -ENODEV;
 
 	val = bxt_get_backlight(connector);
-	panel->backlight.level = intel_panel_compute_brightness(connector, val);
+	val = intel_panel_compute_brightness(connector, val);
+	panel->backlight.level = clamp(val, panel->backlight.min,
+				       panel->backlight.max);
 
-	panel->backlight.enabled = (pwm_ctl & BXT_BLC_PWM_ENABLE) &&
-		panel->backlight.level != 0;
+	panel->backlight.enabled = pwm_ctl & BXT_BLC_PWM_ENABLE;
 
 	return 0;
 }
-- 
2.1.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-10 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-19  8:26 [PATCH] Revert "drm/i915: skip modeset if compatible for everyone." Jani Nikula
2015-11-19  9:05 ` Jani Nikula
2015-12-08  8:10   ` Maarten Lankhorst
2015-12-10 17:36     ` [PATCH] drm/i915/backlight: handle enabled but zero duty cycle at module load Jani Nikula

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.