Page MenuHomeFreeBSD

LinuxKPI: Add pci_power querying for drm-kmod
ClosedPublic

Authored by jfree on Sep 27 2022, 2:09 PM.
Referenced Files
Unknown Object (File)
Sat, Nov 2, 10:02 AM
Unknown Object (File)
Oct 2 2024, 6:37 AM
Unknown Object (File)
Oct 2 2024, 6:33 AM
Unknown Object (File)
Oct 2 2024, 6:28 AM
Unknown Object (File)
Oct 2 2024, 6:22 AM
Unknown Object (File)
Sep 26 2024, 8:54 AM
Unknown Object (File)
Sep 26 2024, 12:06 AM
Unknown Object (File)
Sep 23 2024, 1:52 PM

Details

Summary

Adds a few struct members and a function to get i915_runtime_pm_status()
to compile in drm-kmod.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jfree requested review of this revision.Sep 27 2022, 2:09 PM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/pci.h
205

This must be declared in a C-file and extern keyword must be used here instead of static!

1585

Any range check on state?

jfree marked an inline comment as done.
jfree added a reviewer: hselasky.
  • Added bound checking to pci_power_name()
  • Made pci_power_names array external
sys/compat/linuxkpi/common/include/linux/pci.h
1590

return (pci_power_names[0]); ???

sys/compat/linuxkpi/common/include/linux/pci.h
1585

int pstate = state + 1;

1587

Can you do it like this, instead of hardcoding the array size?

if (pstate >= 0 && pstate < nitems(pci_power_names))

Various changes to pci_power_name() thanks to @hselasky

sys/compat/linuxkpi/common/include/linux/device.h
127

If we add some member this change will break MFC, so if we do that could we add some padding members too for the futur ?

bz added inline comments.
sys/compat/linuxkpi/common/include/linux/device.h
127

I thought @imp had moved all allocation specifics into .c files so that if it is at the end it shouldn't be a problem or do I misremember incorrectly what https://reviews.freebsd.org/D34768 was trying to solve?

sys/compat/linuxkpi/common/include/linux/device.h
127

Indeed, we should be ok by moving it at the end of the struct.

Moved struct dev_pm_info power member to bottom of struct device in <linux/device.h>

This revision was not accepted when it landed; it landed in state Needs Review.Oct 6 2022, 8:18 AM
This revision was automatically updated to reflect the committed changes.