]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Refactor bdw_get_pipemisc_bpp
authorVandita Kulkarni <vandita.kulkarni@intel.com>
Thu, 2 May 2019 15:11:00 +0000 (20:41 +0530)
committerJani Nikula <jani.nikula@intel.com>
Tue, 14 May 2019 07:36:33 +0000 (10:36 +0300)
Move bdw_get_pipemisc_bpp alongside bdw_set_pipemisc

Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1556809862-31203-2-git-send-email-vandita.kulkarni@intel.com
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/vlv_dsi.c

index b66acfcff057b0736882d8a839914ef4b05c9c3c..8f3c3894e11d37e05b82d76e95f43054cfaaf67d 100644 (file)
@@ -8961,6 +8961,28 @@ static void bdw_set_pipemisc(const struct intel_crtc_state *crtc_state)
        I915_WRITE(PIPEMISC(crtc->pipe), val);
 }
 
+int bdw_get_pipemisc_bpp(struct intel_crtc *crtc)
+{
+       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+       u32 tmp;
+
+       tmp = I915_READ(PIPEMISC(crtc->pipe));
+
+       switch (tmp & PIPEMISC_DITHER_BPC_MASK) {
+       case PIPEMISC_DITHER_6_BPC:
+               return 18;
+       case PIPEMISC_DITHER_8_BPC:
+               return 24;
+       case PIPEMISC_DITHER_10_BPC:
+               return 30;
+       case PIPEMISC_DITHER_12_BPC:
+               return 36;
+       default:
+               MISSING_CASE(tmp);
+               return 0;
+       }
+}
+
 int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp)
 {
        /*
index 247893ed1543aa4a85587b0bdbbdf61ab5439e7f..5258abb2ebb5d5549ca4c382cda47ebd2508fb79 100644 (file)
@@ -1617,6 +1617,7 @@ int skl_format_to_fourcc(int format, bool rgb_order, bool alpha);
 unsigned int i9xx_plane_max_stride(struct intel_plane *plane,
                                   u32 pixel_format, u64 modifier,
                                   unsigned int rotation);
+int bdw_get_pipemisc_bpp(struct intel_crtc *crtc);
 
 /* intel_runtime_pm.c */
 static inline void
index bc5b782b053c131f3ead831ac99719295f5bdb54..895ea1a72a69b4b0aa8ed4aa61beba711f0a6541 100644 (file)
@@ -262,28 +262,6 @@ static void band_gap_reset(struct drm_i915_private *dev_priv)
        vlv_flisdsi_put(dev_priv);
 }
 
-static int bdw_get_pipemisc_bpp(struct intel_crtc *crtc)
-{
-       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
-       u32 tmp;
-
-       tmp = I915_READ(PIPEMISC(crtc->pipe));
-
-       switch (tmp & PIPEMISC_DITHER_BPC_MASK) {
-       case PIPEMISC_DITHER_6_BPC:
-               return 18;
-       case PIPEMISC_DITHER_8_BPC:
-               return 24;
-       case PIPEMISC_DITHER_10_BPC:
-               return 30;
-       case PIPEMISC_DITHER_12_BPC:
-               return 36;
-       default:
-               MISSING_CASE(tmp);
-               return 0;
-       }
-}
-
 static int intel_dsi_compute_config(struct intel_encoder *encoder,
                                    struct intel_crtc_state *pipe_config,
                                    struct drm_connector_state *conn_state)