diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2014-03-03 12:31:44 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-03-05 15:30:35 -0500 |
commit | 8cc87b7549969e532317077d325233779f8b96b6 (patch) | |
tree | 14071f62c54a75cc2d6ee5c7d515799e4d5bfac6 /drivers/gpu/drm/i915/intel_display.c | |
parent | 8285222c487b61c48b9b955b82598544c3c06050 (diff) |
drm/i915: Use a pipe variable to cycle through the pipes
I recently fumbled a patch because I wrote twice num_sprites[i], and it
was the right thing to do in only 50% of the cases.
This patch ensures I need to write num_sprites[pipe], ie it should be
self-documented that it's per-pipe number of sprites without having to
look at what is 'i' this time around.
It's all a lame excuse, but it does make it harder to redo the same
mistake.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 227f6602de0a..1ab9e3f37acb 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -10981,7 +10981,8 @@ void intel_modeset_suspend_hw(struct drm_device *dev) | |||
10981 | void intel_modeset_init(struct drm_device *dev) | 10981 | void intel_modeset_init(struct drm_device *dev) |
10982 | { | 10982 | { |
10983 | struct drm_i915_private *dev_priv = dev->dev_private; | 10983 | struct drm_i915_private *dev_priv = dev->dev_private; |
10984 | int i, j, ret; | 10984 | int j, ret; |
10985 | enum pipe pipe; | ||
10985 | 10986 | ||
10986 | drm_mode_config_init(dev); | 10987 | drm_mode_config_init(dev); |
10987 | 10988 | ||
@@ -11018,13 +11019,13 @@ void intel_modeset_init(struct drm_device *dev) | |||
11018 | INTEL_INFO(dev)->num_pipes, | 11019 | INTEL_INFO(dev)->num_pipes, |
11019 | INTEL_INFO(dev)->num_pipes > 1 ? "s" : ""); | 11020 | INTEL_INFO(dev)->num_pipes > 1 ? "s" : ""); |
11020 | 11021 | ||
11021 | for_each_pipe(i) { | 11022 | for_each_pipe(pipe) { |
11022 | intel_crtc_init(dev, i); | 11023 | intel_crtc_init(dev, pipe); |
11023 | for (j = 0; j < INTEL_INFO(dev)->num_sprites; j++) { | 11024 | for (j = 0; j < INTEL_INFO(dev)->num_sprites; j++) { |
11024 | ret = intel_plane_init(dev, i, j); | 11025 | ret = intel_plane_init(dev, pipe, j); |
11025 | if (ret) | 11026 | if (ret) |
11026 | DRM_DEBUG_KMS("pipe %c sprite %c init failed: %d\n", | 11027 | DRM_DEBUG_KMS("pipe %c sprite %c init failed: %d\n", |
11027 | pipe_name(i), sprite_name(i, j), ret); | 11028 | pipe_name(pipe), sprite_name(pipe, j), ret); |
11028 | } | 11029 | } |
11029 | } | 11030 | } |
11030 | 11031 | ||