On Thu, Jan 23, 2020 at 06:56:57PM +0530, Anshuman Gupta wrote: > intel_plane_fb_max_stride should return the max stride of > primary plane for first available pipe in intel device info > pipe_mask. > > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > Signed-off-by: Anshuman Gupta <anshuman.gupta@xxxxxxxxx> > --- > drivers/gpu/drm/i915/display/intel_display.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index b250b31f6000..b9209b7e71d7 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -2703,12 +2703,15 @@ u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv, > { > struct intel_crtc *crtc; > struct intel_plane *plane; > + enum pipe pipe; > > /* > * 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); > + pipe = ffs(INTEL_INFO(dev_priv)->pipe_mask) - 1; > + crtc = intel_get_crtc_for_pipe(dev_priv, pipe); I'd probably just add a small helper for this. Eg.: intel_get_first_crtc() { return to_intel_crtc(drm_crtc_from_index(0)) } > if (!crtc) > return 0; > > -- > 2.24.0 -- Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx