[RFC, PATCH] Getting rid of direct calls to video's methods via vidsw[] array

Wojciech A. Koszek wkoszek at freebsd.org
Sat Dec 22 08:51:48 PST 2007


Hello,

This is very similar patch to my kbdsw[] conversion patch, but directed
to the video output path. In the kernel, video adapter is represented by
"video_adapter" structure. Video adapter code declares itself as being the
video adapter driver with VIDEO_DRIVER() macro. It makes it appear in
vidsw[] array. For now, we indexed this array directly. I want this
behaviour to be improved.


My proposal is here:

	http://people.freebsd.org/~wkoszek/patches/tty/vidcleanup.patch

With this patch, instead of calling:

	(*vidsw[adp->va_index]-><mathod>)(args...)

You call:

	vidd_<method>(agp, args..);

Just like in kbdsw[] patch, I defined missing macros with their
respective convention. My intention was to provide full set of macros
for all "struct video_switch" function pointers.

Comments and suggestions are welcome,

Thanks,

-- 
Wojciech A. Koszek
wkoszek at FreeBSD.org
http://FreeBSD.czest.pl/dunstan/


More information about the freebsd-current mailing list