Skip to contentSkip to conversation

CALLOUT for dri device

DISCUSSION Jon Smirl 2 participants 9 messages Dec 27, 2003 – Dec 30, 2003

lore
Share & tools
lore

Jon Smirl

author
#0 lore raw

Can I make a CALLOUT for a class of devices, like all DRI devices? When the driver is loaded I need to run a userspace program to reset the card (if secondary), query the monitor EDID, etc. This has to be done in userspace since reseting the card is a VM86 operation.

Will CALLOUT work for compiled in drivers? So as soon as the kernel is able my userspace add will get executed.

==Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Jon Smirl

Can I make a CALLOUT for a class of devices, like all DRI devices? When the driver is loaded I need to run a userspace program to reset the card (if secondary), query the monitor EDID, etc. This has to be done in userspace since reseting the card is a VM86 operation.

Don't use udev for this. Use hotplug for things like this. You can add your dri specific scripts to /etc/hotplug.d/dri/

See the documentation in the /sbin/hotplug script on how to do this.

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Jon Smirl
Quoted 4 lines · Jon Smirl

Can I make a CALLOUT for a class of devices, like all DRI devices? When the driver is loaded I need to run a userspace program to reset the card (if secondary), query the monitor EDID, etc. This has to be done in userspace since reseting the card is a VM86 operation.

Don't use udev for this. Use hotplug for things like this. You can add your dri specific scripts to /etc/hotplug.d/dri/

See the documentation in the /sbin/hotplug script on how to do this.

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Jon Smirl
Quoted 4 lines · Jon Smirl

Can I make a CALLOUT for a class of devices, like all DRI devices? When the driver is loaded I need to run a userspace program to reset the card (if secondary), query the monitor EDID, etc. This has to be done in userspace since reseting the card is a VM86 operation.

Don't use udev for this. Use hotplug for things like this. You can add your dri specific scripts to /etc/hotplug.d/dri/

See the documentation in the /sbin/hotplug script on how to do this.

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Jon Smirl
Quoted 4 lines · Jon Smirl

Can I make a CALLOUT for a class of devices, like all DRI devices? When the driver is loaded I need to run a userspace program to reset the card (if secondary), query the monitor EDID, etc. This has to be done in userspace since reseting the card is a VM86 operation.

Don't use udev for this. Use hotplug for things like this. You can add your dri specific scripts to /etc/hotplug.d/dri/

See the documentation in the /sbin/hotplug script on how to do this.

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#5 lore raw
In reply to Jon Smirl

That was easy, now it's calling my reset program. How do I tell if it is an insert or remove event? My program gets called on both.

Does this work for built-in drivers? Will I get an insert event as soon as userspace is running?

Quoted 7 lines · --- Greg KH
Quoted 3 lines · Jon Smirl

Can I make a CALLOUT for a class of devices, like all DRI devices? When the driver is loaded I need to run a userspace program to reset the card (if secondary), query the monitor EDID, etc. This has to be done in userspace

since

Quoted 1 line

reseting the card is a VM86 operation.

Quoted 8 lines

Don't use udev for this. Use hotplug for things like this. You can add your dri specific scripts to /etc/hotplug.d/dri/

See the documentation in the /sbin/hotplug script on how to do this.

thanks,

greg k-h

==Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Jon Smirl
Quoted 2 lines · Jon Smirl

That was easy, now it's calling my reset program. How do I tell if it is an insert or remove event? My program gets called on both.

Look at the ACTION environment variable.

Quoted 1 line

Does this work for built-in drivers?

yes.

Quoted 1 line

Will I get an insert event as soon as userspace is running?

no, the event happens when your device is registered. There is userspace running very early, look at the initramfs stuff. So you will probably have to put your application into the initramfs image. People are working on getting that all working properly.

Hope this helps,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#7 lore raw
In reply to Jon Smirl
Quoted 3 lines · --- Greg KH
Quoted 1 line

Will I get an insert event as soon as userspace is running?

no, the event happens when your device is registered. There is

When do built-in drivers get registered?

Quoted 7 lines

userspace running very early, look at the initramfs stuff. So you will probably have to put your application into the initramfs image. People are working on getting that all working properly.

Hope this helps,

greg k-h

==Jon Smirl
[email protected]

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to Jon Smirl
Quoted 6 lines · Jon Smirl
Quoted 3 lines · --- Greg KH
Quoted 1 line

Will I get an insert event as soon as userspace is running?

no, the event happens when your device is registered. There is

When do built-in drivers get registered?

Whenever they happen to get initialized in the startup sequence. This is usually determined by the link order in the module_init() timeframe.

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel