Re: [Intel-gfx] [PATCH 04/14] drm/i915: Move drrs hardware bit frobbing to small helpers

Ville Syrjälä
2022-01-27T11:35:20Z

On Thu, Jan 27, 2022 at 01:24:05PM +0200, Jani Nikula wrote:
> On Thu, 27 Jan 2022, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> > On Thu, 27 Jan 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> Split the drrs code that actually changes the refresh rate
> >> (via PIPECONF or M/N values) to small helper functions that
> >> only deal with the hardware details an nothing else. We'll
> >> soon have a third way of doing this, and it's less confusing
> >> when each difference method lives in its own funciton.
> >>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> ---
> >> drivers/gpu/drm/i915/display/intel_drrs.c | 67 ++++++++++++-----------
> >> 1 file changed, 36 insertions(+), 31 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_drrs.c b/drivers/gpu/drm/i915/display/intel_drrs.c
> >> index 46be46f2c47e..0cacdb174fd0 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_drrs.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_drrs.c
> >> @@ -87,6 +87,38 @@ intel_drrs_compute_config(struct intel_dp *intel_dp,
> >> pipe_config->dp_m2_n2.data_m *= pipe_config->splitter.link_count;
> >> }
> >>
> >> +static void
> >> +intel_drrs_set_refresh_rate_pipeconf(const struct intel_crtc_state *crtc_state,
> >> + enum drrs_refresh_rate_type refresh_type)
> >
> > Side note, for future, does this really need to be an enum? Could it
> > just be a bool "reduced" or something?
>
> And I mean throughout the driver, not just right here.

I suppose a bool would suffice. I was going to rename it to
at least have a bit more consistent namespace, but perhaps
we could just nuke it entirely.

--
Ville Syrjälä
Intel