* [PATCH 0/3] drm/i915: opregion cleanup
@ 2013-04-12 12:20 Jani Nikula
2013-04-12 12:20 ` [PATCH 1/3] drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB Jani Nikula
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Jani Nikula @ 2013-04-12 12:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
There's still stuff to do on opregion cleanup, but here are some potentially
risky and/or controversial ones...
Jani Nikula (3):
drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB
drm/i915/opregion: don't pretend we did something when we didn't
drm/i915: drop code duplication in favor of asle interrupt handler
drivers/gpu/drm/i915/i915_drv.h | 1 -
drivers/gpu/drm/i915/i915_irq.c | 4 +--
drivers/gpu/drm/i915/intel_opregion.c | 60 ++++-----------------------------
3 files changed, 9 insertions(+), 56 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/3] drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB
2013-04-12 12:20 [PATCH 0/3] drm/i915: opregion cleanup Jani Nikula
@ 2013-04-12 12:20 ` Jani Nikula
2013-04-12 12:20 ` [PATCH 2/3] drm/i915/opregion: don't pretend we did something when we didn't Jani Nikula
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2013-04-12 12:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
In theory, this should prevent the BIOS from requesting them from us, and
this should be the right thing.
In practice, this is not always the case, and might surprise the BIOS.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_opregion.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 4d33874..a622fd0 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -282,9 +282,7 @@ void intel_opregion_enable_asle(struct drm_device *dev)
if (IS_MOBILE(dev))
intel_enable_asle(dev);
- iowrite32(ASLE_ALS_EN | ASLE_BLC_EN | ASLE_PFIT_EN |
- ASLE_PFMB_EN,
- &asle->tche);
+ iowrite32(ASLE_BLC_EN, &asle->tche);
iowrite32(1, &asle->ardy);
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/3] drm/i915/opregion: don't pretend we did something when we didn't
2013-04-12 12:20 [PATCH 0/3] drm/i915: opregion cleanup Jani Nikula
2013-04-12 12:20 ` [PATCH 1/3] drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB Jani Nikula
@ 2013-04-12 12:20 ` Jani Nikula
2013-04-12 12:20 ` [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler Jani Nikula
2013-04-24 18:24 ` [PATCH 0/3] drm/i915: opregion cleanup Damien Lespiau
3 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2013-04-12 12:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
In theory, the BIOS should not even request these from us now that we
aren't claiming we support these, but when it does anyway, don't pretend it
succeeded. It should be the right thing to do, but might confuse the BIOS.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_opregion.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index a622fd0..c3a288e 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -174,29 +174,22 @@ static u32 asle_set_als_illum(struct drm_device *dev, u32 alsi)
{
/* alsi is the current ALS reading in lux. 0 indicates below sensor
range, 0xffff indicates above sensor range. 1-0xfffe are valid */
- return 0;
+ DRM_DEBUG_DRIVER("Illum is not supported\n");
+ return ASLE_ALS_ILLUM_FAILED;
}
static u32 asle_set_pwm_freq(struct drm_device *dev, u32 pfmb)
{
- struct drm_i915_private *dev_priv = dev->dev_private;
- if (pfmb & ASLE_PFMB_PWM_VALID) {
- u32 blc_pwm_ctl = I915_READ(BLC_PWM_CTL);
- u32 pwm = pfmb & ASLE_PFMB_PWM_MASK;
- blc_pwm_ctl &= BACKLIGHT_DUTY_CYCLE_MASK;
- pwm = pwm >> 9;
- /* FIXME - what do we do with the PWM? */
- }
- return 0;
+ DRM_DEBUG_DRIVER("PWM freq is not supported\n");
+ return ASLE_PWM_FREQ_FAILED;
}
static u32 asle_set_pfit(struct drm_device *dev, u32 pfit)
{
/* Panel fitting is currently controlled by the X code, so this is a
noop until modesetting support works fully */
- if (!(pfit & ASLE_PFIT_VALID))
- return ASLE_PFIT_FAILED;
- return 0;
+ DRM_DEBUG_DRIVER("Pfit is not supported\n");
+ return ASLE_PFIT_FAILED;
}
void intel_opregion_asle_intr(struct drm_device *dev)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler
2013-04-12 12:20 [PATCH 0/3] drm/i915: opregion cleanup Jani Nikula
2013-04-12 12:20 ` [PATCH 1/3] drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB Jani Nikula
2013-04-12 12:20 ` [PATCH 2/3] drm/i915/opregion: don't pretend we did something when we didn't Jani Nikula
@ 2013-04-12 12:20 ` Jani Nikula
2013-04-24 18:23 ` Damien Lespiau
2013-04-24 18:24 ` [PATCH 0/3] drm/i915: opregion cleanup Damien Lespiau
3 siblings, 1 reply; 10+ messages in thread
From: Jani Nikula @ 2013-04-12 12:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
With the previous work asle and gse interrupt handlers should now be
functionally the same. Drop the duplicated code.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 1 -
drivers/gpu/drm/i915/i915_irq.c | 4 ++--
drivers/gpu/drm/i915/intel_opregion.c | 37 ---------------------------------
3 files changed, 2 insertions(+), 40 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index b5a495a..aec9377 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1810,7 +1810,6 @@ 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_gse_intr(struct drm_device *dev);
extern void intel_opregion_enable_asle(struct drm_device *dev);
#else
static inline void intel_opregion_init(struct drm_device *dev) { return; }
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index e97bbb2..269f1a1 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -792,7 +792,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
dp_aux_irq_handler(dev);
if (de_iir & DE_GSE_IVB)
- intel_opregion_gse_intr(dev);
+ intel_opregion_asle_intr(dev);
for (i = 0; i < 3; i++) {
if (de_iir & (DE_PIPEA_VBLANK_IVB << (5 * i)))
@@ -886,7 +886,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
dp_aux_irq_handler(dev);
if (de_iir & DE_GSE)
- intel_opregion_gse_intr(dev);
+ intel_opregion_asle_intr(dev);
if (de_iir & DE_PIPEA_VBLANK)
drm_handle_vblank(dev, 0);
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index c3a288e..3e22cea 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -224,43 +224,6 @@ void intel_opregion_asle_intr(struct drm_device *dev)
iowrite32(asle_stat, &asle->aslc);
}
-void intel_opregion_gse_intr(struct drm_device *dev)
-{
- struct drm_i915_private *dev_priv = dev->dev_private;
- struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
- u32 asle_stat = 0;
- u32 asle_req;
-
- if (!asle)
- return;
-
- asle_req = ioread32(&asle->aslc) & ASLE_REQ_MSK;
-
- if (!asle_req) {
- DRM_DEBUG_DRIVER("non asle set request??\n");
- return;
- }
-
- if (asle_req & ASLE_SET_ALS_ILLUM) {
- DRM_DEBUG_DRIVER("Illum is not supported\n");
- asle_stat |= ASLE_ALS_ILLUM_FAILED;
- }
-
- if (asle_req & ASLE_SET_BACKLIGHT)
- asle_stat |= asle_set_backlight(dev, ioread32(&asle->bclp));
-
- if (asle_req & ASLE_SET_PFIT) {
- DRM_DEBUG_DRIVER("Pfit is not supported\n");
- asle_stat |= ASLE_PFIT_FAILED;
- }
-
- if (asle_req & ASLE_SET_PWM_FREQ) {
- DRM_DEBUG_DRIVER("PWM freq is not supported\n");
- asle_stat |= ASLE_PWM_FREQ_FAILED;
- }
-
- iowrite32(asle_stat, &asle->aslc);
-}
#define ASLE_ALS_EN (1<<0)
#define ASLE_BLC_EN (1<<1)
#define ASLE_PFIT_EN (1<<2)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler
2013-04-12 12:20 ` [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler Jani Nikula
@ 2013-04-24 18:23 ` Damien Lespiau
[not found] ` <39ef9d9d21a2211333ce011881e240304c3baec1.1366830005.git.jani.nikula@intel.com>
0 siblings, 1 reply; 10+ messages in thread
From: Damien Lespiau @ 2013-04-24 18:23 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Fri, Apr 12, 2013 at 03:20:58PM +0300, Jani Nikula wrote:
> With the previous work asle and gse interrupt handlers should now be
> functionally the same. Drop the duplicated code.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 1 -
> drivers/gpu/drm/i915/i915_irq.c | 4 ++--
> drivers/gpu/drm/i915/intel_opregion.c | 37 ---------------------------------
> 3 files changed, 2 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index b5a495a..aec9377 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1810,7 +1810,6 @@ 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_gse_intr(struct drm_device *dev);
> extern void intel_opregion_enable_asle(struct drm_device *dev);
> #else
> static inline void intel_opregion_init(struct drm_device *dev) { return; }
You also need to drop the intel_opregion_gse_intr() in the !CONFIG_ACPI
path.
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index e97bbb2..269f1a1 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -792,7 +792,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
> dp_aux_irq_handler(dev);
>
> if (de_iir & DE_GSE_IVB)
> - intel_opregion_gse_intr(dev);
> + intel_opregion_asle_intr(dev);
>
> for (i = 0; i < 3; i++) {
> if (de_iir & (DE_PIPEA_VBLANK_IVB << (5 * i)))
> @@ -886,7 +886,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
> dp_aux_irq_handler(dev);
>
> if (de_iir & DE_GSE)
> - intel_opregion_gse_intr(dev);
> + intel_opregion_asle_intr(dev);
>
> if (de_iir & DE_PIPEA_VBLANK)
> drm_handle_vblank(dev, 0);
> diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
> index c3a288e..3e22cea 100644
> --- a/drivers/gpu/drm/i915/intel_opregion.c
> +++ b/drivers/gpu/drm/i915/intel_opregion.c
> @@ -224,43 +224,6 @@ void intel_opregion_asle_intr(struct drm_device *dev)
> iowrite32(asle_stat, &asle->aslc);
> }
>
> -void intel_opregion_gse_intr(struct drm_device *dev)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
> - u32 asle_stat = 0;
> - u32 asle_req;
> -
> - if (!asle)
> - return;
> -
> - asle_req = ioread32(&asle->aslc) & ASLE_REQ_MSK;
> -
> - if (!asle_req) {
> - DRM_DEBUG_DRIVER("non asle set request??\n");
> - return;
> - }
> -
> - if (asle_req & ASLE_SET_ALS_ILLUM) {
> - DRM_DEBUG_DRIVER("Illum is not supported\n");
> - asle_stat |= ASLE_ALS_ILLUM_FAILED;
> - }
> -
> - if (asle_req & ASLE_SET_BACKLIGHT)
> - asle_stat |= asle_set_backlight(dev, ioread32(&asle->bclp));
> -
> - if (asle_req & ASLE_SET_PFIT) {
> - DRM_DEBUG_DRIVER("Pfit is not supported\n");
> - asle_stat |= ASLE_PFIT_FAILED;
> - }
> -
> - if (asle_req & ASLE_SET_PWM_FREQ) {
> - DRM_DEBUG_DRIVER("PWM freq is not supported\n");
> - asle_stat |= ASLE_PWM_FREQ_FAILED;
> - }
> -
> - iowrite32(asle_stat, &asle->aslc);
> -}
> #define ASLE_ALS_EN (1<<0)
> #define ASLE_BLC_EN (1<<1)
> #define ASLE_PFIT_EN (1<<2)
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3] drm/i915: opregion cleanup
2013-04-12 12:20 [PATCH 0/3] drm/i915: opregion cleanup Jani Nikula
` (2 preceding siblings ...)
2013-04-12 12:20 ` [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler Jani Nikula
@ 2013-04-24 18:24 ` Damien Lespiau
3 siblings, 0 replies; 10+ messages in thread
From: Damien Lespiau @ 2013-04-24 18:24 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Fri, Apr 12, 2013 at 03:20:55PM +0300, Jani Nikula wrote:
> There's still stuff to do on opregion cleanup, but here are some potentially
> risky and/or controversial ones...
With the small fix on patch 3, the whole series is:
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
This should trigger different code paths in the BIOS, but is legal and
what we should do, not supporting the ambient light sensor, the panel
fitter requests or the PWM freq and minimal brightness requests from the
firmware.
>
> Jani Nikula (3):
> drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB
> drm/i915/opregion: don't pretend we did something when we didn't
> drm/i915: drop code duplication in favor of asle interrupt handler
>
> drivers/gpu/drm/i915/i915_drv.h | 1 -
> drivers/gpu/drm/i915/i915_irq.c | 4 +--
> drivers/gpu/drm/i915/intel_opregion.c | 60 ++++-----------------------------
> 3 files changed, 9 insertions(+), 56 deletions(-)
>
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2 3/3] drm/i915: drop code duplication in favor of asle interrupt handler
[not found] ` <39ef9d9d21a2211333ce011881e240304c3baec1.1366830005.git.jani.nikula@intel.com>
@ 2013-04-24 19:18 ` Jani Nikula
2013-04-24 19:34 ` Jani Nikula
2013-04-25 13:09 ` Damien Lespiau
0 siblings, 2 replies; 10+ messages in thread
From: Jani Nikula @ 2013-04-24 19:18 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
With the previous work asle and gse interrupt handlers should now be
functionally the same. Drop the duplicated code.
v2: Drop intel_opregion_gse_intr() also in the !CONFIG_ACPI path. (Damien)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 2 --
drivers/gpu/drm/i915/i915_irq.c | 4 ++--
drivers/gpu/drm/i915/intel_opregion.c | 37 ---------------------------------
3 files changed, 2 insertions(+), 41 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 95a3cc3..b5f33ff 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1820,13 +1820,11 @@ 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_gse_intr(struct drm_device *dev);
extern void intel_opregion_enable_asle(struct drm_device *dev);
#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_gse_intr(struct drm_device *dev) { return; }
static inline void intel_opregion_enable_asle(struct drm_device *dev) { return; }
#endif
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 3cf646c..125b45a 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1205,7 +1205,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
dp_aux_irq_handler(dev);
if (de_iir & DE_GSE_IVB)
- intel_opregion_gse_intr(dev);
+ intel_opregion_asle_intr(dev);
for (i = 0; i < 3; i++) {
if (de_iir & (DE_PIPEA_VBLANK_IVB << (5 * i)))
@@ -1302,7 +1302,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
dp_aux_irq_handler(dev);
if (de_iir & DE_GSE)
- intel_opregion_gse_intr(dev);
+ intel_opregion_asle_intr(dev);
if (de_iir & DE_PIPEA_VBLANK)
drm_handle_vblank(dev, 0);
diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index c3a288e..3e22cea 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -224,43 +224,6 @@ void intel_opregion_asle_intr(struct drm_device *dev)
iowrite32(asle_stat, &asle->aslc);
}
-void intel_opregion_gse_intr(struct drm_device *dev)
-{
- struct drm_i915_private *dev_priv = dev->dev_private;
- struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
- u32 asle_stat = 0;
- u32 asle_req;
-
- if (!asle)
- return;
-
- asle_req = ioread32(&asle->aslc) & ASLE_REQ_MSK;
-
- if (!asle_req) {
- DRM_DEBUG_DRIVER("non asle set request??\n");
- return;
- }
-
- if (asle_req & ASLE_SET_ALS_ILLUM) {
- DRM_DEBUG_DRIVER("Illum is not supported\n");
- asle_stat |= ASLE_ALS_ILLUM_FAILED;
- }
-
- if (asle_req & ASLE_SET_BACKLIGHT)
- asle_stat |= asle_set_backlight(dev, ioread32(&asle->bclp));
-
- if (asle_req & ASLE_SET_PFIT) {
- DRM_DEBUG_DRIVER("Pfit is not supported\n");
- asle_stat |= ASLE_PFIT_FAILED;
- }
-
- if (asle_req & ASLE_SET_PWM_FREQ) {
- DRM_DEBUG_DRIVER("PWM freq is not supported\n");
- asle_stat |= ASLE_PWM_FREQ_FAILED;
- }
-
- iowrite32(asle_stat, &asle->aslc);
-}
#define ASLE_ALS_EN (1<<0)
#define ASLE_BLC_EN (1<<1)
#define ASLE_PFIT_EN (1<<2)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/3] drm/i915: drop code duplication in favor of asle interrupt handler
2013-04-24 19:18 ` [PATCH v2 " Jani Nikula
@ 2013-04-24 19:34 ` Jani Nikula
2013-04-25 13:09 ` Damien Lespiau
1 sibling, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2013-04-24 19:34 UTC (permalink / raw)
To: intel-gfx
This was supposed to be in-reply-to [1] but I screwed up.
Jani.
[1] http://mid.gmane.org/20130424182351.GB3171@strange.amr.corp.intel.com
On Wed, 24 Apr 2013, Jani Nikula <jani.nikula@intel.com> wrote:
> With the previous work asle and gse interrupt handlers should now be
> functionally the same. Drop the duplicated code.
>
> v2: Drop intel_opregion_gse_intr() also in the !CONFIG_ACPI path. (Damien)
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 2 --
> drivers/gpu/drm/i915/i915_irq.c | 4 ++--
> drivers/gpu/drm/i915/intel_opregion.c | 37 ---------------------------------
> 3 files changed, 2 insertions(+), 41 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 95a3cc3..b5f33ff 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1820,13 +1820,11 @@ 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_gse_intr(struct drm_device *dev);
> extern void intel_opregion_enable_asle(struct drm_device *dev);
> #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_gse_intr(struct drm_device *dev) { return; }
> static inline void intel_opregion_enable_asle(struct drm_device *dev) { return; }
> #endif
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 3cf646c..125b45a 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1205,7 +1205,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
> dp_aux_irq_handler(dev);
>
> if (de_iir & DE_GSE_IVB)
> - intel_opregion_gse_intr(dev);
> + intel_opregion_asle_intr(dev);
>
> for (i = 0; i < 3; i++) {
> if (de_iir & (DE_PIPEA_VBLANK_IVB << (5 * i)))
> @@ -1302,7 +1302,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
> dp_aux_irq_handler(dev);
>
> if (de_iir & DE_GSE)
> - intel_opregion_gse_intr(dev);
> + intel_opregion_asle_intr(dev);
>
> if (de_iir & DE_PIPEA_VBLANK)
> drm_handle_vblank(dev, 0);
> diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
> index c3a288e..3e22cea 100644
> --- a/drivers/gpu/drm/i915/intel_opregion.c
> +++ b/drivers/gpu/drm/i915/intel_opregion.c
> @@ -224,43 +224,6 @@ void intel_opregion_asle_intr(struct drm_device *dev)
> iowrite32(asle_stat, &asle->aslc);
> }
>
> -void intel_opregion_gse_intr(struct drm_device *dev)
> -{
> - struct drm_i915_private *dev_priv = dev->dev_private;
> - struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
> - u32 asle_stat = 0;
> - u32 asle_req;
> -
> - if (!asle)
> - return;
> -
> - asle_req = ioread32(&asle->aslc) & ASLE_REQ_MSK;
> -
> - if (!asle_req) {
> - DRM_DEBUG_DRIVER("non asle set request??\n");
> - return;
> - }
> -
> - if (asle_req & ASLE_SET_ALS_ILLUM) {
> - DRM_DEBUG_DRIVER("Illum is not supported\n");
> - asle_stat |= ASLE_ALS_ILLUM_FAILED;
> - }
> -
> - if (asle_req & ASLE_SET_BACKLIGHT)
> - asle_stat |= asle_set_backlight(dev, ioread32(&asle->bclp));
> -
> - if (asle_req & ASLE_SET_PFIT) {
> - DRM_DEBUG_DRIVER("Pfit is not supported\n");
> - asle_stat |= ASLE_PFIT_FAILED;
> - }
> -
> - if (asle_req & ASLE_SET_PWM_FREQ) {
> - DRM_DEBUG_DRIVER("PWM freq is not supported\n");
> - asle_stat |= ASLE_PWM_FREQ_FAILED;
> - }
> -
> - iowrite32(asle_stat, &asle->aslc);
> -}
> #define ASLE_ALS_EN (1<<0)
> #define ASLE_BLC_EN (1<<1)
> #define ASLE_PFIT_EN (1<<2)
> --
> 1.7.10.4
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/3] drm/i915: drop code duplication in favor of asle interrupt handler
2013-04-24 19:18 ` [PATCH v2 " Jani Nikula
2013-04-24 19:34 ` Jani Nikula
@ 2013-04-25 13:09 ` Damien Lespiau
2013-04-25 13:41 ` Daniel Vetter
1 sibling, 1 reply; 10+ messages in thread
From: Damien Lespiau @ 2013-04-25 13:09 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Wed, Apr 24, 2013 at 10:18:44PM +0300, Jani Nikula wrote:
> With the previous work asle and gse interrupt handlers should now be
> functionally the same. Drop the duplicated code.
>
> v2: Drop intel_opregion_gse_intr() also in the !CONFIG_ACPI path. (Damien)
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
To be explicit about it:
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
--
Damien
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 3/3] drm/i915: drop code duplication in favor of asle interrupt handler
2013-04-25 13:09 ` Damien Lespiau
@ 2013-04-25 13:41 ` Daniel Vetter
0 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2013-04-25 13:41 UTC (permalink / raw)
To: Damien Lespiau; +Cc: Jani Nikula, intel-gfx
On Thu, Apr 25, 2013 at 02:09:47PM +0100, Damien Lespiau wrote:
> On Wed, Apr 24, 2013 at 10:18:44PM +0300, Jani Nikula wrote:
> > With the previous work asle and gse interrupt handlers should now be
> > functionally the same. Drop the duplicated code.
> >
> > v2: Drop intel_opregion_gse_intr() also in the !CONFIG_ACPI path. (Damien)
> >
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> To be explicit about it:
>
> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Merged all three patches, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-04-25 13:38 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 12:20 [PATCH 0/3] drm/i915: opregion cleanup Jani Nikula
2013-04-12 12:20 ` [PATCH 1/3] drm/i915: don't pretend we support ASLE ALS, PFIT, or PFMB Jani Nikula
2013-04-12 12:20 ` [PATCH 2/3] drm/i915/opregion: don't pretend we did something when we didn't Jani Nikula
2013-04-12 12:20 ` [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler Jani Nikula
2013-04-24 18:23 ` Damien Lespiau
[not found] ` <39ef9d9d21a2211333ce011881e240304c3baec1.1366830005.git.jani.nikula@intel.com>
2013-04-24 19:18 ` [PATCH v2 " Jani Nikula
2013-04-24 19:34 ` Jani Nikula
2013-04-25 13:09 ` Damien Lespiau
2013-04-25 13:41 ` Daniel Vetter
2013-04-24 18:24 ` [PATCH 0/3] drm/i915: opregion cleanup Damien Lespiau
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.