[PATCH] drm/radeon: Inline r100_mm_rreg

Lauri Kasanen cand at gmx.com
Thu Apr 10 11:46:34 PDT 2014


On Thu, 10 Apr 2014 12:19:10 -0400
Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> > +static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg,
> > +                                   bool always_indirect)
> > +{
> > +       if (reg < rdev->rmmio_size && !always_indirect)
> > +               return readl(((void __iomem *)rdev->rmmio) + reg);
> 
> Quick thought from someone entirely unfamiliar with the hardware:
> perhaps you can get the performance benefit without the size increase
> by moving the else portion into a non-inline function? I'm guessing
> that most accesses happen in the "if" branch.

The function call overhead is about equal to branching overhead, so
splitting it would only help about half that. It's called from many
places, and a lot of calls per sec.

Of course the future kernel LTO will all make this go away, but that's
probably two years in the future before it's stable.

- Lauri


More information about the dri-devel mailing list