Commit 7bd688cd authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

drm/i915: handle backlight through chip specific functions

The backlight code has grown rather hairy, not least because the
hardware registers and bits have repeatedly been shuffled around. And
this isn't expected to get any easier with new hardware. Make things
easier for our (read: my) poor brains, and split the code up into chip
specific functions.

There should be no functional changes.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c91c9f32
...@@ -351,6 +351,7 @@ struct drm_i915_error_state { ...@@ -351,6 +351,7 @@ struct drm_i915_error_state {
enum intel_ring_hangcheck_action hangcheck_action[I915_NUM_RINGS]; enum intel_ring_hangcheck_action hangcheck_action[I915_NUM_RINGS];
}; };
struct intel_connector;
struct intel_crtc_config; struct intel_crtc_config;
struct intel_crtc; struct intel_crtc;
struct intel_limit; struct intel_limit;
...@@ -413,6 +414,14 @@ struct drm_i915_display_funcs { ...@@ -413,6 +414,14 @@ struct drm_i915_display_funcs {
/* render clock increase/decrease */ /* render clock increase/decrease */
/* display clock increase/decrease */ /* display clock increase/decrease */
/* pll clock increase/decrease */ /* pll clock increase/decrease */
int (*setup_backlight)(struct intel_connector *connector);
uint32_t (*get_max_backlight)(struct intel_connector *connector);
uint32_t (*get_backlight)(struct intel_connector *connector);
void (*set_backlight)(struct intel_connector *connector,
uint32_t level);
void (*disable_backlight)(struct intel_connector *connector);
void (*enable_backlight)(struct intel_connector *connector);
}; };
struct intel_uncore_funcs { struct intel_uncore_funcs {
......
...@@ -10418,6 +10418,8 @@ static void intel_init_display(struct drm_device *dev) ...@@ -10418,6 +10418,8 @@ static void intel_init_display(struct drm_device *dev)
dev_priv->display.queue_flip = intel_gen7_queue_flip; dev_priv->display.queue_flip = intel_gen7_queue_flip;
break; break;
} }
intel_panel_init_backlight_funcs(dev);
} }
/* /*
......
...@@ -161,6 +161,7 @@ struct intel_panel { ...@@ -161,6 +161,7 @@ struct intel_panel {
struct { struct {
bool present; bool present;
u32 level; u32 level;
u32 max;
bool enabled; bool enabled;
struct backlight_device *device; struct backlight_device *device;
} backlight; } backlight;
...@@ -817,6 +818,7 @@ int intel_panel_setup_backlight(struct drm_connector *connector); ...@@ -817,6 +818,7 @@ int intel_panel_setup_backlight(struct drm_connector *connector);
void intel_panel_enable_backlight(struct intel_connector *connector); void intel_panel_enable_backlight(struct intel_connector *connector);
void intel_panel_disable_backlight(struct intel_connector *connector); void intel_panel_disable_backlight(struct intel_connector *connector);
void intel_panel_destroy_backlight(struct drm_connector *connector); void intel_panel_destroy_backlight(struct drm_connector *connector);
void intel_panel_init_backlight_funcs(struct drm_device *dev);
enum drm_connector_status intel_panel_detect(struct drm_device *dev); enum drm_connector_status intel_panel_detect(struct drm_device *dev);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment