aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_overlay.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-11 13:48:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-11 19:27:12 +0100
commit5eddb70ba2b8cdbbdd563f5cb04e26fdc9b017f7 (patch)
tree49a0f42a99b4b72794bd2cbab78816595c88da25 /drivers/gpu/drm/i915/intel_overlay.c
parent4ed765f966c8279acc6f6bc1a5dcb0424d074b40 (diff)
downloadkernel_samsung_smdk4412-5eddb70ba2b8cdbbdd563f5cb04e26fdc9b017f7.zip
kernel_samsung_smdk4412-5eddb70ba2b8cdbbdd563f5cb04e26fdc9b017f7.tar.gz
kernel_samsung_smdk4412-5eddb70ba2b8cdbbdd563f5cb04e26fdc9b017f7.tar.bz2
drm/i915: Use macros to switch between equivalent pipe registers
The purpose is to make the code much easier to read and therefore reduce the possibility for bugs. A side effect is that it also makes it much easier for the compiler, reducing the object size by 4k -- from just a few functions! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_overlay.c')
-rw-r--r--drivers/gpu/drm/i915/intel_overlay.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index 743ced7..9dcddfc 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -255,7 +255,7 @@ i830_activate_pipe_a(struct drm_device *dev)
return 0;
/* most i8xx have pipe a forced on, so don't trust dpms mode */
- if (I915_READ(PIPEACONF) & PIPEACONF_ENABLE)
+ if (I915_READ(PIPEACONF) & PIPECONF_ENABLE)
return 0;
crtc_funcs = crtc->base.helper_private;
@@ -876,15 +876,14 @@ static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
{
drm_i915_private_t *dev_priv = overlay->dev->dev_private;
u32 pipeconf;
- int pipeconf_reg = (crtc->pipe == 0) ? PIPEACONF : PIPEBCONF;
if (!crtc->base.enabled || crtc->dpms_mode != DRM_MODE_DPMS_ON)
return -EINVAL;
- pipeconf = I915_READ(pipeconf_reg);
+ pipeconf = I915_READ(PIPECONF(crtc->pipe));
/* can't use the overlay with double wide pipe */
- if (!IS_I965G(overlay->dev) && pipeconf & PIPEACONF_DOUBLE_WIDE)
+ if (!IS_I965G(overlay->dev) && pipeconf & PIPECONF_DOUBLE_WIDE)
return -EINVAL;
return 0;