]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
drm/i915: Get first crtc instead of PIPE_A crtc
authorAnshuman Gupta <anshuman.gupta@intel.com>
Mon, 24 Feb 2020 12:40:02 +0000 (18:10 +0530)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 26 Feb 2020 14:14:47 +0000 (16:14 +0200)
intel_plane_fb_max_stride should return the max stride of
primary plane for first available pipe in intel device info
pipe_mask.
Similarly glk_force_audio_cdclk() should also use the first
available CRTC instead of pipe 'A' crtc to force the cdclk
changes.

changes since RFC:
- Introduced a helper to get first intel_crtc intel_get_first_crtc. [Ville]
v1:
- Used intel_get_first_crtc() instead of PIPE_A crtc in
  glk_force_audio_cdclk(). [Ville]

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200224124004.26712-6-anshuman.gupta@intel.com
drivers/gpu/drm/i915/display/intel_audio.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display_types.h

index 30fb7c887ff006dcb0e3378443a08cd13a0e6bec..19bf206037c260f545a0fd8d238135bde07d8eba 100644 (file)
@@ -844,7 +844,7 @@ static void glk_force_audio_cdclk(struct drm_i915_private *dev_priv,
        struct intel_crtc *crtc;
        int ret;
 
-       crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
+       crtc = intel_get_first_crtc(dev_priv);
        if (!crtc)
                return;
 
index 7399dee2fd372159f430d8f5bee688acf0593d44..cb39297a25802b9c079861f4cd9eee5a08c4647b 100644 (file)
@@ -2729,9 +2729,10 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
 
        /*
         * We assume the primary plane for pipe A has
-        * the highest stride limits of them all.
+        * the highest stride limits of them all,
+        * if in case pipe A is disabled, use the first pipe from pipe_mask.
         */
-       crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
+       crtc = intel_get_first_crtc(dev_priv);
        if (!crtc)
                return 0;
 
index 380ebe5ee26db80b5d3141ddd51fde2f1bb6df73..3ca6cf7f39865365a5be6b648a30d8f217cc1153 100644 (file)
@@ -1406,6 +1406,12 @@ vlv_pipe_to_channel(enum pipe pipe)
        }
 }
 
+static inline struct intel_crtc *
+intel_get_first_crtc(struct drm_i915_private *dev_priv)
+{
+       return to_intel_crtc(drm_crtc_from_index(&dev_priv->drm, 0));
+}
+
 static inline struct intel_crtc *
 intel_get_crtc_for_pipe(struct drm_i915_private *dev_priv, enum pipe pipe)
 {