diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-11-11 11:57:41 -0500 |
---|---|---|
committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-11-14 11:00:29 -0500 |
commit | 5697d60f6e56f90e191d00579307eba044d061a4 (patch) | |
tree | de1ab944f4c353a9f418013845af768c82c3cfed | |
parent | 4f8f225151506f6ea46c15aa410870c1d0b20fee (diff) |
drm/i915/fbc: convert intel_fbc.c to use INTEL_GEN()
Because it's shorter, easier to read, newer and cooler. And I don't
think anybody else has pending FBC patches right now, so the conflicts
should be minimal.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1478883461-20201-8-git-send-email-paulo.r.zanoni@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbc.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c index b0951753c2f8..62f215b12eb5 100644 --- a/drivers/gpu/drm/i915/intel_fbc.c +++ b/drivers/gpu/drm/i915/intel_fbc.c | |||
@@ -48,17 +48,17 @@ static inline bool fbc_supported(struct drm_i915_private *dev_priv) | |||
48 | 48 | ||
49 | static inline bool fbc_on_pipe_a_only(struct drm_i915_private *dev_priv) | 49 | static inline bool fbc_on_pipe_a_only(struct drm_i915_private *dev_priv) |
50 | { | 50 | { |
51 | return IS_HASWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 8; | 51 | return IS_HASWELL(dev_priv) || INTEL_GEN(dev_priv) >= 8; |
52 | } | 52 | } |
53 | 53 | ||
54 | static inline bool fbc_on_plane_a_only(struct drm_i915_private *dev_priv) | 54 | static inline bool fbc_on_plane_a_only(struct drm_i915_private *dev_priv) |
55 | { | 55 | { |
56 | return INTEL_INFO(dev_priv)->gen < 4; | 56 | return INTEL_GEN(dev_priv) < 4; |
57 | } | 57 | } |
58 | 58 | ||
59 | static inline bool no_fbc_on_multiple_pipes(struct drm_i915_private *dev_priv) | 59 | static inline bool no_fbc_on_multiple_pipes(struct drm_i915_private *dev_priv) |
60 | { | 60 | { |
61 | return INTEL_INFO(dev_priv)->gen <= 3; | 61 | return INTEL_GEN(dev_priv) <= 3; |
62 | } | 62 | } |
63 | 63 | ||
64 | /* | 64 | /* |
@@ -351,7 +351,7 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv) | |||
351 | 351 | ||
352 | static bool intel_fbc_hw_is_active(struct drm_i915_private *dev_priv) | 352 | static bool intel_fbc_hw_is_active(struct drm_i915_private *dev_priv) |
353 | { | 353 | { |
354 | if (INTEL_INFO(dev_priv)->gen >= 5) | 354 | if (INTEL_GEN(dev_priv) >= 5) |
355 | return ilk_fbc_is_active(dev_priv); | 355 | return ilk_fbc_is_active(dev_priv); |
356 | else if (IS_GM45(dev_priv)) | 356 | else if (IS_GM45(dev_priv)) |
357 | return g4x_fbc_is_active(dev_priv); | 357 | return g4x_fbc_is_active(dev_priv); |
@@ -365,9 +365,9 @@ static void intel_fbc_hw_activate(struct drm_i915_private *dev_priv) | |||
365 | 365 | ||
366 | fbc->active = true; | 366 | fbc->active = true; |
367 | 367 | ||
368 | if (INTEL_INFO(dev_priv)->gen >= 7) | 368 | if (INTEL_GEN(dev_priv) >= 7) |
369 | gen7_fbc_activate(dev_priv); | 369 | gen7_fbc_activate(dev_priv); |
370 | else if (INTEL_INFO(dev_priv)->gen >= 5) | 370 | else if (INTEL_GEN(dev_priv) >= 5) |
371 | ilk_fbc_activate(dev_priv); | 371 | ilk_fbc_activate(dev_priv); |
372 | else if (IS_GM45(dev_priv)) | 372 | else if (IS_GM45(dev_priv)) |
373 | g4x_fbc_activate(dev_priv); | 373 | g4x_fbc_activate(dev_priv); |
@@ -381,7 +381,7 @@ static void intel_fbc_hw_deactivate(struct drm_i915_private *dev_priv) | |||
381 | 381 | ||
382 | fbc->active = false; | 382 | fbc->active = false; |
383 | 383 | ||
384 | if (INTEL_INFO(dev_priv)->gen >= 5) | 384 | if (INTEL_GEN(dev_priv) >= 5) |
385 | ilk_fbc_deactivate(dev_priv); | 385 | ilk_fbc_deactivate(dev_priv); |
386 | else if (IS_GM45(dev_priv)) | 386 | else if (IS_GM45(dev_priv)) |
387 | g4x_fbc_deactivate(dev_priv); | 387 | g4x_fbc_deactivate(dev_priv); |
@@ -561,7 +561,7 @@ again: | |||
561 | 561 | ||
562 | ret = i915_gem_stolen_insert_node_in_range(dev_priv, node, size >>= 1, | 562 | ret = i915_gem_stolen_insert_node_in_range(dev_priv, node, size >>= 1, |
563 | 4096, 0, end); | 563 | 4096, 0, end); |
564 | if (ret && INTEL_INFO(dev_priv)->gen <= 4) { | 564 | if (ret && INTEL_GEN(dev_priv) <= 4) { |
565 | return 0; | 565 | return 0; |
566 | } else if (ret) { | 566 | } else if (ret) { |
567 | compression_threshold <<= 1; | 567 | compression_threshold <<= 1; |
@@ -594,7 +594,7 @@ static int intel_fbc_alloc_cfb(struct intel_crtc *crtc) | |||
594 | 594 | ||
595 | fbc->threshold = ret; | 595 | fbc->threshold = ret; |
596 | 596 | ||
597 | if (INTEL_INFO(dev_priv)->gen >= 5) | 597 | if (INTEL_GEN(dev_priv) >= 5) |
598 | I915_WRITE(ILK_DPFC_CB_BASE, fbc->compressed_fb.start); | 598 | I915_WRITE(ILK_DPFC_CB_BASE, fbc->compressed_fb.start); |
599 | else if (IS_GM45(dev_priv)) { | 599 | else if (IS_GM45(dev_priv)) { |
600 | I915_WRITE(DPFC_CB_BASE, fbc->compressed_fb.start); | 600 | I915_WRITE(DPFC_CB_BASE, fbc->compressed_fb.start); |
@@ -708,10 +708,10 @@ static bool intel_fbc_hw_tracking_covers_screen(struct intel_crtc *crtc) | |||
708 | struct intel_fbc *fbc = &dev_priv->fbc; | 708 | struct intel_fbc *fbc = &dev_priv->fbc; |
709 | unsigned int effective_w, effective_h, max_w, max_h; | 709 | unsigned int effective_w, effective_h, max_w, max_h; |
710 | 710 | ||
711 | if (INTEL_INFO(dev_priv)->gen >= 8 || IS_HASWELL(dev_priv)) { | 711 | if (INTEL_GEN(dev_priv) >= 8 || IS_HASWELL(dev_priv)) { |
712 | max_w = 4096; | 712 | max_w = 4096; |
713 | max_h = 4096; | 713 | max_h = 4096; |
714 | } else if (IS_G4X(dev_priv) || INTEL_INFO(dev_priv)->gen >= 5) { | 714 | } else if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5) { |
715 | max_w = 4096; | 715 | max_w = 4096; |
716 | max_h = 2048; | 716 | max_h = 2048; |
717 | } else { | 717 | } else { |
@@ -812,7 +812,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc) | |||
812 | fbc->no_fbc_reason = "framebuffer not tiled or fenced"; | 812 | fbc->no_fbc_reason = "framebuffer not tiled or fenced"; |
813 | return false; | 813 | return false; |
814 | } | 814 | } |
815 | if (INTEL_INFO(dev_priv)->gen <= 4 && !IS_G4X(dev_priv) && | 815 | if (INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv) && |
816 | cache->plane.rotation != DRM_ROTATE_0) { | 816 | cache->plane.rotation != DRM_ROTATE_0) { |
817 | fbc->no_fbc_reason = "rotation unsupported"; | 817 | fbc->no_fbc_reason = "rotation unsupported"; |
818 | return false; | 818 | return false; |
@@ -1375,7 +1375,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv) | |||
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | /* This value was pulled out of someone's hat */ | 1377 | /* This value was pulled out of someone's hat */ |
1378 | if (INTEL_INFO(dev_priv)->gen <= 4 && !IS_GM45(dev_priv)) | 1378 | if (INTEL_GEN(dev_priv) <= 4 && !IS_GM45(dev_priv)) |
1379 | I915_WRITE(FBC_CONTROL, 500 << FBC_CTL_INTERVAL_SHIFT); | 1379 | I915_WRITE(FBC_CONTROL, 500 << FBC_CTL_INTERVAL_SHIFT); |
1380 | 1380 | ||
1381 | /* We still don't have any sort of hardware state readout for FBC, so | 1381 | /* We still don't have any sort of hardware state readout for FBC, so |