[Nooby Question] Scale Pixmap / Image
Carsten Haitzler (The Rasterman)
raster at rasterman.com
Tue Sep 21 18:30:47 PDT 2010
On Tue, 21 Sep 2010 09:18:49 +0100 Glynn Clements <glynn at gclements.plus.com>
said:
>
> Rashid wrote:
>
> > is there a way to scale a pixmap / image / frame buffer content with
> > native xlib-Code.
>
> No. The core X protocol doesn't include this functionality. You need
> to use an extension (e.g. XRender, Xv, GLX).
actually it is possible to scale. 2 pass xcopyarea, 1 copy per row and column
of output. first u scale it up in 1 dimension by (for example) reading each
source column once and writing it out twice in the ouput, and then repeat for
rows.
it's not too cheap though. lots of cmds to the gpu, lots of protocol, and
the column copies do nasty things to cachelines and memory fetches even on
the gpu side. :)
aside:
as such though the freerunner has a stretchblit in its gfx hardware. its
primitive and can only do a small subset of what xrender needs.
the freerunner's gfx chip is like taking a good old ISA trident card and
pushing it to run 32bpp @ 1600x1200 because someone managed to buy a nice
monitor cheaply and wants lots of pixels and colors because it looks good on a
spec sheet. let's just for now assume the good old trident ISA card could do
such an output - for the sake of the analogy. the bus to and from the card is
weenie small. the card itself is being pushed to its absolute outer limits in
terms of display resolution and depth attached. you can try and move more
stuff to the gfx chip side to alleviate load on the "ISA bus" but even
over there life is very limited. where normally when your gfx chip is limited
you just move the ops back to the cpu and blast them over when done, this comes
with a big downside on the freerunner due to the "ISA bus". the problem is all
the nice modern stuff people would like will need to go back to the cpu there.
and any read of the gfx chip programming docs clearly shows it was intended for
qvga on a good day, and vga output for the freerunner gfx chip is an outlier
capability but not an optimal target). so no matter what - you'll always be
pushing poo uphill with that gfx chip unless you drop back to qvga. :)
--
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler) raster at rasterman.com
More information about the xorg
mailing list