Page MenuHomeFreeBSD

LinuxKPI: Implement ACPI bits required by drm-kmod in base system.
ClosedPublic

Authored by wulf on Sep 30 2020, 10:34 AM.
Tags
None
Referenced Files
F103556852: D26603.diff
Tue, Nov 26, 12:01 PM
Unknown Object (File)
Tue, Nov 19, 12:30 AM
Unknown Object (File)
Tue, Nov 19, 12:30 AM
Unknown Object (File)
Tue, Nov 19, 12:30 AM
Unknown Object (File)
Tue, Nov 19, 12:07 AM
Unknown Object (File)
Mon, Nov 18, 2:14 PM
Unknown Object (File)
Oct 2 2024, 4:35 AM
Unknown Object (File)
Sep 9 2024, 7:48 AM

Details

Summary

It includes:

ACPI_HANDLE() implementation.
AC and VIDEO ACPI events notification support.
Replacement of hand-rolled GPLed _DSM method evaluation helpers with in-base ones.
General cleanup of ACPI headers (based on previous @manu work in 5.4-cleanup-lkpi branch)

Depends on https://reviews.freebsd.org/D26602

Required drm-kmod changes: https://github.com/freebsd/drm-kmod/pull/30 (5.4-cleanup-lkpi branch)

Test Plan

Try to run it on amd gpu. My intel laptops do not have DSM functions. Moreover ACPI events handler in i915kms driver is a stub.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

wulf requested review of this revision.Sep 30 2020, 10:35 AM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/acpi/acpi.h
46

If these are functions, use function macros, to narrow down the matching scope.

Thanks,
That looks good at first glance, will do a better review later this week.
This will need a FreeBSD_version bump so we can check it in the drm-kmods code.
Thanks for doing that, I'm glad I didn't started this work after cleaning the unneeded bits in drm-kmod :)

Use static inline functions instead of preprocessor #define's to rename ACPICA methods.

Add workaround for BOOLEAN type leaked from FreeBSD ACPICA to drm-kmod. It can break amdgpu compilation.

wulf marked an inline comment as done.Sep 30 2020, 9:53 PM

Make sure this code compiles for all platforms we have before committing. Not only amd64 and aarch64.

This revision is now accepted and ready to land.Oct 1 2020, 7:16 AM

LGTM too.
Please bump __FreeBSD_version and please sync with me before commiting to base so I can merge in drm-kmod and update the ports quickly.
Thanks.

Remove already committed parts and fix build on non-ACPI archs.

This revision now requires review to proceed.Nov 6 2020, 9:17 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/acpi.h
42

Not sure if any of this is needed; I have come across things demanding something like this with not all types figured out (yet). Will this collide with anything?

typedef const char *    acpi_string;
union acpi_object {
        /* XXX FIXME */
        int type;
        struct {
                int                     value;
        } integer;
        struct {
                union acpi_object       *elements;
        } package;
};
sys/compat/linuxkpi/common/include/linux/acpi.h
42

Not sure if what is needed ?
ACPI_HANDLE is used in drm-kmod and is needed.
Not sure I understand what you mean.

sys/compat/linuxkpi/common/include/linux/acpi.h
42

The block of code I pasted in above... Did I just need that or do we inherit that from FreeBSD's ACPI implementation ... or would that break anything in yours?

sys/compat/linuxkpi/common/include/linux/acpi.h
42

I don't understand.
What's in this review is the only thing needed for drm, maybe you need more I don't know, this can be addressed later.

sys/compat/linuxkpi/common/include/linux/acpi.h
42

dokioki. I just wanted to make sure it's not going to break your stuff later.

sys/compat/linuxkpi/common/include/linux/acpi.h
42

I have no idea if it will break things or not, you can try yourself.
I'm going to commit this tomorow so it will be easier for you to test.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 9 2020, 1:20 PM
This revision was automatically updated to reflect the committed changes.