Commit Graph

13806 Commits

Author SHA1 Message Date
Keith Packard
2eb9915eea present: Set complete notify mode to Skip as needed
Skipped present pixmap calls were not setting the mode to
PresentCompleteModeSkip for skipped operations.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
e487babd52 present: Don't abandon presents which are already queued for flip
Presents which are not marked 'queued' and are in the window present
list are waiting for the flip event; discarding those won't work very
well (it'll end up trashing displayed content for the next frame), so
skip over those when looking for duplicate frame presents

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
ca3a5b2a8f present: Handle PresentOptionAsync for copy mode
Check for Async flag and execute immediately if set, otherwise wait
for the next appropriate vblank before copying.

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-20 12:28:00 -08:00
Keith Packard
a68df14742 Bump version to 1.14.99.905 (1.15 RC5)
Another week, another RC. This should be the last before 1.15 final

Signed-off-by: Keith Packard <keithp@keithp.com>
2013-12-19 14:31:07 -08:00
Keith Packard
4b1ead9d34 Merge remote-tracking branch 'whot/for-keith' 2013-12-19 14:14:59 -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
b8055bd1f6 glamor: fix leak in xv code.
This loop needed to go one higher, not sure if this fixes the leak
MrCooper was seeing on irc, but it fixes a leak.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Gaetan Nadon
752a79562e Fix glamor_egl->egl_create_image_khr makes pointer from integer
This is a warning, but a real problem can occur on some system.

Reported-by: Fabio Pedretti <fabio.ped@libero.it>
Reviewed-by: Axel Davy <davyaxel@free.fr>
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
Axel Davy
7cfd9cc232 Add DRI3 support to glamor
This implements some DRI3 helpers to help the DDXs using
glamor to support DRI3.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Zhigang Gong
06ba3fdfd6 Fixed some compilation warning/error or error checking.
There is one compilation error ,cast int to pointer, when built without
libgbm, reported by Gaetan Nadon.
And some error checking after memory allocation, reported by Seth Arnold.
There are still some similar issues in the largepixmap implementation.
They are relatively more complicate due to the heavy usage of RegionXXX
APIs which may allocate implicitly. Will fix them in the future.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Tested-by: Gaetan Nadon <memsize@videotron.ca>
2013-12-18 11:23:54 -08:00
Axel Davy
a5321ea431 Allow to create textured pixmaps from gbm_bo without using gem names
This implements glamor_egl_create_textured_pixmap_from_gbm_bo,
which is similar to glamor_egl_create_textured_pixmap, except
it takes a gbm_bo as argument.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Fabio Pedretti
403004fe79 glamor: remove unused variable
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Maarten Lankhorst
842cd7eb43 fixup picture in SetWindowPixmap
When creating a window with recordmydesktop running, the following may happen:

create picture 0x1cd457e0, with drawable 0x1327d1f0
(SetWindowPixmap is called)
destroy picture 0x1cd457e0, with drawable 0x1cd65820

Obtaining format for pixmap 0x1327d1f0 and picture 0x1cd457e0
==7989== Invalid read of size 4
==7989==    at 0x8CAA0CA: glamor_get_tex_format_type_from_pixmap (glamor_utils.h:1252)
==7989==    by 0x8CAD1B7: glamor_download_sub_pixmap_to_cpu (glamor_pixmap.c:1074)
==7989==    by 0x8CA8BB7: _glamor_get_image (glamor_getimage.c:66)
==7989==    by 0x8CA8D2F: glamor_get_image (glamor_getimage.c:92)
==7989==    by 0x29AEF2: miSpriteGetImage (misprite.c:413)
==7989==    by 0x1E7674: compGetImage (compinit.c:148)
==7989==    by 0x1F5E5B: ProcShmGetImage (shm.c:684)
==7989==    by 0x1F686F: ProcShmDispatch (shm.c:1121)
==7989==    by 0x15D00D: Dispatch (dispatch.c:432)
==7989==    by 0x14C569: main (main.c:298)
==7989==  Address 0x1cd457f0 is 16 bytes inside a block of size 120 free'd
==7989==    at 0x4C2B60C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7989==    by 0x228897: FreePicture (picture.c:1477)
==7989==    by 0x228B23: PictureDestroyWindow (picture.c:73)
==7989==    by 0x234C19: damageDestroyWindow (damage.c:1646)
==7989==    by 0x1E92C0: compDestroyWindow (compwindow.c:590)
==7989==    by 0x20FF85: DbeDestroyWindow (dbe.c:1389)
==7989==    by 0x185D46: FreeWindowResources (window.c:907)
==7989==    by 0x1889A7: DeleteWindow (window.c:975)
==7989==    by 0x17EBF1: doFreeResource (resource.c:873)
==7989==    by 0x17FC1B: FreeClientResources (resource.c:1139)
==7989==    by 0x15C4DE: CloseDownClient (dispatch.c:3402)
==7989==    by 0x2AB843: CheckConnections (connection.c:1008)
==7989==
(II) fail to get matched format for dfdfdfdf

The fix is to update the picture pointer when the window pixmap is changed,
so it moves the picture around with the window rather than the pixmap.

This makes FreePicture work correctly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71088
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Zhigang Gong
2925db6616 Fixed an incorrect printf format.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69573

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Brian Paul
644e05562e Remove useless return statement
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Brian Paul
8c51eb8239 Remove redundant dispatch->glEnable(GL_TEXTURE_2D)
The same call was already made a few lines earlier.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Brian Paul
3bf1eb577e Fix _glamor_set_spans() bug (re-used 'n' variable)
n was used as a function parameter.  But inside the for (i=1..n) loop,
n got reassigned as REGION_NUM_RECTS() and then decremented to zero by
the while loop.  This caused the for loop to only iterate once instead
of 'n' times.

This patch renames the n parameter to numPoints.

Found by code inspection.  Untested.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Grigori Goronzy
2f62bd46cc glamor_render: fix PictFilters
Add Fast/Good/Best and appropriately map to Nearest and
Bilinear. Additionally, add a fallback path for unsupported filters.

Notably, this fixes window shadow rendering with Compiz, which uses
PictFilterConvolution for some odd reason.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Grigori Goronzy
5695708ecd Use GL_STATIC_DRAW for element index buffer
The buffer never changes anyway.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Grigori Goronzy
8afa008ec4 Use glDrawRangeElements instead of glDrawElements
This lets us explicitly specify the range of vertices that are used,
which the OpenGL driver can use for optimization. Particularly,
it results in lower CPU overhead with Mesa-based drivers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Zhigang Gong
229601e080 Shoud return null subpixmap if we fail to get a valid map address.
The patch is prepared by Raul Fernandes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86693
Signed-off-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
Michel Dänzer
39e95cd0f5 Reset traps_count and ptrap when necessary for the next trapezoid cliprect
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64912
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: He Junyan <junyan.he@inbox.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:54 -08:00
Michel Dänzer
61fca4342a Fix RegionContainsRect test for PutImage
The return value of RegionContainsRect() is not a boolean but an enum
indicating that the region contains the rectangle completely, partially
or not at all. We can only take the PutImage fastpath when the region
contatins the rectangle completely.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65964
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.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
Michel Dänzer
97416e3f14 glamoregl: Use xf86ScreenToScrn()
Fixes crashes when glamor is used for a GPU screen with xserver 1.13 or
newer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200#c17

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-18 11:23:53 -08:00
Dave Airlie
4c5bfd529f glamor_utils: fix unlikely define use
using a define across a split line expression is failure, compiling
with warnings shows this up.

Signed-off-by: Dave Airlie <airlied@redhat.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
80f5e21dae glamor_compositerects: Need to initialize region before fallback.
As we need to call DamageRegionAppend even for fallback path,
we must initialize the region before do that. Pointed by
Igor Vagulin.

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

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Michel Dänzer
14e02f5132 Don't use glBlitFramebufferEXT for overlapping copies.
According to the GL_EXT_framebuffer_blit spec, the result of doing so is
undefined. But we need well-defined results. :)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
e846f48f48 Increase vbo size to 64K verts.
This commit will benefit vertex stressing cases such as
aa10text/rgb10text, and can get about 15% performance gain.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Acked-by: Junyan <junyan.he@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
b8f0a21882 Silence compilation warnings.
After increase to gcc4.7, it reports more warnings, now
fix them.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Tested-by: Junyan He<junyan.he@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
50614451ad glamor_largepixmap: Fixed a bug in repeat clipping.
If the repeat direction only has one block, then we need to set the
dx/dy to cover all the extent. This commit also silence some compilation
warnings.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Michel Dänzer
7eb434918b Prefer KHR_surfaceless_context EGL extension over KHR_surfaceless_opengl/gles2.
Current Mesa Git only advertises the former instead of the latter.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Michel Dänzer
59653fa08a Print space between name of missing EGL extension and 'required'.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Junyan He
c3096c5a56 Fallback to pixman when trapezoid mask is big.
The trapezoid generating speed of the shader is relatively
 slower when the trapezoid area is big. We fallback when
 the trapezoid's width and height is bigger enough.
 The big traps number will also slow down the render because
 of the VBO size. We fallback if ntrap > 256

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-By: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
f62f4d53ef glamor_glyphs: When dst arg point to a NULL buffer, dont't flush.
This is a corner case, when we render glyphs via mask cache, and
when we need to upload new glyphs cache, we need to flush both the
mask and dest buffer. But we the dest arg may point to a NULL buffer
at that time, we need to check it firstly. If the dest buffer is NULL.
Then we don't need to flush both the dest and mask buffer.

This commit fix a potential crash.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
e7af7cb76d glamor_trapezoid: workaround a glsl like problem.
It seems that the following statement cann't run as expected on SNB.
bool trap_left_vertical = (abs(trap_left_vertical_f - 1.0) <= 0.0001);

Have to rewrite it to another style to let the vertical edge trapezoid
to be rendered correctly.

Reviewed-by: Junyan He <junyan.he@linux.intel.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Junyan He
5512c14e34 Fix the problem of VBO leak.
In some cases we allocate the VBO but have no vertex to
 emit, which cause the VBO fail to be released. Fix it.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2013-12-18 11:23:53 -08:00
Junyan He
9f78e22fa6 Just use the shader to generate trapezoid if PolyMode == Imprecise
The precise mode of trapezoid rendering need to sample the trapezoid on
 the centre points of an (2*n+1)x(2*n-1) subpixel grid. It is computationally
 expensive in shader, and we use inside area ratio to replace it.
 The result has some difference, and we just use it if the polymode == Imprecise.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2013-12-18 11:23:53 -08:00
Junyan He
fe024a7822 Change the trapezoid render to use VBO.
Because some uniform variables need to be set for every
 trapezoid rendering, we can not use vbo to render multi
 trapezoids one time, which have performance big loss.
 We now add attributes which contain the same value to bypass
 the uniform variable problem. The uniform value for one
 trapezoid will be set to the same value to all the vertex
 of that trapezoid as an attribute, then in FS, it is still
 a constant.

Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
9dff3378e5 Added the missed header file for xorg 1.13 compat.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
bc1b412b3b Synch with xorg 1.13 change.
As xorg 1.13 change the scrn interaces and remove those
global arrays. Some API change cause we can't build. Now
fix it.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Zhigang Gong
4c27ca4700 gles2: Fixed the compilation problem and some bugs.
Previous patch doesn't set the offset to zero for GLESv2
path. Now fix it.

This patch also fix a minor problem in pixmap uploading
preparation. If the revert is not REVERT_NORMAL, then we
don't need to prepare a fbo for it. As current mesa i965
gles2 driver doesn't support to set a A8 texture as a fbo
target, we must fix this problem. As some A1/A8 picture
need to be uploaded, this is the only place a A8 texture
may be attached to a fbo.

This patch also enable the shader gradient for GLESv2.
The reason we disable it before is that some glsl linker
doesn't support link different objects which have cross
reference. Now we don't have that problem.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00
Michel Dänzer
006fe0e66d Stream vertex data to VBOs.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2013-12-18 11:23:53 -08:00