Re: [Mesa-dev] [PATCH] Unified st_context::draw_vbo

2010-07-18 Thread Keith Whitwell
On Fri, 2010-07-16 at 11:10 -0700, Chia-I Wu wrote:
> Hi all,
> 
> This patch series replaces
> 
>   st_context::draw_arrays
>   st_context::draw_elements,
>   st_context::draw_arrays_instanced
>   st_context::draw_elements_instanced
>   st_context::draw_range_elements
> 
> by a single
> 
>   st_context::draw_vbo(struct pipe_context *pipe,
>const struct pipe_draw_info *info);
> 
> The series is too big in size and I have to push it to
> 
>   http://cgit.freedesktop.org/~olv/mesa/log/?h=gallium-unified-draw
> 
> Since the drivers no longer need to implement all the drawing
> variants, the diffstat says
> 
>  29 files changed, 359 insertions(+), 1061 deletions(-)
> 
> Its main user (st_draw_vbo) is also simplified.
> 
> There are 4 commits in the branch.  The first commit adds the new
> function prototype to the header file.  The second commit implements
> draw_vbo for all pipe drivers.  The third commit converts all state
> trackers (st/mesa, st/vega, and util_draw_vertex_buffer) to use
> draw_vbo.  The last commit removes all other variants from the
> interface.
> 
> This looks like a nice cleanup to have to me.  Suggestion?


If we're reorganising these interfaces, there are a couple of things I'd
like to see done differently.  In particular, within your draw_info
struct there are a couple of entities which are often better handled as
persistent state - namely the primitive mode and index buffer binding.

Right now we've got a single call which sets as much state as
glMultiDrawElementsIndexed, but which can only draw a single primitive.

The ways out of this situation are to either move state out of
per-primitive transaction, or to modify the interface to accept >1
primitive at a time.

My preference would be to move primitive mode & index buffer (and other
stuff too?) out of your info struct and turn them into new dynamic state
calls.  

Having done that, it may still be worth considering passing >1 of your
info structs to the new unified entrypoints...

Keith


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] The state tracker for EGL does not implement eglCreatePbufferFromClientBuffer

2010-07-18 Thread Thinker K.F. Li
Hi,

I had found that the state tracker of EGL does not implement
eglCreatePbufferFromClientBuffer().  Without this function, user
should copy pixels between pbuffers with a temporary buffer allocated
by the application.  Are there any plan to implement it?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] st/dri: minor cleanups after dri1 removal

2010-07-18 Thread George Sapountzis
Hi,

I put 3 patches at
http://cgit.freedesktop.org/~gsap7/mesa/log/?h=st-dri with minor
cleanups after dri1 removal. Please review and test.

regards,
George
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] Fix kFreeBSD build

2010-07-18 Thread nobled
All the other OS tests for FreeBSD use the form '*freebsd*',
except for this line. This fixes the build on kFreeBSD/GNU.

Based on the patch 06_kfreebsd-ftbfs.diff by Aurelien Jarno:
http://bugs.debian.org/524690

NOTE: This is a candidate for the 7.8 branch.
---
 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9619597..d6d37d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -800,7 +800,7 @@ if test "$mesa_driver" = dri; then
 ;;
 esac
 ;;
-freebsd* | dragonfly*)
+*freebsd* | dragonfly*)
 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
-- 
1.5.4.3
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] Fix kFreeBSD build

2010-07-18 Thread Corbin Simpson
I didn't ack the earlier version of the patch because it had no testers. Has
this been tested?

Posting from a mobile, pardon my terseness. ~ C.

On Jul 18, 2010 8:48 AM, "nobled"  wrote:

All the other OS tests for FreeBSD use the form '*freebsd*',
except for this line. This fixes the build on kFreeBSD/GNU.

Based on the patch 06_kfreebsd-ftbfs.diff by Aurelien Jarno:
http://bugs.debian.org/524690

NOTE: This is a candidate for the 7.8 branch.
---
 configure.ac |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9619597..d6d37d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -800,7 +800,7 @@ if test "$mesa_driver" = dri; then
;;
esac
;;
-freebsd* | dragonfly*)
+*freebsd* | dragonfly*)
DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
--
1.5.4.3
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] Fix kFreeBSD build

2010-07-18 Thread nobled
1. this is a completely different patch from that one;
2. A version of this patch has been in Debian packaging since May 2009
(as seen in the bug link).

Corbin Simpson  wrote:
> I didn't ack the earlier version of the patch because it had no testers. Has
> this been tested?
>
> Posting from a mobile, pardon my terseness. ~ C.
>
> On Jul 18, 2010 8:48 AM, "nobled"  wrote:
>
> All the other OS tests for FreeBSD use the form '*freebsd*',
> except for this line. This fixes the build on kFreeBSD/GNU.
>
> Based on the patch 06_kfreebsd-ftbfs.diff by Aurelien Jarno:
> http://bugs.debian.org/524690
>
> NOTE: This is a candidate for the 7.8 branch.
> ---
>  configure.ac |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 9619597..d6d37d2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -800,7 +800,7 @@ if test "$mesa_driver" = dri; then
>             ;;
>         esac
>         ;;
> -    freebsd* | dragonfly*)
> +    *freebsd* | dragonfly*)
>         DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
>         DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
>         DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
> --
> 1.5.4.3
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] Fix kFreeBSD build

2010-07-18 Thread Julien Cristau
On Sun, Jul 18, 2010 at 08:59:23 -0700, Corbin Simpson wrote:

> I didn't ack the earlier version of the patch because it had no testers. Has
> this been tested?
> 
It's been used in debian's mesa packages since April 2009.
So Acked-by: Julien Cristau 

Cheers,
Julien
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Bug#585618: [PATCH 1/6] pipe: Detect FreeBSD better

2010-07-18 Thread Julien Cristau
On Thu, Jun 24, 2010 at 01:07:17 -0700, Corbin Simpson wrote:

> On Wed, Jun 23, 2010 at 6:31 PM, nobled  wrote:
> > Taking advice from the Debian BSD porting guide:
> > http://glibc-bsd.alioth.debian.org/porting/PORTING
> >
> > This should help fix Debian bug #585618 (gallium build failure).
> > ---
> >  src/gallium/include/pipe/p_config.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > diff --git a/src/gallium/include/pipe/p_config.h
> > b/src/gallium/include/pipe/p_config.h
> > index b81702a..68025fa 100644
> > --- a/src/gallium/include/pipe/p_config.h
> > +++ b/src/gallium/include/pipe/p_config.h
> > @@ -128,7 +128,7 @@
> >  #define PIPE_OS_UNIX
> >  #endif
> >
> > -#if defined(__FreeBSD__)
> > +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> >  #define PIPE_OS_FREEBSD
> >  #define PIPE_OS_BSD
> >  #define PIPE_OS_UNIX
> > --
> > 1.5.4.3
> 
> Looks reasonable; does this actually work for you? I'd like somebody
> to test first.
> 
I verified that this builds on a kfreebsd system on top of 7.8.2, and
looking at the differences between PIPE_OS_LINUX and PIPE_OS_{,FREE}BSD
in the code this seems reasonable, so
Reviewed-by: Julien Cristau 

Maybe also consider:

diff --git a/src/gallium/auxiliary/rtasm/rtasm_execmem.c 
b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
index 65d5ce7..bd84532 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_execmem.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_execmem.c
@@ -37,7 +37,7 @@
 
 #include "rtasm_execmem.h"
 
-#if defined(PIPE_OS_BSD)
+#ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 

(the kfreebsd glibc headers define MAP_ANONYMOUS to MAP_ANON already, so
this one shouldn't be strictly necessary)

Cheers,
Julien


signature.asc
Description: Digital signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] The state tracker for EGL does not implement eglCreatePbufferFromClientBuffer

2010-07-18 Thread Chia-I Wu
On Sun, Jul 18, 2010 at 9:04 PM, Thinker K.F. Li  wrote:
> I had found that the state tracker of EGL does not implement
> eglCreatePbufferFromClientBuffer().  Without this function, user
> should copy pixels between pbuffers with a temporary buffer allocated
> by the application.  Are there any plan to implement it?
Does the attached patch work for you?  I've had it for a while, but did not
commit it due to the lack of a demo to verify.

-- 
o...@lunarg.com
From 0f5fbcfaff37fc846d2b4867cfd438c9e11ceb34 Mon Sep 17 00:00:00 2001
From: Chia-I Wu 
Date: Fri, 12 Mar 2010 09:54:12 +0800
Subject: [PATCH 1/2] st/vega: Implement get_resource_for_egl_image hook.

---
 src/gallium/state_trackers/vega/vg_manager.c |   23 +++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/vega/vg_manager.c b/src/gallium/state_trackers/vega/vg_manager.c
index c2aa98b..f10ee80 100644
--- a/src/gallium/state_trackers/vega/vg_manager.c
+++ b/src/gallium/state_trackers/vega/vg_manager.c
@@ -332,6 +332,27 @@ vg_context_flush(struct st_context_iface *stctxi, unsigned flags,
   vg_manager_flush_frontbuffer(ctx);
 }
 
+static boolean
+vg_context_get_resource_for_egl_image(struct st_context_iface *stctxi,
+  struct st_context_resource *res)
+{
+   struct vg_image *img;
+
+   if (res->type != ST_CONTEXT_RESOURCE_OPENVG_PARENT_IMAGE ||
+   (VGImage) res->resource == VG_INVALID_HANDLE)
+  return FALSE;
+
+   img = (struct vg_image *) res->resource;
+   /* must be a parent image */
+   if (img->parent)
+  return FALSE;
+
+   res->texture = NULL;
+   pipe_resource_reference(&res->texture, img->sampler_view->texture);
+
+   return TRUE;
+}
+
 static void
 vg_context_destroy(struct st_context_iface *stctxi)
 {
@@ -365,6 +386,8 @@ vg_api_create_context(struct st_api *stapi, struct st_manager *smapi,
 
ctx->iface.teximage = NULL;
ctx->iface.copy = NULL;
+   ctx->iface.get_resource_for_egl_image =
+  vg_context_get_resource_for_egl_image;
 
ctx->iface.st_context_private = (void *) smapi;
 
-- 
1.7.1

From 0afb39d7ca1d78646625b44c6da4fb60bd1ad979 Mon Sep 17 00:00:00 2001
From: Chia-I Wu 
Date: Mon, 19 Jul 2010 02:58:37 +0800
Subject: [PATCH 2/2] st/egl: Add support for pbuffer from EGL_OPENVG_IMAGE.

get_resource_for_egl_image is used to get the pipe_resource of an
VGImage.  It is not perfect.  The callback intentionally rejects child
images, while eglCreatePbufferFromClientBuffer allows it.  There is also
no access control.
---
 src/gallium/state_trackers/egl/common/egl_g3d_st.c |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/egl/common/egl_g3d_st.c b/src/gallium/state_trackers/egl/common/egl_g3d_st.c
index 05cdb0d..9c1a7b3 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d_st.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d_st.c
@@ -34,6 +34,7 @@
 #include "egldriver.h"
 #include "eglimage.h"
 #include "eglmutex.h"
+#include "eglcurrent.h"
 
 #include "egl_g3d.h"
 #include "egl_g3d_st.h"
@@ -124,7 +125,21 @@ egl_g3d_st_framebuffer_flush_front_pbuffer(struct st_framebuffer_iface *stfbi,
 static void
 pbuffer_reference_openvg_image(struct egl_g3d_surface *gsurf)
 {
-   /* TODO */
+   _EGLContext *ctx = _eglGetAPIContext(EGL_OPENVG_API);
+   struct egl_g3d_context *gctx = egl_g3d_context(ctx);
+   struct st_context_resource stres;
+
+   memset(&stres, 0, sizeof(stres));
+   stres.type = ST_CONTEXT_RESOURCE_OPENVG_PARENT_IMAGE;
+   stres.resource = (void *) gsurf->client_buffer;
+
+   if (!gctx ||
+   !gctx->stctxi->get_resource_for_egl_image(gctx->stctxi, &stres)) {
+  _eglError(EGL_BAD_PARAMETER, "eglCreatePbufferFromClientBuffer");
+  return;
+   }
+
+   gsurf->render_texture = stres.texture;
 }
 
 static void
-- 
1.7.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev