alternative openchrome rotate design

Daniel Drake dsd at laptop.org
Thu Oct 28 14:04:46 EDT 2010


Latest openchrome patches from Jon N result in working rotation, but
have some downsides: a loss of 2D accel in the rotated modes, and
overall bad performance even in general operation. (but much better
than nothing!)

Bernie explained to me how Geode does rotation and I investigated to
see if openchrome can do the same. Here is a summary of my findings...
(just some initial research)

It's something like this:

When in a rotated mode, do all rendering to an offscreen buffer rather
than the framebuffer that gets shown on the screen. (assumption #1:
openchrome, like geode, can do accelerated rendering to an offscreen
buffer just like it can to the framebuffer)

Then, for the first frame, perform a blit-and-rotate of the whole
offscreen buffer onto the framebuffer.
When changes happen, continue to render them the "right way up" using
all normal acceleration onto the offscreen buffer.
Use XDAMAGE events to learn about which parts of the display have
changed, then perform blit+rotate operations on those changed regions,
from offscreen to framebuffer, to update the display.
(assumption #1: openchrome's 2d engine can do an accelerated
blit-and-rotate, otherwise it won't be much fun)
(Mart Raudsepp says that the XDAMAGE part is handled outside of the
driver, the graphics driver just needs to support the appropriate
RENDER operations (i.e. blit+rotate?) and then xrandr will call the
right codepaths to get the right parts of the screen updated)

Onto chrome9 then...
Possibility of accelerated rendering to offscreen memory: not yet
investigated, but I presume this is possible

Availability of accelerated 2D blit+rotate operation: openchrome
doesn't have any obvious code along these lines but the kernel viafb
driver sent me in the right direction.
http://www.x.org/docs/via/OGPM_Chrome9%20HCM_R100_Part1_Core_2D.pdf

page 75 GE Command
1001: Bitblt then rotate
Basically, bit 3 seems to be the "enable rotatation" switch. Currently
unused by openchrome as far as I can see.

page 76 GE Mode and Status
bits 1:0 control the rotation
         00: Rotate 0 degree.                 01: Rotate anticlockwise
90 degree.
         10: Rotate anticlockwise 180 degree. 11: Rotate anticlockwise
270 degree.


The docs don't really clarify if this is the formation of a
blit+rotate command, or any limitations that may come along with it,
but it does look that way.


I took a look at via's own driver
http://linux.via.com.tw/support/beginDownload.action?eleid=423&fid=731
via-xserver-87a-55727_src.tar.bz2

via_3d.c has a function viaAccel2D410Blt() which uses the bits
described above. Could serve as an example if we decide to go further
with this idea. However, it is #if'd out.

Daniel



More information about the Devel mailing list