commit 9b8a791290af0add84269efdb315f9f58798f6d2
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Aug 10 13:46:42 2012 +0800

    Bump to version 0.5.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 047c1375d6d08ac53839d0149dbbc03258f28d6a
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Aug 8 20:43:38 2012 +0800

    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>

commit 43cabf3f7c84e00d8480136d2ed5108d84ca392b
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Aug 8 20:11:43 2012 +0800

    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>

commit a991ea45a60b0566adf9e6c15809fd4f49af7129
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Aug 8 20:08:12 2012 +0800

    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>

commit aa2b71332143fe7d62b3c3f16462f8335e3a7844
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Tue Aug 7 18:16:58 2012 +0200

    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>

commit 67fb454c47903d4dc9b439f2c5af73a331cbc3cb
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Tue Aug 7 18:13:32 2012 +0200

    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>

commit 801192caf1444d50d905de9c6133abe7de869894
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue Aug 7 05:01:59 2012 +0800

    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>

commit ded419455c67846d75944c75d623d6e1c510db9f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Aug 2 18:07:07 2012 +0800

    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>

commit f233aeef15ca357c9a0a770687d13b6560871420
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Aug 1 18:27:29 2012 +0800

    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>

commit 79d369f161c78185483bf8fdeed77f79430d4a1e
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Jul 20 05:52:57 2012 +0800

    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>

commit 1f50d3f368c9e7135576ecb376fbaef34fd22132
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Jul 20 05:52:50 2012 +0800

    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>

commit 1315ff92e2e19811cfb9a8bddab8e40bca5cd4e5
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Jul 20 05:52:43 2012 +0800

    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>

commit ab212d3b90cd288da46af43390feacb489db77b1
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jul 16 17:27:22 2012 +0800

    Added the missed header file for xorg 1.13 compat.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 726ad264f485ce1d39aa387e93ac224fb46ed059
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jul 16 11:25:09 2012 +0800

    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>

commit e51e16e64b1b87a6eb96c5993183475ad8a88cfd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jul 13 09:20:02 2012 +0800

    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>

commit 5247854b57c3d931b5ad593a8c12b6978e6865d0
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Jul 12 18:57:06 2012 +0800

    Stream vertex data to VBOs.
    
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 12c5d248a3efe5afb06f0dc246b207cc497e9420
Author: Michel D=C3=A4nzer <michel.daenzer@amd.com>
Date:   Wed Jul 11 15:01:15 2012 +0800

    Fix translation of clip region for composite fallback.
    
    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>

commit 1aeca388c9ff9d8cbdfbdd552abe764d36c73f40
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jul 4 17:59:25 2012 +0800

    glamor_glyphs: Don't merge extents for different lists.
    
    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>

commit 73d33dd2400772ad47a57dad2c2fa93caebccc80
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jul 3 18:24:07 2012 +0800

    glamor_copyarea: Use blitcopy if current state is not render.
    
    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>

commit 1ec81c73bf4660d87b9cfa281647ca6cbda68f2e
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jul 3 18:11:12 2012 +0800

    glamor_glyphs: Use cache picture to store mask picture if possible.
    
     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>

commit 4c368b12c1af317c79469f8b6b809997d1769080
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jun 27 12:53:40 2012 +0800

    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>

commit ecc70624ca77478a46e9fb9487d76c74c6be1d8f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 26 20:00:21 2012 +0800

    optimize: Use likely and unlikely.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 622bfc174ab0c8a04146bd5fb754e96bc51d38c0
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 26 19:56:27 2012 +0800

    create_pixmap: use texture for large glyphs.
    
    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>

commit 033349420f53cdbbdda37b3975c498a0dc885cf6
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 26 17:19:16 2012 +0800

    glamor_copyarea: Fixed a bug introduced by 996194...
    
    Default return value should be FALSE.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f3cff9975b1969b91b85f329be9fa925a9137f34
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 26 16:24:32 2012 +0800

    glamor_glyphs: Slightly performance tuning.
    
    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>

commit 593bd206bf2794dc1450e8e7d20142b8d0ca074b
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 26 15:39:24 2012 +0800

    glamor_render: Don't allocate buffer for vbo each time.
    
    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>

commit e44ce79d719ece8997c777329834c5293fc668b8
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 26 13:09:05 2012 +0800

    glamor_largepixmap: Walkaround for large texture's upload.
    
    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>

commit fc3674fbf40cbe5ddb3e3a29ce86be7db743892b
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 25 23:24:37 2012 +0800

    glamor_render: Optimize the two pass ca rendering.
    
    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>

commit 63fb516af37d07f11b4e8d52338354de98885425
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 25 16:37:22 2012 +0800

    glamor_composite_glyph: Optimize glyphs with non-solid pattern.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 07177a4842851a5ee611bdff6693bdd81c9828c1
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Jun 21 19:30:51 2012 +0800

    glamor_glyphs: Detect fake or real glyphs overlap.
    
    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>

commit 1f14ab24d716644f22846d9134883d7dda9bf0b2
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Jun 21 19:29:06 2012 +0800

    glamor_render: Don't fallback when rendering glyphs with OpOver.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 029ef43d5fe0148b12d832a638b2c8c8e39fd262
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Jun 21 19:27:07 2012 +0800

    glamor_create_pixmap: Allocate glyphs pixmap in memory.
    
    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>

commit ba625dc12634c50bc8183e64fbfb2827b94d931f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Jun 21 19:26:28 2012 +0800

    glamor_fbo: fix a memory leak for large pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 08e86e4b64b5c36b5d1db0d95effb79d82842f14
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Jun 15 09:00:15 2012 +0800

    Fix a bug for trapezoid clip
    
     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>

commit d9202dc2cb6aadfbc14983279649c2285c3e6501
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jun 15 13:31:30 2012 +0800

    gles2_largepixmap: force clip for a non-large pixmap.
    
    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>

commit 291402b1a9abd7a1e747c71b2e7c7104d5061614
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jun 15 09:03:42 2012 +0800

    glamor_emit_composite_vert: Optimize to don't do two times vert coping.
    
    We change some macros to put the vert to the vertex buffer
    directly when we cacluating it. This way, we can get about
    4% performance gain.
    
    This commit also fixed one RepeatPad bug, when we RepeatPad
    a not eaxct size fbo. We need to calculate the edge. The edge
    should be 1.0 - half point, not 1.0.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 741a065f55fc78d624ef9c423d8c36d8d06a95c3
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jun 15 08:46:24 2012 +0800

    glamor_glyphs: Before get upload to cache flush is needed.
    
    When we can't get a cache hit and have to evict one cache
    entry to upload new picture, we need to flush the previous
    buffer. Otherwise, we may get corrupt glyphs rendering result.
    
    This is the reason why user-font-proxy may fail sometimes.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 996194140ce10b8c8b2b1cf8774c857fed4a6f24
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jun 15 08:43:37 2012 +0800

    copyarea: Cleanup the error handling logic.
    
    Should use ok rather than mixed ok or ret.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 0604eb4aadf0162e7971b2e8b138174e376eb5e4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jun 12 18:21:10 2012 +0800

    trapezoid: Fallback to sw-rasterize for largepixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 566ba215aac7c191d85410b8794d28b561e0aff5
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue Jun 5 03:21:03 2012 +0800

    Use the direct render path for A1
    
     Because when mask depth is 1, there is no Anti-Alias at all,
     in this case, the directly render can work well and it is faseter.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>

commit 0bc9a5de83063976902866e4175effedd3ae5a1f
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Mon Jun 4 07:52:05 2012 +0800

    Add the trapezoid direct render logic
    
     We firstly get the render area by clipping the trapezoid
     with the clip rect, then split the clipped area into small
     triangles and use the composite logic to generate the result
     directly. This manner is fast but have the problem that
     some implementation of GL do not implement the Anti-Alias
     of triangles fill, so the edge sometimes has sawtooth. It is
     not acceptable when use trapezoid to approximate circles and
     wide lines.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>

commit 2133d22a7e57d0151051106fa15464218ae88385
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Mon Jun 4 07:22:27 2012 +0800

    Modilfy the composite logic to two phases
    
     We seperate the composite to two phases, firstly to
     select the shader according to source type and logic
     op, setting the right parameters. Then we emit the
     vertex array to generate the dest result.
     The reason why we do this is that the shader may be
     used to composite no only rect, trapezoid and triangle
     render function can also use it to render triangles and
     polygens. The old function glamor_composite_with_shader
     do the whole two phases work and can not match the
     new request.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>

commit 445ee22ac67976d8226f2ba743a3a6897781c404
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Mon Jun 4 03:18:40 2012 +0800

    Add macro of vertex setting for triangle stripe
    
      Add macro of vertex setting for triangle stripe draw,
      and make the code clear.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>

commit 2f6aa7a8d3fcae266b174fd629131616ef09686a
Author: RobinHe <robinhe@robinhe-desktop.lan>
Date:   Sat Jun 2 22:00:09 2012 +0800

    Use shader to generate the temp trapezoid mask
    
     The old manner of trapezoid render uses pixman to
     generate a mask pixmap and upload it to the GPU.
     This effect the performance. We now use shader to
     generate the temp trapezoid mask to avoid the
     uploading of this pixmap.
     We implement a anti-alias manner in the shader
     according to pixman, which will caculate the area
     inside the trapezoid dividing total area for every
     pixel and assign it to the alpha value of that pixel.
     The pixman use a int-to-fix manner to approximate but
     the shader use float, so the result may have some
     difference.
     Because the array in the shader has optimization problem,
     we need to emit the vertex of every trapezoid every
     time, which will effect the performance a lot. Need to
     improve it.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>

commit 5f03910369012e1d9b973142f704d8488df57f59
Author: RobinHe <robinhe@robinhe-desktop.lan>
Date:   Sat Jun 2 21:52:25 2012 +0800

    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>

commit 7ed0d760fbd4378c59fde4d88adc6eca2cb3ea95
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 14:02:59 2012 +0800

    Enable large pixmap by default.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 3ed87725dc79c6dd51598a4ed060ad8c53306d55
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 13:05:48 2012 +0800

    largepixmap: Fix the selfcopy issue.
    
    If the source and destination are the same pixmap/fbo, and we
    need to split the copy to small pieces. Then we do need to
    consider the sequence of the small pieces when the copy area
    has overlaps. This commit take the reverse/upsidedown into
    the clipping function, thus it can generate correct sequence
    and avoid corruption self copying.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d3e0c76f8cd17784b0b57ddaafe30c9996ac67de
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 11:42:46 2012 +0800

    largepixmap: Support self composite for large pixmap.
    
    The simplest way to support large pixmap's self compositing
    is to just clone a pixmap private data structure, and change
    the fbo and box to point to the correct postions. Don't need
    to copy a new box.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f3c06ebd10f1518f11d75ac563f1d671df51935a
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 09:36:56 2012 +0800

    largepixmap: Add transform/repeat/reflect/pad support.
    
    This commit implement almost all the needed functions for
    the large pixmap support. It's almost complete.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 503dc69c03421f2ea42089137c024eca2a137ff6
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 02:27:00 2012 +0800

    glamor_getimage: should call miGetimage if failed to get sub-image.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a0ae6978c712f5f8c325553d08d085693b9e6518
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 02:24:41 2012 +0800

    glamor_putimage: Correct the wrong stride value.
    
    We should not use the destination pixmap's devkind as the input
    image data's stride.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit b0257c3a67798d44e0f8218ccc798c5392729c62
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 02:15:53 2012 +0800

    largepixmap: Enable glamor_composite.
    
    Now we start to enable glamor_composite on large pixmap.
    We need to do a three layer clipping to split the dest/source/mask
    to small pieces. This commit only support non-transformation and
    repeat normal case.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit e836be57a45c3acee73251190593a882428fa7ed
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 01:52:14 2012 +0800

    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>

commit 25ba2dcf0e9858edc93fafa0d77f6d1a574bd833
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jun 11 01:02:30 2012 +0800

    glamor_largepixmap: first commit for large pixmap.
    
    This is the first commit to add support for large pixmap.
    The large here means a pixmap is larger than the texutre's
    size limitation thus can't fit into one single texutre.
    
    The previous implementation will simply fallback to use a
    in memory pixmap to contain the large pixmap which is
    very slow in practice.
    
    The basic idea here is to use an array of texture to hold
    the large pixmap. And when we need to get a specific area
    of the pixmap, we just need to compute/clip the correct
    region and find the corresponding fbo.
    
    We need to implement some auxiliary routines to clip every
    rendering operations into small pieces which can fit into
    one texture.
    
    The complex part is the transformation/repeat/repeatReflect
    and repeat pad and their comination. We will support all of
    them step by step.
    
    This commit just add some necessary data structure to represent
    the large pixmap, and doesn't change any rendering process.
    This commit doesn't add real large pixmap support.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6116de526bc174baa6292c216e44ad0109855d2d
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue May 15 10:08:03 2012 +0800

    Fix the problem of x_source and y_source causing radial error
    
     The x_source and y_source cause some problem in
     gradient. The old way to handle it by recaulate P1 P2
     to minus the x_source and y_source, but this causes
     problem in radial shader. Now we modify the manner to
     set the texture coordinates: (x_source, y_source) -->
     (x_source + width, y_source + height) to handle all the
     cases.
    
    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>

commit ce9c97547cc5897e2435c20c11ce13ae45fffeff
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue May 15 10:07:55 2012 +0800

    Fix the problem of vertical and horizontal case error in linear gradient.
    
     1. The vertical and horizontal judgement in linear
     gradient have problem when p1 point and p2 point
     distance is very small but the gradient pict have a
     transform matrix which will convert the X Y coordinates
     to small values. So the judgement is not suitable.
     Because this judgement's purpose is to assure the
     divisor not to be zero, so we simply it to enter
     horizontal judgement when p1 and p2's Y is same.
     Vertical case is deleted. 2. Delete the unused p1 p2
     uniform variable.
    
    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>

commit 98402a908f36aebc1537a22d86d77667c25a1136
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue May 15 10:07:46 2012 +0800

    Fix the problem of set the same stop several times.
    
     Some gradient set the stops at the same position, for
     example: firstly 0.5 to red color and then set 0.5 to
     blue. This kind of setting will cause the shader work
     not correctly because the percentage caculating need to
     use the stop[i] - stop[i-1] as dividend. The previous
     patch we just kill some stop if the distance between
     them is 0. But this cause the problem that the color
     for next stop is wrong. We now modify to handle it in
     the shader to avoid the 0 as dividend.
    
    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>

commit c1ec3ef1f0a86c5977d9623d1cbbc2159885d0af
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue May 15 10:07:35 2012 +0800

    Fix a bugy macro definition.
    
     The macro like "#define LINEAR_SMALL_STOPS 6 + 2" causes
     the problem. When use it to define like "GLfloat
     stop_colors_st[LINEAR_SMALL_STOPS*4];" The array is
     small than what we supposed it to be. Cause memory
     corruption problem and cause the bug of render wrong
     result. Fix it.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a3bbd3bc6299680ac6f4dd382ee403f556e15a92
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Tue May 15 10:07:24 2012 +0800

    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>

commit da9563fd123263c5124ae336369d2aa8a5bdb9e4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue May 15 15:25:41 2012 +0800

    glamor_set_destination_pixmap_priv_nc: set drawable's width x height.
    
    Previous implementation set the whole fbo's width and height as the
    viewpoint. This may increase the numerical error as we may only has
    a partial region as the valid pixmap. So add a new marco
    pixmap_priv_get_dest_scale to get proper scale factor for the
    destination pixmap. For the source/mask pixmap, we still need to
    consider the whole fbo's size.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 36d4d32bdd6ecc03f45fd68b1c214748ab5e0c0b
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue May 15 10:52:37 2012 +0800

    Remove the texture cache code.
    
    Caching texture objects is not necessary based on previous testing.
    To keep the code simple, we remove it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 59b18f837483329564192f5ac0b23834c21e2f7a
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue May 15 10:42:41 2012 +0800

    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>

commit 9b4cd897c20eeba5ccbbc2fea2ace6e993580497
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 18:23:09 2012 +0800

    We should not call gradient finalization code if we disable it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d5cdad0497ae5f6cd936a74f68169c0910ea1e68
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 17:02:35 2012 +0800

    Release 0.4.
    
    Update Readme, and write a new ReleaseNote and bump the version
    to 0.4.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8b009ce320f67b63c6bcc499acc73280acac07a6
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 14:55:34 2012 +0800

    Fixed all unused variables warnings.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 964b23a83f9367584b688b4138bd9285dd3d5573
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 14:54:38 2012 +0800

    Fixed an uninitialized problem at gradient shader functions.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 925c2436f57c22a3752fb5a10da8b21c61343808
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 14:51:27 2012 +0800

    Fixed one typo bug when fixup a mask picture.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a4e1eec9f1d7906124065c2520bb7ee78c5d97c3
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 14:13:47 2012 +0800

    Added some copyright and author information.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 61f441223575f46f6d9c1240e41ce292b2b9d83d
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 13:43:39 2012 +0800

    Added --enable-debug configuration option.
    
    For release version, we disable asserts.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 9ed6ac6cd216bbfd53adba6bae754cf8623499eb
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 28 13:42:48 2012 +0800

    Remove unecessary header file.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 4c882abc45111d6c5dae5bfbadc13631c3802dde
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Mar 27 18:17:00 2012 +0800

    configure: Install glamor.conf to xorg.conf.d.
    
    As we need to make sure load DRI2 first and then load
    glamoregl and then load GLX module, we create a new
    xorg configuration file here and install it to system
    configuration directory.
    
    Note: If you are building xserver at your local directory
    and set the prefix to your local directory rather than
    the system directory, then the glamor.conf may
    not be loaded when you run the X server you built locally.
    
    The reason is that currently xorg will search the following dir
    /usr/share/X11/xorg.conf.d
    if it exist , then will ignore your local configuration
    directory where the glamor.conf is at. Then you may fail
    to start Xserver.
    
    If this is the case, you may need to copy the glamor.conf
    to /usr/share/X11/xorg.conf.d manually.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d8cd4dfd24a92315636ff29d0a1c985e1e05441c
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 27 15:34:15 2012 +0800

    glamor_render: Fix the repeat none for GLES2.
    
    As GLES2 doesn't support clamp to the border, we have to
    handle it seprately from the normal case.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit b2d64e6065859326a89150d82d964b36a01c4818
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 26 20:35:09 2012 +0800

    glamor_blockhandler: Don't do glFinish every time.
    
    To do glfinish every time bring some performance overhead.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit e25304d71c3892509babcf0906e6fdcd785d90bd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 26 19:59:58 2012 +0800

    glamor_copyarea: Return earlier if have zero nbox.
    
    Almost all callers will check whether the regions is empty
    before call to this internal API, but it seems the
    glamor_composite_with_copy may call into here with a zero
    nbox. A little weird, as the miComputeCompositeRegion return
    a Non-NULL, but the region is empty.
    
    Also remove a unecessary glflush.
    
    So let's check it here.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit cd0033b465f97b9af27b1a7e10953cc75ac9cb56
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 26 19:57:21 2012 +0800

    glamor_render: Have to use eaxct size pixmap for transformation.
    
    Use partial texture as the pixmap for the transformation
    source/mask may introduce extra errors. have to use
    eaxct size.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 623e5750c936e43b28e7ed28e22d69300185a6dd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 26 18:31:07 2012 +0800

    glamor_fbo: Added a threshold value for the fbo cache pool.
    
    Currently set it to 256MB. If cache pool watermark increases
    to this value, then don't push any fbo to this pool, will purge
    the fbo directly.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 865516949d182d8fe5c99bd38e1850e342615592
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 26 18:28:17 2012 +0800

    Fixed a1 bug.
    
    It seems that mesa has bugs when uploading bitmap to texture.
    We switch to convert bitmap to a8 format and then upload the
    a8 texture.
    
    Also added a helper routine to dump 1bpp pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 26d5802ec12619ba05b150fc959f46bbc32f0534
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 22:35:12 2012 +0800

    glamor_render.c: Fixed repeatPad and repeatRelect.
    
    We should use difference calculation for these two repeat mode
    when we are a sub region within one texture.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6c1c378448c725ce00895aff5c9a93bf58d6f4d5
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 19:50:57 2012 +0800

    gradient: Don't need fixup flag when creating pixmap.
    
    Gradient can use a larger texture/fbo directly, don't need
    an eaxct size texture.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6969cbf87f57698e87810037bb2831d7741c006f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 18:58:16 2012 +0800

    glamor_copyarea: Don't access a DRM only pixmap.
    
    As EGL image/gbm only support ARGB8888 image, we don't support
    other format. We may change the way to use gbm directly latter.
    But now, we have to face this limitation, and thus if a client
    create a 16bpp drawable, and call get texture from pixmap then
    a copy to here may occur and thus we have to force retur a TRUE
    without do nothing.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 519388d6e80dac48b11ad3b8f92131e8b607c73d
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 13:54:40 2012 +0800

    Disable A8 texture format for GLES2.
    
    As PVR's GLES2 implementation doesn't support A8 texture as
    rendering target, we disable it for now.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit b48fb31d70a16976b1cff60604e39ac042d1efac
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 13:51:58 2012 +0800

    gradient: Disable gradient for gles2.
    
    As PVR glsl compiler seems doesn't support external fragment
    function, and fails at compile gradient shader. Disable it
    for now. We may need to modify gradient shader to don't use
    external function.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 4136ba52aa5437f3f40653ff8ec127a37705024f
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Wed Apr 18 08:04:26 2012 +0800

    Fix the bug caused by gradient picture set the stops at the same percentage.
    
     Fix the bug caused by gradient picture set the stops at
     the same percentage. The (stops[i] - stops[i-1]) will
     be used as divisor in the shader, which will cause
     problem. We just keep the later one if stops[i] ==
     stops[i-1].
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a6d2e02afa15b014622fb169d66b66d66daf3d4a
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Wed Apr 25 14:25:39 2012 +0800

    Fix the problem of memory leak in gradient pixmap generating.
    
     Fix the problem of memory leak in gradient pixmap
     generating. The problem caused by we do not call
     glDeleteShader when destroy a shader program. This patch
     will split the gradient pixmap generating to three
     category. If nstops < 6, we will use the no array version
     of the shader, which has the best performance. Else if
     nstops < 16, we use array version of the shader, which is
     compiled and linked at screen init stage. Else if nstops >
     16, we dynamically create a new shader program, and this
     program will be cached until bigger nstops.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8e9595f99075bf476390ba726da23c63c91ac4f5
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 11:59:47 2012 +0800

    glamor_putimage: Optimize for direct uploading and fallback path.
    
    This commit optimize two cases:
    1. When the clip contains the whole area, we can directly upload
    the texel data to the pixmap, and don't need to do one extra
    clipped copy.
    
    2. At fallback path, we don't read back the whole pixmap, just
    need a sub region.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit bc7bfc7d94a51b6fe2953c42c117d1c5258423ca
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 11:56:43 2012 +0800

    Fixed one potential texture size mismatch problem.
    
    There are two cases which we may use a wrong texture size.
    1. A pixmap is modified by the client side after it created
    it. Then the pixmap's width may mismatch the original fbo/tex's
    size. Thus we need to check this condition when preparing
    upload the pixmap.
    
    2. We provide two API to download/upload sub region of a
    textured pixmap. The caller may pass in a larger width then
    the original pixmap's size, this may happen at putimage
    and setspans. We need to validate the width and height
    when do the downloading/uploading.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit aa64c82102ed094ca1b1662d4a93b2359584b9ec
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 25 09:27:06 2012 +0800

    glamor_getimage: Don't fallback to miGetImage.
    
    As miGetImage is very inefficient, we don't fallback to it.
    If the format is not ZPixmap, we download the required sub-
    region, and then call fbGetImage to do the conversion.
    This way is much faster than previous.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 24856d2f21b19b31db847719748bde1f17eb40c5
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 13 18:15:49 2012 +0800

    pending_op: Remove the pending operations handling.
    
    We have disabled this feature for a long time, and previous
    testing shows that this(pending fill) will not bring observed
    performance gain. Now remove it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 0077d019a2be62be19acd5fb075d664ffa5a819f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 23:50:09 2012 +0800

    glamor_upload_pixmap: Use glTexImage2D for a fully update.
    
    Currently, intel's mesa dri driver will not check pbo for
    a TexSubImage2D. So we use glTexImage2D if we are a fully
    updating.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit e54978e41aa2710b9960f01e0f82d04b99fd5f5e
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 23:49:38 2012 +0800

    glamor_setspans: Reuse glamor_upload_sub_pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit eab6b8f93759293b57a57b14eab826bc31c3861a
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 23:18:47 2012 +0800

    code clean up.
    
    Remove unused variables.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f2fa4f33148d198d3bec1f4c5391bf35c931ea53
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 23:16:51 2012 +0800

    glamor_getspans: Reuse glamor_download_sub_pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 25a862727c7db2ee0729cc609b8e933d166de7be
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 19:46:09 2012 +0800

    glamor_render: Don't download whole picture when fallback.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6d25a3b8233867df22b01c4dbc9a6d97a477e4a2
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 19:43:44 2012 +0800

    glamor_put_sub_pixmap: Change to use glamor_upload_sub_pixmap.
    
    As the pixmap may be attached to a picture, we need to use
    glamor_upload_sub_pixmap to process it. glamor_copy_n_to_n
    will not consider the picture case.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit e51a23d3d21b524979e4de5690042e36560e72ca
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 17:09:06 2012 +0800

    Fixed a stride problem for textured_drm pixmap.
    
    As a textured_drm pixmap has a drm bo attached to it, and
    it's the DDX layer to set it stride value. In some case,
    the stride value is not equal to PixmapBytePad(w, depth)
    which is used within glamor.
    
    Then if it is the case, we have two choice, one is to set
    the GL_PACK_ROW_LENGTH/GL_UNPACK_ROW_LENGTH when we need
    to download or upload the pixmap. The other option is to
    change the pixmap's devKind to match the one glamor is using
    when downloading the pixmap, and restore it to the drm stride
    after uploading the pixmap.
    
    We choose the 2nd option, as GLES doesn't support the first
    method.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a1947497a1bd430c60d11a30241fa27aee355c22
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 14:36:09 2012 +0800

    glamor_putimage: Reuse copy area to do the clipped copy.
    
    If no clip set, we load the bits to the pixmap directly.
    Otherwise, load the bits to a temporary pixmap and call
    glamor_copy_area to do the clipped copy.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit b3d1385e22391e49c798613290aca9dc81492139
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 10:30:02 2012 +0800

    Fixed a unbalanced glamor_put_dispatch.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit c4677d1c5d8f0bc3bb27aa499ecbeb0fc59c87d0
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Apr 15 22:47:48 2012 +0800

    glamor_pixmap_priv: Always return a valid private pixmap.
    
    If a pixmap doesn't have a private, then set its type to
    GLAMOR_MEMORY, and thus it will get a valid private.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f7304af17c0e1bf6d1904e52ca9f45ba2ec5edd9
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Apr 14 22:40:48 2012 +0800

    Don't need to set GL_PACK_ROW_LENGTH/GL_UNPACK_ROW_LENGTH.
    
    We already adjust the stride of the pixmap, and keep the alignment
    as 4 should be ok to let the GL/GLES match the stride.
    
    Previous version has a unbalanced PACK ROW length seting, and is
    buggy, now fixed it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8b7884a70143497e36fdc28cbe05b1305a7b0be8
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 13 13:47:05 2012 +0800

    glamor_gl: Use GL_ALPHA for depth 8 pixmap.
    
    Use GL_RGBA to represent a8 pixmap is not efficient.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 609b5ff3ae35ed453b17bf561f6ecb23deec4a62
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 13 13:45:42 2012 +0800

    glamor_pixmap_ensure_fbo: Should allocate tex if we don't have one.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 701d9a92fa7ab1e0e6dd919a2bfd7a7635c54645
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 11 18:59:27 2012 +0800

    glamor_polylines: Don't fallback for non-solid fill.
    
    As glamor_fill/fbFill will handle non-solid fill correctly.
    We don't fallback it here.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit bec97f5fef06416c36f3c599ce1203fa16033fe5
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Apr 11 18:57:33 2012 +0800

    glamor_upload/download: fix 1bpp bug.
    
    For A1 to A8's conversion, the stride is different for the
    source and destination. Previous implementation use the same
    stride, and may allocate less memory than required. Thus may
    crash the server when uploading a A1 pixmap. Now fix it.
    
    Tested-by: Peng Li <peng.li@intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6d9f0542451810b4fa6ef83b58910bfc91f004a8
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Apr 10 20:50:14 2012 +0800

    glamor_pixmap_upload_texture: Support to upload a sub region of data.
    
    Just as the downloading side, we can upload an sub region data to
    a pixmap's specified region. The data could be in memory or in a
    pbo buffer.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 0c12794b3468a0a031c7b0b5d2ddd9b7ae86b88d
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Apr 10 10:40:17 2012 +0800

    glamor_getimage: Use glamor_download_sub_pixmap_to_cpu to get image.
    
    Reduce the duplicate logic.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 9d00724ce2a1d5dde9db3b1fb623914f29c2ab27
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Apr 10 10:19:30 2012 +0800

    glamor_polyfillrect: Fixed a potential bug if fallback at glamor_fill.
    
    We should advance the prect after we successfully excuted the
    glamor_fill. And if failed, we need to add the failed 1 box
    back to nbox.
    
    Although, this bug will never happen currently, as glamor_fill
    will never fallback.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 1dbda06d004981593c863b9b2b6907ac676ddf03
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Apr 9 20:20:45 2012 +0800

    glamor_polyfillrect: Optimize fallback path.
    
    Download/upload required region only.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit ee34aeb5150e73cf360bc2d142e94b9a8ecd6102
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Apr 9 20:16:07 2012 +0800

    fallback_optimize: Prepare for downloading/uploading subregion.
    
    Introduced two function glamor_get_sub_pixmap/glamor_put_sub_pixmap,
    can easily used to get and put sub region of a big textured pixmap.
    And it can use pbo if possible.
    
    To support download a big textured pixmap's sub region to another
    pixmap's pbo, we introduce a new type of pixmap GLAMOR_MEMORY_MAP.
    This type of pixmap has a valid devPrivate.ptr pointer, and that
    pointer points to a pbo mapped address.
    
    Now, we are ready to refine those
    glamor_prepare_access/glamor_finish_access pairs.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 815ef3d8dc0ea01ef01a79094aaa0a5fc1fced2e
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Apr 9 16:39:42 2012 +0800

    glamor_download_sub_pixmap_to_cpu: New function to download subregion.
    
    Prepare to optimize the fallback path. We choose the important
    rendering pathes to optimzie it by using shader. For other pathes,
    we have to fallback. We may continue to optimize more pathes in
    the future, but now we have to face those fallbacks.
    
    The original fallback is very slow and will download/upload the whole
    pixmap. From this commit, I will refine it to just download/upload
    needed part.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a361f9bdda664aef4ac96c96e95693e142c4a983
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Apr 9 15:57:05 2012 +0800

    glamor_es2_pixmap_read_prepare: Just prepare the required region.
    
    Don't need to prepare the whole source pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 3d2c451078b76f50e887ed0039222dd471b37628
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Apr 9 10:00:57 2012 +0800

    glamor_color_convert: Let the caller to provide destination buffer.
    
    As we don't need to allocate new buffer when downloading pixmap
    to CPU, we change the prototype of the color converting function
    and let the caller to provide the buffer to hold the result.
    
    All the color conversion function supports store the result
    just at the same place of the source.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 33eace9c5c5bcc92c64a55cd6278971a6dddd6ef
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 6 21:20:15 2012 +0800

    glyphblt/polyops: Use miFunctions by default.
    
    Calling to miFunctions give some opportunities to jump to
    accelerated path, so we switch to call miFunctions rather
    than fallback to fbFunctions directly.

commit a69bb6ae042a536cc3902f234f9bae685bc64520
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 6 21:17:46 2012 +0800

    glamor_set_alu: Added GXclear support at glamor_solid.
    
    We don't need to issue the glamor_fallback at the glamor_set_alu
    routine, as the caller may support GXclear or other most frequent
    Ops. Leave it to the caller to determine fallback or not.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 973f071fcd602bbabf9b9f107b5a484edc9f56da
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 6 21:15:12 2012 +0800

    getimage: Enable getimage by default.
    
    Fixed one bug when calculate the coords, should consider the
    drawable's x and y. Now enable it by default. Most of the time,
    it should be more efficient than miGetImage.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 78780ec20222a312351ea692bd40ab0e6a204ee6
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 6 17:01:57 2012 +0800

    render: Enable more componentAlpha support.
    
    Actually only PictOpAtop,PictOpAtopReverse and PictOpXor
    can't be implemented by using single source blending.
    All the other can be easily support. Slightly change
    the code to support them. Consider those three Ops
    are not frequenly used in real application. We simply
    fallback them currently.
    
    PictOpAtop: 		s*mask*dst.a + (1 - s.a*mask)*dst
    PictOpAtopReverse: 	s*mask*(1 - dst.a) + dst *s.a*mask
    PictOpXor:		s*mask*(1 - dst.a) + dst * (1 - s.a*mask)
    
    The two oprands in the above three ops are all reated to dst and
    the blend factors are not constant (0 or 1), it's hardly to
    convert it to single source blend.
    
    Now, the rendercheck is runing more smoothly.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a65ea430b68354ba8521e7abd4aacdfc995e297f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 6 11:02:36 2012 +0800

    glamor_set_alu: Fallback for non GXcopy ops with GLES2.
    
    As GLES2 doesn't support LogiOps, we have to fallback
    here. GLES2 programing guide's statement is as below:
    
    "In addition, LogicOp is removed as it is very
    infrequently used by applications and the OpenGL ES
    working group did not get requests from independent
    software vendors (ISVs) to support this feature in
    OpenGL ES 2.0."
    
    So, I think, fallback here may not a big deal ;).
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit e5a5621c4849f6b7cbceaa5aeb525bc5cc1ec4ba
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 5 22:39:41 2012 +0800

    glamor_putimage: Reuse the function in pixmap.c to do the uploading.
    
    We reuse glamor_upload_bits_to_pixmap_texture to do the
    data uploading to texture in putimage. Besides to avoid
    duplicate code, this also fixed the potential problem
    when the data format need extra reversion which is not
    supported by the finish shader, as
    glamor_upload_bits_to_pixmap_texture will handle all
    conditions.
    
    Tested-by: Junyan He <junyan.he@linux.intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 09a0a936dbbd61c1baa6eb81ef81e4dbda7cc2f7
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 5 22:31:44 2012 +0800

    gles2: Added 1555/2101010 formats support.
    
    Added color conversion code to support 1555/2101010
    formats,now gles2 can pass the render check with all
    formats.
    
    We use  5551 to represent 1555, and do the revertion
    if downloading/uploading is needed.
    
    For 2101010, as gles2 doesn't support reading the
    identical formats. We have to use 8888 to represent,
    thus we may introduce some accurate problem. But anyway,
    we can pass the error checking in render check, so that
    may not be a big problem.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6aea7e3586c29c5c0d3498177d03fff23d976eb3
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 5 21:53:44 2012 +0800

    gles2: Fixed color conversion for the formats except 1555 and 2101010.
    
    This patch fixed two major problems when we do the color convesion with
    GLES2.
    
    1. lack of necessary formats in FBO pool.
    GLES2 has three different possible texture formats, GL_RGBA,
    GL_BGRA and GL_ALPHA. Previous implementation only has one bucket
    for all the three formats which may reuse a incorrect texture format
    when do the cache lookup. After this fix, we can enable fbo safely
    when running with GLES2.
    
    2. Refine the format matching method in
    glamor_get_tex_format_type_from_pictformat.
    If both revertion and swap_rb are needed, for example use GL_RGBA
    to represent PICT_b8g8r8a8. Then the downloading and uploading should
    be handled differently.
    
        The picture's format is PICT_b8g8r8a8,
        Then the expecting color layout is as below (little endian):
        0   1       2       3   : address
        a   r       g       b
    
        Now the in GLES2 the supported color format is GL_RGBA, type is
        GL_UNSIGNED_TYPE, then we need to shuffle the fragment
        color as :
            frag_color = sample(texture).argb;
        before we use glReadPixel to get it back.
    
        For the uploading process, the shuffle is a revert shuffle.
        We still use GL_RGBA, GL_UNSIGNED_BYTE to upload the color
        to a texture, then let's see
        0   1       2       3   : address
        a   r       g       b   : correct colors
        R   G       B       A   : GL_RGBA with GL_UNSIGNED_BYTE
    
        Now we need to shuffle again, the mapping rule is
        r = G, g = B, b = A, a = R. Then the uploading shuffle is as
        below:
            frag_color = sample(texture).gbar;
    
    After this commit, gles2 version can pass render check with all
    the formats except those 1555/2101010.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a97f0f0b9e77b14fdf14f21fe21e186715600509
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Apr 5 20:27:35 2012 +0800

    glamor_utils: Added debug function to dump depth 15/16 pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8d88ef59823b82070d3e3583bc2df17a572c8ef4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Apr 6 11:14:21 2012 +0800

    glamor_render: Disable gradient shader conversion due to bug.
    
    I found when enable the gradient shader, the firefox's tab's
    background has incorrect rendering result.
    
    Need furthr investigation, for now, just disable it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit ce6de7c92a4e8741abda444c688646bf00cf90d4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Mar 16 16:42:46 2012 +0800

    glamor_fbo: Added one macro to disable fbo cache.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 5b252635a089b9a3e1d19c13c0423d77eedccb20
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Mar 26 19:03:20 2012 +0800

    glamor_fill: Should restore alu to GXcopy.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 93ba0061ece880cf97a191a5f99919f90b13721d
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Mar 23 04:06:06 2012 +0800

    Add the feature for radial gradient using shader.
    
     Add the feature for radial gradient using shader. The
     transform matrix and the 4 type of repeat mode are
     supported. Less than 2/255 difference for every color
     component comparing to pixman's result. Extract the
     common logic of linear and radial's to another shader.
    
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit fa798cd2925146b1a523cb39b56b288d271efcee
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Mar 23 04:05:56 2012 +0800

    Add the feature of generating linear gradient picture by using shader.
    
     Add the feature of generating linear gradient picture
     by using shader.  This logic will replace the original
     linear gradient picture generating manner in glamor
     which firstly use pixman and then upload it to GPU.
     Compare it to the result generated by pixman, the
     difference of each color component of each pixel is
     normally 0, sometimes 1/255, and 2/255 at most. The
     pixman use fixed-point but shader use float-point, so may have
     difference. The feature of transform matrix and 4 types
     of repeat modes have been supported. The array usage in
     shader seems slow, so use 8 uniform variables to avoid
     using array when stops number is not very big. This
     make code look verbose but the performance improved a
     lot.
    
     We still have slightly performance regression compare to
     original pixman version. There are one further optimization
     opportunity which is to merge the gradient pixmap generation
     and the latter compositing into one shader, then we don't need
     to generate the extra texture, we can use the gradient value
     directly at the compositing shader. Hope that can beat pixman
     version. Will do that latter.
    
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 45c2106f0f0b44d6678612977286c5a6131abc6b
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Fri Mar 23 04:05:48 2012 +0800

    Prepare for modification of gradient using shader.
    
     Prepare for modification of gradient using shader. The
     gradient pixmaps now is generated by pixman and we will
     replace them with shader. Add structure fields and
     dispatch functions which will be needed. Some auxiliary
     macro for vertex convert.
    
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 2658018ded10817d2d67424c6ffe0fbc0d65c5ed
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Mon Mar 26 13:51:13 2012 +0800

    glamor_utils: Add some assistant functions to compare pixmaps/pictures.
    
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a3bece2867c2d093d706ae789952fed995a780f2
Author: Junyan He <junyan.he@linux.intel.com>
Date:   Mon Mar 5 08:24:20 2012 +0800

    Fixup For list.h change in xorg
    
     Because the file list.h in xorg/include has changed the
     functions and struct names, adding xorg_ prefix before
     the original name. So Modify glamor_screen_private
     struct and the code which use list's functions in
     glamor_fbo.c. We hack at glamor_priv.h avoid the
     compile error when using old version xserver header
     file.
    
    Signed-off-by: Junyan He <junyan.he@linux.intel.com>

commit f6620ef1af968882159bcc04230b02ae4e8ff877
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 17 18:36:28 2012 +0800

    configure.ac: Let's enable the AM_MAINTAINER_MODE.
    
    Otherwise, Make will not invoke autoconf even if the configure.ac
    changed.
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f569dfefa236eaf21ae4645943d0c43dfddf5da8
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 17 17:09:37 2012 +0800

    Bump version to 0.3.1 for the new swap buffer API.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 9252fc7f546df727961d6c15af025aa5fc6cad4c
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 17 16:56:05 2012 +0800

    For DRI swap buffers.
    
    This commit added two APIs to support the DRI swap buffer.
    one is glamor_egl_exchange_buffers() which can swap two
    pixmaps' underlying KHRimages/fbos/texs. The DDX layer should
    exchange the DRM bos to make them consistent to each other.
    
    Another API is glamor_egl_create_textured_screen_ext(), which
    extent one more parameters to track the DDX layer's back pixmap
    pointer. This is for the triple buffer support. When using triple
    buffer, the DDX layer will keep a back pixmap rather then the
    front pixmap and the pixmap used by the DRI2 client. And during
    the closing screen stage, we have to dereference all the back
    pixmap's glamor resources. Thus we have to extent this API to
    register it when create new screen.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d5dbd94947c4373d4e7e9aaa205c74f5a732ed25
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 17 16:26:59 2012 +0800

    glamor_copyarea: Don't use GL_CLAMP_TO_BORDER when GLES2 enabled.
    
    We may need to modify all the shader to handle GL_CLAMP_TO_BORDER
    when using GLES2. XXX, for now, we just ignore them.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 04b95a5cf6e1f894682ada9ae59b5bf9cc4a5c1a
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Feb 14 17:39:11 2012 +0800

    glamor_fbo: Fix a bug when create No gl FBO pixmap.
    
    Need to get format before goto create a new fbo.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8fb50cc6957278219f1b027dfdc76ce1ee35eb63
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Feb 12 09:18:51 2012 +0800

    glamor_render: Only recalculate texture for repeat case.
    
    Slightly optimize the fragment shader, as if we are not
    repeat case and not exceed the valid texture range, then
    we don't need to recalculate the coords.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 30cc457394597978c7a6e6a198c975edbc1f88e8
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 10 17:40:37 2012 +0800

    glamor_tile/composite: Modify fs to re-calculate texture coords.
    
    Then we don't need to fixup the larger pixmap to the exact
    size, just need to let the shader to re-calculate the correct
    texture coords.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 12e0a5670f23d7cea04eb9cd1895c4eac3ed20c8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Feb 10 12:54:44 2012 +0000

    Fixup glx support
    
    Renaming glamor_priv->dispatch and wrapping the access to
    the dispatch table with a function that also ensured the
    context was bound.
    
     dispatch = glamor_get_dispatch(glamor_priv);
     ...
     glamor_put_dispatch(glamor_priv);
    
    So that we catch all places where we attempt to call into GL withouta
    context. As an optimisation we can then do glamor_get_context();
    glamor_put_context() around the rendering entry points to reduce the
    frequency of having to restore the old context. (Along with allowing
    the context to be recursively acquired and making the old context part of
    the glamor_egl state.)
    
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6350035af6317eac9f33e7ada11488e784428476
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 10 16:04:07 2012 +0800

    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>

commit 95091f6ab552997421e7fd9dd7e19bd8c2e3d082
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 10 15:34:43 2012 +0800

    glamor_pixmap: Should bind unpack buffer to 0 after the uploading.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit b0fc6d0c08814346d805941384e7cdbdfbf60b48
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Feb 11 07:37:17 2012 +0800

    glamor_picture: Fix the wrong order of header file.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d9bbe219c1bc2a677aad47a72f31bc942ef70431
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 3 11:46:01 2012 +0800

    glamor_dump_pixmap: Add helper routine to dump pixmap.
    
    For debug purpose only to dump the pixmap's content.
    As this function will call glamor_prepare_access/glamor_finish_access
    internally. Please use it carefully.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 492578de39def2ee2397e7f8938c12e7b85ea138
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 3 11:44:51 2012 +0800

    glamor_fill/tile: Fixed a tileX/tileY calculation bug.
    
    The previous's calculation is incorrect, now fix it and then
    we don't need to fallback at glamor_tile.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    Tested-by: Peng Li <peng.li@intel.com>

commit b982edcfd1ab6b254539fabae7702c54b47249eb
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Feb 3 11:21:37 2012 +0800

    prepare_access: Don't use fbo after it was downloaded.
    
    We add a new gl_fbo status GLAMOR_FBO_DOWNLOADED to indicate
    the fbo was already downloaded to CPU. Then latter the access
    to this pixmap will be treated as pure CPU access. In glamor,
    if we fallback to DDX/fbXXX, then we fallback everything
    currently. We don't support to jump into glamor acceleration
    layer between a prepare_access/finish_access. Actually, fbCopyPlane
    is such a function which may call to acceleration function within
    it. Then we must mark the downloaded pixmap to another state
    rather than a normal fbo textured pixmap, and then stick to use
    it as a in-memory pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    Tested-by: Peng Li <peng.li@intel.com>

commit b5f8dbbd74d76546b618fc48418df810d27b651b
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Feb 2 11:21:05 2012 +0800

    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>

commit b5080dcb2dea75f3199c00ec9b2dbdd2c6313abc
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Feb 2 09:34:42 2012 +0800

    Don't call dixSetPrivate directly.
    
    We may change the way to set/get those private data latter.
    consolidate to glamor_set_pixmap/screen_private is better
    than call those dixSetPrivate directly.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 1bc8bf32ea09fbb614c004ba11e04e85f3b02dd5
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jan 31 18:16:58 2012 +0800

    Refine CloseScreen and FreeScreen processes.
    
    This commit move the calling to glamor_close_screen from
    glamor_egl_free_screen to glamor_egl_close_screen, as this
    is the right place to do this.
    
    We should detach screen fbo and destroy the corresponding
    KHR image at glamor_egl_close_screen stage. As latter
    DDX driver will call DestroyPixmap to destroy screen pixmap,
    if the fbo and image are still there but glamor screen private
    data pointer has been freed, then it causes segfault.
    
    This commit also introduces a new flag GLAMOR_USE_EGL_SCREEN.
    if DDX driver is using EGL layer then should set this bit
    when call to glamor_init and then both glamor_close_screen
    and glamor_egl_close_screen will be registered correctly,
    DDX layer will not need to call these two functions manually.
    This way is also the preferred method within Xorg domain.
    
    As interfaces changed, bump the version to 0.3.0.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    Tested-by: Peng Li <peng.li@intel.com>

commit bab6e844e91e320ecde51aed555295efcfd467f6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jan 27 13:22:13 2012 +0000

    Use CLAMP_TO_BORDER in copy_n_to_n so we can sample outside of the source
    
    In order to reduce a composite operation to a source, we need to provide
    Render semantics for the pixel values of samples outside of the source
    pixmap, i.e. they need to be rgba(0, 0, 0, 0). This is provided by using
    the CLAMP_TO_BORDER repeat mode, but only if the texture has an alpha
    channel.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit fe4b69859b7c94e8061f668253006412fff234a7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jan 27 13:22:12 2012 +0000

    Do not reduce a composite to a copy if we need to sample outside of the source
    
    In order to maintain Render semantics, samples outside of the source
    should return CLEAR. The copy routines instead are based on the core
    protocol and expects the source rectangle to be wholly contained within
    the drawable and so does no fixup.
    
    Fixes the rendering of GTK icons.
    
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a40fc0ca00ddc81396b668d2ab3178c1cb810ec0
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Jan 29 14:14:36 2012 +0800

    glamor-gles2: Fixup the pixmap before read back if it is not readable.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6341657a03c96a3ce7cecac387259bf304d1b2f4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Jan 21 14:41:44 2012 +0800

    glamor-fbo: Tweek the cache bucket calculation.
    
    And also reduce the expire count to 100 which should be
    good enough on x11perf and cairo-trace testing.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 2f4a71f7c87ffc1466131a6e0bc44e9e85e2ebcd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Jan 21 13:22:14 2012 +0800

    glamor_create_fbo: Concentrate the fbo size/depth checking.
    
    Concentrate checking the size/depth when creating fbo. Simply
    the pixmap creation and the uploading fbo/texture preparing.
    
    Also slightly change the uploading fbo's preparation. If don't
    need fbo, then a fbo only has valid texture should be enough
    to return.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f646b45987370c86dcc1a4fbf085831e6fb607ef
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 20:38:29 2012 +0800

    glamor-pixmap-upload: Create a uploading fbo with a texture only.
    
    Just an initial implementation and disabled by default.
    When uploading a pixmap to a texture, we don't really want
    to attach the texture to any fbo. So add one fbo type
    which doesn't has a gl FBO attached to it.
    This commit can increase the cairo-trace's performance by
    10-20%. Now the firefox-planet-gnome is 8.3s. SNA is still
    the best, only take 3.5s.
    
    Thanks for Chris to point out the A1 pixmap uploading bug.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 3e69da0af314d4bd3cea356a988f2984b940be28
Author: Li Peng <peng.li@intel.com>
Date:   Fri Jan 20 16:23:17 2012 +0800

    glamor: check driver support GEM or not
    
    glamor calls DRM_IOCTL_GEM_FLINK to get a name for a buffer object.
    It only works for driver that support GEM, such as intel i915 driver.
    But for pvr driver who doesn't has GEM, we can't do it this way.
    
    According to Chris's comments, we check the has_gem as the following
    method:
    
    Here we just try to flink handle 0. If that fails with ENODEV or
    ENOTTY instead of ENOENT (or EINVAL on older kernels), set has_gem=0.
    
    Signed-off-by: Li Peng <peng.li@intel.com>
    Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f6691ba19552d6137602058b8663e115cf3e602b
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 15:56:25 2012 +0800

    glamor_gles2: Consolidate gles2 pixmap format readable check to one function.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f9b4bd8ab5643bbf82eb896c0ded381fb3b0c423
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 12:10:06 2012 +0800

    glamor_egl: Add support for the platform doesn't have gbm.
    
    Maybe we should use eglGetDisplayDRM to get display, but current
    PVR's driver is using eglGetDisplay.
    
    Signed-off-by: Peng Li <peng.li@intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f9bcc8909dae77e3936b98afba79a3618c629e1c
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 11:58:34 2012 +0800

    glamor_egl: Don't call eglDestroyImageKHR directly.
    
    Some implementation doesn't have it.
    
    Signed-off-by: Peng Li <peng.li@intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f0586bdc5c6484b29c69a14181d306ccb81e1bed
Author: Peng Li <peng.li@intel.com>
Date:   Fri Jan 20 11:52:18 2012 +0800

    glamor_gl_dispatch: fix the dispatch initialization on GLES2.
    
    Some gles2 implementation doesn's support get_proc_address.
    And we also need to avoid get those missing functions pointers
    when we are GLES2.
    
    Signed-off-by: Peng Li <peng.li@intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit cfb5017712ca69af70a63e26a4b74c60b1af8589
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 10:56:17 2012 +0800

    glamor_render: Add non-Map/Unmap vertex array for GLES.
    
    As some GLES implementations' glMapOES /glUnmapOES is
    not so efficient, we implement the in memory vertex array
    for them.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8afe856a93eedf9f21c0a5783a1a2b3149b88b6e
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 10:55:16 2012 +0800

    glamor_init: Should set gl_flavor before sub-module intialization.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a126a5b55d5d590127773bfa7cb412c89c1edce7
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 10:04:21 2012 +0800

    glamor_composite: Fix one bug when we have too more vertices.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 108ad205819f0e131ede82bbdf9454072376c4dd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 20 09:59:44 2012 +0800

    glamor-fbo-pool: Enable to reuse different size fbo/texture.
    
    Fixup three special cases, one is in tile and the other is in
    composite. Both cases are due to repeat texture issue. Maybe
    we can refine the shader to recalculate texture coords to
    support partial texture's repeating.
    
    The third is when upload a memory pixmap to texture, as now
    the texture may not have the exact size as the pixmap, we
    should not use the full rect coords.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6c33fda0c4dab96041cd670f8d9741e1b7e68bbf
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Jan 19 20:47:55 2012 +0800

    glamor-fbo-pool: Implement fbo cache mechanism.
    
    We classify the cache according to the texture's format/width/height.
    As openGL doesn't allow us to change a texture's format/width/height
    after the internal texture object is already allocated, we can't
    just calculate the size and then according ths size to put the
    fbo to an bucket which is just like SNA does. We can only put
    the fbo to the corresponding format/width/height bucket.
    
    This commit only support the exact size match. The following patch
    will remove this restriction, just need to handle the repeat/tile
    case when the size is not exactly match.
    
    Should use fls instead of ffs when decide the width/height bucket,
    thanks for Chris to point this out.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 7e90507d0f23c67abd7c16ba62ce1217826173bd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 18 19:21:36 2012 +0800

    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>

commit 583a2ef4b0452767c93900e59e9ee9251829c3aa
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 18 17:12:32 2012 +0800

    glamor_set_pixmap_texture/screen_pixmap: Remove useless parameters.
    
    As after we got a texture, no matter the texture is created
    on the glamor_create_pixmap or on the egl layer, we all already
    know the texture's width and height there. We don't need
    to pass them in.
    
    This commit also simply the glamor_egl_create_textured_screen to
    reuse the egl_create_textured_pixmap. And also remove the useless
    root image from the egl private structure. As now the root image
    is bound to the screen image, we don't take care it separately
    here. It will be freed at the screen closing.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d732f30eb4026e9e843d87ae6260625abd1ffef4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 18 17:10:26 2012 +0800

    Add debug message for all the uploading path.
    
    The previous message missed the texture restoring path.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 977720f15a224a788b5729f740c94d7db401b4b7
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 18 17:07:25 2012 +0800

    glamor_create_picture: Fix the format matching method.
    
    We should not simply set a TEXTURE_DRM pixmap to a separated
    texture pixmap. If the format is compatible with current fbo
    then it is just fine to keep it as TEXTURE_DRM type and we
    can safely fallback to DDX layer on it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 8c85181351befe558c7da1d40a395017b67beb08
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Jan 13 11:18:28 2012 +0800

    Rearrange data structure and remove unused fileds.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit a0fcca63e71e8af06b34fc9ed4560820c22e3b79
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jan 10 17:04:48 2012 +0800

    Release previous textre/fb when bind a new texture to a pixmap.
    
    As we want to support DRI2 drawable which may create a new textured_drm
    to a pre-existing texture_only pixmap, we have to add this logical.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
    Tested-by: He Junyan<junyan.he@linux.intel.com>

commit 04f657997b7b567e53907cefef4b5c04fdc08c68
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Jan 10 15:24:36 2012 +0800

    Add glFinish after glFlush.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6167738a70fce8b86190f3610da4363f11b34d5f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jan 9 12:50:39 2012 +0800

    Set glamor's initial version to 0.2.0.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6c81956e8ae5c274e52ed26c12c489a8d1760527
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jan 9 07:16:06 2012 +0800

    Silence a compilation warning.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit c88d336afc5801123de6163acea214dd5610049d
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jan 9 07:11:26 2012 +0800

    glamor_composite: Allocate VBO on demand.
    
    Use a fixed VBO is not efficient. Some times we may only has less than
    100 verts, and some times we may have larger than 4K verts. We change
    it to allocate VBO buffer dynamically, and this can bring about 10%
    performance gain for both aa10text/rgb10text and some cairo benchmarks.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 97d4f50da66571362f4789d3d3ef436a890f9950
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jan 9 05:03:08 2012 +0800

    glamor_getimage: Add the optimization path of getImage.
    
    This optimization will only call glReadPixels once. It should get
    some performance gain. But it seems it even get worse performance
    at SNB, disable it by default.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 80e02fb74211c22ea3a41ac504e1031d0fdc68c9
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Jan 9 05:01:48 2012 +0800

    Consolidate the choose of internal texture format to one function.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 7f0a33f0901b72f5870032a669fbd6d649dec486
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Jan 8 08:50:41 2012 +0800

    Set filter to GL_NEAREST by default.
    
    This is the fastest filter and let's use it by default.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 0365a776bdee3fa08d56f359750c848e7c63a1ed
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Jan 8 08:45:08 2012 +0800

    glamor-composite: Use glDrawElements to reduce the count of vertices.
    
    To split a rectangle (0,1,2,3) to two separated triangles need to feed
    6 vertices, (0,1,2) and (0,2,3). use glDrawElements can reuse the shared
    vertices.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 9291ead8bd18408cdff39ff0d559aaa209537199
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Jan 8 01:14:12 2012 +0800

    glamor-composite: Optimize the computation of composite region.
    
    Computing the composite region at the composite_with_shader is very
    inefficient. As when we call to here from the glamor_glyph's temproary
    picture, we don't need to compute this region at all. So we move this
    computing out from this function and do that at the glamor_composite
    function. This can get about 5% performance gain for aa10text/rgb10text.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit e5fdb5644d4505cddefaf02566bd35b947436c52
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Jan 5 14:26:01 2012 +0800

    Fixed a configure bug.
    
    Should check the enable-glamor-gles2 before use the variable.
    And should include the config.h as the GLAMOR_GLES2 macro is
    defined there.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit bed6c3076227c97814b4ba21073c41a399fa9d8e
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 4 14:40:24 2012 +0800

    Reduce the double check of pixmap's private pointer.
    
    As we now add the checking to the Macro, we don't need to check
    the pointer outside the Macro.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6a92962c90b3d8961aa56a575a3c1b6b56e625fb
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 4 14:37:37 2012 +0800

    get_spans: Check whether have a valid fbo before check format.
    
    If a pixmap is a pure in-memory pixmap, we do not need to
    check its format. Format checking has more overhead than
    checking FBO, so we change to check fbo firtly.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d7fdec7adedce9bec2371485988ff8f950d501ce
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 4 14:34:39 2012 +0800

    Track all picture's drawable pict format.
    
    Even if a picture's pixmap is a pure in memory pixmap, we still need
    to track its format. The reason is we may need to upload this drawable
    to texture thus we need to know its real picture format.
    
    As to the MACRO to check whether a pixmap is a picture, we should
    check whether the priv is non-NULL before we touch its field.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 0d6ad1663fa0c1f52cc54bf440df69134b742196
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Jan 4 13:11:52 2012 +0800

    Need to check pixmap priv before touch its field.
    
    As now the pixmap may be allocated by DDX and doesn't have a
    valid pixmap private field. We must check pixmap private
    pointer before touch its field value. If a pixmap doesn't
    have a non-NULL private pointer, it doesn't have a valid
    FBO.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 163c0db70d5a57b5cb7fed7dc8c1c4c9892a6183
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Dec 31 19:29:17 2011 +0800

    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>

commit 6b12b275824af1b04b2d99b4dd6e3b59a5bebfd4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Dec 31 19:27:33 2011 +0800

    Remove useless output messages.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit de234e3864e46d7951de7feb3b707666351c3291
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Dec 31 19:20:10 2011 +0800

    Fixed a rendering bug at fillspans.
    
    We should not change the points coords when loop for the clip
    rects. Change to use another variable to store the clipped
    coords and keep the original coords. This bug cause some
    XTS failures. Now fix it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 499cb827714f8c57f473639d7895f6d494366e36
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sat Dec 31 19:14:06 2011 +0800

    Fixed a bug at putImage.
    
    fbPutImage wants the input drawable is the target drawable rather
    than the backing pixmap. This bug cause some XTS failures, now
    fix it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 27f85fef84f4aab2a13826011e5faabf1a1c6139
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Dec 27 16:44:17 2011 +0800

    Remove the assertion which is not safe sometimes.
    
    The original version assumes that each drawable pixmap should
    have a valid private pixmap pointer. But this is not true after
    we create this libglamor. As the DDX layer may create a pure
    software drawable pixmap which doesn't have a private pixmap
    pointer.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 5c2fd5c92fe32caf749330ee9c75ef2a4da2a6a4
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Dec 27 16:42:32 2011 +0800

    Export glamor_validate_gc to DDX.
    
    This is also a function which may direct access pixmaps which
    may be a glamor only pixmap and DDX doesn't know how to access
    it. We have to export this API to DDX driver and let the DDX
    driver use it to do the validation.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit f089d1eb0b9d0b76834e34f75caac23a83761a66
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 23 16:21:44 2011 +0800

    Flush gl operations when destroy an textured image.
    
    Before destroy an image which was attached to a texture.
    we must call glFlush to make sure the operation on that
    texture has been done.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 2f9d53f3c3d7fa5585a122afa555c64c165a7422
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 23 16:19:39 2011 +0800

    Add a new API glamor_create_gc.
    
    As at ValidateGC stage, it may need to touch the pixmap directly, for
    example the tile pixmap. We must export this interface to DDX driver
    and let the DDX driver to route the processing to us. As this pixmap
    may be a texture only pixmap, and DDX don't know how to handle it.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 87d9526be3c4254c4525f73b27597a9c498eca3f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 23 16:18:22 2011 +0800

    Code cleanup.
    
    Remove useless code, and after a fbCreatePixmap, we
    do not need to modify its header there.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 7e78c55689e22a0446f40aa5b1ffef0bc80e6bfd
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 23 14:23:56 2011 +0800

    Remove useless egl functions.
    
    We only need to create image fron external name rather
    than use drm_image_mesa to create drm image, so remove
    them.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 912f4da51a53fa896517ed2a890e3074f1606304
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 16 20:15:33 2011 +0800

    Make sure the devPrivate.ptr of a textured pixmap is NULL.
    
    Just in case when wrongly fallback to DDX layer and cause
    random memory corruption. Pointed out by Chris.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit aa1fa8b8cd4fd50bdd284650b46c75f0805ad98f
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 16 15:04:33 2011 +0800

    Export glamor_create_texture to DDX driver.
    
    If DDX failed to create textured pixmap from its BO's handle,
    it can turn to call this API to create a brand new glamor
    rather than fallback to pure in memory pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 00c40cecc0a346b6a522b399600ef82dbbdd8081
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 16 15:02:54 2011 +0800

    Correct the logic of glamor_egl_create_textured_pixmap.
    
    Discussed with Chris and found the previous logic is not
    good. Now change it in this commit, this API will just
    try to create a textured pixmap from the handle provided
    by DDX driver, if failed simply return FALSE without touch
    the pixmap. And the DDX driver can choose how to do next
    step.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 1a540680e338dbcd69749d2c2b7266c217c22eaf
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Dec 13 22:48:34 2011 +0800

    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>

commit d5ecb2678f08806a236773291912e20d6fa3b305
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Dec 12 09:58:03 2011 +0800

    Enable texture dynamic uploading.

commit 8e949784d26d3a834e0dc08f6eaf19c940cdbdf0
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Dec 12 09:49:06 2011 +0800

    Call screen's method to create pixmap.
    
    As we may need to fallback to DDX's rendering path
    during the glyphs, we have to call screen's create pixmap
    method to create pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 954f7e8685452f16ee3e4e7144a3acedb079edd2
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Dec 12 09:48:04 2011 +0800

    Fallback if the pixmap is drm only.
    
    Glamor can't do anything with a drm only pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit ccc8267c32b0da39a9e36fac5e02d1041622df13
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Dec 12 07:09:03 2011 +0800

    Classfy glamor pixmap to different types.
    
    During the integration with intel driver, we introduce two
    new type of pixmap, one is TEXTURE_DRM, the other is DRM_ONLY.
    TEXTURE_DRM means we create a texture bind to the DRM buffer
    successfully. And then the texture and the external BO is
    consistent. DRM_ONLY means that we failed to create a texture
    from the external DRM BO. We need to handle those different
    types carefully, so we have to track them in the data structure.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 6023b5db10e2dc5a1a01d4c145107ec42df535fb
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Mon Dec 12 06:56:36 2011 +0800

    Call glamor_create_pixmap directly in glamor rendering path.
    
    When glamor is rendering pixmaps, and needs to create some
    temporary pixmap, it's better to use glamor version create
    pixmap directly. As if goes to external DDX's create pixmap,
    it may create a external DRM buffer which is not necessary.
    All the case within glamor scope is to create a texture only
    pixmap or a in memory pixmap.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 15c8159161f08003d0dcd9c00f2b3fc14dc8eac1
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Dec 11 08:06:13 2011 +0800

    Remove garbage file.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit d640d0b9fccdc13721e3344403b7c49b878fc1ac
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Sun Dec 11 02:26:15 2011 +0800

    Remove the access mode from private pixmap structure.
    
    Change the finish_access to pass in the access mode, and remove
    the access mode from the pixmap structure. This element should
    not be a pixmap's property.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 51d800c23134459aeada793696837977043f4f36
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 9 16:01:45 2011 +0800

    Can't create KHR image if the depth is uncompatible.
    
    Currently, KHR image only support one color format ARGB32.
    For all other format, we have to fail to create corresponding
    image and texture here.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 99ff5c26acfcc1ff7cf3836bc09b896712530aac
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 9 15:58:19 2011 +0800

    exports more rendering functions to DDX driver.
    
    Exports all necessary rendering functions to DDx drivers, including
    CopyArea, Glyphs, Composite, Triangles, ....
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit b424581505980fcd6ff53c081c913ca3ce1dd5e1
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 9 14:57:24 2011 +0800

    Override create/destroy picture to track pict format.
    
    When create a piccture, we need to attach a pixmap to it.
    A pixmap only has a depth, which is not sufficant for glamor.
    As in openGL texture only has a few internal formats which
    is not sufficant to represent all the possible picture
    format. So we always transform the picture format to GL_RGBA.
    And when we need to read back the picture, we must know the
    original picture format. So we have to override create
    and destroy picture to track a pixmap's real picture format
    if it is attached to a picture.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 5a98541a27759aebe10122ffc9ee0b785b396842
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Dec 9 14:56:21 2011 +0800

    Fix the cflags of glamor-egl package.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 89d49be410483c7bed85ebc4d32ea72889b48e85
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Nov 22 18:28:10 2011 +0800

    Added a missed header file.
    
    Pointed by Chris, we must add xorg-server.h at the top
    of each file before we include any other xorg header files.
    Otherwise, it may cause incorrect XID length.
    
    This commit also fixes one compilation warning in X86_64
    platform.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit c3329fdf17b078d2b995e45aac4d5aca7b641123
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Thu Nov 17 10:54:01 2011 +0800

    Correct the configure.ac to check gbm.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit ca4329b278ea37c9e4d7e162ee2a20c686dce1ba
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Nov 15 20:17:18 2011 +0800

    If caller is not using glamor screen, we can't register
    the block handler.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit cda2a3fae6b5f0a27872d4ef704900ae747816f8
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Tue Nov 15 20:16:16 2011 +0800

    Revert "Disable glamor_tile temporary."
    
    The previous corruption output is caused by GLAMOR/UXA flushing
    issue. Now get fixed.
    
    This reverts commit 0d2d3e4f051e48c3499e1c972e012803a8623526.

commit 0d2d3e4f051e48c3499e1c972e012803a8623526
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Nov 11 14:55:12 2011 +0800

    Disable glamor_tile temporary.
    
    Enable glamor tile cause corrupted output. Need more investigation.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 714667157f0e27bc861905dd7ef2fe3ac630f3c1
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Nov 11 14:00:39 2011 +0800

    Added more details to introduce GLAMOR in README.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit dac277199e86af1d178f4cb8600d01498acc3a69
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Fri Nov 11 10:26:00 2011 +0800

    Add new version glamor_poly_fill_rect without internal fallback.
    
    If need fallback, this new version just returns FALSE without
    doing anything. It's the caller's responsibility to implement
    fallback method.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 114bb7359db9d5dfb074dce94eb06d25ffcddd72
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Nov 9 16:09:03 2011 +0800

    Add new version glamor_fillspans without internal fallback.
    
    For the purpose of incrementally intergration of existing intel
    driver, for the GC operations we may don't want to use glamor's
    internal fallback which is in general much slower than the
    implementation in intel driver. If the parameter "fallback" is
    false when call the glamor_fillspans, then if glamor found it
    can't accelerate it then it will just return a FALSE rather than
    fallback to a slow path.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>

commit 584e8d59cd4ed184ed7eef2a110bce3eea834620
Author: Zhigang Gong <zhigang.gong@linux.intel.com>
Date:   Wed Nov 2 13:44:50 2011 +0800

    Initial version.
    
    Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
