[v4 2/5] drm/i915/display: Compute the scaler filter coefficients

Murthy, Arun R arun.r.murthy at intel.com
Tue Sep 10 07:22:54 UTC 2024


> > > The sharpness property requires the use of one of the scaler so need
> > > to set the sharpness scaler coefficient values.
> > > These values are based on experiments and vary for different tap
> > > value/win size. These values are normalized by taking the sum of all
> > > values and then dividing each value with a sum.
> > >
> > > --v4: fix ifndef header naming issue reported by kernel test robot
> > >
> > > Signed-off-by: Nemesa Garg <nemesa.garg at intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/Makefile                 |   1 +
> > >  drivers/gpu/drm/i915/display/intel_display.c  |   2 +
> > >  .../drm/i915/display/intel_display_types.h    |   9 ++
> > >  .../drm/i915/display/intel_sharpen_filter.c   | 121 ++++++++++++++++++
> > >  .../drm/i915/display/intel_sharpen_filter.h   |  27 ++++
> > >  drivers/gpu/drm/i915/i915_reg.h               |   2 +
> > >  drivers/gpu/drm/xe/Makefile                   |   1 +
> > >  7 files changed, 163 insertions(+)
> > >  create mode 100644
> > > drivers/gpu/drm/i915/display/intel_sharpen_filter.c
> > >  create mode 100644
> > > drivers/gpu/drm/i915/display/intel_sharpen_filter.h
> >
> > Can a unified name be used across the patches. ->
> > intel_sharpness_filter.c
> >
> > >
> > > diff --git a/drivers/gpu/drm/i915/Makefile
> > > b/drivers/gpu/drm/i915/Makefile index c63fa2133ccb..0021f0a372ab
> > > 100644
> > > --- a/drivers/gpu/drm/i915/Makefile
> > > +++ b/drivers/gpu/drm/i915/Makefile
> > > @@ -280,6 +280,7 @@ i915-y += \
> > >  	display/intel_pmdemand.o \
> > >  	display/intel_psr.o \
> > >  	display/intel_quirks.o \
> > > +	display/intel_sharpen_filter.o \
> > >  	display/intel_sprite.o \
> > >  	display/intel_sprite_uapi.o \
> > >  	display/intel_tc.o \
> > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> > > b/drivers/gpu/drm/i915/display/intel_display.c
> > > index c2c388212e2e..a62560a0c1a9 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > > @@ -5906,6 +5906,8 @@ static int intel_atomic_check_planes(struct
> > > intel_atomic_state *state)
> > >  		if (ret)
> > >  			return ret;
> > >
> > > +		intel_sharpness_scaler_compute_config(new_crtc_state);
> > > +
> > >  		/*
> > >  		 * On some platforms the number of active planes affects
> > >  		 * the planes' minimum cdclk calculation. Add such planes diff -
> > > -git a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > index 8713835e2307..1c3e031ab369 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > > @@ -55,6 +55,7 @@
> > >  #include "intel_display_limits.h"
> > >  #include "intel_display_power.h"
> > >  #include "intel_dpll_mgr.h"
> > > +#include "intel_sharpen_filter.h"
> > >  #include "intel_wm_types.h"
> > >
> > >  struct drm_printer;
> > > @@ -828,6 +829,13 @@ struct intel_scaler {
> > >  	u32 mode;
> > >  };
> > >
> > > +struct intel_sharpness_filter {
> > > +	struct scaler_filter_coeff coeff[7];
> > > +	u32 scaler_coefficient[119];
> > What is this magic number 119 and 7?
> > For each win size there are 7 coefficients, so coeff[7] is used to store these
> values which are further used in calculating scaler coefficients.
> As we need to compute scaler coefficients for 17 phases of 7 taps I have used
> scaler_coefficient[119] .

Can these magic numbers be replaced with a meaningful macros?

Thanks and Regards,
Arun R Murthy
--------------------


More information about the dri-devel mailing list