summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2012-05-15Remove the texture cache code.Zhigang Gong2-89/+6
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>
2012-05-15Added strict warning flags to CFLAGS.Zhigang Gong9-29/+30
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>
2012-04-28We should not call gradient finalization code if we disable it.Zhigang Gong1-0/+2
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Fixed all unused variables warnings.Zhigang Gong12-44/+14
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Fixed an uninitialized problem at gradient shader functions.Zhigang Gong1-4/+3
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Fixed one typo bug when fixup a mask picture.Zhigang Gong1-15/+11
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Added some copyright and author information.Zhigang Gong17-1/+216
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Added --enable-debug configuration option.Zhigang Gong3-3/+6
For release version, we disable asserts. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-28Remove unecessary header file.Zhigang Gong1-1/+0
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_render: Fix the repeat none for GLES2.Zhigang Gong2-28/+71
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>
2012-04-27glamor_blockhandler: Don't do glFinish every time.Zhigang Gong1-2/+0
To do glfinish every time bring some performance overhead. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_copyarea: Return earlier if have zero nbox.Zhigang Gong1-6/+3
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>
2012-04-27glamor_render: Have to use eaxct size pixmap for transformation.Zhigang Gong1-19/+30
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>
2012-04-27glamor_fbo: Added a threshold value for the fbo cache pool.Zhigang Gong2-6/+21
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>
2012-04-27Fixed a1 bug.Zhigang Gong2-4/+29
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>
2012-04-27glamor_render.c: Fixed repeatPad and repeatRelect.Zhigang Gong2-34/+87
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>
2012-04-27gradient: Don't need fixup flag when creating pixmap.Zhigang Gong1-11/+11
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>
2012-04-27glamor_copyarea: Don't access a DRM only pixmap.Zhigang Gong1-0/+7
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>
2012-04-27Disable A8 texture format for GLES2.Zhigang Gong1-4/+1
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>
2012-04-27gradient: Disable gradient for gles2.Zhigang Gong2-2/+4
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>
2012-04-27Fix the bug caused by gradient picture set the stops at the same percentage.Junyan He1-18/+27
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>
2012-04-27Fix the problem of memory leak in gradient pixmap generating.Junyan He4-69/+199
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>
2012-04-27glamor_putimage: Optimize for direct uploading and fallback path.Zhigang Gong1-11/+30
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>
2012-04-27Fixed one potential texture size mismatch problem.Zhigang Gong1-1/+15
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>
2012-04-27glamor_getimage: Don't fallback to miGetImage.Zhigang Gong1-6/+17
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>
2012-04-27pending_op: Remove the pending operations handling.Zhigang Gong8-243/+80
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>
2012-04-27glamor_upload_pixmap: Use glTexImage2D for a fully update.Zhigang Gong1-16/+16
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>
2012-04-27glamor_setspans: Reuse glamor_upload_sub_pixmap.Zhigang Gong1-45/+15
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27code clean up.Zhigang Gong2-17/+0
Remove unused variables. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_getspans: Reuse glamor_download_sub_pixmap.Zhigang Gong1-58/+8
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_render: Don't download whole picture when fallback.Zhigang Gong2-21/+73
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_put_sub_pixmap: Change to use glamor_upload_sub_pixmap.Zhigang Gong2-16/+25
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>
2012-04-27Fixed a stride problem for textured_drm pixmap.Zhigang Gong3-3/+14
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>
2012-04-27glamor_putimage: Reuse copy area to do the clipped copy.Zhigang Gong1-91/+19
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>
2012-04-27Fixed a unbalanced glamor_put_dispatch.Zhigang Gong1-1/+0
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-27glamor_pixmap_priv: Always return a valid private pixmap.Zhigang Gong3-3/+10
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>
2012-04-14Don't need to set GL_PACK_ROW_LENGTH/GL_UNPACK_ROW_LENGTH.Zhigang Gong2-16/+6
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>
2012-04-13glamor_gl: Use GL_ALPHA for depth 8 pixmap.Zhigang Gong2-2/+4
Use GL_RGBA to represent a8 pixmap is not efficient. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-13glamor_pixmap_ensure_fbo: Should allocate tex if we don't have one.Zhigang Gong1-1/+1
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-12glamor_polylines: Don't fallback for non-solid fill.Zhigang Gong1-4/+3
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>
2012-04-12glamor_upload/download: fix 1bpp bug.Zhigang Gong1-7/+19
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>
2012-04-12glamor_pixmap_upload_texture: Support to upload a sub region of data.Zhigang Gong3-135/+96
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>
2012-04-12glamor_getimage: Use glamor_download_sub_pixmap_to_cpu to get image.Zhigang Gong2-60/+13
Reduce the duplicate logic. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-12glamor_polyfillrect: Fixed a potential bug if fallback at glamor_fill.Zhigang Gong1-3/+6
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>
2012-04-12glamor_polyfillrect: Optimize fallback path.Zhigang Gong2-4/+40
Download/upload required region only. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-12fallback_optimize: Prepare for downloading/uploading subregion.Zhigang Gong5-88/+272
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>
2012-04-12glamor_download_sub_pixmap_to_cpu: New function to download subregion.Zhigang Gong1-121/+168
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>
2012-04-12glamor_es2_pixmap_read_prepare: Just prepare the required region.Zhigang Gong4-18/+19
Don't need to prepare the whole source pixmap. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
2012-04-12glamor_color_convert: Let the caller to provide destination buffer.Zhigang Gong1-29/+21
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>
2012-04-12glyphblt/polyops: Use miFunctions by default.Zhigang Gong2-76/+10
Calling to miFunctions give some opportunities to jump to accelerated path, so we switch to call miFunctions rather than fallback to fbFunctions directly.