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)
Wed, Dec 18, 4:04 AM
Unknown Object (File)
Sat, Dec 7, 11:30 PM
Unknown Object (File)
Sun, Nov 24, 6:21 AM
Unknown Object (File)
Nov 19 2024, 6:53 PM
Unknown Object (File)
Nov 19 2024, 4:53 PM
Unknown Object (File)
Nov 15 2024, 2:21 AM
Unknown Object (File)
Nov 2 2024, 10:02 AM
Unknown Object (File)
Oct 2 2024, 6:37 AM

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 Skipped
Unit
Tests Skipped

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!

1587

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
1592

return (pci_power_names[0]); ???

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

int pstate = state + 1;

1589

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.