Skip to contentSkip to conversation

Can video_detect be made __init?

DISCUSSION Andrey Borzenkov 2 participants 3 messages Nov 8, 2008 – Nov 12, 2008 ACPI

lore
Share & tools
lore
#0 lore raw

I would add DMI entries to force vendor backlight for my system, but I'd really prefer they are not remain in memory forever. Is there any reason for the whole detection to not happen exactly once? After all, ACPI cannot change after boot, can it?

Hmm ... actually DSDT can be loaded from initrd, so it can change ... but in this case we actually are just interested in DMI matching which says whether vendor driver is preferred or not. What would be the the best place to call it from?

-andrey

#1 lore raw

Hi,

First, thanks Len for adjusing the patches and taking them into your test tree.
Norbert: I tried your .config you sent recently and it compiles fine with Len's ACPI test tree which now includes the patchset.

Quoted 1 line · Andrey Borzenkov

I would add DMI entries to force vendor backlight for my system,

Why? video.ko is the way to go. Do you see regressions with that?

Quoted 1 line

but I'd really prefer they are not remain in memory forever.

You mean video.ko should give up access to the backlight interface and e.g. toshiba.ko takes over at runtime?
Theoretically that may be possible, but practically this should not be implemented.
You must make sure all brightness functions got processed and unregister the backlight interface in video.ko, before you could re-register with a vendor specific driver. Rather complex without much gain.

Quoted 3 lines

Is there any
reason for the whole detection to not happen exactly once? After all, ACPI cannot change after boot, can it?

It should only happen once:
acpi_video_backlight_support()
and
acpi_video_display_switch_support()
the funcs called from the brightness supporting drivers checks for:

        if (!acpi_video_caps_checked)
                acpi_video_get_capabilities(NULL);

which should do the real checking only once.
If you see that checking is done several times, it's a bug.

Quoted 2 lines

Hmm ... actually DSDT can be loaded from initrd, so it can change ...

Checking is done after the DSDT got chosen, even if provided via initrd. DSDT overriding is done far before entering userspace when the real initrd tasks are processed (in userspace) and also far before video_detect.c gets active. That also is the reason why the DSDT override patch is not mainline, because it uses the initrd in a way it should not.

Quoted 3 lines

in this case we actually are just interested in DMI matching which says whether vendor driver is preferred or not. What would be the the best place to call it from?

I do not understand this. Why are you only interested in dmi checking if you override the DSDT?
DSDT overriding is for debugging only. Let's say you debug brightness functionality, then you pass the boot param to either choose vendor.ko or acpi_xy.ko brightness. Then you change DSDT again, you have to reboot anyway and adjust the boot param again.
The dmi blacklist should stay empty in mainline as long as we find really broken _BCM, _BQC implementations.

Thanks (that I am not the only one looking at this),

Thomas

#2 lore raw
In reply to Andrey Borzenkov
Quoted 9 lines · Andrey Borzenkov

I would add DMI entries to force vendor backlight for my system, but I'd really prefer they are not remain in memory forever. Is there any reason for the whole detection to not happen exactly once? After all, ACPI cannot change after boot, can it?

Hmm ... actually DSDT can be loaded from initrd, so it can change ... but in this case we actually are just interested in DMI matching which says whether vendor driver is preferred or not. What would be the the best place to call it from?

Sorry, I only half answered the question in my previous mail. acpi_video_backlight_support(..)
which is called by the backlight supporting drivers is going to check (when invoked the first time) whether general ACPI video functions are provided via the ACPI tables.
Advantage is that the check is only done if video.ko or vendor_laptop drivers are trying to be loaded. That means on a server where video.ko or vendor_laptop.ko are not needed, the video ACPI func detection does not take place.
The "disadvantage" is that it's done at driver load time and cannot be declared __init.

Thomas