summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-06-26glamor_xv: add missing includeHEADmasterChí-Thanh Christopher Nguyễn1-0/+1
glamor_xv.c uses DamageDamageRegion but does not include xorg/damage.h. This causes the build to fail if 9b8217f9ef6279fff6628631d18497bed0343ef9 is not present in the X server. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75466 Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=499442 Signed-off-by: Chí-Thanh Christopher Nguyễn <chithanh at gentoo.org> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09xv: workaround corruptionGrigori Goronzy1-0/+1
Keeping the video pixmaps persistent sometimes will lead to video corruption (shifted chroma planes) for unknown reasons. Possibly there are some subtle pixmap handling bugs in xv or other parts of the glamor code. To workaround, simply destroy pixmaps after they have been used once. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72821 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09glamor: Fix typo in setting v_position's attrib location.Eric Anholt1-1/+1
Assuming it was the first attribute assigned by the GL, it would have ended up with location 0 anyway. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09glamor: don't reset the GLSL programMarkus Wick10-24/+0
We don't use fixed function rendering, so there is no need to reset the program at all. This lets the driver avoid checking for state changes between draw calls when we rebind the same program. Improves xephyr x11perf -f8text performance by 6.03062% +/- 1.64928% (n=20) Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09glamor: Use glsl "fract/mod" instead of "while" in gradient shaders.Markus Wick1-44/+4
This fixes gtkperf. It seemed to hang forever. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09glamor: Fix accelerated rendering of GTK's ARGB vs xBGR composites.Eric Anholt1-0/+10
There is some complicated code to support tweaking the format as we upload from a SHM pixmap (aka the GTK icon cache), but if we weren't sourcing from a SHM pixmap we just forgot to check that the formats matched at all. We could potentially be a little more discerning here (xRGB source and ARGB mask would be fine, for example), but this will all change with texture views anyway, so just get the rendering working for 1.16 release. Fixes the new rendercheck gtk_argb_xbgr test. v2: Squash in keithp's fix for checking that we have a non-NULL pixmap, and reword the comment even more. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09vbo: Raise VBO sizeGrigori Goronzy1-1/+1
This reduces CPU overhead due to buffer orphaning, which results in a small overall performance improvement. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09glamor: Use buffer_storageEric Anholt3-1/+66
29.5361% +/- 2.74092% improvement in x11perf -aa10text (n=489). Pulled from Eric's xserver glamor tree. v2: Fix fallback, return correct buffer offset, map whole buffer, unmap conditionally. v3: add conditional defines to make it compile with outdated headers. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Grigori Goronzy <greg@chown.ath.cx> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-06-09glamor: Revert a context related change. It caused a compilation error since ↵Samuel Li1-7/+1
context switcher related changes have not been pulled into this tree. This reverts commit 73ab7f4. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor add dispatch for glGetError and glBufferStorageAlex Deucher2-0/+5
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-03-13glamor: Move shader precision stuff from build time to shader compile time.Eric Anholt1-2/+5
Ported from Eric's glamor xserver tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Don't try to fallback sub-upload to an in-memory pixmap.Eric Anholt1-0/+3
This path needs to draw to the pixmap using its fbo, while an in-memory pixmap doesn't have one. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Fix requested composite VBO size.Eric Anholt1-3/+2
The argument to setup_composte_vbo is the number of verts. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Don't forget to unmap our PBOs before usng them to upload.Eric Anholt1-2/+3
From the GL_ARB_vertex_buffer_object spec: After the client has specified the contents of a mapped data store, and before the data in that store are dereferenced by any GL commands, the mapping must be relinquished by calling boolean UnmapBufferARB(enum target); Our mappings were only getting reaped at PBO destroy time, after the upload. If the GL implementation wasn't coherent, it would have used stale data to do the texture upload. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Add am assert about an invariant the upload code relies on.Eric Anholt1-0/+1
Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Make sure we've put the context back to 0 periodically.Eric Anholt1-1/+7
We've got some leaks in the tree. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Fix ignoring the ALU during SetSpans().Eric Anholt1-1/+5
Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Improve the performance of PolyGlyphBlt.Eric Anholt1-0/+140
Using the same idea as the previous PushPixels code, just make points for each point in the glyph. This is an advantage over the pushpixels fallback because we can batch the BO mappings and draw calls across glyphs. Improves performance of x11perf -f8text by 881.481% +/- 50.5971% (n=6). Ported from Eric's xserver glamor tree. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Improve the performance of PushPixels by, well, pushing pixels.Eric Anholt1-0/+117
Otherwise, mi will fall back to GetSpans()ing the bitmap, walking the bitmap, computing spans to be filled, and calling FillSpans(). Improves x11perf -f23text16 by 49.8918% +/- 7.81351% (n=4). Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Use quads instead of index buffer on desktop.Eric Anholt1-1/+3
No difference (n=7) Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Use streamed vertex data for solid fills.Eric Anholt2-29/+19
No difference on performance in x11perf -f8text (n=15), but if we ever get GL_ARB_buffer_storage support, it should be worth a few percent CPU overhead on Intel. Ported from Eric's xserver glamor tree. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Add missing prepares on the GC during fb fallbacks.Eric Anholt4-4/+12
We had regressions in CopyPlane reported by xts5, because we were (successfully!) dereferencing the null pixmap->devPrivate.ptr for a tile or stipple without having done a prepare. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Rely on nested mappings to handle src==dst and !prepare bugs.Eric Anholt16-110/+81
Now that the core deals with that for us, we can avoid all this extra carefulness. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Allow nested mapping of pixmaps.Eric Anholt2-1/+25
The common pattern is to do nested if statements making calls to prepare_access() and then popping those mappings back off in each set of braces. Some cases checked for src == dst to avoid leaking mapping, but others didn't. Others didn't even do the nested mappings, so a failure in the outer would result in trying to umap the inner and failing. By allowing nested mappings, we can fix both problems by not requiring the care from the caller, plus we can allow a simpler nesting of all the prepares in one if statement. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Drop unused GLAMOR_ACCESS_WO.Eric Anholt2-10/+1
Nothing was using it, and it was going to complicate the glamor_prepare_access bugfixing I'm going to do next. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Replace some goofy enum-likes with a real enum.Eric Anholt2-10/+17
This unpacks the bitfield into an int size, but my experience has been that packing bitfields doesn't matter for performance. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Extract the streamed vertex data code used by Render. (v2)Eric Anholt6-103/+141
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. Ported from Eric's glamor xserver tree. v2: fix composite_vbo_offset init in trapezoid rendering Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Fix up doxygen for glamor_fill.c.Eric Anholt1-1/+17
Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Rename more solid fill variables to clean up the code.Eric Anholt1-19/+18
Now the error path of allocation is more obvious: We leave things in the a-few-boxes-at-a-time stack memory state. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Rename a variable to be more descriptive.Eric Anholt1-4/+5
The "valid_" prefix was used above to describe our allocation that gets reused multiple times, which is totally unrelated. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Fix some integer overflow errors.Eric Anholt1-2/+2
Imagine a nbox that was (UINT_MAX + small number) / 4 * 2 * sizeof(float). We'd malloc a few bytes after the integer overflow, but glamor_set_normalize_vcoords would write over gigabytes of heap. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Drop bogus _X_UNLIKELY.Eric Anholt1-1/+1
nbox > 4 is actually quite common for spans handling. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Avoid generating GL errors when doing two-pass CA.Eric Anholt2-2/+7
We were double-unmapping the VBO, and the second would throw an error. Ported from Eric's glamor xserver tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Don't forget to set GL_INVALIDATE_RANGE_BIT on GL_ARB_mbr.Eric Anholt1-1/+3
We don't need any current contents of the buffer, and this allows an implementation to make a temporary BO for a streamed upload if it wants to. Ported from Eric's glamor xserver tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Don't bother keeping references to shader stages for gradients.Eric Anholt2-69/+6
They never get reattached to any other program, so saving them to unreference later is a waste of code. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Fix typo in setting v_position's attrib location.Eric Anholt1-1/+1
Assuming it was the first attribute assigned by the GL, it would have ended up with location 0 anyway. Ported from Eric's glamor xserver tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Unifdef the picture-format-to-format-and-type functions.Eric Anholt1-25/+29
There's no way these should be in a header file, but I'll leave that cleanup until later. Ported from Eric's glamor xserver tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Move glamor_get_tex_format_type_from_pictformat to a .c file.Eric Anholt2-306/+305
A pair of 150 lines of inlined switch statements in a header file is crazy. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Unifdef the cache format indices.Eric Anholt2-20/+2
We only ask for GL_RGB on desktop GL as far as I can see, but now if GLES2 did happen to ask for GL_RGB it would return a cache index instead of -1. Pulled from Eric's glamor xserver tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Pass pixmaps around to unifdef glamor_iformat_for_depth().Eric Anholt4-21/+19
Pulled from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: yInverted is a boolean value, so use the Bool type.Eric Anholt2-3/+3
Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Drop useless glEnable/glDisable(GL_TEXTURE_2D) calls.Eric Anholt6-33/+0
Those calls are only for enabling texture handling in the fixed function pipeline, while everything we do is with shaders. Ported from Eric's xserver glamor tree. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Drop fixed function transformation matrix setup.Eric Anholt1-6/+0
gl_ModelViewProjection and friends aren't used in our shaders, so this setup didn't do anything. Pulled from Eric's xserver glamor port. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-13glamor: Fix a spelling mistake in GLAMOR_PIXMAP_FBO_NOT_EXACT_SIZE.Eric Anholt3-3/+3
Pulled from Eric's xserver glamor. Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-03-05Fix a missing MakeCurrent in glamor_egl_create_argb8888_based_textureAxel Davy1-0/+2
There is a missing MakeCurrent before creating the texture and link it to the EGLImage. This fixes an X server crash with the piglit test glx-make-current-multi-process on radeonsi from current Mesa Git. Signed-off-by: Axel Davy <axel.davy@ens.fr> Tested-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-02-17glamor: Correctly specificy the stride parameter for glamor_put_imageAnthony Waters1-2/+4
The stride parameter is based on bits and is set according to PixmapBytePad Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74733 Signed-off-by: Anthony Waters <awaters1@gmail.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2014-02-11Fallback to system memory when fail to allocate one big fbo.Zhigang Gong2-16/+24
Even when create a pixmap which smaller than the max_fbo_size, it may fail due to some low level driver limitation. If that is the case, we don't need to crash the xserver. We just need to fallback to system memory. See the related bug at: https://bugs.freedesktop.org/show_bug.cgi?id=71190 Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: Michel Danzer <michel@daenzer.net> Tested-by: Kai Wasserbach <kai@dev.carbon-project.org> Tested-by: Erich Seifert <eseifert@error-reports.org>
2014-02-06glamor: Fall back for unsupported picture format.Samuel Li1-1/+1
This fixes seg fault when running x11perf -aa4trap300. Signed-off-by: Samuel Li <samuel.li@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-31glamor: Added in an optimization to copy area that uploads the data directly ↵Anthony Waters1-15/+40
to the destination similar to what EXA did For instances where the destination has a FBO but the source doesn't, the code now just puts the data that was in source directly into destination through glamor_upload_sub_pixmap_to_texture. This is the same way that EXA works in this case as well. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71813 Signed-off-by: Anthony Waters <awaters1@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-01-31glamor: Add in support for the stride parameter when uploading texture dataAnthony Waters3-8/+38
The method __glamor_upload_pixmap_to_texture was updated to support a stride parameter for the data being uploaded to a texture. This required correctly setting the alignment from 4 to a value based on the depth of the data and also required setting GL_UNPACK_ROW_LENGTH based on both the stride and the alignment. The stride parameter was also updated in glamor_put_image to be correctly specified, the old values would cause the xserver to crash. Part of bug: https://bugs.freedesktop.org/show_bug.cgi?id=71813 Signed-off-by: Anthony Waters <awaters1@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>