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)
Thu, Sep 26, 8:54 AM
Unknown Object (File)
Thu, Sep 26, 12:06 AM
Unknown Object (File)
Mon, Sep 23, 1:52 PM
Unknown Object (File)
Sun, Sep 22, 4:46 PM
Unknown Object (File)
Thu, Sep 19, 10:58 PM
Unknown Object (File)
Tue, Sep 17, 3:06 AM
Unknown Object (File)
Tue, Sep 10, 3:52 PM
Unknown Object (File)
Sun, Sep 8, 6:59 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 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.