提交 19c8054c 编写于 作者: J Jani Nikula

drm/i915: prefer for_each_intel_* macros for iteration

Use the for_each_intel_* macros for iterating intel_encoder,
intel_connector, and intel_crtc. No functional changes.
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: NJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450262896-5325-1-git-send-email-jani.nikula@intel.com
上级 ada8f955
...@@ -543,15 +543,12 @@ bool i915_semaphore_is_enabled(struct drm_device *dev) ...@@ -543,15 +543,12 @@ bool i915_semaphore_is_enabled(struct drm_device *dev)
static void intel_suspend_encoders(struct drm_i915_private *dev_priv) static void intel_suspend_encoders(struct drm_i915_private *dev_priv)
{ {
struct drm_device *dev = dev_priv->dev; struct drm_device *dev = dev_priv->dev;
struct drm_encoder *encoder; struct intel_encoder *encoder;
drm_modeset_lock_all(dev); drm_modeset_lock_all(dev);
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { for_each_intel_encoder(dev, encoder)
struct intel_encoder *intel_encoder = to_intel_encoder(encoder); if (encoder->suspend)
encoder->suspend(encoder);
if (intel_encoder->suspend)
intel_encoder->suspend(intel_encoder);
}
drm_modeset_unlock_all(dev); drm_modeset_unlock_all(dev);
} }
......
...@@ -15823,7 +15823,7 @@ void intel_connector_unregister(struct intel_connector *intel_connector) ...@@ -15823,7 +15823,7 @@ void intel_connector_unregister(struct intel_connector *intel_connector)
void intel_modeset_cleanup(struct drm_device *dev) void intel_modeset_cleanup(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct drm_connector *connector; struct intel_connector *connector;
intel_disable_gt_powersave(dev); intel_disable_gt_powersave(dev);
...@@ -15850,12 +15850,8 @@ void intel_modeset_cleanup(struct drm_device *dev) ...@@ -15850,12 +15850,8 @@ void intel_modeset_cleanup(struct drm_device *dev)
flush_scheduled_work(); flush_scheduled_work();
/* destroy the backlight and sysfs files before encoders/connectors */ /* destroy the backlight and sysfs files before encoders/connectors */
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { for_each_intel_connector(dev, connector)
struct intel_connector *intel_connector; connector->unregister(connector);
intel_connector = to_intel_connector(connector);
intel_connector->unregister(intel_connector);
}
drm_mode_config_cleanup(dev); drm_mode_config_cleanup(dev);
......
...@@ -389,8 +389,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp) ...@@ -389,8 +389,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
* We don't have power sequencer currently. * We don't have power sequencer currently.
* Pick one that's not used by other ports. * Pick one that's not used by other ports.
*/ */
list_for_each_entry(encoder, &dev->mode_config.encoder_list, for_each_intel_encoder(dev, encoder) {
base.head) {
struct intel_dp *tmp; struct intel_dp *tmp;
if (encoder->type != INTEL_OUTPUT_EDP) if (encoder->type != INTEL_OUTPUT_EDP)
...@@ -530,7 +529,7 @@ void vlv_power_sequencer_reset(struct drm_i915_private *dev_priv) ...@@ -530,7 +529,7 @@ void vlv_power_sequencer_reset(struct drm_i915_private *dev_priv)
* should use them always. * should use them always.
*/ */
list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) { for_each_intel_encoder(dev, encoder) {
struct intel_dp *intel_dp; struct intel_dp *intel_dp;
if (encoder->type != INTEL_OUTPUT_EDP) if (encoder->type != INTEL_OUTPUT_EDP)
...@@ -2850,8 +2849,7 @@ static void vlv_steal_power_sequencer(struct drm_device *dev, ...@@ -2850,8 +2849,7 @@ static void vlv_steal_power_sequencer(struct drm_device *dev,
if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B)) if (WARN_ON(pipe != PIPE_A && pipe != PIPE_B))
return; return;
list_for_each_entry(encoder, &dev->mode_config.encoder_list, for_each_intel_encoder(dev, encoder) {
base.head) {
struct intel_dp *intel_dp; struct intel_dp *intel_dp;
enum port port; enum port port;
......
...@@ -422,7 +422,7 @@ int intel_opregion_notify_adapter(struct drm_device *dev, pci_power_t state) ...@@ -422,7 +422,7 @@ int intel_opregion_notify_adapter(struct drm_device *dev, pci_power_t state)
static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_connector *intel_connector; struct intel_connector *connector;
struct opregion_asle *asle = dev_priv->opregion.asle; struct opregion_asle *asle = dev_priv->opregion.asle;
DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp); DRM_DEBUG_DRIVER("bclp = 0x%08x\n", bclp);
...@@ -446,8 +446,8 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) ...@@ -446,8 +446,8 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
* only one). * only one).
*/ */
DRM_DEBUG_KMS("updating opregion backlight %d/255\n", bclp); DRM_DEBUG_KMS("updating opregion backlight %d/255\n", bclp);
list_for_each_entry(intel_connector, &dev->mode_config.connector_list, base.head) for_each_intel_connector(dev, connector)
intel_panel_set_backlight_acpi(intel_connector, bclp, 255); intel_panel_set_backlight_acpi(connector, bclp, 255);
asle->cblv = DIV_ROUND_UP(bclp * 100, 255) | ASLE_CBLV_VALID; asle->cblv = DIV_ROUND_UP(bclp * 100, 255) | ASLE_CBLV_VALID;
drm_modeset_unlock(&dev->mode_config.connection_mutex); drm_modeset_unlock(&dev->mode_config.connection_mutex);
......
...@@ -1845,7 +1845,7 @@ void intel_backlight_register(struct drm_device *dev) ...@@ -1845,7 +1845,7 @@ void intel_backlight_register(struct drm_device *dev)
{ {
struct intel_connector *connector; struct intel_connector *connector;
list_for_each_entry(connector, &dev->mode_config.connector_list, base.head) for_each_intel_connector(dev, connector)
intel_backlight_device_register(connector); intel_backlight_device_register(connector);
} }
...@@ -1853,6 +1853,6 @@ void intel_backlight_unregister(struct drm_device *dev) ...@@ -1853,6 +1853,6 @@ void intel_backlight_unregister(struct drm_device *dev)
{ {
struct intel_connector *connector; struct intel_connector *connector;
list_for_each_entry(connector, &dev->mode_config.connector_list, base.head) for_each_intel_connector(dev, connector)
intel_backlight_device_unregister(connector); intel_backlight_device_unregister(connector);
} }
...@@ -3314,7 +3314,7 @@ static void skl_write_wm_values(struct drm_i915_private *dev_priv, ...@@ -3314,7 +3314,7 @@ static void skl_write_wm_values(struct drm_i915_private *dev_priv,
struct drm_device *dev = dev_priv->dev; struct drm_device *dev = dev_priv->dev;
struct intel_crtc *crtc; struct intel_crtc *crtc;
list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) { for_each_intel_crtc(dev, crtc) {
int i, level, max_level = ilk_wm_max_level(dev); int i, level, max_level = ilk_wm_max_level(dev);
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
...@@ -3523,8 +3523,7 @@ static void skl_update_other_pipe_wm(struct drm_device *dev, ...@@ -3523,8 +3523,7 @@ static void skl_update_other_pipe_wm(struct drm_device *dev,
* Otherwise, because of this_crtc being freshly enabled/disabled, the * Otherwise, because of this_crtc being freshly enabled/disabled, the
* other active pipes need new DDB allocation and WM values. * other active pipes need new DDB allocation and WM values.
*/ */
list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, for_each_intel_crtc(dev, intel_crtc) {
base.head) {
struct skl_pipe_wm pipe_wm = {}; struct skl_pipe_wm pipe_wm = {};
bool wm_changed; bool wm_changed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册