[Mesa-dev] [PATCH v2 4/4] i965: implement driResourceSharing extension.

2013-07-16 Thread Zhigang Gong
This patch implements the texture sharing. Signed-off-by: Zhigang Gong --- src/mesa/drivers/dri/i965/Makefile.am |2 + src/mesa/drivers/dri/i965/Makefile.sources |1 + .../drivers/dri/i965/intel_dri_resource_sharing.c | 192 .../drivers/dri

[Mesa-dev] [PATCH v2 3/4] DRI: implement helper functions for dri resource sharing extension.

2013-07-16 Thread Zhigang Gong
Signed-off-by: Zhigang Gong --- src/mesa/drivers/dri/common/dri_util.c | 48 src/mesa/drivers/dri/common/dri_util.h | 10 +++ 2 files changed, 58 insertions(+) diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c

[Mesa-dev] [PATCH v2 2/4] EGL: Implement the new extension MESA_EGL_extension_sharing.

2013-07-16 Thread Zhigang Gong
ter at dri driver layer. Signed-off-by: Zhigang Gong --- include/EGL/eglext.h| 19 include/GL/internal/dri_interface.h | 19 src/egl/drivers/dri2/egl_dri2.c | 167 +++ src/egl/drivers/dri2/egl_dri2.h |2 + src/egl/main/M

[Mesa-dev] [PATCH v2 1/4] Introduce a new EGL extension MESA_EGL_resource_sharing

2013-07-16 Thread Zhigang Gong
/render buffer. The low level attributes are defined at dri driver layer. It a driver specific data structure which could be used by the external library (Open Cl driver) to create another shared buffer object to access the same resource correctly. Signed-off-by: Zhigang Gong --- docs/specs

[Mesa-dev] [RFC] [PATCH 3/3] i965: implement driResourceSharing extension.

2013-07-14 Thread Zhigang Gong
This patch implements the texture sharing. Signed-off-by: Zhigang Gong --- src/mesa/drivers/dri/i965/Makefile.am |2 + src/mesa/drivers/dri/i965/Makefile.sources |1 + .../drivers/dri/i965/intel_dri_resource_share.c| 192 .../drivers/dri

[Mesa-dev] [RFC] [PATCH 2/3] DRI: implement helper functions for dri resource sharing extension.

2013-07-14 Thread Zhigang Gong
Signed-off-by: Zhigang Gong --- src/mesa/drivers/dri/common/dri_util.c | 48 src/mesa/drivers/dri/common/dri_util.h | 10 +++ 2 files changed, 58 insertions(+) diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c

[Mesa-dev] [RFC] [PATCH 1/3] EGL: introduce a new extension to share resource with external library.

2013-07-14 Thread Zhigang Gong
ter at dri driver layer. Signed-off-by: Zhigang Gong --- include/EGL/eglext.h| 19 include/GL/internal/dri_interface.h | 19 src/egl/drivers/dri2/egl_dri2.c | 167 +++ src/egl/drivers/dri2/egl_dri2.h |2 + src/egl/main/M

[Mesa-dev] [RFC] [PATCH 0/3] Introduce a new EGL/DRI extension for resource sharing with Open CL.

2013-07-14 Thread Zhigang Gong
e welcome and if this new extension is not the right way to solve the original problem, please feel free to point it out and kindly guide which is the right way to implement the cl-gl interoperations. Thanks. Zhigang Gong (3): EGL: introduce a new extension to share resource with external

[Mesa-dev] Question about how to implement gl sharing extension in Open CL C with mesa

2013-07-07 Thread Zhigang Gong
Hi, I'm developing gl sharing for Open Cl 1.1 implementation. My current solution is to use the existing interface and extension to export a gl texture/buffer object to the OpenCL domain, and create an cl memory object from the same buffer object(drm level). But I met some gaps with current mes

Re: [Mesa-dev] [PATCH v3 2/2] GLX_TLS: use TLS macros when define those TLS variables.

2012-03-19 Thread Zhigang Gong
Hi Brian, Have you tried those testings(osmesa, static lib builds, etc) already and any new comments for the previous patchset. Thanks. > -Original Message- > From: > mesa-dev-bounces+zhigang.gong=linux.intel@lists.freedesktop.org > [mailto:mesa-dev-bounces+zhigang.gong=linux.intel.

Re: [Mesa-dev] [PATCH v3 1/2] configure.ac: Enable GLX_USE_TLS if possible.

2012-02-15 Thread Zhigang Gong
archives. > > -tom > > On 15.02.2012, at 12:41, zhigang.g...@linux.intel.com wrote: > > > From: Zhigang Gong > > > > If the system support tls, we prefer to enable it by default just as > > xserver does. Actually, the checking code is copied from > >

[Mesa-dev] [PATCH v3 2/2] GLX_TLS: use TLS macros when define those TLS variables.

2012-02-15 Thread zhigang . gong
From: Zhigang Gong Use the properate way detected in autoconf stage to define those TLS variables rather than using hard coded "attribute..." Signed-off-by: Zhigang Gong --- src/egl/main/eglcurrent.c |3 +-- src/glx/glxclient.h|3 +-

[Mesa-dev] [PATCH v3 1/2] configure.ac: Enable GLX_USE_TLS if possible.

2012-02-15 Thread zhigang . gong
From: Zhigang Gong If the system support tls, we prefer to enable it by default just as xserver does. Actually, the checking code is copied from xserver/configure.ac. According to nobled's suggestion, move the checking before enable_asm. As if tls_model is not supported, then asm may can&#

[Mesa-dev] [PATCH v3 0/2] Enable GLX_USE_TLS if possible.

2012-02-15 Thread zhigang . gong
From: Zhigang Gong This version fixed the CFLAGS setting when check whether support tls model. --- This patchset enable GLX_USE_TLS if the system support it. And this patchset will check whether we support tls model and choose propriate method to define those TLS variables rather than define

[Mesa-dev] [PATCH 2/2] gbm/dri: Add more color formats support.

2012-02-14 Thread zhigang . gong
From: Zhigang Gong Added two color formats RGB565 and A8 to gbm layer. Added A8 to dri layer. Signed-off-by: Zhigang Gong --- include/GL/internal/dri_interface.h |1 + src/gbm/backends/dri/gbm_dri.c|6 ++ src/gbm/main/gbm.h|6

[Mesa-dev] [PATCH 1/2] gbm: Use a separate function to check format and usage.

2012-02-14 Thread zhigang . gong
From: Zhigang Gong To extent gbm to support more formats and usages, it's better to do the format and usage matching in a seprated function. Also fixed a memory leak at gbm_dri_bo_create, if failed to create a DRI image, before return NULL, we need to free bo. Signed-off-by: Zhigang

Re: [Mesa-dev] [PATCH v2 2/2] GLX_TLS: use TLS macros when define those TLS variables.

2012-02-13 Thread Zhigang Gong
On Mon, Feb 13, 2012 at 06:10:36PM +0800, Zhigang Gong wrote: > On Sun, Feb 12, 2012 at 09:02:44AM -0500, nobled wrote: >From ac92209ccf1d8877eb58bf0bfdd0ccc389200bac Mon Sep 17 00:00:00 2001 From: Zhigang Gong Date: Mon, 13 Feb 2012 17:29:12 +0800 Subject: [PATCH 2/2] GLX_TLS: use TLS

Re: [Mesa-dev] [PATCH v2 1/2] configure.ac: Enable GLX_USE_TLS if possible.

2012-02-13 Thread Zhigang Gong
etc defines. > Thanks for the comments, I refined the patch according to you and Dan's suggestion. Here is the new version. As to the version check of CLANG, I haven't handled it as I don't have the environment at hand. Could you help to add it? >From 75de119cf92cb43cecd4813

Re: [Mesa-dev] [PATCH] configure.ac: Enable GLX_USE_TLS if possible.

2012-02-08 Thread Zhigang Gong
On Wed, Feb 08, 2012 at 02:46:42PM -0800, Eric Anholt wrote: > On Wed, 8 Feb 2012 16:19:38 +0800, zhigang.g...@linux.intel.com wrote: > > From: Zhigang Gong > > > > If the system support tls, we prefer to enable it by default > > just as xserver does. Actually,

[Mesa-dev] [PATCH] configure.ac: Enable GLX_USE_TLS if possible.

2012-02-08 Thread zhigang . gong
From: Zhigang Gong If the system support tls, we prefer to enable it by default just as xserver does. Actually, the checking code is copied from xserver/configure.ac. Signed-off-by: Zhigang Gong --- configure.ac | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a

[Mesa-dev] [PATCH 3/3] gbm: Add interface to create bo from name.

2011-12-17 Thread Zhigang Gong
Added a new interface to create a gbm_bo from external name. Signed-off-by: Zhigang Gong --- src/gbm/backends/dri/gbm_dri.c | 40 src/gbm/main/gbm.c | 12 src/gbm/main/gbm.h |6 ++ src/gbm/main/gbmint.h

[Mesa-dev] [PATCH 2/3] gbm/dri: Add more color formats support.

2011-12-17 Thread Zhigang Gong
Added two color formats RGB565 and A8 to gbm layer. Add A8 to dri layer. Signed-off-by: Zhigang Gong --- include/GL/internal/dri_interface.h |1 + src/gbm/backends/dri/gbm_dri.c|6 ++ src/gbm/main/gbm.h|2 ++ src/mesa/drivers/dri/intel

[Mesa-dev] [PATCH 1/3] gbm: Added new funtions to match dri format and usage.

2011-12-17 Thread Zhigang Gong
are valid and if not, we return NULL directly. And if we fail to create image, we need to free the allocated buffer. Signed-off-by: Zhigang Gong --- src/gbm/backends/dri/gbm_dri.c | 64 +--- src/gbm/main/gbm.h |4 ++ 2 files changed, 44

[Mesa-dev] [PATCH 0/3] gbm extension patch set - v2

2011-12-17 Thread Zhigang Gong
According to Ian's comments, split the original patchset to three. The last one is to add new API to create a gbm bo from external name. Now I'm convinced that in one process , it's better to use one bufmgr. Just for API completeness, I still submit it here. ___

Re: [Mesa-dev] [PATCH 1/2] gbm: Introduce a new API gbm_bo_create_from_name.

2011-12-15 Thread zhigang gong
On Thu, Dec 15, 2011 at 11:57 PM, Eric Anholt wrote: > On Thu, 15 Dec 2011 17:58:45 +0800, zhigang.g...@linux.intel.com wrote: >> From: Zhigang Gong >> >> Glamor need a function to create a texture from a >> BO allocated by using libdrm directly in DDX layer.

[Mesa-dev] [PATCH 2/2] gbm/dri: Added more color formats.

2011-12-15 Thread zhigang . gong
From: Zhigang Gong Added two color formats RGB565 and A8 to gbm layer. Add A8 to dri layer. Signed-off-by: Zhigang Gong --- include/GL/internal/dri_interface.h |1 + src/gbm/backends/dri/gbm_dri.c|6 ++ src/gbm/main/gbm.h|2 ++ src

[Mesa-dev] [PATCH 1/2] gbm: Introduce a new API gbm_bo_create_from_name.

2011-12-15 Thread zhigang . gong
From: Zhigang Gong Glamor need a function to create a texture from a BO allocated by using libdrm directly in DDX layer. EGL image extension API eglCreateImageKHR does support this function, but that extension only support one colore format - ARGB32 which is not sufficent for us. I discussed

Re: [Mesa-dev] About MESA drm image extension

2011-12-06 Thread zhigang gong
2011/12/5 Kristian Høgsberg : > 2011/12/5 zhigang gong : >> Hi Kristian, >> >> I'm integrating glamor with intel's video driver now. The basic idea >> is to allocate a BO >>  by calling libdrm directly in intel uxa code path, then latter create >>

[Mesa-dev] About MESA drm image extension

2011-12-05 Thread zhigang gong
Hi Kristian, I'm integrating glamor with intel's video driver now. The basic idea is to allocate a BO by calling libdrm directly in intel uxa code path, then latter create an EGL image from that BO's handle. And then bind the image to a texture then glamor can use it as usual. Now the problem is

[Mesa-dev] Question about the texture's reference count processing in _mesa_update_texture

2011-11-25 Thread zhigang gong
Sorry, forgot to copy to the mail list. -- Forwarded message -- From: zhigang gong Date: Fri, Nov 25, 2011 at 5:18 PM Subject: Re: [Mesa-dev] Question about the texture's reference count processing in _mesa_update_texture To: Brian Paul Hi Brian, The test case is attache

[Mesa-dev] Question about the texture's reference count processing in _mesa_update_texture

2011-11-22 Thread zhigang gong
Hi guys, I have a question about the internal implementation of glDrawArrays or any rendering functions. In the code path, it calls to _mesa_update_texture(), and if there is really a complete texture, it will call _mesa_reference_texobj to set it to _Current, and increase the texture object's ref

Re: [Mesa-dev] [PATCH] mesa: silence some compilation warnings.

2011-05-12 Thread zhigang gong
Thanks for your suggestion. Jose already revised my patch to use uintptr_t instead of long. On Fri, May 13, 2011 at 1:48 AM, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 05/12/2011 01:49 AM, zhigang gong wrote: >> glu.h: typedef void (GLAPI

[Mesa-dev] [PATCH] mesa: silence some compilation warnings.

2011-05-12 Thread zhigang gong
glu.h: typedef void (GLAPIENTRYP _GLUfuncptr)(); causes the following warning: function declaration isn't a prototype. egl: When convert a (void *) to a int type, it's better to convert to long firstly, otherwise in 64 bit envirnonment, it causes compilation warning. --- inc

[Mesa-dev] [PATCH] EGL: Add hardware cursor image format for EGL image extension.

2011-05-10 Thread zhigang gong
Current EGL only support one drm buffer format which is EGL_DRM_BUFFER_FORMAT_ARGB32_MESA. This format works fine with normal image, but if we want to create a drm buffer which will be used for a hardware cursor, then it has problem. The default behaviou for this format is