glamor: Changes to 'master'

Zhigang Gong gongzg at kemper.freedesktop.org
Thu Apr 12 02:58:23 PDT 2012


 src/glamor.c              |   15 
 src/glamor.h              |    1 
 src/glamor_copyarea.c     |   16 
 src/glamor_core.c         |  115 +++-
 src/glamor_fbo.c          |  203 ++++++--
 src/glamor_fill.c         |   50 ++
 src/glamor_getimage.c     |   74 ---
 src/glamor_getspans.c     |   31 -
 src/glamor_glyphblt.c     |   32 -
 src/glamor_pixmap.c       | 1076 ++++++++++++++++++++++++++++++----------------
 src/glamor_polyfillrect.c |   13 
 src/glamor_polylines.c    |    7 
 src/glamor_polyops.c      |   54 --
 src/glamor_priv.h         |   66 ++
 src/glamor_putimage.c     |   70 +-
 src/glamor_render.c       |   32 -
 src/glamor_setspans.c     |   13 
 src/glamor_tile.c         |    5 
 src/glamor_utils.h        |  207 +++++++-
 19 files changed, 1355 insertions(+), 725 deletions(-)

New commits:
commit 701d9a92fa7ab1e0e6dd919a2bfd7a7635c54645
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit bec97f5fef06416c36f3c599ce1203fa16033fe5
Author: Zhigang Gong <zhigang.gong at 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 at intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>

commit 6d9f0542451810b4fa6ef83b58910bfc91f004a8
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 0c12794b3468a0a031c7b0b5d2ddd9b7ae86b88d
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 9d00724ce2a1d5dde9db3b1fb623914f29c2ab27
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 1dbda06d004981593c863b9b2b6907ac676ddf03
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit ee34aeb5150e73cf360bc2d142e94b9a8ecd6102
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 815ef3d8dc0ea01ef01a79094aaa0a5fc1fced2e
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit a361f9bdda664aef4ac96c96e95693e142c4a983
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 3d2c451078b76f50e887ed0039222dd471b37628
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 33eace9c5c5bcc92c64a55cd6278971a6dddd6ef
Author: Zhigang Gong <zhigang.gong at 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 at 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 at linux.intel.com>

commit 973f071fcd602bbabf9b9f107b5a484edc9f56da
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 78780ec20222a312351ea692bd40ab0e6a204ee6
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit a65ea430b68354ba8521e7abd4aacdfc995e297f
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit e5a5621c4849f6b7cbceaa5aeb525bc5cc1ec4ba
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>
    Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>

commit 09a0a936dbbd61c1baa6eb81ef81e4dbda7cc2f7
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 6aea7e3586c29c5c0d3498177d03fff23d976eb3
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit a97f0f0b9e77b14fdf14f21fe21e186715600509
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit 8d88ef59823b82070d3e3583bc2df17a572c8ef4
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>

commit ce6de7c92a4e8741abda444c688646bf00cf90d4
Author: Zhigang Gong <zhigang.gong at 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 at linux.intel.com>



More information about the xorg-commit mailing list