[Intel-gfx] [PATCH 3/3] drm/i915: Initialize drm_driver vblank funcs at compile time

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Jun 19 16:18:52 UTC 2019


On Tue, Jun 18, 2019 at 03:55:10PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2019-06-18 15:21:08)
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > Move the .get_vblank_timestamp() and .get_scanout_position()
> > initialization to happen at compile time. No point in delaying
> > it since we always assign the same functions.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c |  3 +++
> >  drivers/gpu/drm/i915/i915_irq.c | 11 ++++-------
> >  drivers/gpu/drm/i915/i915_irq.h |  5 +++++
> >  3 files changed, 12 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index ea6b06109d5a..178e9872b905 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -3216,6 +3216,9 @@ static struct drm_driver driver = {
> >         .gem_prime_export = i915_gem_prime_export,
> >         .gem_prime_import = i915_gem_prime_import,
> >  
> > +       .get_vblank_timestamp = drm_calc_vbltimestamp_from_scanoutpos,
> > +       .get_scanout_position = i915_get_crtc_scanoutpos,
> 
> One might suggest intel_get_crtc_scanoutpos, and a push for it to be
> passed drm_crtc instead of dev + pipe.

I suppose. There's also a FIXME about moving it to the crtc_helper funcs
instead. Or could just remove the vfunc entirely and have each driver
pass it to drm_calc_vbltimestamp_from_scanoutpos(). Either that or
eliminate the .get_vblank_timestamp() vfunc instead since I believe
everyone who has that uses drm_calc_vbltimestamp_from_scanoutpos().

Anyways, looks like there's enough material there for a good few hours
of cursing.

> 
> Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
> -Chris

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list