summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-08-02Rework current context trackingglxAdam Jackson3-17/+26
Since xserver's GLX is now hosted on real GL, we need to unify current tracking in glamor, and to tell glamor when we've changed the EGL context out from under it. Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-08-02Add a way to get the EGLDisplay from the screenAdam Jackson2-0/+9
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-08-02Add hack to get the fbo for a pixmapAdam Jackson2-0/+8
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-07-16xserver 1.15 compatibilityAdam Jackson5-165/+4
In the 1.15 GLX rewrite, the server is now just another EGL client, and no longer directly loads DRI drivers. As a result we need to delete the code that directly mucks with the DRI dispatch table, and instead always do the equivalent thing in terms of eglMakeCurrent. Since the convention elsewhere in xserver/glx is now to set the EGL context right when you need it, we don't explicitly unbind in glamor_egl_restore_context. Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-07-15Clean xf86 headers out from glamor.hAdam Jackson2-4/+7
Makes glamor.h includeable in dix code. Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-03-18Don't use AC_PROG_LIBTOOLArmin K1-1/+0
Autoconf only needs libtool macros which are copied when autoreconf is run. There is no need for looking for "libtool" program in PATH. This properly disables static libraries from being built and installed. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-03-18First attempt to make libglamor.so shared versioned libraryArmin K2-8/+6
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-03-18Properly dist necesary headersArmin K1-0/+1
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-03-18Silence Automake 1.13 warningsArmin K1-1/+1
warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-03-18glamoregl: Use xf86ScreenToScrn()Michel Dänzer1-10/+10
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>
2012-12-29glamor_utils: fix unlikely define useDave Airlie1-2/+1
using a define across a split line expression is failure, compiling with warnings shows this up. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-29glamor: add compiler.hDave Airlie1-0/+1
This is also required for distchecking. Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-29glamor: fix make distcheck part 1Dave Airlie1-1/+7
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>
2012-11-13glamor_compositerects: Need to initialize region before fallback.Zhigang Gong1-10/+10
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>
2012-11-06Don't use glBlitFramebufferEXT for overlapping copies.Michel Dänzer1-1/+2
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>
2012-08-10Bump to version 0.5.Zhigang Gong1-1/+1
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-08-10Increase vbo size to 64K verts.Zhigang Gong2-2/+1
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>
2012-08-10Silence compilation warnings.Zhigang Gong17-337/+280
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>
2012-08-08glamor_largepixmap: Fixed a bug in repeat clipping.Zhigang Gong1-18/+6
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>
2012-08-08Prefer KHR_surfaceless_context EGL extension over KHR_surfaceless_opengl/gles2.Michel Dänzer1-3/+10
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>
2012-08-08Print space between name of missing EGL extension and 'required'.Michel Dänzer1-1/+1
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-08-07Fallback to pixman when trapezoid mask is big.Junyan He2-31/+75
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>
2012-08-02glamor_glyphs: When dst arg point to a NULL buffer, dont't flush.Zhigang Gong1-0/+3
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>
2012-08-02glamor_trapezoid: workaround a glsl like problem.Zhigang Gong1-2/+10
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>
2012-07-23Fix the problem of VBO leak.Junyan He2-6/+6
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>
2012-07-23Just use the shader to generate trapezoid if PolyMode == ImpreciseJunyan He1-9/+14
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>
2012-07-23Change the trapezoid render to use VBO.Junyan He2-173/+330
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>
2012-07-16Added the missed header file for xorg 1.13 compat.Zhigang Gong1-0/+107
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-16Synch with xorg 1.13 change.Zhigang Gong5-10/+23
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>
2012-07-13gles2: Fixed the compilation problem and some bugs.Zhigang Gong4-4/+7
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>
2012-07-12Stream vertex data to VBOs.Michel Dänzer1-15/+15
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-11Fix translation of clip region for composite fallback.Michel D=C3=A4nzer1-2/+2
Fixes incorrectly clipped rendering. E.g. the cursor in Evolution composer windows became invisible. Signed-off-by: Michel Daenzer <michel.daenzer@amd.com> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-11glamor_glyphs: Don't merge extents for different lists.Zhigang Gong1-39/+71
If we merge all lists's extent together, than we may have some fail overlap checking. Here is a simple: A E B F C D The first list has vertical "ABCD". And the second list has two char "EF". When detecting E, it can successfully find it doesn't overlap with previous glyphs. But after that, the original code will merge the previous extent with E's extent, then the extent will cover "F", so when detecting F, it will be treated as overlapped. We can simply solve this issue by not merge extent from different list. We can union different list's extent to a global region. And then do the intersect checkint between that region and current glyph extent, then we can avoid that fail checking. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-11glamor_copyarea: Use blitcopy if current state is not render.Zhigang Gong6-44/+24
Practically, for pure 2D blit, the blit copy is much faster than textured copy. For the x11perf copywinwin100, it's about 3x faster. But if we have heavy rendering/compositing, then use textured copy will get much better (>30%)performance for most of the cases. So we simply add a data element to track current state. For rendering state we use textured copy, otherwise, we use blit copy. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-11glamor_glyphs: Use cache picture to store mask picture if possible.Zhigang Gong1-215/+830
By default, mask picture is newly created, and each time we need to clear the whole mask picture, and then composite glyphs to the mask picture and then composite the mask picture to destination. Testing results shows that the filling of the mask picture takes a big portion of the rendering time. As we don't really need to clear the whole region, we just need to clear the real overlapped region. This commit is to solve this issue. We split a large glyphs list to serval lists and each list is non-overlapped or overlapped. we can reduce the length of overlapped glyphs to do the glyphs_via_mask to 2 or 3 glyphs one time for most cases. Thus it give us a case to allocate a small portion of the corresponding cache directly as the mask picture. Then we can rendering the glyphs to this mask picture, and latter we can accumulate the second steps, composite the mask to the dest with the other non-overlapped glyphs's rendering process. It also make us implement a batch mask cache blocks clearing algorithm to avoid too frequently small region clearing. If there is no any overlapping, this method will not get performance gain. If there is some overlapping, then this algorithm can get about 15% performance gain. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_compositerects: Implement optimized version.Zhigang Gong6-49/+439
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>
2012-07-03optimize: Use likely and unlikely.Zhigang Gong3-19/+78
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03create_pixmap: use texture for large glyphs.Zhigang Gong1-1/+1
As we only cache glyphs smaller than 64x64, we need to use texutre for the large glyphs. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_copyarea: Fixed a bug introduced by 996194...Zhigang Gong1-2/+6
Default return value should be FALSE. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_glyphs: Slightly performance tuning.Zhigang Gong2-56/+37
As glamor_glyphs never fallback, we don't need to keep the underlying glyphs routines, just override the ps->glys Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_render: Don't allocate buffer for vbo each time.Zhigang Gong1-5/+16
We can reuse the last one if the last one is big enough to contain current vertext data. In the meantime, Use MapBufferRange instead of MapBuffer. Testing shows, this patch brings some benefit for aa10text/rgb10text. Not too much, but indeed faster. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_largepixmap: Walkaround for large texture's upload.Zhigang Gong2-1/+6
I met a problem with large texture (larger than 7000x7000)'s uploading on SNB platform. The map_gtt get back a mapped VA without error, but write to that virtual address triggers BUS error. This work around is to avoid that direct uploading. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_render: Optimize the two pass ca rendering.Zhigang Gong3-111/+169
For the componentAlpha with PictOpOver, we use two pass rendering to implement it. Previous implementation call two times the glamor_composite_... independently which is very inefficient. Now we change the control flow, and do the two pass internally and avoid duplicate works. For the x11perf -rgb10text, this optimization can get about 30% improvement. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_composite_glyph: Optimize glyphs with non-solid pattern.Zhigang Gong1-10/+78
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-07-03glamor_glyphs: Detect fake or real glyphs overlap.Zhigang Gong4-103/+356
To split a glyph's extent region to three sub-boxes as below. left box 2 x h center box (w-4) x h right box 2 x h Take a simple glyph A as an example: * __* *__ ***** * * ~~ ~~ The left box and right boxes are both 2 x 2. The center box is 2 x 4. The left box has two bitmaps 0001'b and 0010'b to indicate the real inked area. The right box also has two bitmaps 0010'b and 0001'b. And then we can check the inked area in left and right boxes with previous glyph. If the direction is from left to right, then we need to check the previous right bitmap with current left bitmap. And if we found the center box has overlapped or we overlap with not only the previous glyph, we will treat it as real overlapped and will render the glyphs via mask. If we only intersect with previous glyph on the left/right edge. Then we further compute the real overlapped bits. We set a loose check criteria here, if it has less than two pixel overlapping, we treat it as non-overlapping. With this patch, The aa10text boost fom 1660000 to 320000. Almost double the performance! And the cairo test result is the same as without this patch. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-21glamor_render: Don't fallback when rendering glyphs with OpOver.Zhigang Gong1-3/+25
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-21glamor_create_pixmap: Allocate glyphs pixmap in memory.Zhigang Gong1-0/+1
As we have glyphs atlas cache, we don't need to hold each glyphs on GPU. And for the subsequent optimization, we need to store the original glyphs pixmap on system memory. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-21glamor_fbo: fix a memory leak for large pixmap.Zhigang Gong1-1/+2
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-06-15Fix a bug for trapezoid clipJunyan He1-8/+107
We find in some cases the trapezoid will be render as a triangle and the left edge and right edge will cross with each other just bellow the top or over the bottom. The distance between the cross poind and the top or bottom is less than pixman_fixed_1_minus_e, so after the fixed converted to int, the cross point has the same value with the top or botton and the triangle should not be affected. But in our clip logic, the cross point will be clipped out. So add a logic to fix this problem. Signed-off-by: Junyan He <junyan.he@linux.intel.com>
2012-06-15gles2_largepixmap: force clip for a non-large pixmap.Zhigang Gong2-8/+32
One case we need force clip when download/upload a drm_texture pixmap. Actually, this is only meaningful for testing purpose. As we may set the max_fbo_size to a very small value, but the drm texture may exceed this value but the drm texture pixmap is not largepixmap. This is not a problem with OpenGL. But for GLES2, we may need to call glamor_es2_pixmap_read_prepare to create a temporary fbo to do the color conversion. Then we have to force clip the drm pixmap here to avoid large pixmap handling at glamor_es2_pixmap_read_prepare. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>