grate-driver / xf86-video-opentegra

X.Org video driver for NVIDIA Tegra
Other
12 stars 9 forks source link

Accelerated display rotation and some cleanup #46

Closed digetx closed 5 years ago

digetx commented 5 years ago

Implemented some basic acceleration for rotational transforms and now rotated display is quite usable in comparison to a slideshow that it was before. :christmas_tree:

digetx commented 5 years ago

@kusma Seems all corner cases have been addressed and typos fixed now. Brief recap.. we are going to use GR2D's Fast Rotate (FR) functionality for rotating original->rotated framebuffer copyings. The FR has some limitations like 16bytes alignment requirement (it operates with 16x16bytes blocks), hence fallback if alignment restrictions are not met.. for example FR can't be used if display resolution is something like 1366x768. It should be possible to implement a more complex logic for unaligned cases (bounce buffer / checking early that copied area is aligned), but probably it's not really worth the effort and more sane will be to just use GR3D for the cases that GR2D can't handle.

Any comments?

digetx commented 5 years ago

@kusma Commits updated.

digetx commented 5 years ago

BTW, display's orientation can be changed using xrandr.

xrandr --output LVDS-0 --rotate left
xrandr -x
xrandr -y

As well as by changing Xorg's config.

Section "Monitor"
    Identifier "LVDS-0"
    Option "Rotate" "left"
    Option "Panning" "2000x1280+0+0/1280x800+0+0/0/0/800/800"
EndSection
digetx commented 5 years ago

I forgot about taking into account panning (coords translation) in the yesterday's push, it works again.now.