Commit Graph

951 Commits

Author SHA1 Message Date
Zhigang Gong
98f8ef5f99 glamor: Change to use official APIs rather than ARB version function.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
0ef1698be2 glamor: Fix one bug for Xephyr.
Xephyr doesn't has a bounded valid texture. It seems that we can't
load texture 0 directly sometimes. Especially in the copyarea, function
if that is the case, we prefer to use fbo blit to read the screen pixmap
rather than load the bound texture.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
9b667ffd56 glamor: Use small internal texture format if possible.
Reduce some texture memory requirement and also save
some bandwidth.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
1f3f3baf14 glamor: Avoid 2D bitblit if possible.
It turns out that the use of fbo blit is one of the root cause
which lead to slow drawing, especially slow filling rects.

We guess there should be a performance bug in the mesa driver
or even in the kernel drm driver. Currently, the only thing
glamor can do is to avoid calling those functions.

We check whether the copy source and destination has overlapped
region, if it has, we have to call fbo blit function. If it has
not, we can load the source texture directly and draw it to the
target texture. We totally don't need the glCopyPixels here, so
remove it.

By apply this patch, the rendering time of firefox-planet-gnome
decrease to 10.4 seconds. At the same platform, uxa driver get 13
seconds. This is the first time we get better performance than
uxa driver.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
5c4d53c512 glamor: Implement delayed solid filling.
When we need to solid fill an entire pixmap with a specific color,
we do not need to draw it immediately. We can defer it to the
following occasions:

1. The pixmap will be used as source, then we can just use a shader
   to instead of one copyarea.
2. The pixmap will be used as target, then we can do the filling
   just before drawing new pixel onto it. The filling and drawing
   will have the same target texture, we can save one time of
   fbo context switching.

Actually, for the 2nd case, we have opportunity to further optimize
it. We can just fill the untouched region.

By applying this patch, the cairo-trace for the firefox-planet-gnome's
rendering time decrease to 14seconds from 16 seconds.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
1caf741a4a glamor: Fixed a bug when computing the bounds of boxes.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
fe0a6a2930 glamor: Should return when done gl drawing.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:47:00 +08:00
Zhigang Gong
7fbdc60fd4 glamor: comment out the message when creating a system memory pixmap.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:49 +08:00
Zhigang Gong
f961390db6 glamor: Don't need to pad the tile image if pixmap is ni texture.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
77ecd36693 glamor: We don't need to check format in compositing.
We already handle all format checking in pixmap uploading and
converting, don't need to do that again.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
477a54bc9e glamor: Fixed two unintialized warnings.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
fc23334e54 glamor: Optimize fallback case for the polylines.
When fallback to cpu for the polylines procedure, we can just download
required region to CPU rather than to download the whole pixmap. This
significant improve the performance if we have to fallback, for example
 do non-solid filling in the game Mines.

Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
da66a76f27 Revert "glamor: Don't need to read dest if op is SRC or CLEAR."
This reverts commit eb16fe0b7c8ea27b5cf9122d02e48bf585495228.
As currently glamor_prepare_access/finish_access will touch
the whole pixmap, not just the request region, then write only
mode will not work correctly. We may need to revisit all fallback
case, and convert the image to the right size before do the
prepare/finish processing.

Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
ca614860fa glamor: convert if too large source or mask .
Some strange web page has 20000*1 png picture, and actually only use
partial of it. We force to convert it to a actuall size rather than
its original size,if it is the case. Then to avoid latter's failure
uploading.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
1444fed4a8 glamor: silence compilation warnings.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
734b10e9f7 glamor: Fix one typo bug in glamor_tile.
It will return when the destination pixmap has a fbo but will continue
when it doesn't have a fbo.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
2eb40a3792 glamor: Remove one extra area copy in glamor_glyph.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
61e1ad3972 glamor: Reduce source or mask picture size if possible.
If we only need a short part of the source or mask's drawable
pixmap, we can convert it to a new small picture before
call to the low level compositing function. Then it will only
upload the smaller picture latter.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
14503fbb81 glamor: Fix the coords calculation in glamor_fill.
glamor_fill is only called from internal functions
glamor_fillspancs and glamor_polyfillrect. And both functions
already add the offset to the coords, so the coords are already
relative value, we can't add the offset once again.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
1dca5d7b91 glamor: Reduce source pixmap's size.
If the dest pixmap is in texture memory, but source pixmap is not.
Then we need to upload the source pixmap to texture memory. Previous
version will upload the whole source pixmap. This commit preprocess
the source pixmap, and reduce it to a smaller tempory pixmap only
contains the required region.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
33c6c78ae9 glamor: Add one option to force create a cpu memory pixmap.
Some special case we want to get a cpu memory pixmap. For example
to gather a large cpu memory pixmap's block to a small pixmap.

Add pixmap's priviate data's deallocation when destroy a pixmap.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
8890b38857 glamor: Don't map the vbo to system memory.
Access mapped vbo address is too slow. And by use system memory
directly, rgb10text/aa10text increases from 980K/1160K to 117K/140K.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
c303949aab glamor: Reduce one extra copy in glamor_trapezoids.
This reduce the time when running cairo-performance-trace with
the firefox-planet-gnome.trace from 23.5 seconds to 21.5 seconds.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
9e4567afe6 glamor: Change to use system memory for write only access.
If the pixmap is write-only, then use a pbo mapping will not
get too much benefit. And even worse, when the software
rendering is access this mapped data range, it's much slower
than just using a system memory. From the glamor_prepare_access
glamor_finish_access view, we have two options here:

option 1:
1.0 create a pbo
1.1 copy texture to the pbo
1.2 map the pbo to va
1.3 access the va directly in software rendering.
1.4 bind the pbo as unpack buffer & draw it back to texture.

option 2:
2.0 allocate a block memory in system memory space.
2.1 read the texture memory to the system memory.
2.2 access the system memory and do rendering.
2.3 draw the system memory back to texture.

In general, 1.1 plush 1.2 is much faster than 2.1.
And 1.3 is slower than 2.2. 1.4 is faster than 2.3.

If the access mode is read only or read write, option 1
may be fater, but if the access mode is write only. Then
most of the time option 1 is much faster.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
4afa9e4080 glamor: Prepare/finish access once if src equal to dst.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:36 +08:00
Zhigang Gong
cbedfe7513 glamor: Don't need to read dest if op is SRC or CLEAR.
Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
b8e692d94e glamor: Move the blend set up after the pixmap uploading.
This is a bug, as if we do blend set up before do the pixmap
dynamic uploading. We will have a incorrect blend env when
doing the uploading.

Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
bf78228337 glamor: Fixed one bug when enable dynamic pixmap uploading.
When try to upload a pixmap without yInverted set, we must
set up a fbo for it to do the y flip. Previous implementation
only consider the ax bit. After fix this problem, we can
enable the dynamic uploading feature in copyarea function when
the yInverted is not set (from Xephyr).

Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
489e6c4e6f glamor: Initialize pixmap private's container to correct value.
When calling from ephyr, we forgot to initialize it to the correct
value. Will cause segfault when run Xephyr.

Signed-off-by: Zhigang Gong <zhigang.gong@gmail.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
ca36ada041 glamor: Don't always fallback everything when change window attr.
Change the glamor_change_window_attributes's handling. We don't need
to fallback every thing to cpu at the beginning. Only when there
is a real need to change the pixmap's format, we need to do something.
Otherwise, we need do nothing here.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
ca1908e11d glamor: Concentrate and reduce some coords processing code.
Concentrate the verties and texture coords processing code to a new
file glamor_utils.h. Change most of the code to macro. Will have some
performance benefit on slow machine. And reduce most of the duplicate
code when calculate the normalized coords.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
355334fcd9 glamor : Add dynamic texture uploading feature.
Major refactoring.
1. Rewrite the pixmap texture uploading and downloading functions.
   Add some new functions for both the prepare/finish access and
   the new performance feature dynamic texture uploading, which
   could download and upload the current image to/from a private
   texture/fbo. In the uploading or downloading phase, we need to
   handle two things:
   The first is the yInverted option, If it set, then we don't need
   to flip y. If not set, if it is from a dynamic texture uploading
   then we don't need to flip either if the current drawing process
   will flip it latter. If it is from finish_access, then we must
   flip the y axis.

   The second thing is the alpha channel hanlding, if the pixmap's
   format is something like x8a8r8g8, x1r5g5b5 which means it doesn't
   has alpha channel, but it do has those extra bits. Then we need to
   wire those bits to 1.

2. Add almost all the required picture format support.
   This is not as trivial as it looks like. The previous implementation
   only support GL_a8,GL_a8r8g8b8,GL_x8r8g8b8. All the other format,
   we have to fallback to cpu. The reason why we can't simply add those
   other color format is because the exists of picture. one drawable
   pixmap may has one or even more container pictures. The drawable pixmap's
   depth can't map to a specified color format, for example depth 16 can
   mapped to r5g6b5, x1r5g5b5, a1r5g5b5, or even b5g6r5. So we can't get
   get the color format just from the depth value. But the pixmap do not
   has a pict_format element. We have to make a new one in the pixmap
   private data structure. Reroute the CreatePicture to glamor_create_picture
   and then store the picture's format to the pixmap's private structure.

   This is not an ideal solution, as there may be more than one pictures
   refer to the same pixmap. Then we will have trouble. There is an example
   in glamor_composite_with_shader. The source and mask often share the
   same pixmap, but use different picture format. Our current solution is to
   combine those two different picture formats to one which will not lose any
   data. Then change the source's format to this new format and then upload
   the pixmap to texture once. It works. If we fail to find a matched new
   format then we fallback.

   There still is a potential problem, if two pictures refer to the same
   pixmap, and one of them destroy the picture, but the other still remained
   to be used latter. We don't handle that situation currently. To be fixed.

3. Dynamic texture uploading.
   This is a performance feature. Although we don't like the client to hold
   a pixmap data to shared memory and we can't accelerate it. And even worse,
   we may need to fallback all the required pixmaps to cpu memory and then
   process them on CPU. This feature is to mitigate this penalty. When the
   target pixmap has a valid gl fbo attached to it. But the other pixmaps are
   not. Then it will be more efficient to upload the other pixmaps to GPU and
   then do the blitting or rendering on GPU than fallback all the pixmaps to CPU.
   To enable this feature, I experienced a significant performance improvement
   in the Game "Mines" :).

4. Debug facility.
   Modify the debug output mechanism. Now add a new macro:
   glamor_debug_output(_level_, _format_,...) to conditional output some messages
   according to the environment variable GLAMOR_DEBUG. We have the following
   levels currently.
    exports GLAMOR_DEBUG to 3 will enable all the above messages.

5. Changes in pixmap private data structure.
   Add some for the full color format supports and relate it to the pictures which
   already described. Also Add the following new elements:
   gl_fbo - to indicates whether this pixmap is on gpu only.
   gl_tex - to indicates whether the tex is valid and is containing the pixmap's
            image originally.
   As we bring the dynamic pixmap uploading feature, so a cpu memory pixmap may
   also has a valid fbo or tex attached to it. So we will have to use the above
   new element to check it true type.

After this commit, we can pass the rendercheck testing for all the picture formats.
And is much much fater than fallback to cpu when doing rendercheck testing.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
ba6dd8aa49 glamor: Simplify fill acceleration for spans/polyfillrect by only clipping once.
This commit was borrowed from uxa driver contributed by Eric.
    commit number is e0066e77e026b0dd0daa0c3765473c7d63aa6753. commit log paste as
    below:
    We were clipping each span against the bounds of the clip, throwing
    out the span early if it was all clipped, and then walked the clip box
    clipping against each of the cliprects.  We would expect spans to
    typically be clipped against one box, and not thrown out, so we were
    not saving any work there.  For multiple cliprects, we were adding
    work.  Only for many spans clipped entirely out of a complicated clip
    region would it have saved work, and it clearly didn't save bugs as
    evidenced by the many fix attempts here.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
a0a52be739 glamor: Fallback to fbPolylines for diagonal poly_line.
It's better to give a correct output when we haven't
implement all the code path.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
d7f8b888d0 glamor: For non-supported fill style fallback to fbFill.
The previous implementation will just skip the rendering
which is not good.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
b60e6cb66d glamor: Silence compilation warnings.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
229240e565 glamor: Add render triangles support.
By default, fallback to frame buffer currently. This commit
makes us pass the rendercheck's triangles testing.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
ac0589c916 glamor: Use software fb for 1bpp pixmap.
For 1bpp pixmap, software fb get better performance than
GL surface. The main reason is that fbo doesn't support
1bpp texture as internal format, so we have to translate
a 1bpp bitmap to a 8bit alpha format each time which is
very inefficient. And the previous implementation is
not supported by the latest OpenGL 4.0, the GL_BITMAP
was deprecated.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
3c44e3e0ce glamor: Optimize composite when soure/mask is xrgb.
Added a new shader aswizlle_prog to wired the alpha to 1 when
the image color depth is 24 (xrgb). Then we don't need to fallback
the xrgb source/mask to software composite in render phase. Also
don't wire the alpha bit to 1 in the render phase. This can get
about 2x performance gain with the cairo performance trace's
firefox-planet case.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
0e2af4d0c9 glamor: Don't print those fallback messages by default.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
925fc9724f glamor: Optimize glamor_finish_access.
use pbo if possible when we load texture to a temporary tex.
And for the previous direct texture load function, it's not
correct and get removed in this commit.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2011-09-26 16:46:35 +08:00
Zhigang Gong
b8ce483f58 glamor: Don't use glamor_pixmap_type currently.
Added comments to glamor_pixmap_create. To be refined in the future.
We need to identify whether a pixmap is a CPU memory pixmap or a
GPU pixmap. Current implementation is not correct. There are three
cases:

1. Too large pixmap, we direct it to CPU memory pixmap.
2. w ==0 ||  h == 0 pixmap, this case has two possibilities:
   2.1 It will become a screen pixmap latter, then it should be
       GPU type.
   2.2 It's a scratch pixmap or created from a share memory, then
       it should belong to CPU memory.

XXX, need to be refined latter.
2011-09-26 16:46:35 +08:00
Zhigang Gong
28835be1b8 glamor: improve glamor_finish_access.
When the platform's coordinate system is the same as X11's . We
can load the texture to the fbo directly without one extra texture
transformation.
2011-09-26 16:46:35 +08:00
Zhigang Gong
1edf0cc6ab glamor: Don't write back read only pixmap to fbo.
For those pixmap which has valid fbo and opened as GLAMOR_ACCESS_RO
mode, we don't need to upload the texture back when calling the
glamor_finish_access(). This will get about 10% performance gain.
2011-09-26 16:46:35 +08:00
Zhigang Gong
1495ba9e64 glamor: Use buffer object as much as possible.
Change the row length of 1bit color depth pixmap to the actual stride.
The previous implementation use the width as its stride which is not
good. As it will waste 8 times of space and also bring some non-unify
code path. With this commit, we can merge those 1bit or other color
depth to almost one code path. And we will use pixel buffer object
as much as possible due to performance issue. By default, some mesa
hardware driver will fallback to software rasterization when use
glReadPixels on a non-buffer-object frame buffer. This change will
get about 4x times performance improvemention when we use y-inverted
glamor or the driver support hardware y-flipped blitting.
2011-09-26 16:46:35 +08:00
Zhigang Gong
cd43b1ea83 glamor: Add fallback code path for glamor_fill. 2011-09-26 16:46:35 +08:00
Zhigang Gong
8593f22fb8 glamor: glamor_set_alu should enable GL_COLOR_LOGIC_OP.
GL_COLOR_OP seems not supported in current MESA.
2011-09-26 16:46:35 +08:00
Zhigang Gong
f871d174a8 glamor: Switch to software fb for too large pixmap.
If pixmap's size exceeds the limitation of the MESA library, the
rendering will fail. So we switch to software fb if it is the case.
Add one new element for pixmap private structure to indicate whehter
we are a software fb type or a opengl type.
2011-09-26 16:46:35 +08:00
Zhigang Gong
c97d4533f2 glamor: Silent compilation warnings due to some deprecated APIs.
those xcalloc/xfree/xalloc/XNFprintf/... are deprecated. Replace
then with the new one. And fix some other minor problems.
2011-09-26 16:46:34 +08:00
Zhigang Gong
eb3487a448 glamor: Add new feature which is to flip output on y axis.
Due to the coordinate system on EGL is different from FBO
object. To support EGL surface well, we add this new feature.
When calling glamor_init from EGL ddx driver, it should use
the new flag GLAMOR_INVERTED_Y_AXIS.
2011-09-26 16:46:34 +08:00
Zhigang Gong
26ff612171 glamor: Resolved merge conflictions with Kristian's glamor-ddx patch. 2011-09-26 16:46:34 +08:00
Zhigang Gong
47b6531273 glamor: Fixed one segfault bug when close screen.
move the original glamor_fini to glamor_close_screen. And wrap the CloseScreen
with glamor_close_screen, Then we can do some thing before call the underlying
CloseScreen().
The root cause is that glamor_fini will be called after the ->CloseScreen().
This may trigger a segmentation fault at
glamor_unrealize_glyph_caches() at calling into FreePicture().
2011-09-26 16:46:34 +08:00
Zhigang Gong
b3577a1c85 glamor: Merged with latest xserver.
Merged with latest xserver, the major change is due to the API change of
the management of devPrivates.
2011-09-26 16:46:34 +08:00
Zhigang Gong
3105fe9f64 glamor: Call glamor_composite_rects only when enable RENDER. 2011-09-26 16:46:34 +08:00
Zhigang Gong
f9843c7a35 glamor: Fixed one conflict data type(XID) bug.
We should include the dix-config.h for all the glamor files. Otherwise
the XID type maybe inconsisitent in different files in 64bit machine.
The root cause is this macro "#define _XSERVER64 1" should be included
in all files refer to the data type "XID" which is originally defined
in X.h. If _XSERVER64 is defined as 1, then XID is defined as CARD32
which is a 32bit integer. If _XSERVER64 is not defined as 1 then XID
is "unsigned long". In a 32bit machine, "unsigned long" should be
identical to CARD32. But in a 64bit machine, they are different.
2011-09-26 16:46:34 +08:00
Zhigang Gong
e194740c94 glamor: Fixed some compiling and linking errors.
Change the inline functions to static type, otherwise when linking it
complains multiple definitions of those functions.
2011-09-26 16:46:34 +08:00
Eric Anholt
8cfcc61403 glamor: Add support for using EXT_framebuffer_blit to do CopyArea. 2011-09-26 16:46:34 +08:00
Eric Anholt
d2da9d1c22 glamor: Reduce the noise from wide lines "fallback". 2011-09-26 16:46:34 +08:00
Eric Anholt
955ccfbc34 glamor: Fix the segfault at screen fini. 2011-09-26 16:46:34 +08:00
Eric Anholt
003dee4c82 glamor: Replace the immediate mode in glamor_fill() with glDrawArrays(). 2011-09-26 16:46:34 +08:00
Eric Anholt
60775e21e3 glamor: Use a VBO to accumulate multiple glyph quads at once.
This increases us from 23000 to 27000/sec on rgb24text.
2011-09-26 16:46:34 +08:00
Eric Anholt
8ce312e619 glamor: Use glamor_composite_with_shader once per group of glyphs.
This shaves CPU time in GL setup.  Performance of rgb24text went from
18400/sec to 23500/sec.
2011-09-26 16:46:34 +08:00
Eric Anholt
6ce05e0b28 glamor: Convert the shaders path to handling glamor_composite_rect_t. 2011-09-26 16:46:34 +08:00
Eric Anholt
858ce0c192 glamor: Add support for component alpha rendering.
Brings x11perf -rgb24text from 230/sec to 18400/sec
2011-09-26 16:46:34 +08:00
Eric Anholt
d07fc66a05 glamor: Rework shader setup to make extending the IN types easier. 2011-09-26 16:46:33 +08:00
Eric Anholt
8cefa287dd glamor: Add a little mechanism for only printing fallbacks when they happen.
Sometimes we want to try a couple of different methods for
accelerating.  If one of them says "no" and the other says "yes",
don't spam the log about the "no."
2011-09-26 16:46:33 +08:00
Eric Anholt
5f5c35b56d glamor: Fix up the fallback message for no texture present on compositing. 2011-09-26 16:46:33 +08:00
Eric Anholt
2fa95725d8 glamor: Add support for a1 composite sources.
They're stored just like a8, but the values are set to either 0.0 or
1.0.  Because they're a8 with only two legal values, we can't use them
as destinations, but nobody's rendering to a1 dests anyway (we hope).
2011-09-26 16:46:33 +08:00
Eric Anholt
9bcbcbf8c2 glamor: Fix and enable ZPixmap PutImage acceleration. 2011-09-26 16:46:33 +08:00
Eric Anholt
2ba634fab9 glamor: Fix render source transforms.
Fixes (except for small bit differences) cairo source-pattern.
2011-09-26 16:46:33 +08:00
Eric Anholt
b1f67a5082 glamor: Fix and enable glamor_get_spans().
This makes running the cairo test suite almost tolerable.
2011-09-26 16:46:33 +08:00
Eric Anholt
f88d76cf7e glamor: Enable glamor_fill_spans().
x11perf -wline100 performance goes from 8.8/sec to 111/sec.
2011-09-26 16:46:33 +08:00
Eric Anholt
a63df0c504 glamor: Fix up the wide/non-solid lines fallback. 2011-09-26 16:46:33 +08:00
Eric Anholt
d61a13cf3f glamor: Fix and enable tile fill acceleration (aka the root weave). 2011-09-26 16:46:33 +08:00
Eric Anholt
86a2065253 glamor: Fix off-by-one in CopyPixels CopyArea path.
Fixes window dragging in uncomposited metacity.
2011-09-26 16:46:33 +08:00
Eric Anholt
be82a06242 glamor: Fix screen_x/screen_y handling for compositing.
It's not an offset from pixmap coords to composited pixmap coords,
it's an offset from screen-relative window drawable coords to
composited pixmap coords.
2011-09-26 16:46:33 +08:00
Eric Anholt
5360b1e8bb glamor: Implement glCopyPixels based src == dest CopyArea acceleration 2011-09-26 16:46:33 +08:00
Eric Anholt
0565c1d789 glamor: Add support for accel of x8r8g8b8 source pictures.
There's a limitation still for RepeatNone, but this fixes a bunch of
fallbacks for gnome-terminal.
2011-09-26 16:46:33 +08:00
Eric Anholt
e6bf505736 glamor: Set active texture on glamor_copy_n_to_n setup.
Fixes failure in rendercheck -t blend -o src
2011-09-26 16:46:33 +08:00
Eric Anholt
be64167fea glamor: Don't try to CopyArea from a Solid source picture.
Fixes failure with rendercheck.
2011-09-26 16:46:33 +08:00
Eric Anholt
126fc09cb5 glamor: Rework the Render shader setup to be easily modified, like cairo-gl. 2011-09-26 16:46:33 +08:00
Eric Anholt
f4a3194837 glamor: Add the glyph cache from UXA (de-camelCased).
This doesn't yet have an optimized glamor_composite_rects()
implementation, but it does triple the speed of x11perf -aa10text.
2011-09-26 16:46:33 +08:00
Eric Anholt
7e6432e7b9 glamor: Fix up and enable accelerated composite. 2011-09-26 16:46:33 +08:00
Eric Anholt
a0b589e90a glamor: Restore planemask to all-on when finishing a fill. 2011-09-26 16:46:33 +08:00
Eric Anholt
d8c2662bf4 glamor: Set active texture in finishaccess drawing. 2011-09-26 16:46:33 +08:00
Eric Anholt
4f398b29dd glamor: Align stride of fallback pixmap data to 32 bits.
fb/pixman demand this alignment, and all sorts of things go badly otherwise.
Fixes piglit x11-8bpp-7x8-draw.
2011-09-26 16:46:33 +08:00
Eric Anholt
15e58b5ffb glamor: Split the copy path out into its own function. 2011-09-26 16:46:33 +08:00
Eric Anholt
ad67299fa2 glamor: Provide more information about the operands to fallback composites. 2011-09-26 16:46:33 +08:00
Eric Anholt
4811e428a9 glamor: Pull in UXA code for dumping some composites down to copy_n_to_n.
Window dragging with metacity+gnome-terminal+xcompmgr is almost credible.
2011-09-26 16:46:33 +08:00
Eric Anholt
35847c578e glamor: Add acceleration for copyarea not from the screen. 2011-09-26 16:46:32 +08:00
Eric Anholt
647b9fb49a glamor: Add CopyWindow implementation so it doesn't crash. 2011-09-26 16:46:32 +08:00
Eric Anholt
95d4a5a6ab glamor: Enable fill acceleration and flip opposite for pixmaps too.
Here's my theory for the flipping: It doesn't really matter which
orientation we store the pixmaps if we don't scan them out.  We have
to flip coordinates for the window system framebuffer.  Doing so for
everything else makes things consistent.  I'm not sure how this will
interact with future GLX integration, though.
2011-09-26 16:46:32 +08:00
Eric Anholt
5332547a0a glamor: Fix prepare_access on 1bpp data.
Apparently I don't have anything hitting this path, so I'm not sure if
it's good or not.
2011-09-26 16:46:32 +08:00
Eric Anholt
c3c3a63497 glamor: Use the pixmap stride in fallbacks instead of trying to guess it.
Mostly fixes gnome-terminal text.
2011-09-26 16:46:32 +08:00
Eric Anholt
45de3d24b4 glamor: Replace the glDrawPixels in glamor_finish_access with GLSL.
Root weave displays. \o/
2011-09-26 16:46:32 +08:00
Eric Anholt
d8d3fa1034 glamor: All the fallbacks in the world.
Bringup is really not flying when I can't see anything.  So dump back
to all software so I can turn on a bit at a time.
2011-09-26 16:46:32 +08:00
Eric Anholt
745502af96 glamor: Add check for EXT_bgra which we rely on. 2011-09-26 16:46:32 +08:00
Eric Anholt
6ce378f11f glamor: Add fallback support for glamor_get_spans(). 2011-09-26 16:46:32 +08:00
Eric Anholt
b5087ff9b1 glamor: Fix the row length of 1bpp prepare_access. 2011-09-26 16:46:32 +08:00
Eric Anholt
e93070affd glamor: Fix up the access flags for glamor_prepare_access(). 2011-09-26 16:46:32 +08:00
Eric Anholt
0e56c182c3 glamor: Add fallback support to glamor_put_image(). 2011-09-26 16:46:32 +08:00
Eric Anholt
22cad98975 glamor: Add fallback support to glamor_set_spans(). 2011-09-26 16:46:32 +08:00
Eric Anholt
55dac9b42e glamor: Add glamor_prepare_access_gc() from UXA. 2011-09-26 16:46:32 +08:00
Eric Anholt
72a757ba00 glamor: Use GL_MESA_pack_invert to avoid complexity in prepare_access. 2011-09-26 16:46:32 +08:00
Eric Anholt
e9d4794cd0 glamor: Add fallbacks for Render. 2011-09-26 16:46:32 +08:00
Eric Anholt
de675893b7 glamor: Add fallbacks for glamor_copy_area(). 2011-09-26 16:46:32 +08:00
Eric Anholt
ca58607a44 glamor: Move glamor_poly_lines to a separate file. 2011-09-26 16:46:32 +08:00
Eric Anholt
800fd4f849 glamor: Fix the type for copyarea. 2011-09-26 16:46:32 +08:00
Eric Anholt
c4343dfa0a glamor: Add prepare/finishaccess code based on UXA. 2011-09-26 16:46:32 +08:00
Eric Anholt
f17473cdd5 glamor: Fix pixmap private getter in copyarea. 2011-09-26 16:46:32 +08:00
Eric Anholt
5915b4c0cf glamor: Add support for solid source pictures. 2011-09-26 16:46:32 +08:00
Eric Anholt
1159ebb30b glamor: Add untested copyarea implementation 2011-09-26 16:46:32 +08:00
Eric Anholt
936385142c glamor: Accelerate PolyFillRect using glamor_fill instead of spans. 2011-09-26 16:46:32 +08:00
Eric Anholt
6dacc9b08c glamor: Add untested PutImage 1bpp XYPixmap support. 2011-09-26 16:46:31 +08:00
Eric Anholt
854e9bd20a glamor: Add untested PutImage XYBitmap support. 2011-09-26 16:46:31 +08:00
Eric Anholt
8a53566acb glamor: make the polylines complaint a little more useful. 2011-09-26 16:46:31 +08:00
Eric Anholt
aa13306974 glamor: Start adding render acceleration support.
This brings in idr's glu3 code.  We'll probably want to move to linking to
it as a library, once an ABI-stable release is out.
2011-09-26 16:46:31 +08:00
Eric Anholt
4a51cc0440 glamor: Add clipping to setspans. 2011-09-26 16:46:31 +08:00
Eric Anholt
5fadea5d9c glamor: Fix some screen_xy offsets to be the right way around. 2011-09-26 16:46:31 +08:00
Eric Anholt
44e4599b83 glamor: Move planemask to a function in case I decide to fill it in. 2011-09-26 16:46:31 +08:00
Eric Anholt
882411bef1 glamor: add alu support to setspans. 2011-09-26 16:46:31 +08:00
Eric Anholt
c70ce72fd7 glamor: Give setspans the same format support as getspans. 2011-09-26 16:46:31 +08:00
Eric Anholt
d9eef95c74 glamor: Fix bad fallthrough in getspans (accessing invalid memory). 2011-09-26 16:46:31 +08:00
Eric Anholt
0360ba361a glamor: Fix memory leak in getspans. 2011-09-26 16:46:31 +08:00
Eric Anholt
cdb1fe6d96 glamor: Move setspans to a separate file. 2011-09-26 16:46:31 +08:00
Eric Anholt
cfb8dea815 glamor: Hook up miGetImage to fix some invalid accesses. 2011-09-26 16:46:31 +08:00
Eric Anholt
e3c02c09c1 glamor: Add ALU support to solid, tile, and putimage. 2011-09-26 16:46:31 +08:00
Eric Anholt
2b657d91d8 glamor: Add untested putimage support. 2011-09-26 16:46:31 +08:00
Eric Anholt
f66e5c4145 glamor: Add 8bpp to get/setspans. 2011-09-26 16:46:31 +08:00
Eric Anholt
93ad091442 glamor: Add trapezoids code.
This fixes segfaults on starting gnome-terminal.
2011-09-26 16:46:31 +08:00
Eric Anholt
60ca0260f2 glamor: Add more solid_fail_regions for software fallbacks. 2011-09-26 16:46:31 +08:00
Eric Anholt
7500ee2b02 glamor: Fill in 1 and 24-bit getspans. 2011-09-26 16:46:31 +08:00
Eric Anholt
f6cffbb2ba glamor: Add stub Composite support. 2011-09-26 16:46:31 +08:00
Eric Anholt
2fa26c4958 glamor: Free resources when destroying pixmaps. 2011-09-26 16:46:31 +08:00
Eric Anholt
16c3b929dd glamor: Add untested support for tile filling. 2011-09-26 16:46:31 +08:00
Eric Anholt
8016135ec7 glamor: Fill out glamor_get_color_4f_from_pixel() a bit. 2011-09-26 16:46:31 +08:00
Eric Anholt
519103565c glamor: Create FBOs for pixmaps. 2011-09-26 16:46:31 +08:00
Eric Anholt
f92d1478e9 glamor: Maybe fix up the format/type for setspans. 2011-09-26 16:46:30 +08:00
Eric Anholt
4f139db92f glamor: Add getspans implementation. 2011-09-26 16:46:30 +08:00
Eric Anholt
f1dbed5456 glamor: Move to using shader objects. 2011-09-26 16:46:30 +08:00
Eric Anholt
fbbdd788cb glamor: Fix up DrawPixels arguments to bear some relation to reality. 2011-09-26 16:46:30 +08:00
Eric Anholt
74f262bcdb glamor: remove gratuitous flush. 2011-09-26 16:46:30 +08:00
Eric Anholt
399e006989 glamor: Fix up block/wakeup handler.
Prototypes are fixed, and we don't need to flush on wakeup.
2011-09-26 16:46:30 +08:00
Eric Anholt
2e35ceca65 ephyr: Use GLEW.
This will hide all sorts of extension stuff from us.
2011-09-26 16:46:30 +08:00
Eric Anholt
08097434ec add fill files, merge with first real attempt at rendering. 2011-09-26 16:46:30 +08:00
Eric Anholt
df083fab84 glamor: first real attempt at rendering. 2011-09-26 16:46:30 +08:00
Eric Anholt
1b151f2e6a glamor: glFlush from the blockhandler so rendering happens. 2011-09-26 16:46:30 +08:00
Eric Anholt
b530cdea4a glamor: Use a nicer struct initializer for gcops. 2011-09-26 16:46:30 +08:00
Eric Anholt
4d52ae7f2d glamor: Start trying to hook up the rendering bits 2011-09-26 16:46:30 +08:00
Eric Anholt
da6e0ffad2 More ephyr/glamor glue. 2011-09-26 16:46:30 +08:00
Eric Anholt
0ec823ce5b Add build infrastructure for glamor. 2011-09-26 16:37:50 +08:00