Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-29 Thread Keith Whitwell
On Wed, 2009-10-28 at 05:21 -0700, José Fonseca wrote:
 On Tue, 2009-10-27 at 14:45 -0700, Younes Manton wrote:
  I'd just like to add that if other interfaces will exist in the future
  (I recall pipe_2d_context being floated at one time) and state
  trackers want to use them without initializing a pipe_context
  needlessly and want to reuse the rest of the DRM winsys then the
  relevent parts of this patch (or comparable changes) will need to be
  considered sooner or later regardless of whether or not
  pipe_video_context exists.
 
 Indeed.
 
 And it is not only the problem of the pipe_*_context creation. There is
 the problem of the state tracker still reaching out parts of the winsys.
 
 I really think that a simple driver with a generic interface query as I
 proposed in 
 
 http://www.mail-archive.com/mesa3d-dev@lists.sourceforge.net/msg07818.html
 
 is the best, and we sorely need it, with the recent and welcomed
 increase of pipe drivers and state trackers.
 
 I'll try to prototype this on a few state trackers and see how it goes.
 
 Jose



It's an interesting topic how to broaden the set of interfaces that we
manage in Gallium, and there's a real opportunity to create a nice
solution.

My personal interest would be to see Gallium grow an ability to build a
complete driver (possibly at runtime) out of a set of registered
components, each of which implements one or more named interfaces, and
in turn depends on a set of named interfaces.

Once you do that, we end up with a lot of flexibility about how to
incorporate new interfaces over time, and add the ability to keep older
versions alive, provide compatibility shims, and so forth.  It also
provides a universal mechanism for injecting tracing shims, etc.


Keith


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-28 Thread José Fonseca
On Tue, 2009-10-27 at 14:45 -0700, Younes Manton wrote:
 I'd just like to add that if other interfaces will exist in the future
 (I recall pipe_2d_context being floated at one time) and state
 trackers want to use them without initializing a pipe_context
 needlessly and want to reuse the rest of the DRM winsys then the
 relevent parts of this patch (or comparable changes) will need to be
 considered sooner or later regardless of whether or not
 pipe_video_context exists.

Indeed.

And it is not only the problem of the pipe_*_context creation. There is
the problem of the state tracker still reaching out parts of the winsys.

I really think that a simple driver with a generic interface query as I
proposed in 

http://www.mail-archive.com/mesa3d-dev@lists.sourceforge.net/msg07818.html

is the best, and we sorely need it, with the recent and welcomed
increase of pipe drivers and state trackers.

I'll try to prototype this on a few state trackers and see how it goes.

Jose


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-27 Thread Zack Rusin
On Saturday 24 October 2009 19:02:51 Younes Manton wrote:
 Hi Thomas,
 
 I'd like to make these changes to make it possible to use the DRM
 state tracker interface with contexts other than pipe_context. Nouveau
 is the only public driver that does DRI1 from what I can see, but I've
 been told that there are some closed drivers that also depend on these
 interfaces and that you look after them.
 
 Added drm_api::create_video_context() to get a pipe_video_context, you
 can ignore it. Changes to the st_* lock functions are trivial and
 obvious, Nouveau doesn't use them but presumably anyone who does can
 return pipe_context-priv just as easily. Changes to
 dri1_api::front_srf_locked() are too, hopefully your front buffer can
 be accessed via pipe_screen as well. I didn't change
 dri1_api::present_locked() because we don't do page flipping yet, but
 I think that could be done with just a screen as well in Nouveau.
 Thoughts?

Younes,

sorry for the slow response, we've been a bit busy lately. 
I can't say that I'm a huge fan of this patch. I've been thinking about it 
lately and essentially I'd like to reiterate what I said initially about the 
pipe_video_context. While I think it's a great idea, I'm not too excited about 
the way it looks right now. It boils down to three problems for me:

1) The interface itself. In particular:

void (*clear_surface)(struct pipe_video_context *vpipe,
 unsigned x, unsigned y,
 unsigned width, unsigned height,
 unsigned value,
 struct pipe_surface *surface);
is problematic for two reasons: a) because it's something that looks more like 
a pipe_context method in itself, b) because it's a combination of a 
surface_fill and clear interface which we moved away from in master

void (*render_picture)(struct pipe_video_context *vpipe,
  /*struct pipe_surface *backround,
  struct pipe_video_rect*backround_area,*/
  struct pipe_video_surface *src_surface,
  enum pipe_mpeg12_picture_type picture_type,
  /*unsignednum_past_surfaces,
  struct pipe_video_surface *past_surfaces,
  unsigned  num_future_surfaces,
  struct pipe_video_surface *future_surfaces,*/
  struct pipe_video_rect*src_area,
  struct pipe_surface   *dst_surface,
  struct pipe_video_rect*dst_area,
  /*unsigned  num_layers,
  struct pipe_texture   *layers,
  struct pipe_video_rect*layer_src_areas,
  struct pipe_video_rect*layer_dst_areas,*/
  struct pipe_fence_handle  **fence);

has simply way too many arguments, not to mention that over a half is 
commented out. It's really a common problem for the entire interface, methods 
are very complex. Gallium deals with it with settable state. Which  brings us 
to another problem with the interface:

struct pipe_video_context
{
   struct pipe_screen *screen;
   enum pipe_video_profile profile;
   enum pipe_video_chroma_format chroma_format;
   unsigned width;
   unsigned height; 
... methods follow...

which means that the interface is both an interface and a state. 
All of it is very un-gallium like.

2) We really need a real world video api implemented with the interface before 
making it public. So it should be proven that openmax or vdpau can actually be 
implemented using the interface before making it public.

3) There's no hardware implementation for the interface and as far as i can 
see there's no plans for one. It's really what the interfaces are for, until 
we have people actually working on a hardware implementation there's no reason 
for this to be a Gallium interface at all.

That's why i think the whole code should be an auxiliary module in which case 
patches like this one wouldn't be even necessary.

When it comes to interfaces it's a lot harder to remove/significantly change an 
interface than to add a new one, so we should be extremely careful when adding 
interfaces and at least try to make sure that for all #1, #2 and #3 are 
fixable.

Also it's worth noting that Keith is the maintainer for Gallium interfaces, so 
pipe_video_context and, in general, all changes to Gallium should always go 
through him.

z

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 

Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-27 Thread José Fonseca
On Tue, 2009-10-27 at 12:11 -0700, Zack Rusin wrote:
 On Saturday 24 October 2009 19:02:51 Younes Manton wrote:
  Hi Thomas,
  
  I'd like to make these changes to make it possible to use the DRM
  state tracker interface with contexts other than pipe_context. Nouveau
  is the only public driver that does DRI1 from what I can see, but I've
  been told that there are some closed drivers that also depend on these
  interfaces and that you look after them.
  
  Added drm_api::create_video_context() to get a pipe_video_context, you
  can ignore it. Changes to the st_* lock functions are trivial and
  obvious, Nouveau doesn't use them but presumably anyone who does can
  return pipe_context-priv just as easily. Changes to
  dri1_api::front_srf_locked() are too, hopefully your front buffer can
  be accessed via pipe_screen as well. I didn't change
  dri1_api::present_locked() because we don't do page flipping yet, but
  I think that could be done with just a screen as well in Nouveau.
  Thoughts?
 
 Younes,
 
 sorry for the slow response, we've been a bit busy lately. 
 I can't say that I'm a huge fan of this patch. I've been thinking about it 
 lately and essentially I'd like to reiterate what I said initially about the 
 pipe_video_context. While I think it's a great idea, I'm not too excited 
 about 
 the way it looks right now. It boils down to three problems for me:
 
 1) The interface itself. In particular:
 
 void (*clear_surface)(struct pipe_video_context *vpipe,
  unsigned x, unsigned y,
  unsigned width, unsigned height,
  unsigned value,
  struct pipe_surface *surface);
 is problematic for two reasons: a) because it's something that looks more 
 like 
 a pipe_context method in itself, b) because it's a combination of a 
 surface_fill and clear interface which we moved away from in master
 
 void (*render_picture)(struct pipe_video_context *vpipe,
   /*struct pipe_surface *backround,
   struct pipe_video_rect*backround_area,*/
   struct pipe_video_surface *src_surface,
   enum pipe_mpeg12_picture_type picture_type,
   /*unsignednum_past_surfaces,
   struct pipe_video_surface *past_surfaces,
   unsigned  num_future_surfaces,
   struct pipe_video_surface *future_surfaces,*/
   struct pipe_video_rect*src_area,
   struct pipe_surface   *dst_surface,
   struct pipe_video_rect*dst_area,
   /*unsigned  num_layers,
   struct pipe_texture   *layers,
   struct pipe_video_rect*layer_src_areas,
   struct pipe_video_rect*layer_dst_areas,*/
   struct pipe_fence_handle  **fence);
 
 has simply way too many arguments, not to mention that over a half is 
 commented out. It's really a common problem for the entire interface, methods 
 are very complex. Gallium deals with it with settable state. Which  brings us 
 to another problem with the interface:
 
 struct pipe_video_context
 {
struct pipe_screen *screen;
enum pipe_video_profile profile;
enum pipe_video_chroma_format chroma_format;
unsigned width;
unsigned height; 
 ... methods follow...
 
 which means that the interface is both an interface and a state. 
 All of it is very un-gallium like.
 
 2) We really need a real world video api implemented with the interface 
 before 
 making it public. So it should be proven that openmax or vdpau can actually 
 be 
 implemented using the interface before making it public.
 
 3) There's no hardware implementation for the interface and as far as i can 
 see there's no plans for one. It's really what the interfaces are for, until 
 we have people actually working on a hardware implementation there's no 
 reason 
 for this to be a Gallium interface at all.
 
 That's why i think the whole code should be an auxiliary module in which case 
 patches like this one wouldn't be even necessary.
 
 When it comes to interfaces it's a lot harder to remove/significantly change 
 an 
 interface than to add a new one, so we should be extremely careful when 
 adding 
 interfaces and at least try to make sure that for all #1, #2 and #3 are 
 fixable.

Yes. Younes, I really think it is better to crystallize this in a
separate branch until it reaches a point where the interfaces are
crystallized. The master branch is not always perfect, but it should
always near a state were a release can be made, and it seems that the
video interfaces need to mature a little more before that.

Jose



Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-27 Thread Younes Manton
On Tue, Oct 27, 2009 at 3:11 PM, Zack Rusin za...@vmware.com wrote:
 Younes,

 sorry for the slow response, we've been a bit busy lately.
 I can't say that I'm a huge fan of this patch. I've been thinking about it
 lately and essentially I'd like to reiterate what I said initially about the
 pipe_video_context. While I think it's a great idea, I'm not too excited about
 the way it looks right now. It boils down to three problems for me:

 1) The interface itself. In particular:

 void (*clear_surface)(struct pipe_video_context *vpipe,
 unsigned x, unsigned y,
 unsigned width, unsigned height,
 unsigned value,
 struct pipe_surface *surface);
 is problematic for two reasons: a) because it's something that looks more like
 a pipe_context method in itself, b) because it's a combination of a
 surface_fill and clear interface which we moved away from in master

Thanks for the comments. I've changed this slightly in my tree to be
::surface_fill() and ::surface_copy() just as in pipe_context. The way
I see it in a video API implementation the client won't have a
pipe_context, so pipe_video_context has to provide these methods so
you can 1) initialize video surfaces (to black, in cases where the
video doesn't actually fill the entire frame) and 2) to copy the
surfaces to the front buffer. Unlike pipe_context these must be
provided because I don't expect surfaces that can't be rendered to to
exist in this context, the only surfaces that should exist are color
buffers. If someone wants/needs to implement these with their
pipe_context then they can, but if their video HW can handle it then
there's no need to initialize a pipe_context at all.

 void (*render_picture)(struct pipe_video_context *vpipe,
  /*struct pipe_surface *backround,
  struct pipe_video_rect*backround_area,*/
  struct pipe_video_surface *src_surface,
  enum pipe_mpeg12_picture_type picture_type,
  /*unsignednum_past_surfaces,
  struct pipe_video_surface *past_surfaces,
  unsigned  num_future_surfaces,
  struct pipe_video_surface *future_surfaces,*/
  struct pipe_video_rect*src_area,
  struct pipe_surface   *dst_surface,
  struct pipe_video_rect*dst_area,
  /*unsigned  num_layers,
  struct pipe_texture   *layers,
  struct pipe_video_rect*layer_src_areas,
  struct pipe_video_rect*layer_dst_areas,*/
  struct pipe_fence_handle  **fence);

 has simply way too many arguments, not to mention that over a half is
 commented out. It's really a common problem for the entire interface, methods
 are very complex.

Well, because they're commented out we haven't really committed to
anything yet, I just had it in there as a reminder of what needs to be
supported for VDPAU (if you remove the comments this function maps
one-to-one with the VDPAU function that does the same thing). I can
implement it as settable states when the time comes if that's what
people prefer.

Gallium deals with it with settable state. Which  brings us
 to another problem with the interface:

 struct pipe_video_context
 {
   struct pipe_screen *screen;
   enum pipe_video_profile profile;
   enum pipe_video_chroma_format chroma_format;
   unsigned width;
   unsigned height;
... methods follow...

 which means that the interface is both an interface and a state.
 All of it is very un-gallium like.

However this isn't mutable state, they're effectively constants; once
you create a pipe_video_context with a set of parameters you get a
context that can only handle what you specified and everything else
fails, so they're there so it can easily be determined what this video
context handles. They could be behind getter functions if that's what
people prefer, but I'm the only one who uses this stuff so I apologize
if my personal habits sometimes sneak in...

 2) We really need a real world video api implemented with the interface before
 making it public. So it should be proven that openmax or vdpau can actually be
 implemented using the interface before making it public.

Fair enough.

 3) There's no hardware implementation for the interface and as far as i can
 see there's no plans for one. It's really what the interfaces are for, until
 we have people actually working on a hardware implementation there's no reason
 for this to be a Gallium interface at all.

 That's why i think the whole code should be an auxiliary module in which case
 patches like this one wouldn't be even 

Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-27 Thread Younes Manton
On Tue, Oct 27, 2009 at 3:33 PM, José Fonseca jfons...@vmware.com wrote:
 Yes. Younes, I really think it is better to crystallize this in a
 separate branch until it reaches a point where the interfaces are
 crystallized. The master branch is not always perfect, but it should
 always near a state were a release can be made, and it seems that the
 video interfaces need to mature a little more before that.

 Jose

That's probably the best solution for everybody. I'll copy a video
branch off master, remove the video stuff from master, and continue on
in the video branch. Thanks.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [PATCH] Make DRI/DRM state tracker interface less context-dependent

2009-10-27 Thread Younes Manton
I'd just like to add that if other interfaces will exist in the future
(I recall pipe_2d_context being floated at one time) and state
trackers want to use them without initializing a pipe_context
needlessly and want to reuse the rest of the DRM winsys then the
relevent parts of this patch (or comparable changes) will need to be
considered sooner or later regardless of whether or not
pipe_video_context exists.

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev