[PATCHv3 6/6] drm/i915/histogram: Histogram changes for Display 20+

Jani Nikula jani.nikula at linux.intel.com
Wed Sep 25 12:59:28 UTC 2024


On Wed, 25 Sep 2024, "Murthy, Arun R" <arun.r.murthy at intel.com> wrote:
>> >> > +static __inline__ void set_bin_index_0(struct intel_display
>> >> > +*display, enum pipe pipe)
>> >>           ^^^^^^^^^^
>> >>
>> >> Why?
>> >>
>> > Sorry, didn't get your question. Is it why "enum pipe pipe"
>> 
>> No, why __inline__? What's the point?
>> 
>> (I tried to underline it with ^^^^^^^^^^ [1].)
>> 
>> You should basically never use inline in .c files, just let the compiler do its job.
>> And if you do need to use inline in headers, it should be "inline", not
>> "__inline__". See include/linux/compiler_types.h.
>> 
> The code within the inline functions is very much small and in order to execute
> that small code with functions involve register usage, hence thought of using
> inline.

It's just that the compiler usually knows better than us what to do, and
will automatically inline them, and much more, with a more clever
granularity.

And on the downside, e.g. gcc does not warn about unused static inlines
in .c files.

> Will remove inline!

Thanks,
Jani.


-- 
Jani Nikula, Intel


More information about the dri-devel mailing list