[PATCH] drm/i915/display: Workaround for odd panning for planar yuv

Garg, Nemesa nemesa.garg at intel.com
Tue Oct 15 16:23:12 UTC 2024



> -----Original Message-----
> From: Kandpal, Suraj <suraj.kandpal at intel.com>
> Sent: Tuesday, October 15, 2024 8:24 PM
> To: Garg, Nemesa <nemesa.garg at intel.com>; intel-gfx at lists.freedesktop.org
> Subject: RE: [PATCH] drm/i915/display: Workaround for odd panning for planar
> yuv
> 
> 
> 
> > -----Original Message-----
> > From: Garg, Nemesa <nemesa.garg at intel.com>
> > Sent: Tuesday, October 15, 2024 6:52 PM
> > To: Kandpal, Suraj <suraj.kandpal at intel.com>; intel-
> > gfx at lists.freedesktop.org
> > Subject: RE: [PATCH] drm/i915/display: Workaround for odd panning for
> > planar yuv
> >
> >
> >
> > > -----Original Message-----
> > > From: Kandpal, Suraj <suraj.kandpal at intel.com>
> > > Sent: Tuesday, October 15, 2024 2:33 PM
> > > To: Garg, Nemesa <nemesa.garg at intel.com>;
> > > intel-gfx at lists.freedesktop.org
> > > Cc: Garg, Nemesa <nemesa.garg at intel.com>
> > > Subject: RE: [PATCH] drm/i915/display: Workaround for odd panning
> > > for planar yuv
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On
> > > > Behalf Of Nemesa Garg
> > > > Sent: Monday, September 30, 2024 4:54 PM
> > > > To: intel-gfx at lists.freedesktop.org
> > > > Cc: Garg, Nemesa <nemesa.garg at intel.com>
> > > > Subject: [PATCH] drm/i915/display: Workaround for odd panning for
> > > > planar yuv
> > > >
> > > > Disable the support for odd x pan for even xsize for NV12 format
> > > > as underrun issue is seen.
> > > >
> > > > WA: 16024459452
> > > >
> > > > v2: Replace HSD with WA in commit message [Suraj]
> > > >     Modified the condition for handling odd panning
> > > >
> > > > v3: Simplified the condition for checking hsub
> > > >     Using older framework for wa as rev1[Jani]
> > > >
> > > > v4: Modify the condition for hsub [Sai Teja]
> > > >     Initialize hsub in else path [Dan]
> > > >
> > > > v5: Replace IS_LUNARLAKE with display version.
> > > >     Resolve nitpicks[Jani]
> > > >
> > > > Signed-off-by: Nemesa Garg <nemesa.garg at intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/display/intel_atomic_plane.c | 8 ++++++++
> > > >  1 file changed, 8 insertions(+)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > > b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > > index e979786aa5cf..e3401a4f7992 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > > > @@ -1029,6 +1029,14 @@ int
> > > > intel_plane_check_src_coordinates(struct
> > > > intel_plane_state *plane_state)
> > > >  		 * This allows NV12 and P0xx formats to have odd size
> > and/or
> > > odd
> > > >  		 * source coordinates on DISPLAY_VER(i915) >= 20
> > > >  		 */
> > > > +		/*
> > > > +		 *  Wa_16023981245 for display version 20.
> > > > +		 *  Do not support odd x-panning for even xsize for NV12.
> > >
> > > Only mention WA no here the rest anyone can refer to by going and
> > > checking the HSD
> > Sure..will do.
> > >
> > > > +		 */
> > > > +		if (DISPLAY_VER(i915) == 20 && fb->format->format ==
> > > > DRM_FORMAT_NV12 &&
> > > > +		    src_x % 2 != 0 && src_w % 2 == 0)
> > > > +			return -EINVAL;
> > >
> > > Also rather than return -EINVAL here we set hsub =2 and vsub =1 this
> > > should make sure odd panning is disabled When we have even size
> > > since we only need to disable odd panning according to hsd not even
> > > panning this return may end stop panning for even sizes all together.
> > >
> > Even if I do hsub=2 then also it will return -EINVAL as src_x will be
> > odd and src_x % hsub will be 1 which will return -EINVAL.
> > Even panning doesn't get disable that's why I have added the check
> > src_x %
> > 2 != 0 to make sure that position in not even and src_w % 2 to check
> > for even size.
> 
> 
> That will be fine let the code later that already exists take care of that since we
> don't Want to abruptly send an -EINVAL in a code block where we were assigning
> variables.
> When it fails later as you said it will with a clean debug message too.
> Secondly when you do return -EINVAL for src_x % 2 != 0 it ends up stopping
> panning in y direction If the current src_x is odd but panning is being done only in
> y direction it will return -EINVAL Hence assigning hsub and vsub here make a lot
> more sense.
> We can remove the src_x check and keep src_w and add src_h check
> 
But if I remove  src_x % 2 != 0 then above condition will get true for even positions as well in both x and y direction. 

Regards,
Nemesa

> Regards,
> Suraj Kandpal
> 
> >
> > Regards,
> > Nemesa
> >
> > > Regards,
> > > Suraj Kandpal
> > > > +
> > > >  		hsub = 1;
> > > >  		vsub = 1;
> > > >  	} else {
> > > > --
> > > > 2.25.1



More information about the Intel-gfx mailing list