Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
osresearch committed Mar 29, 2018
2 parents bd0c7da + 8ca6286 commit c6ece3b
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,8 @@ bin_modules-$(CONFIG_LVM2) += lvm2
bin_modules-$(CONFIG_DROPBEAR) += dropbear
bin_modules-$(CONFIG_FLASHTOOLS) += flashtools
bin_modules-$(CONFIG_NEWT) += newt
bin_modules-$(CONFIG_CAIRO) += cairo
bin_modules-$(CONFIG_FBWHIPTAIL) += fbwhiptail

$(foreach m, $(bin_modules-y), \
$(call map,initrd_bin_add,$(call bins,$m)) \
Expand Down Expand Up @@ -489,6 +491,10 @@ module_dirs := \
$(kernel-headers_dir) \
$(slang_dir) \
$(newt_dir) \
$(libpng_dir) \
$(pixman_dir) \
$(cairo_dir) \
$(fbwhiptail_dir)

modules.clean:
for dir in $(module_dirs) \
Expand Down
7 changes: 5 additions & 2 deletions boards/librem13v2/librem13v2.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ CONFIG_KEXEC=y
CONFIG_UTIL_LINUX=y
CONFIG_LVM2=y
CONFIG_MBEDTLS=y
CONFIG_NEWT=y
CONFIG_PCIUTILS=y
CONFIG_POPT=y
CONFIG_QRENCODE=y
CONFIG_SLANG=y
CONFIG_TPMTOTP=y

#CONFIG_SLANG=y
#CONFIG_NEWT=y
CONFIG_CAIRO=y
CONFIG_FBWHIPTAIL=y

CONFIG_LINUX_USB=y

export CONFIG_TPM=y
Expand Down
28 changes: 28 additions & 0 deletions modules/cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
modules-$(CONFIG_CAIRO) += cairo

cairo_version := 1.14.12
cairo_dir := cairo-$(cairo_version)
cairo_tar := cairo-$(cairo_version).tar.xz
cairo_url := https://www.cairographics.org/releases/$(cairo_tar)
cairo_hash := 8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16

cairo_configure := \
$(CROSS_TOOLS) \
CFLAGS="-DCAIRO_NO_MUTEX=1 -O3" \
./configure \
--host i386-elf-linux \
--prefix="/" \
--disable-xlib --disable-xcb --disable-pdf \
--disable-ps --disable-svg --disable-script \
--disable-ft --disable-fc --disable-pthread \
--disable-glib --disable-gobject

cairo_target := \
$(MAKE_JOBS) \
$(CROSS_TOOLS) \
DESTDIR="$(INSTALL)" \
install

cairo_libraries := src/.libs/libcairo.so.2

cairo_depends := pixman $(musl_dep)
15 changes: 15 additions & 0 deletions modules/fbwhiptail
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
modules-$(CONFIG_FBWHIPTAIL) += fbwhiptail

fbwhiptail_depends := cairo $(musl_dep)

fbwhiptail_version := git
fbwhiptail_dir := fbwhiptail
fbwhiptail_repo := https://code.puri.sm/kakaroto/fbwhiptail.git

fbwhiptail_target := \
$(MAKE_JOBS) \
$(CROSS_TOOLS) \
fbwhiptail

fbwhiptail_output := \
fbwhiptail whiptail
23 changes: 23 additions & 0 deletions modules/libpng
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
modules-$(CONFIG_CAIRO) += libpng

libpng_version := 1.6.34
libpng_dir := libpng-$(libpng_version)
libpng_tar := libpng-$(libpng_version).tar.gz
libpng_url := https://download.sourceforge.net/libpng/$(libpng_tar)
libpng_hash := 574623a4901a9969080ab4a2df9437026c8a87150dfd5c235e28c94b212964a7

libpng_configure := \
$(CROSS_TOOLS) \
./configure \
--host i386-elf-linux \
--prefix="/" \

libpng_target := \
$(MAKE_JOBS) \
$(CROSS_TOOLS) \
DESTDIR="$(INSTALL)" \
install \

libpng_libraries := .libs/libpng16.so.16

libpng_depends := zlib $(musl_dep)
24 changes: 24 additions & 0 deletions modules/pixman
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
modules-$(CONFIG_CAIRO) += pixman

pixman_version := 0.34.0
pixman_dir := pixman-$(pixman_version)
pixman_tar := pixman-$(pixman_version).tar.gz
pixman_url := https://www.cairographics.org/releases/$(pixman_tar)
pixman_hash := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3997aa20a88e

pixman_configure := \
$(CROSS_TOOLS) \
./configure \
--host i386-elf-linux \
--prefix="/" \
--disable-gtk

pixman_target := \
$(MAKE_JOBS) \
$(CROSS_TOOLS) \
DESTDIR="$(INSTALL)" \
install \

pixman_libraries := pixman/.libs/libpixman-1.so.0

pixman_depends := libpng $(musl_dep)

11 comments on commit c6ece3b

@tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented on c6ece3b Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When merging the changes into x230 board config, the following boot gives the following error in loop:

Error: Can't find usable screen

I don't see any probable differences in the merge applying to Librem that could explain the error for x230.
@kakaroto ?

@tlaurion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be linked to coreboot config:
CONFIG_HAVE_VGA_TEXT_FRAMEBUFFER=y

Retesting with it commented.

@kakaroto
Copy link
Contributor

@kakaroto kakaroto commented on c6ece3b Mar 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm.. It might be the text framebuffer, might be something else. I use the DRM interface for drawing on the framebuffer, I also had a linuxfb 'driver' to draw the cairo surface into /dev/fb but since on my machine, it didn't support double buffering (which caused horrible tearing at every refresh), that's why I implemented the DRM 'driver'.
So, your issue here is either because you use the VGA text framebuffer, which means the framebuffer doesn't work/exist, or because your kernel driver doesn't support the DRI interface at all and you should use the linuxfb driver (which I removed, so I'd need to commit that back and make it use it if DRI fails).
You can check if there's a /dev/dri/card0 device on your machine, and you could also define DRI_DEBUG in fbwhiptail/cairo_dri.c and recompile, see if the debugging information from DRI are more helpful (no DRI card, no screens, no valid modes, etc...)

EDIT: I think that even if coreboot initializes the graphics in vga text mode, it won't matter, once the i915 kernel driver of heads loads up, it will set it up differently, no ? In the case of the librem, we don't include the vgabios or vbt, and we don't do any graphics initialization in coreboot, the i915 driver does it for us once Heads is loaded, and that saves some time in boot time from coreboot not initializing the GPU needlessly

EDIT2: https://github.com/osresearch/heads/blob/master/config/linux-x230.config#L1508 :
# CONFIG_DRM_I915 is not set
That's probably why it failed, because the DRM driver isn't compiled. You should either enable it, or if /dev/fb works for you and supports double buffering and you prefer that, I can bring back the linuxfb driver in fbwhiptail.

@tlaurion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakaroto : weird it is found in the Audio Coprocessor section. Testing.

@tlaurion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakaroto It did it. Thanks!

@kakaroto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlaurion cool, glad it worked! Weird that you found the option in Audio Coprocessor though...
I hope you like how it looks now with fbwhiptail :)

We'll soon start working on it again so that the gui design isn't as bad (it was done for a ps3 game in 2011, so it was flashy and used (apparently) out-of-fashion reflection on buttons) and make everything customizable through arguments (I'm actually thinking of a --gui definition.txt option instead of having hundreds of --gui-related-options).
For now, the only gui options available are --background-gradient (like used in the whiptail wrapper script) or --background-png (which will stretch the png to fit the screen resolution), so you could at least customize that.
Note: on your linux system, if you compile fbwhiptail, it will build 'gtkwhiptail' which you can use to test stuff out with the buffer being drawn inside of a gtk window.

@tlaurion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakaroto : screen flickers on the librem13v2 when booting xen before linux kernel?

@kakaroto
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, never tried xen, maybe @kylerankin can answer that.

@flammit
Copy link
Collaborator

@flammit flammit commented on c6ece3b Apr 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with i915 enabled on x230, there is a long pause after the kexec from Heads, then a brief glitch/flicker before seeing the console once the new dom0 kernel has a chance to setup the framebuffer again.

@tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented on c6ece3b Apr 5, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlaurion
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kakaroto : discussion continues here

Please sign in to comment.