PDA

View Full Version : vesa driver already for amd64!


paradox
August 14th, 2009, 16:45
tested on amd64 freebsd 8 current/stable

http://paradox.lissyara.su/vesa.tar.bz2

add to kernel conf "options SC_PIXEL_MODE"
and rebuild kernel

after reboot

tar xjvf vesa.tar.bz2
cd vesa
make
make load

use
vidcontrol -i mode
to show graphics modes

on my NVIDIA card iam use a MODE_277
800x600x32

to use it
vidcontrol MODE_277

ps:
any 32bit/16bit modes will be work
8bit not tested yet

to support 8bit depth
need my old patch for scvgarndr.c
http://www.freebsd.org/cgi/query-pr.cgi?pr=124902

to be continue

aragon
August 14th, 2009, 23:28
Wow, have you PR'd this yet? This looks like a huge chunk of work (particularly the x86 emulation).

Will try it out soon.

paradox
August 14th, 2009, 23:48
no its little work within one day
x86emu taked from openbsd

I think this driver will work under the i386 arch too

zeiz
August 16th, 2009, 03:25
I am using vesa on 8.0 from ports. It's not nvidia but works pretty fine if no effects enabled.
Please explain how this driver differ from the one in ports?

john_doe
August 16th, 2009, 04:57
Unlike X11 driver, vesa(4) allows you to set graphic modes for console so you can view images or play video without leaving it.

Ex.: with sysutils/jfbterm you can get not limited to 256 chars unicode support
www/w3m allows you to browse www sites with images on jfbterm
using libSDL + libvgl you can play some videos or graphical gamesall the while Xserver is not running

zeiz
August 16th, 2009, 07:28
WOW! Thanks a lot!

...but where the tarball is?
Tried http://paradox.lissyara.su, http://www.paradox.lissyara.su, ftp://ftp.paradox.lissyara.su...where it is?

paradox
August 16th, 2009, 09:20
the tarball is
http://paradox.lissyara.su/vesa.tar.bz2

zeiz
August 16th, 2009, 10:21
Got it. Thanks!

paradox
August 17th, 2009, 21:19
continued

http://paradox.lissyara.su/8bit.patch

cp 8bit.patch /usr/src
patch -p1 < 8bit.patch

and rebuild yr kernel

this patch allow the console to switch in the 8bit modes
from a list
vidcontrol -i mode

paradox
August 18th, 2009, 01:33
continued

http://paradox.lissyara.su/syscons.c.diff for freebsd 8 stable

cp syscons.c.diff /usr/src
patch -p1 < syscons.c.diff

and rebuild yr kernel

this is patch to allow switch the console to graphic mode early at boot time
the new flags is hint.sc.0.flags=0x01150180
where
0x100 - the flag for keyboard (used by default in freebsd)
0x80 - flag to switch the graphic console at boot(new flag)
0x0115 - the graphic mode that can be see from vidcontrol -i mode(new flag)
add this flag 0xXXX mode after testing with vidcontorl MODE_****
as example MODE_277 is 0x0115

all virtual console will be to switched to new graphic mode

don't forget the install vesa driver and add to loader.conf vesa_load="YES" options

dont use any more allscreens_flags= in rc.conf
becouse its clear boot log in console

gnemmi
August 21st, 2009, 21:23
will this make it into BETA3?

paradox
August 21st, 2009, 21:53
yes

gnemmi
August 22nd, 2009, 04:24
paradox, thanks for your work man !

I just gave it a go on my BETA2 install (Dell 1318 notebook, i386, Celeron(R) CPU 560 @ 2.13GHz) and it works OK.

I used the same hint (hint.sc.0.flags=0x01150180) you used because any resolution above 800x600 is way too high (1280x800, native resolution, would be unusable ... yet still it's not even available anyways). I couldn't figure out why "0x0115" if vidcontrol -i mode reports "0x115"?

So far the catch seems to be that the resolution goes up as soon as sc0 gets loaded (wich happens to be halfway through the boot process ... so the first half of the boot process looks big and the second half looks as expected at 800x600x32).

The only problem I found is that if I use "vesa" instead of "i915" I don't get the screen back when I resume from supend (acpiconf -s 3)

Really nice job .. will be looking forward to try your next patches ;)

Best Regards
Gonzalo

paradox
August 22nd, 2009, 09:32
the value 0x0115 and 0x115 the same
suspend not tested yet

paradox
August 22nd, 2009, 10:07
will this make it into BETA3?
what you mean?

will be included in beta3 this patch?
or
Is it possible to apply this patch to beta3?

mdma
August 22nd, 2009, 16:15
S-w-e-e-e-e-e-t

gnemmi
August 22nd, 2009, 20:37
I meant if this patch was going to be included into BETA3 :)

paradox
August 22nd, 2009, 20:58
i don't know :(

aragon
August 22nd, 2009, 22:04
I highly doubt it. Maybe 8.1.

joel@
August 23rd, 2009, 12:24
If you want something committed to the FreeBSD svn repository, find someone who can review and commit it for you, or send a PR with the patch.

nickolas
August 24th, 2009, 12:04
I've made a port (vesa-kmod.diff (ftp://ftp.lissyara.su/users/Guest/vesa-kmod.diff)) based on paradox's work. It should work on 7.x as well. Anyone wants to test/comment?

To apply use
cd /usr/ports
patch -sp0 -i /path/to/vesa-kmod.diff
cd misc/vesa-kmod; make install clean

It doesn't works:
vidcontrol: obtaining new video mode parameters: Operation not supported by device

# uname -a
FreeBSD cloud.zone 7.2-STABLE FreeBSD 7.2-STABLE #38: Sun Aug 2 16:40:23 EEST 2009 root@cloud.zone:/usr/obj/usr/src/sys/CLOUD amd64

If I write in loader.conf:
vesa_load="YES"
hint.sc.0.flags="0x01150180"

I got a blank screen.

paradox
August 24th, 2009, 12:29
add to kernel conf "options SC_PIXEL_MODE"
and rebuild kernel

nickolas
August 24th, 2009, 18:57
add to kernel conf "options SC_PIXEL_MODE"
and rebuild kernel

No change.
I've use john_doe's port.
Meybe it's better use your kernel patch?

paradox
August 24th, 2009, 19:26
show me your
vidcontrol -i mode
after load vesa.ko

paradox
August 24th, 2009, 19:34
hint.sc.0.flags="0x01150180"
this flag allowed only on freebsd 8/9
not for freebsd 7

you can use only the
allscreens_flags="MODE_277"
in rc.conf
as example
to switch the graphic console after boot

nickolas
August 24th, 2009, 19:53
you can use only the
allscreens_flags="MODE_277"

Now it works, thank you!

paradox
September 11th, 2009, 17:29
all patches already in 9-current

Bas
September 26th, 2009, 10:20
[bas@gw /usr/ports/misc/vesa-kmod]# make
===> Building for vesa-kmod-20090921
===> dpms (all)
Warning: Object directory not changed from original /usr/ports/misc/vesa-kmod/work/vesa-20090921/dpms
===> s3 (all)
Warning: Object directory not changed from original /usr/ports/misc/vesa-kmod/work/vesa-20090921/s3
===> vesa (all)
Warning: Object directory not changed from original /usr/ports/misc/vesa-kmod/work/vesa-20090921/vesa
/usr/local/libexec/ccache/cc -O2 -fno-strict-aliasing -pipe -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -I. -I@ -I@/contrib/altq -finline-
limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -fno-omit-frame-pointer -mcmodel=kernel
-mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign
-fformat-extensions -c vesa.c
vesa.c: In function 'vesa_map_buffer':
vesa.c:858: error: 'PAT_WRITE_COMBINING' undeclared (first use in this function)
vesa.c:858: error: (Each undeclared identifier is reported only once
vesa.c:858: error: for each function it appears in.)
*** Error code 1

Stop in /usr/ports/misc/vesa-kmod/work/vesa-20090921/vesa.
*** Error code 1

Stop in /usr/ports/misc/vesa-kmod/work/vesa-20090921.
*** Error code 1

Stop in /usr/ports/misc/vesa-kmod.

[bas@gw /usr/home/bas]# uname -a
FreeBSD gw.*.ru 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Sat Sep 26 17:02:24 PETST 2009 bas@gw.*.ru:/usr/src/sys/amd64/compile/GW amd64

May be some fixes or i do something wrong?

john_doe
September 26th, 2009, 14:11
I think r197323 wasn't meant for 7.2 release. I've added.if ${OSVERSION} < 702106
EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-vesa.c
.endifCan you redownload vesa-kmod.diff and try again?

Bas
September 27th, 2009, 08:06
Can you redownload vesa-kmod.diff and try again?
Great job, man! Tnx. Now all work properly.

HUNTERok
December 2nd, 2009, 18:56
http://paradox.lissyara.su/vesa.tar.bz2

link broken, reupload plz. :)

HUNTERok
December 3rd, 2009, 06:33
http://paradox.lissyara.su/vesa.tar.bz2

link broken, reupload plz. :)

up pls )

robbak
December 3rd, 2009, 07:09
ngls brkn, pls rpst

paradox
December 8th, 2009, 11:50
see at post #11

Jamz
December 16th, 2009, 00:11
Anyone tried this on 8-RELEASE ?

The syscons stuff doesn't seem to work for me, tried it on i386 and amd64, both the same. I can change resolution via vidcontrol after boot but the flags in loader.conf don't seem to do anything. I can see from dmesg that they're being picked up by sc0 but the res never changes.

Any ideas ?

paradox
December 16th, 2009, 22:27
are you correct load the modules vesa.ko and rebuild kernel?
look at the post #1 and use the port from post #11

Jamz
December 17th, 2009, 00:14
The driver and patches were installed via the port on post #11, kernel was rebuilt with 'options SC_PIXEL_MODE' and I can set 1280x1024x32 (MODE_283) after boot.

vidcontrol -i mode

283 (0x11b) 0x0000000f G 1280x1024x32 1 8x16 0xa0000 64k 64k 0xe8000000 8000k

kldstat

Id Refs Address Size Name
1 5 0xc0400000 b70ec4 kernel
2 1 0xc0f71000 6a9c vesa.ko
3 2 0xc0f78000 1026c x86bios.ko

cat /boot/loader.conf

module_path="/boot/modules;/boot/kernel"
vesa_load="YES"
hint.sc.0.flags="0x11b0180"

dmesg

sc0: <System console> at flags 0x11b0180 on isa0
sc0: VGA <16 virtual consoles, flags=0x11b0380>

Jamz
December 17th, 2009, 01:01
I've done a bit more fiddling and it looks like an issue with the onboard video card in this Dell GX270 (the i386 PC, see below).

vgapci0: <VGA-compatible display> port 0xed98-0xed9f mem 0xe8000000-0xefffffff,0xfeb80000-0xfebfffff irq 16 at device 2.0 on pci0
agp0: <Intel 82865G (865G GMCH) SVGA controller> on vgapci0
agp0: detected 8060k stolen memory
agp0: aperture size is 128M

I've found and fitted an old half-height ATI Rage Pro 128 AGP card and now I get a nice black screen mid-way through boot (yey!).

The black screen isn't related to your stuff as I pretty much can't get any graphical resolutions with this card using yours or the default vesa driver.

The amd64 box is also a Dell (745) which I believe has an intel card too, I'll check when I get to work tomorrow.

john_doe
December 17th, 2009, 01:03
The flags in loader.conf are meant only for 9.0-CURRENT. They touch dev/syscons/syscons.c that's not part of any module. Look at r197085 (http://svn.freebsd.org/viewvc/base/head/sys/dev/syscons/syscons.c?view=log#rev197085) and subsequent commits. I think it shouldn't be hard to backport them. IOW, r197085 looks almost exactly like the patch in #10 looked.

FYI, the port is just a fairly old snapshot. Expect things more improved in HEAD.

paradox
December 17th, 2009, 01:46
Jamz
turn on verbose (by sysctl) to show the whole process of recognition of your BIOS VESA

bigwillyg
December 18th, 2009, 22:32
excellent, I applied the vesa-kmod.diff patch and then installed the vesa-kmod port. I loaded the vesa.ko after a reboot and I now have 1024x768 on my freebsd-8.0 system. Thanks so much.

aragon
December 18th, 2009, 22:38
What is the status of this being committed to the project's source? Has it been PR'd or reviewed by any FreeBSD committers yet?

bigwillyg
December 18th, 2009, 23:00
something odd though, even though I can do "vidcontrol MODE_280" manually, it wont take it in the allscreens_flags in rc.conf nor will it work with the hints line in the loader.conf

Am I missing something?

john_doe
December 19th, 2009, 03:37
What is the status of this being committed to the project's source? Has it been PR'd or reviewed by any FreeBSD committers yet?See #28 post in this thread. Ping delphij@ for MFC in 7.x/8.x.it wont take it in the allscreens_flags in rc.confDo you have vesa_load=YES in loader.conf? allscreen_flags basically does same thing as vidcontrol MODE_280. It won't change mode to a graphic one unless vesa.ko is loaded. # set this mode for all virtual screens
#
if [ -n "${allscreens_flags}" ]; then
sc_init
echo -n ' allscreens'
for ttyv in /dev/ttyv*; do
vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1
done
fi

bigwillyg
December 19th, 2009, 20:48
Yes, I have added VESA_load="yes" into the loader.conf. But the allscreens_flags in rc.conf isn't being read.

mdma
January 10th, 2010, 20:43
i can't get this to work on my new setup 8.0R-p2 amd64.
i am getting just a black screen on some modes and some other modes even put the monitor in power saving modes.
can someone explain post #41? debug.bootverbose in loader.conf?

sng84
February 18th, 2010, 19:19
Hi guys

I decided to test this patch (i used ports version), everything is ok until i will not start Xorg, then when i'm switching between console and X, i'm getting odd colors on console, text which should be white turnes blue etc. When i try to shutdown system my box hangs

Amd64, FreeBSD 8-STABLE, Tyan K8SD PRO, PowerColor RadeonHD 2400 PCI

Regards

thuglife
March 6th, 2010, 01:44
The driver got MFCed to 8-STABLE , yay!

http://svn.freebsd.org/viewvc/base?view=revision&revision=204546

val
March 11th, 2010, 19:26
Hm, may be on amd64 it works, but on i386 it doesn't :(

aragon
May 10th, 2010, 22:49
I tried this today in 8-STABLE. Works awesomely! Complements to the chef. :)

Has anyone figured out how to correctly craft hint.sc.0.flags so that the kernel sets a mode at bootup other than 800x600x32?

aragon
May 11th, 2010, 02:28
Figured it out. It appears to be incorrectly documented in syscons. Setting the high 16 bits of hint.sc.0.flags will get you no where. You need to set hint.sc.0.vesa_mode in /boot/loader.conf. For example, the kernel sets 1024x768x16 for me with this:


hint.sc.0.flags=0x0180
hint.sc.0.vesa_mode=0x0117


0x0117 is taken from
vidcontrol -i mode
(MODE_279)

A little bit better than allscreens_flags in rc.conf. :)

john_doe
May 11th, 2010, 12:23
delphij@ incorrectly merged r197109 (http://svn.freebsd.org/viewvc/base?view=revision&revision=197109) vs. r204546 (http://svn.freebsd.org/viewvc/base?view=revision&revision=204546)
It's properly documented in /head.

Markand
February 6th, 2011, 16:54
continued

http://paradox.lissyara.su/syscons.c.diff for freebsd 8 stable

cp syscons.c.diff /usr/src
patch -p1 < syscons.c.diff

and rebuild yr kernel

this is patch to allow switch the console to graphic mode early at boot time
the new flags is hint.sc.0.flags=0x01150180
where
0x100 - the flag for keyboard (used by default in freebsd)
0x80 - flag to switch the graphic console at boot(new flag)
0x0115 - the graphic mode that can be see from vidcontrol -i mode(new flag)
add this flag 0xXXX mode after testing with vidcontorl MODE_****
as example MODE_277 is 0x0115

all virtual console will be to switched to new graphic mode

don't forget the install vesa driver and add to loader.conf vesa_load="YES" options

dont use any more allscreens_flags= in rc.conf
becouse its clear boot log in console

Hi,

I wanted to do the same thing :


496 (0x1f0) 0x0000001f G 1366x768x32 D 8x16 0xa0000 64k 64k 0xc0000000 4128k


This is the mode I want so I modified hint.sc.0.flags to hint.sc.0.flags="0x1f00180" but it seems to use 1024x768 resolution (or something else but not 1366x768).

It works after the boot if I do vidcontrol MODE_496 so I don't know...

xibo
February 10th, 2011, 21:21
Can't try it right now ( am on Windows OS ), but I think you're supposed to use

hint.sc.0.flags=0x180
hint.sc.0.vesa_mode=0xYYY

where YYY is the hexadecimal form of the decimal number suffix to MODE_ according to post 51. In your case that would be

hint.sc.0.flags=0x180
hint.sc.0.vesa_mode=0x1f0

busyboy
March 16th, 2011, 10:04
Can someone please share an active link for Vesa Module for FreeBSD/AMD64. Thanks

break19
November 30th, 2011, 05:28
Can someone please share an active link for Vesa Module for FreeBSD/AMD64. Thanks

Uhm, sure /boot/kernel/vesa.ko, if you run FreeBSD AMD64 8.2 or greater.

In other words: you already have it.