OSDN Git Service

drm/i915: Parametrize PFIT_PIPE
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 12 Feb 2020 16:17:31 +0000 (18:17 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 20 Feb 2020 19:50:38 +0000 (21:50 +0200)
Make the PFIT_PIPE stuff less ugly via parametrization.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200212161738.28141-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_panel.c
drivers/gpu/drm/i915/i915_reg.h

index 585688b..5aead62 100644 (file)
@@ -434,8 +434,7 @@ void intel_gmch_panel_fitting(struct intel_crtc *intel_crtc,
        /* 965+ wants fuzzy fitting */
        /* FIXME: handle multiple panels by failing gracefully */
        if (INTEL_GEN(dev_priv) >= 4)
-               pfit_control |= ((intel_crtc->pipe << PFIT_PIPE_SHIFT) |
-                                PFIT_FILTER_FUZZY);
+               pfit_control |= PFIT_PIPE(intel_crtc->pipe) | PFIT_FILTER_FUZZY;
 
 out:
        if ((pfit_control & PFIT_ENABLE) == 0) {
index b09c1d6..faf8945 100644 (file)
@@ -4928,6 +4928,7 @@ enum {
 #define   PFIT_ENABLE          (1 << 31)
 #define   PFIT_PIPE_MASK       (3 << 29)
 #define   PFIT_PIPE_SHIFT      29
+#define   PFIT_PIPE(pipe)      ((pipe) << 29)
 #define   VERT_INTERP_DISABLE  (0 << 10)
 #define   VERT_INTERP_BILINEAR (1 << 10)
 #define   VERT_INTERP_MASK     (3 << 10)