[Mesa-dev] [PATCH 05/16] glx/dri2: rework __DRIextension handling

2014-03-16 Thread Emil Velikov
Use a const arrays with the extensions, and use the correct one at runtime. This removes the assumption that the dri2_screen has a fixed size dri extension list and avoids the individual assignment of each extension at runtime. While we're here make sure that the DRI*Extensions report the version

[Mesa-dev] [PATCH 00/16] DRI*extension cleanups v3

2014-03-16 Thread Emil Velikov
Hi all, Here is the third iteration of some DRI*extension cleanup patches. This revision adds some minor updates and squashes the patches into a shorter patchset. The previous revision can be found at http://lists.freedesktop.org/archives/mesa-dev/2014-February/054327.html For people interested

[Mesa-dev] [PATCH 04/16] st/dri: cleanup dri extension handling

2014-03-16 Thread Emil Velikov
Explicitly set the version that is implemented, as that may differ from the one defined in dri_interface.h. Use designated initialisers and constify whereever possible. Note: __DRIimageExtension should not be made const as it's modified at runtime. This patch should have no side effects on compile

[Mesa-dev] [PATCH 02/16] drivers/dri: cleanup dri extension instantiation

2014-03-16 Thread Emil Velikov
Uniformly use the typecasted extension name, constify extension instances and use designated initialisers. Set the implemented version of the extension, over the one defined in dri_infertace.h. Patch covers the following extensions: __DRItexBufferExtension __DRIimageExtension __DRIrobustnessExtens

[Mesa-dev] [PATCH 08/16] dri_util: cleanup dri extension handling

2014-03-16 Thread Emil Velikov
Explicitly set the version that is implemented, as that may differ from the one defined in dri_interface.h. The remaining __DRI*Extensions are treated as constants, so got ahead and declare them as such. Signed-off-by: Emil Velikov --- src/mesa/drivers/dri/common/dri_util.c | 2 +- src/mesa/driv

[Mesa-dev] [PATCH 10/16] egl_dri: rework dri extension handling

2014-03-16 Thread Emil Velikov
Use designated initialisers, and store the extensions pointers as const. The loader extensions __DRIdri2LoaderExtension and __DRIswrastLoaderExtension are setup by the platform backends so they should not be constified. Signed-off-by: Emil Velikov --- src/egl/drivers/dri2/egl_dri2.c | 7 --

[Mesa-dev] [PATCH 01/16] dri_interface: Update __DRItexBufferExtensionRec to version 3

2014-03-16 Thread Emil Velikov
With commit e59fa4c46c8("dri2: release texture image.") we updated the extension without bumping the version number. The patch itself added an interface required to enable texture_from_pixmap on certain platforms. The new code was effectively never build, as it depended on __DRI_TEX_BUFFER_VERSION

[Mesa-dev] [PATCH 07/16] glx/tests: explicitly set __DRI2rendererQueryExtension members

2014-03-16 Thread Emil Velikov
While we're here use the typcast'ed name and constify. Signed-off-by: Emil Velikov --- src/glx/tests/query_renderer_implementation_unittest.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/glx/tests/query_renderer_implementation_unittest.cpp b/src/glx/tests/qu

[Mesa-dev] [PATCH 11/16] glx/apple: explicitly assign struct components for glx_*_vtable

2014-03-16 Thread Emil Velikov
... to improve readability of code. Set applegl_screen_vtable as a static const. Signed-off-by: Emil Velikov --- src/glx/applegl_glx.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index a67416e..4e2d

[Mesa-dev] [PATCH 09/16] gbm: cleanup __DRI*extension handling

2014-03-16 Thread Emil Velikov
Use designated initialisers, store all extension pointers as const and use a const __DRIextensions array over assigning each element individually. Signed-off-by: Emil Velikov --- src/gbm/backends/dri/gbm_dri.c| 20 src/gbm/backends/dri/gbm_driint.h | 12 ++-- 2 f

[Mesa-dev] [PATCH 16/16] glx/drisw: explicitly assign struct components for glx_*_vtable

2014-03-16 Thread Emil Velikov
... to improve readability of code. Signed-off-by: Emil Velikov --- src/glx/drisw_glx.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index a77be4e..751626b 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/d

[Mesa-dev] [PATCH 03/16] dri/radeon: use a const __DRIextension array

2014-03-16 Thread Emil Velikov
Rather than keeping a separate and unused copy of the screen extensions within the radeon screen, use a constant array that can be used directly with __DRIscreen. Signed-off-by: Emil Velikov --- src/mesa/drivers/dri/radeon/radeon_screen.c | 29 ++--- src/mesa/drivers/dri/

[Mesa-dev] [PATCH 12/16] glx/indirect: explicitly assign struct components for glx_*_vtable

2014-03-16 Thread Emil Velikov
... to improve readability of code. Set indirect_screen_vtable as a static const. Signed-off-by: Emil Velikov --- src/glx/indirect_glx.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index 28b8cd0

[Mesa-dev] [PATCH 13/16] glx/dri: explicitly assign struct components for glx_*_vtable

2014-03-16 Thread Emil Velikov
... to improve readability of code. Signed-off-by: Emil Velikov --- src/glx/dri_glx.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 3b7502d..04a0847 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx

[Mesa-dev] [PATCH 06/16] glx/dri3: rework __DRIextension handling

2014-03-16 Thread Emil Velikov
Use a const array with the extensions, rather than assigning each one to a fixed size array at runtime. Signed-off-by: Emil Velikov --- src/glx/dri3_glx.c | 17 - src/glx/dri3_priv.h | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/glx/dri3_glx.c b/sr

[Mesa-dev] [PATCH 14/16] glx/dri2: explicitly assign struct components for glx_*_vtable

2014-03-16 Thread Emil Velikov
... to improve readability of code. Signed-off-by: Emil Velikov --- src/glx/dri2_glx.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 84ae875..298e771 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri

[Mesa-dev] [PATCH 15/16] glx/dri3: explicitly assign struct components for glx_*_vtable

2014-03-16 Thread Emil Velikov
... to improve readability of code. Signed-off-by: Emil Velikov --- src/glx/dri3_glx.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 2a178d5..4cde9ef 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_

[Mesa-dev] glxInitialize cleanups

2014-03-16 Thread Emil Velikov
Hello list, A couple of patches - first one cleans the glXInitialize error path as currently we can call unlock_mutex on an already unlocked mutex. The second patch cleans up glXInitialize handling by always checking its return value, and drops a few cases where it's not needed. IMHO the checks

[Mesa-dev] [PATCH 1/2] glx: drop obsolete _XUnlock_Mutex in __glXInitialize error path

2014-03-16 Thread Emil Velikov
With commit 1f1928db001(glx: Drop _Xglobal_lock while we create and initialize glx display) we've split the big _Xglobal_lock handling in a more fine grained manner. Unfortunatelly we forgot to drop the unlock_mutex on the error paths, leading to undefined behaviour as the mutex is already unlocke

[Mesa-dev] [PATCH 2/2] glx: clean-up __glXInitialize handling

2014-03-16 Thread Emil Velikov
Consistently check for the function return status to prevent null ptr deref, and stop calling it without a purpose. Signed-off-by: Emil Velikov --- src/glx/dri2_glx.c | 21 +++-- src/glx/dri3_glx.c | 8 src/glx/drisw_glx.c | 5 + 3 files changed, 20 insertions(+)

[Mesa-dev] [PATCH 1/3] gallium/u_blitter: don't adjust cubemap coordinates by a small number

2014-03-16 Thread Marek Olšák
From: Marek Olšák It may cause issues with mipmap generation. I think it was used to make some piglit tests pass on r300g. --- src/gallium/auxiliary/util/u_blitter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliar

[Mesa-dev] [PATCH 3/3] gallium/u_gen_mipmap: rewrite using pipe->blit

2014-03-16 Thread Marek Olšák
From: Marek Olšák This replaces u_gen_mipmap with an extremely simple implementation based on pipe->blit. The diff speaks for itself. st/mesa is also cleaned up. Pros: - less code - correct mipmap generation for NPOT 3D textures (u_blitter uses a better formula) - queries are not affected by m

[Mesa-dev] [PATCH 2/3] gallium/u_blitter: implement scaled blitting in the Z direction

2014-03-16 Thread Marek Olšák
From: Marek Olšák So that pipe->blit can be used for 3D mipmap generation. --- src/gallium/auxiliary/util/u_blitter.c | 40 ++ 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_bli

[Mesa-dev] [PATCH] winsys/radeon: only add duplicate relocations for DMA if VM isn't supported

2014-03-16 Thread Marek Olšák
From: Marek Olšák Also rewrite the comment for it to be readable and reorder the code. --- src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/wins

Re: [Mesa-dev] [PATCH] winsys/radeon: only add duplicate relocations for DMA if VM isn't supported

2014-03-16 Thread Alex Deucher
On Sun, Mar 16, 2014 at 12:46 PM, Marek Olšák wrote: > From: Marek Olšák > > Also rewrite the comment for it to be readable and reorder the code. Reviewed-by: Alex Deucher > --- > src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 23 +-- > 1 file changed, 13 insertions(+), 1

[Mesa-dev] [PATCH 2/3] gallium, st/mesa: implement InvalidateBufferSubData

2014-03-16 Thread Marek Olšák
From: Marek Olšák --- src/gallium/include/pipe/p_context.h | 14 ++ src/mesa/state_tracker/st_cb_bufferobjects.c | 21 + 2 files changed, 35 insertions(+) diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index fe30

[Mesa-dev] [PATCH 1/3] mesa: add driver interface for glInvalidateBuffer(Sub)Data

2014-03-16 Thread Marek Olšák
From: Marek Olšák --- src/mesa/main/bufferobj.c | 14 ++ src/mesa/main/dd.h| 8 +++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 2e9e059..e7b6382 100644 --- a/src/mesa/main/bufferobj.c +++ b/

[Mesa-dev] [PATCH 3/3] r600g, radeonsi: implement resource_invalidate hook

2014-03-16 Thread Marek Olšák
From: Marek Olšák The invalidation is already implemented by the driver. --- src/gallium/drivers/radeon/r600_pipe_common.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 5f6e0

Re: [Mesa-dev] [PATCH 1/3] mesa: add driver interface for glInvalidateBuffer(Sub)Data

2014-03-16 Thread Marek Olšák
Please disregard this series. The extension is not about reallocating a buffer as I thought, it's actually about freeing a buffer and allocating it later when it's used again. Marek On Sun, Mar 16, 2014 at 6:00 PM, Marek Olšák wrote: > From: Marek Olšák > > --- > src/mesa/main/bufferobj.c | 14

Re: [Mesa-dev] [PATCH 03/40] mesa: Eliminate parameters to dd_function_table::Viewport

2014-03-16 Thread Alexander von Gluck IV
On 01/10/2014 07:40 PM, Ian Romanick wrote: > From: Ian Romanick > > No driver uses them. They will just be annoying in future patches. > > Signed-off-by: Ian Romanick > --- > src/mesa/drivers/dri/i915/intel_context.c | 15 ++- > src/mesa/drivers/dri/i965/brw_context.c| 7 +-

[Mesa-dev] GSoC: OpenCL Image

2014-03-16 Thread Marek Skalický
Hi, My name is Marek Skalický. I am 20 years old and I study Applied informatics at Masaryk university in Brno. And I am interested in GSoC project about implementing OpenCL Image Support into r600g/radeonsi. I would like to ask what to do except of writing proposal. Should I close some example bu

[Mesa-dev] [PATCH] egl: Fix eglMakeCurrent behaviour when used with EGL_NO_SURFACE and EGL_NO_CONTEXT.

2014-03-16 Thread Beren Minor
EGL 1.4 Specification says that eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) can be used to release the current thread's ownership on the surfaces and context. MESA's egl implementation was only accepting the parameters when the KHR_surfaceless_context extension is sup

[Mesa-dev] [PATCH 1/3] r600g/dma: don't flush the gfx IB explicitly before doing DMA

2014-03-16 Thread Marek Olšák
From: Marek Olšák It's flushed by calling r600_context_bo_reloc. --- src/gallium/drivers/r600/evergreen_hw_context.c | 2 -- src/gallium/drivers/r600/evergreen_state.c | 3 --- src/gallium/drivers/r600/r600_hw_context.c | 3 --- src/gallium/drivers/r600/r600_state.c | 3 ---

[Mesa-dev] [PATCH 3/3] r600g: use more appropriate names for async DMA functions

2014-03-16 Thread Marek Olšák
From: Marek Olšák *_dma_copy calls either *_dma_copy_buffer or *_dma_copy_tile. --- src/gallium/drivers/r600/evergreen_hw_context.c | 12 ++-- src/gallium/drivers/r600/evergreen_state.c | 8 src/gallium/drivers/r600/r600_hw_context.c | 12 ++-- src/gallium/dri

[Mesa-dev] [PATCH 2/3] r600g: deobfuscate async DMA code

2014-03-16 Thread Marek Olšák
From: Marek Olšák --- src/gallium/drivers/r600/evergreen_hw_context.c | 10 +- src/gallium/drivers/r600/evergreen_state.c | 20 ++-- src/gallium/drivers/r600/evergreend.h | 4 src/gallium/drivers/r600/r600_hw_context.c | 13 ++--- src/gal

Re: [Mesa-dev] [PATCH 1/3] r600g/dma: don't flush the gfx IB explicitly before doing DMA

2014-03-16 Thread Michel Dänzer
The series is Reviewed-by: Michel Dänzer -- Earthling Michel Dänzer| http://www.amd.com Libre software enthusiast |Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org h

Re: [Mesa-dev] [PATCH 2/2] radeonsi: Implement DMA blit

2014-03-16 Thread Marek Olšák
Thanks for doing this! I have some comments... 1) As of SI, the maximum supported size for dword-aligned L2L, L2T, and T2L copies is 0x8. The maximum supported size for byte-aligned L2L copies is 0xfffe0. I'd like to have proper definitions for this, e.g. SI_DMA_COPY_MAX_SIZE and SI_DMA_COPY_M

Re: [Mesa-dev] [PATCH] egl: Fix eglMakeCurrent behaviour when used with EGL_NO_SURFACE and EGL_NO_CONTEXT.

2014-03-16 Thread Chia-I Wu
On Sun, Mar 16, 2014 at 5:20 AM, Beren Minor wrote: > EGL 1.4 Specification says that > eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT) can > be used to release the > current thread's ownership on the surfaces and context. > > MESA's egl implementation was only accepting t

[Mesa-dev] [PATCH] st/vdpau: Fix segmentation fault

2014-03-16 Thread Kusanagi Kouichi
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75699 Signed-off-by: Kusanagi Kouichi --- src/gallium/state_trackers/vdpau/surface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c