From ec5e0c336b3ca84df7ed17ab2ed8648bf0948998 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 26 Aug 2011 18:38:35 +0300 Subject: [PATCH] Revert "Not all systems expose a firmware or platform mechanism for changing the backlight intensity on i915, so add native driver support." This reverts commit aaa6fd2a004147bf32fce05720938236de3361d9. --- drivers/gpu/drm/i915/i915_drv.h | 4 -- drivers/gpu/drm/i915/intel_dp.c | 7 --- drivers/gpu/drm/i915/intel_drv.h | 3 +- drivers/gpu/drm/i915/intel_lvds.c | 5 -- drivers/gpu/drm/i915/intel_opregion.c | 1 + drivers/gpu/drm/i915/intel_panel.c | 72 +-------------------------------- 6 files changed, 3 insertions(+), 89 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 7916bd9..feb4f16 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -36,7 +36,6 @@ #include #include #include -#include /* General customization: */ @@ -691,7 +690,6 @@ typedef struct drm_i915_private { int child_dev_num; struct child_device_config *child_dev; struct drm_connector *int_lvds_connector; - struct drm_connector *int_edp_connector; bool mchbar_need_disable; @@ -725,8 +723,6 @@ typedef struct drm_i915_private { /* list of fbdev register on this device */ struct intel_fbdev *fbdev; - struct backlight_device *backlight; - struct drm_property *broadcast_rgb_property; struct drm_property *force_audio_property; diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 44fef5e..0feae90 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1841,11 +1841,6 @@ done: static void intel_dp_destroy (struct drm_connector *connector) { - struct drm_device *dev = connector->dev; - - if (intel_dpd_is_edp(dev)) - intel_panel_destroy_backlight(dev); - drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); kfree(connector); @@ -2077,8 +2072,6 @@ intel_dp_init(struct drm_device *dev, int output_reg) DRM_MODE_TYPE_PREFERRED; } } - dev_priv->int_edp_connector = connector; - intel_panel_setup_backlight(dev); } intel_dp_add_properties(intel_dp, connector); diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 0b2ee9d..7b330e7 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -297,10 +297,9 @@ extern void intel_pch_panel_fitting(struct drm_device *dev, extern u32 intel_panel_get_max_backlight(struct drm_device *dev); extern u32 intel_panel_get_backlight(struct drm_device *dev); extern void intel_panel_set_backlight(struct drm_device *dev, u32 level); -extern int intel_panel_setup_backlight(struct drm_device *dev); +extern void intel_panel_setup_backlight(struct drm_device *dev); extern void intel_panel_enable_backlight(struct drm_device *dev); extern void intel_panel_disable_backlight(struct drm_device *dev); -extern void intel_panel_destroy_backlight(struct drm_device *dev); extern enum drm_connector_status intel_panel_detect(struct drm_device *dev); extern void intel_crtc_load_lut(struct drm_crtc *crtc); diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 31da77f..8b521a2 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -552,8 +552,6 @@ static void intel_lvds_destroy(struct drm_connector *connector) struct drm_device *dev = connector->dev; struct drm_i915_private *dev_priv = dev->dev_private; - intel_panel_destroy_backlight(dev); - if (dev_priv->lid_notifier.notifier_call) acpi_lid_notifier_unregister(&dev_priv->lid_notifier); drm_sysfs_connector_remove(connector); @@ -1034,9 +1032,6 @@ out: /* keep the LVDS connector */ dev_priv->int_lvds_connector = connector; drm_sysfs_connector_add(connector); - - intel_panel_setup_backlight(dev); - return true; failed: diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index b8e8158b..b7c5ddb 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c @@ -227,6 +227,7 @@ void intel_opregion_asle_intr(struct drm_device *dev) asle->aslc = asle_stat; } +/* Only present on Ironlake+ */ void intel_opregion_gse_intr(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index a9e0c7b..05f500c 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -277,7 +277,7 @@ void intel_panel_enable_backlight(struct drm_device *dev) dev_priv->backlight_enabled = true; } -static void intel_panel_init_backlight(struct drm_device *dev) +void intel_panel_setup_backlight(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; @@ -309,73 +309,3 @@ intel_panel_detect(struct drm_device *dev) return connector_status_unknown; } - -#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE -static int intel_panel_update_status(struct backlight_device *bd) -{ - struct drm_device *dev = bl_get_data(bd); - intel_panel_set_backlight(dev, bd->props.brightness); - return 0; -} - -static int intel_panel_get_brightness(struct backlight_device *bd) -{ - struct drm_device *dev = bl_get_data(bd); - return intel_panel_get_backlight(dev); -} - -static const struct backlight_ops intel_panel_bl_ops = { - .update_status = intel_panel_update_status, - .get_brightness = intel_panel_get_brightness, -}; - -int intel_panel_setup_backlight(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - struct backlight_properties props; - struct drm_connector *connector; - - intel_panel_init_backlight(dev); - - if (dev_priv->int_lvds_connector) - connector = dev_priv->int_lvds_connector; - else if (dev_priv->int_edp_connector) - connector = dev_priv->int_edp_connector; - else - return -ENODEV; - - props.type = BACKLIGHT_RAW; - props.max_brightness = intel_panel_get_max_backlight(dev); - dev_priv->backlight = - backlight_device_register("intel_backlight", - &connector->kdev, dev, - &intel_panel_bl_ops, &props); - - if (IS_ERR(dev_priv->backlight)) { - DRM_ERROR("Failed to register backlight: %ld\n", - PTR_ERR(dev_priv->backlight)); - dev_priv->backlight = NULL; - return -ENODEV; - } - dev_priv->backlight->props.brightness = intel_panel_get_backlight(dev); - return 0; -} - -void intel_panel_destroy_backlight(struct drm_device *dev) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - if (dev_priv->backlight) - backlight_device_unregister(dev_priv->backlight); -} -#else -int intel_panel_setup_backlight(struct drm_device *dev) -{ - intel_panel_init_backlight(dev); - return 0; -} - -void intel_panel_destroy_backlight(struct drm_device *dev) -{ - return; -} -#endif -- 1.7.3.4