[Intel-gfx] [PATCH] drm/i915/rpm: add rpm_to_i915() helper around container_of()

Jani Nikula jani.nikula at intel.com
Thu Dec 7 11:16:21 UTC 2023


On Wed, 06 Dec 2023, Gustavo Sousa <gustavo.sousa at intel.com> wrote:
> Quoting Jani Nikula (2023-12-05 09:15:45-03:00)
>>Reduce the duplication.
>
> By the way, is it too ambitious to dream of a to_i915() using generics?

I'm not fundamentally opposed, but there are a few open questions here.

_Generic() has been slowly cropping up since commit e8c07082a810
("Kbuild: move to -std=gnu11"). Well, maybe even before that in some
cases. But there are only 30 or so users. I'm kind of uneasy about going
"all in" with it in this fashion before there's more general approval
that it's fine. Dave, Sima, thoughts?

The other thing is that with i915 and xe display integration, we're not
sure yet where it'll go. It's possible the display code will cease to
use i915 and switch to some other device struct. See [1] for some draft
ideas. At least for display code, I'd prefer not embarking on this kind
of changes yet so we don't have to churn many times in a row.


BR,
Jani.


[1] https://patchwork.freedesktop.org/series/124286/


-- 
Jani Nikula, Intel


More information about the Intel-gfx mailing list