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)
Feb 19 2024, 9:40 PM
Unknown Object (File)
Dec 11 2023, 7:34 AM
Unknown Object (File)
Sep 6 2023, 6:20 AM
Unknown Object (File)
Aug 14 2023, 9:37 PM
Unknown Object (File)
Aug 14 2023, 10:23 AM
Unknown Object (File)
Jul 3 2023, 4:23 AM
Unknown Object (File)
Jul 1 2023, 4:40 AM
Unknown Object (File)
May 28 2023, 11:23 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 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.