[Intel-gfx] [Update][PATCH 0/3] Fix backlight issues on some Windows 8 systems
Jani Nikula
jani.nikula at linux.intel.com
Fri Jul 26 15:24:57 CEST 2013
[distribution massively reduced]
On Sat, 20 Jul 2013, Felipe Contreras <felipe.contreras at gmail.com> wrote:
> I tried this patch series and it's as I expected, it's the same as
> acpi_backlight=vendor, and the intel backlight driver doesn't work
> correctly in this machine. If you are actually serious about the
> mantra of "no user-space regressions", then for this machine at least,
> you need to use the ACPI backlight with Windows8 OSI disabled, until
> the intel backlight driver is fixed. My patch does that:
>
> http://article.gmane.org/gmane.linux.acpi.devel/60969
Hi Felipe, would you mind trying the following patch on top of -rc2,
without your quirk patch? Up front, I'm not sure what all your failure
modes are, I'm not claiming this fixes them, and frankly, it didn't do
anything on a machine I tried... I just have this hunch it might help
with the ACPI hotkeys on some BIOSes. Maybe you're the lucky one! :)
BR,
Jani.
>From eb1493a7551dafb4bac3d65e4ed3ecd2e46f7f67 Mon Sep 17 00:00:00 2001
From: Jani Nikula <jani.nikula at intel.com>
Date: Fri, 7 Dec 2012 15:32:45 +0200
Subject: [PATCH] drm/i915: set the BIOS current backlight reference level
Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
Cc: Jani Nikula <jani.nikula at intel.com>
This should keep BIOS brightness keys and i915 backlight device better in
sync.
Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 3 +++
drivers/gpu/drm/i915/intel_opregion.c | 20 +++++++++++++++++++-
drivers/gpu/drm/i915/intel_panel.c | 3 +++
3 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 82ea281..5a1cfa3 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2059,10 +2059,13 @@ extern int intel_opregion_setup(struct drm_device *dev);
extern void intel_opregion_init(struct drm_device *dev);
extern void intel_opregion_fini(struct drm_device *dev);
extern void intel_opregion_asle_intr(struct drm_device *dev);
+extern void intel_opregion_asle_set_cblv(struct drm_device *dev, u32 level, u32 max);
#else
static inline void intel_opregion_init(struct drm_device *dev) { return; }
static inline void intel_opregion_fini(struct drm_device *dev) { return; }
static inline void intel_opregion_asle_intr(struct drm_device *dev) { return; }
+}
+static inline void intel_opregion_asle_set_cblv(struct drm_device *dev, u32 level, u32 max) { return; }
#endif
/* intel_acpi.c */
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index cfb8fb6..00fce49 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -158,6 +158,25 @@ struct opregion_asle {
#define ACPI_LVDS_OUTPUT (4<<8)
#ifdef CONFIG_ACPI
+
+/* set backlight brightness reference to level in range [0..max] */
+void intel_opregion_asle_set_cblv(struct drm_device *dev, u32 level, u32 max)
+{
+ struct drm_i915_private *dev_priv = dev->dev_private;
+ struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
+
+ if (!asle)
+ return;
+
+ if (level > max)
+ level = max;
+
+ /* scale to 0...100 per opregion spec */
+ level = level * 100 / max;
+
+ iowrite32(level | ASLE_CBLV_VALID, &asle->cblv);
+}
+
static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
{
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -173,7 +192,6 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
return ASLE_BACKLIGHT_FAILED;
intel_panel_set_backlight(dev, bclp, 255);
- iowrite32((bclp*0x64)/0xff | ASLE_CBLV_VALID, &asle->cblv);
return 0;
}
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 67e2c1f..a497e20 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -497,6 +497,9 @@ void intel_panel_set_backlight(struct drm_device *dev, u32 level, u32 max)
goto out;
}
+ /* set brightness reference value for bios hotkeys */
+ intel_opregion_asle_set_cblv(dev, level, max);
+
/* scale to hardware */
level = level * freq / max;
--
1.7.9.5
--
Jani Nikula, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list