Commit Graph

72 Commits

Author SHA1 Message Date
Louis-Francis Ratté-Boulianne c8c276c956 glamor: Implement PixmapFromBuffers and BuffersFromPixmap
It relies on GBM >= 17.1.0 where we can import BO with multiple
planes and a format modifier (GBM_BO_IMPORT_FD_MODIFIER).

v2: Properly free fds in Xwayland

[Also add glamor_egl_ext.h to Makefile.am for distcheck's sake - ajax]

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-03-05 13:27:49 -05:00
Adam Jackson f4a4115547 glamor: Use eglGetPlatformDisplay{,EXT} if we can
eglGetDisplay forces the implementation to guess which kind of display
it's been handed. glvnd does something different from Mesa, and in
general it's impossible for the library to get this right. Add a new
inline that gets the logic right, and works around a quirk in epoxy.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-10-05 16:03:13 -04:00
Olivier Fourdan 25ce263fd8 glamor: do not build Xv support when --disable-xv
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-03-09 14:03:06 -05:00
Keith Packard b0d2e01031 glamor: Replace CompositeGlyphs code [v2]
New composite glyphs code uses the updated glamor program
infrastructure to create efficient shaders for drawing render text.

Glyphs are cached in two atlases (one 8-bit, one 32-bit) in a simple
linear fashion. When the atlas fills, it is discarded and a new one
constructed.

v2: Eric Anholt changed the non-GLSL 130 path to use quads instead of
two triangles for a significant performance improvement on hardware
with quads. Someone can fix the GLES quads emulation if they want to
make it faster there.

v3: Eric found more dead code to delete

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-05-14 16:32:07 -07:00
Keith Packard cfa302d622 glamor: Add support for SHM sync fences
This hooks up SHM sync fences to complete the requirements for DRI3
running on Glamor.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-07-18 12:22:50 -07:00
Eric Anholt 65efc14b6a glamor: Split the XV code into XF86-dependent parts and generic.
I want to expose this from Xephyr as well, both to be able to test XV
changes rapidly, and beause the XV passthrough to the host's overlay
really doesn't work out well when we glXSwapBuffers() over the
colorkey.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-06-15 23:20:02 +01:00
Keith Packard ef2bf0e645 glamor: Remove 'tiling' shader code
The core rendering paths all use the glamor_program fill functions now

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-15 23:17:59 +01:00
Keith Packard 18c09e60bf glamor: Replace glamor_solid_boxes and glamor_solid with GC using code
This provides glamor_solid_boxes and glamor_solid using regular GC
operations instead of calling directly to underlying rendering
functions. This will allow the old rendering code to be removed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-15 23:17:58 +01:00
Keith Packard d18f5801c9 glamor: Add glamor_program based 0-width dashed lines
This makes sure the pixelization for dashed lines matches non-dashed
lines, while also speeding them up.

v2: Switch to glamor_make_current

v3: Create dash pattern pixmap without GLAMOR_CREATE_FBO_NO_FBO

v4: Adopt suggestions from Eric's review:

  - Drops power-of-two alignment of our line vertex data, simplifying
    the code.

  - Stops reading from the VBO.  While on keithp's and my machines the
    VBO is mapped cached, on many implementations it will be mapped WC,
    making those reads extremely expensive.

  - Style fixes (line wrapping, spaces around operators).

v5: Adopt suggestions from Markus' review:

  - Use max when computing zero-width dashed line length.

    Don't open code max here.

  - Embed CoordModePrevious into VBO writing for dashed lines

    Instead of pre-computing the coord mode previous results, just
    embed this in the loop which fills the vertex buffer. Saves
    re-writing the request buffer, and shortens the code a bit

v6: Export glamor_destroy_gc for UXA

    UXA needs to call glamor_destroy_gc from its GCFuncs, so export
    it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-15 22:02:41 +01:00
Keith Packard dc9fa9080a glamor: Use glamor_program and GL_LINES for 0-width lines
GL lines are nearly X compliant; you just need to fill in the last
pixel when the client hasn't requested CapNotLast.

v2: switch to glamor_make_current

v3: use miPolylines instead of custom glamor fallback path. Wrap
    code to 80 columns.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-15 22:02:41 +01:00
Keith Packard 45ebc4e3fa glamor: Add glamor_program based copy acceleration
Paints with textures, using a temporary buffer for overlapping copies

Performs CPU to GPU transfers for pixmaps in memory. Accelerates copy
plane when both objects are in the GPU. Includes copy_window
acceleration too.

v2: Use NV_texture_barrier for non-overlapping copies within the same
drawable

v3: Switch to glamor_make_current

v4: Do overlap check on the bounding box of the region rather than
    on individual boxes

v5: Use Eric Anholt's re-written comments which provide a more accurate
    description of the code

v6: Use floating point uniform for copy plane bit multiplier. This
    avoids an int to float conversion in the copy plane fragment shader.

    Use round() instead of adding 0.5 in copy plane. round() and +0.5
    end up generating equivalent code, and performance measurements
    confirm that they are the same speed. Round() is a bit clearer
    though, so we'll use it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus@selfnet.de>
2014-06-15 22:02:41 +01:00
Keith Packard 15e4d14dfa glamor: Replace fallback preparation code
These offer a simpler and more efficient means for temporarily
transitioning to CPU-accessible memory for fallback implementations.

v2: Do not attempt fallbacks with GLAMOR_DRM_ONLY pixmaps

    glamor cannot transfer pixels for GLAMOR_DRM_ONLY pixmaps using
    glReadPixels and glTexSubImage2D, and so there's no way to perform
    fallback operations with these pixmaps.

v3: Clear ->pbo field when deleting the PBO.  Otherwise, we'd reuse
    the old name next time we fall back on the pixmap, which would
    potentially conflict with some other pixmap that genned a new
    name, or just do a lazy allocation of the name (compat GL context,
    like we currently use) or error out (core GL context, like we hope
    to use some day).  Also, style fixes.  Changes by anholt, acked by
    keithp.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-15 22:02:40 +01:00
Keith Packard 5062b4fadd glamor: Add glamor_transfer based glamor_get_image and glamor_put_image
These use the upload_boxes and download_boxes helpers to provide
reasonably efficient image transfer.

Fixes segfaults in Xephyr with x11perf -reps 1.

Performance improvements:

Improves -putimage10 by 548.218% +/- 88.601% (n=10).
Improves -putimage500 by 3.71014% +/- 1.5049% (n=10).
Improves -getimage10 by 8.37004% +/- 4.58274% (n=10).
No statistically significant difference on -getimage500 (n=10).

v2: Fix rebase failures, don't forget to check/prepare the gc in
    putimage fallbacks (changes by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-23 10:36:18 -07:00
Michel Dänzer 80a0b29c3b glamor: Add remaining header files to SOURCES
It wasn't possible to build glamor from tarballs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64297#c9
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-04-21 15:25:40 -07:00
Keith Packard 3c34dd3603 glamor: Add glamor_program based poly_text and image_text
Accelerates text painting with GPU-based geometry computation and stippling

v2: Simplify get_glyphs, expand single character variable names to
    more descriptive ones. (Markus Wick)
v3: Rebase against the glamor_prepare_* un-renaming (changes by anholt).

Improves x11perf -f8text by 417.908% +/- 11.0144% (n=10)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-03 13:07:52 -07:00
Keith Packard 3411e8c538 glamor: Add glamor_program based poly_fill_rect
This accelerates poly_fill_rect using GPU-based geometry computation

Improves x11perf -rect100 by 41.5127% +/- 7.63888% (n=10)
Improves x11perf -rect10 by 3745.72% +/- 94.7503% (n=6)

v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL
    1.20 and GLES2 cases (changes by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-03 13:07:52 -07:00
Keith Packard 0a6d311618 glamor: Add glamor_program based fill/set/get spans
This accelerates spans operations using GPU-based geometry computation

-wellipse500 goes from about 4k/sec before the patch, to ~8k/sec in
the GLES2 fallback loop, to ~100k/sec in desktop mode.

v2: Rebase on skipping the prepare rewrite for now, and fix the GLSL
    1.20 and GLES2 cases (changes by anholt).

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-04-03 13:07:51 -07:00
Keith Packard d78c257f52 glamor: Add simple upload/download functions in glamor_transfer
These use glTexSubimage2D for upload and glReadPixels for
download. There are a variety of interfaces to the basic function as
needed by the callers.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2014-04-03 13:07:51 -07:00
Keith Packard 1b5d7e7846 glamor: Add glamor_program PolyPoint implementation
This accelerates poly point when possible by off-loading all geometry
computation to the GPU.

Improves x11perf -dot performance by 28109.5% +/- 1022.01% (n=3)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-26 12:58:40 -07:00
Keith Packard 72a4beff6d glamor: Move glamor_poly_segment to separate glamor_segment.c file
There's no reason to mix PolyPoint and PolySegment in the same file.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-off-by: Eric Anholt <eric@anholt.net>
2014-03-26 12:58:40 -07:00
Keith Packard 029b64c30a glamor: Add infrastructure for generating shaders on the fly
This just adds a bunch of support code to construct shaders from
'facets', which bundle attributes needed for each layer of the
rendering system. At this point, that includes only the primitive and
the fill stuff.

v2: Correct comment in glamor transform about 1/2 pixel correction needed
    for GL_POINT. (Eric Anholt)
v3: Rebase on Markus's cleanups (change by anholt)

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-03-26 12:58:40 -07:00
Eric Anholt d310d566b1 glamor: Extract the streamed vertex data code used by Render.
We should be uploading any vertex data using this kind of upload
style, since it saves a bunch of extra copies of our vertex data.

v2:
  - Add a simple comment about what the function does.
  - Use get_vbo_space()'s return in trapezoids, instead of dereffing
    glamor_priv->vb (by Markus Wick).
  - Fix the double-unmapping by moving put_vbo_space() outside of
    flush_composite_rects().
  - Remove the rest of the composite_vbo_offset usage, and just always
    use get_vbo_space()'s return value.
v3:
  - Fix failure to put_vbo_space in traps when no prims were
    generated.
  - Unbind the VBO from put_vbo_space().  Keeps callers from
    forgetting to do so.
v4:
  - Split out some changes into the previous 3 commits while trying to
    track down a regression.
  - Fix regression due to rebase fail where glamor_priv->vbo_offset
    wasn't incremented.
v5:
  - Fix GLES2 VBO sizing.
  - Add a comment about resize behavior.
  - Move glamor_vbo.c init code to glamor_vbo.c from
    glamor_render.c. (Derived from Markus's changes, but the GLES2 fix
    dropped almost all of the code in the functions).
v6:
  - Drop the initial BufferData on GLES2 (it happens at put() time).
  - Don't forget to set vbo_offset to the size on GLES2.
  - Use char * instead of void * in the cast to return the vbo_offset.
  - Resize the default FBO to 512kb, to be similar to previous
    behavior.  +1.66124% +/- 0.284223% (n=679) on aa10text.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Markus Wick <markus at selfnet.de>
2014-03-10 13:57:21 -07:00
Eric Anholt 2d20f75b60 xorg: Connect up the glamor XV code, xorg DDX-only for now.
Porting this code to be non-xorg-dependent is going to take
significant hacking, so just dump it in the glamoregl module for the
moment, so I can hack on it while regression testing.

v2: Fix compiler warnings by adding #include dix-config.h at the top,
    don't try to auto-init (I'll try to fix the xv ABI later).
v3: Fix last minute breakage of having reintroduced xf86ScrnToScreen
    (one of the compat macros).  Just use the drawable's pScreen instead.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-03-05 13:10:20 -08:00
Eric Anholt 4afe15d8bf glamor: Put in a pluggable context switcher for GLX versus EGL.
The GLX side just gets the context from the current state.  That's
also something I want to do for EGL, so that the making a context is
separate from initializing glamor, but I think I need the modesetting
driver in the server before I think about hacking on that more.

The previous code was rather incestuous, along with pulling in xf86
dependencies to our dix code.  The new code just initializes itself
from the current state.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-14 18:30:01 -08:00
Eric Anholt 0373b3f4f7 glamor: Convert to using libepoxy.
Libepoxy hides all the GL versus GLES2 dispatch handling for us, with
higher performance.

v2: Squash in the later patch to drop the later of two repeated
    glamor_get_dispatch()es instead (caught by keithp)

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-02-14 18:28:56 -08:00
Eric Anholt d26f533515 glamor: Hook the module back up to the build.
For now we're just building an uninstalled library.  The extra EGL
stubs are required so that we can get the DIX building and usable
without pulling in the xf86 DDX code in glamor_egl.c.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Eric Anholt a7b8ce8b42 glamor: Drop xfree86 dependencies from this dix module.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Adam Jackson 6cc0b7b015 glamor/egl: Remove glapi awareness
We only needed this because glx was directly bashing glapi tables.
Since that's not the case anymore, we should just MakeCurrent like a
real GL app.

v2: Hand-resolve against rebase onto newer server (by anholt)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Eric Anholt 0c5a7c2086 glamor: Remove compat code for building out of tree.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Adam Jackson 82efb90efb glamor: Remove copy of sna's compiler.h
Xfuncproto.h has equivalents for these already.

v2: Adjust a couple more likelies after the rebase (anholt)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Gaetan Nadon 4dd62d7807 libglamoregl: remove -I$(top_srcdir)/src
Automake always provide -I. It is at the beginning of the list of compiler
options.

Not needed either to find glamor_egl.c source.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Gaetan Nadon 08c23ff8ae Make: remove cruft copied over from the X server makefiles
In toplevel makefile:
nostdinc: only xserver, no other X modules
aclocaldir: no local macros to install
xkb_path: xserver only
"Gross hack": xserver only

In src/makefile:
SOLARIS_ASM_CFLAGS; server only
XORG_INCS: undefined variable
DIX_CFLAGS: undefined variable

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Dave Airlie e3d1d4e3ca glamor: add initial Xv support
This does YV12 and I420 for now, not sure if we can do packed without
a GL extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-18 11:23:54 -08:00
Christian König 2ea618f2cf Use GBM_LIBS and GBM_CFLAGS
Signed-off-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
2013-12-18 11:23:54 -08:00
Armin K 7e818f7d39 First attempt to make libglamor.so shared versioned library
As recommended by Michel in this thread reply:
http://lists.freedesktop.org/archives/glamor/2013-March/000305.html

v2: Correct shared library location in glamor.pc.in

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62259

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-18 11:23:53 -08:00
Armin K b0318b6de7 Properly dist necesary headers
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-18 11:23:53 -08:00
Armin K fc179bb863 Silence Automake 1.13 warnings
warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-18 11:23:53 -08:00
Dave Airlie 6b954880c2 glamor: add compiler.h
This is also required for distchecking.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-12-18 11:23:53 -08:00
Dave Airlie efbdc9e90f glamor: fix make distcheck part 1
This just adds the headers, then it falls over on the sdk_HEADERS
as it overrides proper install paths by the looks of it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong 4d1a2173f2 glamor_compositerects: Implement optimized version.
Don't call miCompositeRects. Use glamor_composite_clipped_region
to render those boxes at once.
Also add a new function glamor_solid_boxes to fill boxes at once.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:52 -08:00
RobinHe 6dd81c5939 Create the file glamor_triangles.c
Create the file glamor_trapezoid.c, extract the logic
 relating to trapezoid from glamor_render.c to this file.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2013-12-18 11:23:52 -08:00
Zhigang Gong e96ea02010 largepixmap: Implement infrastructure for large pixmap.
Added infrastructure for largepixmap, this commit implemented:
1. Create/Destroy large pixmap.
2. Upload/Download large pixmap.
3. Implement basic repeat normal support.
3. tile/fill/copyarea large pixmap get supported.

The most complicated part glamor_composite still not implemented.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:51 -08:00
Junyan He d900f553c2 Extract the gradient related code out.
1. Extract the logic of gradient from the glamor_render.c
 to the file glamor_gradient.c.
 2. Modify the logic of gradient pixmap gl draw. Use the
 logic like composite before, but the gradient always just
 have one rect to render, so no need to set the VB and EB,
 replace it with just call glDrawArrays. 3.Kill all the
 warning in glamor_render.c

Reviewed-by: Zhigang Gong<zhigang.gong@linux.intel.com>

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:51 -08:00
Zhigang Gong c5b3c2cedc Added strict warning flags to CFLAGS.
We miss the strict warning flags for a long time, now add it back.
This commit also fixed most of the warnings after enable the strict
flags.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:51 -08:00
Zhigang Gong 430bc16ca0 GLX: Enable glx support.
If we are using MESA as our GL library, then both xserver's
GLX and glamor are link to the same library. As xserver's
GLX has its own _glapi_get/set_context/dispatch etc, and it
is a simplified version derived from mesa thus is not
sufficient for mesa/egl's dri loader which is used by glamor.

Then if glx module is loaded before glamoregl module, the
initialization of mesa/egl/opengl will not be correct, and
will fail at a very early stage, most likely fail to map
the element buffer.

Two methodis to fix this problem, first is to modify the xserver's
glx's glapi.c to fit mesa's requirement. The second is to put
a glamor.conf as below, to the system's xorg.conf path.

Section "Module"
        Load  "glamoregl"
EndSection

Then glamor will be loaded firstly, and the mesa's libglapi.so
will be used. As current xserver's dispatch table is the same
as mesa's, then the glx's dri loader can work without problem.

We took the second method as it don't need any change to xorg.:)
Although this is not a graceful implementation as it depends
on the xserver's dispatch table and the mesa's dispatch table
is the same and the context set and get is using the same method.
Anyway it works.

As by default, xserver will enable GLX_USE_TLS. But mesa will not
enable it, you may need to enable that when build mesa.

Three pre-requirements to make this glamor version work:

0. Make sure xserver has commit 66e603, if not please pull the latest
   master branch.
1. Rebuild mesa by enable GLX_USE_TLS.
2. Put the glamor.conf to your system's xorg.conf path and make sure
   it loaded prior to glx module.

Preliminary testing shows indirect glxgears works fine.

If user want to use GLES2 for glamor by using MESA, GLX will not
work correctly.

If you are not using normal MESA, for example PVR's private GLES
implementation, then it should be ok to use GLES2 glamor and the
GLX should work as expected. In this commit, I use gbm to check
whether we are using MESA or non-mesa. Maybe not the best way.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:48 -08:00
Zhigang Gong 1817b6c0cf glamor_eglmodule: Change module name according to normalize naming rule.
As Xorg module loader will normalize module name which will
remove '_' when we put "glamor_egl" to the configure file,
then it will fail to find us.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:48 -08:00
Zhigang Gong 2ff4100849 glamor_fbo: Introduce glamor fbo to manage all the fb/tex.
This is the first patch to implement a fbo/tex pool mechanism which
is like the sna's BO cache list. We firstly need to decopule the
fbo/tex from each pixmap. The new glamor_pixmap_fbo data
structure is for that purpose. It's somehow independent to each
pixmap and can be reused latter by other pixmaps once it's detached
from the current pixmap.

And this commit also slightly change the way to create a
memory pixmap. We will not create a pixmap private data structure
by default, instead we will crete that structure when a memory
pixmap is attaching a fbo to it.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:47 -08:00
Zhigang Gong 9264335347 Added more drawing functions.
As we want to take over all the possible GC ops from the DDX
layer, we need to add all the missed functions.
This commit also fixed one bug at polylines.
We simply drop the bugy optimized code now, as it did not
consider of clip info.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:47 -08:00
Zhigang Gong 8c7fcefb96 glamor-for-ddx: Exports all rendering/drawing functions.
This commit exports all the rest rendering/drawing functions
to the DDX drivers. And introduce some new pixmap type. For
a pixmap which has a separated texture, we never fallback
it to the DDX layer.

This commit also adds the following new functions:
glamor_composite_rects, glamor_get_image_nf which are needed
by UXA framework. Just a simple wrapper function of miXXX.
Will consider to optimize them next few weeks.

This commit also Fixed a glyphs rendering bug pointed by Chris.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:46 -08:00
Zhigang Gong b861aad8e2 Initial version.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:46 -08:00