Re: [Mesa-dev] [PATCH] nouveau: fix double free when screen_create fails

2015-12-28 Thread samuel.pitoiset



On 12/11/2015 21:21, Samuel Pitoiset wrote:



On 11/12/2015 08:51 PM, Samuel Pitoiset wrote:

Hi Emil,

On 11/10/2015 04:35 PM, Emil Velikov wrote:

Hi Samuel,

Sorry about this I thought I already replied :-\

On 29 October 2015 at 22:22, Samuel Pitoiset
<samuel.pitoi...@gmail.com> wrote:

On 10/27/2015 02:01 PM, samuel.pitoiset wrote:

On 27/10/2015 12:52, Emil Velikov wrote:


On 27 October 2015 at 10:50, samuel.pitoiset
<samuel.pitoi...@gmail.com>
wrote:


On 27/10/2015 11:37, Emil Velikov wrote:


On 22 October 2015 at 00:16, Julien Isorce
<julien.iso...@gmail.com>
wrote:


The real fix is in nouveau_drm_winsys.c by setting dev to 0.
Which means dev's ownership has been passed to previous call.
Other changes are there to be consistent with what the
screen_create functions already do on errors.

Encountered this crash because nvc0_screen_create sometimes fails
with:
nvc0_screen_create:717 - Error allocating PGRAPH context for
M2MF: -16
Also see: https://bugs.freedesktop.org/show_bug.cgi?id=70354

Signed-off-by: Julien Isorce <j.iso...@samsung.com>
---
src/gallium/drivers/nouveau/nv30/nv30_screen.c  | 5 -
src/gallium/drivers/nouveau/nv50/nv50_screen.c  | 4 +++-
src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 2 ++
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 0330164..9b8ddac 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -425,8 +425,10 @@ nv30_screen_create(struct nouveau_device
*dev)
   unsigned oclass = 0;
   int ret, i;

-   if (!screen)
+   if (!screen) {
+  nouveau_device_del();
  return NULL;
+   }


Imho having these in screen_create() seems like the wrong 'layer'.
Shouldn't one call nouveau_device_dev() from within
nouveau_drm_screen_unref
and explicitly call the latter if the calloc() (here and in
nv50/nvc0)
fails ?



We can't do that because nouveau_drm_screen_unref() needs a valid
nouveau_screen
object and in this case it is NULL.


Ouch I was under the impression that we've brought back the
concept of
winsys in nouveau with the hash_table patches. Seems like we haven't
:(

If we are to do so (split things just like the radeon/amdgpu winsys)
then we can kill two birds with one stone. The missing
device_del() on
calloc failure as well as other error paths in nvxx_screen_create().



Okay, I'll have a look at how radeon/amdgpu split those things.



Well, this doesn't seem to be "trivial" to do it properly actually.
This is on my todolist (but not with a top priority) so, if someone
else want to send a patch for this stuff, feel free to do it. :)


On the contrary - it's pretty trivial 99% of the work is either code
movement or sed job.
On the other hand, it's might not turn out to be stable material
(rather large diff). So if please a comment or two (something
resembling my suggestion) and get feel free to push it.

Roughly how many things do you have in your mesa todo list prior to
nouveau_winsys ?


Lot of things, mostly related to performance counters! ;)
Fixing a segfault when something else has failed doesn't sound like to
be a top priority for me. But... I agree this should be fixed, I'll have
a look this month.


I meant, this segfault only happens when nvXX_screen_create() fails,
it's pretty rare, and it's not a critical issue. :)


This issue has probably been fixed along with 
323d4da372298900ce02293a682ba563ac29f4cb (nouveau: fix screen creation 
failure paths).


If someone get a chance to test it, please report if it works.
Thanks.







Cheers,
Emil


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


Re: [Mesa-dev] [PATCH v2] nouveau: fix double free when screen_create fails

2015-10-27 Thread samuel.pitoiset



On 27/10/2015 11:08, Julien Isorce wrote:
Looks good though what happened to the del around if (!oclass)  in 
nv30_screen_create ?


Yeah, good catch. I think we could use FAIL_SCREEN_INIT() there.
I'll send a new patch with this fix.

Also it seems to fix the other problem around else if (dupfd) which 
was not closed on failure.


Yes, it fixes both issues.



On 27 October 2015 at 09:10, samuel.pitoiset 
<samuel.pitoi...@gmail.com <mailto:samuel.pitoi...@gmail.com>> wrote:


What about this one http://hastebin.com/uboruxicof.coffee ?

This patch is loosely based on your first attempt, except that I
removed the call
to nouveau_device_del() in nouveau_drm_screen_create().


On 27/10/2015 09:52, Julien Isorce wrote:

This patch prevents to call nouveau_device_del twice on the
same device.

Encountered this case when nvc0_screen_create fails with:
nvc0_screen_create:717 - Error allocating PGRAPH context for
M2MF: -16

https://bugs.freedesktop.org/show_bug.cgi?id=70354

Signed-off-by: Julien Isorce <j.iso...@samsung.com
<mailto:j.iso...@samsung.com>>
---
  src/gallium/drivers/nouveau/nouveau_screen.c   | 8 ++--
  src/gallium/drivers/nouveau/nv30/nv30_screen.c | 1 +
  src/gallium/drivers/nouveau/nv50/nv50_screen.c | 1 +
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 1 +
  4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c
b/src/gallium/drivers/nouveau/nouveau_screen.c
index b2290e7..2bd6d4f 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -177,13 +177,17 @@ nouveau_screen_init(struct
nouveau_screen *screen, struct nouveau_device *dev)
screen->device = dev;
ret = nouveau_client_new(screen->device, >client);
-   if (ret)
+   if (ret) {
+   screen->device = 0;
return ret;
+   }
ret = nouveau_pushbuf_new(screen->client, screen->channel,
  4, 512 * 1024, 1,
>pushbuf);
-   if (ret)
+   if (ret) {
+   screen->device = 0;
return ret;
+   }
/* getting CPU time first appears to be more
accurate */
  screen->cpu_gpu_time_delta = os_time_get();
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 0330164..54af655 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -411,6 +411,7 @@ nv30_screen_destroy(struct pipe_screen
*pscreen)
  #define FAIL_SCREEN_INIT(str, err)   \
 do {  \
NOUVEAU_ERR(str, err);   \
+  screen->base.device = 0; \
nv30_screen_destroy(pscreen);  \
return NULL;   \
 } while(0)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index ec51d00..a1fad42 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -905,6 +905,7 @@ nv50_screen_create(struct nouveau_device *dev)
 return pscreen;
fail:
+   screen->base.device = 0;
 nv50_screen_destroy(pscreen);
 return NULL;
  }
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index af8e5f7..28fee35 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -609,6 +609,7 @@ nvc0_screen_resize_tls_area(struct
nvc0_screen *screen,
  #define FAIL_SCREEN_INIT(str, err)   \
 do {  \
NOUVEAU_ERR(str, err);   \
+  screen->base.device = 0; \
nvc0_screen_destroy(pscreen);  \
return NULL;   \
 } while(0)





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


Re: [Mesa-dev] [PATCH v2] nouveau: fix double free when screen_create fails

2015-10-27 Thread samuel.pitoiset

What about this one http://hastebin.com/uboruxicof.coffee ?

This patch is loosely based on your first attempt, except that I removed 
the call

to nouveau_device_del() in nouveau_drm_screen_create().

On 27/10/2015 09:52, Julien Isorce wrote:

This patch prevents to call nouveau_device_del twice on the same device.

Encountered this case when nvc0_screen_create fails with:
nvc0_screen_create:717 - Error allocating PGRAPH context for M2MF: -16

https://bugs.freedesktop.org/show_bug.cgi?id=70354

Signed-off-by: Julien Isorce 
---
  src/gallium/drivers/nouveau/nouveau_screen.c   | 8 ++--
  src/gallium/drivers/nouveau/nv30/nv30_screen.c | 1 +
  src/gallium/drivers/nouveau/nv50/nv50_screen.c | 1 +
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 1 +
  4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_screen.c 
b/src/gallium/drivers/nouveau/nouveau_screen.c
index b2290e7..2bd6d4f 100644
--- a/src/gallium/drivers/nouveau/nouveau_screen.c
+++ b/src/gallium/drivers/nouveau/nouveau_screen.c
@@ -177,13 +177,17 @@ nouveau_screen_init(struct nouveau_screen *screen, struct 
nouveau_device *dev)
screen->device = dev;
  
  	ret = nouveau_client_new(screen->device, >client);

-   if (ret)
+   if (ret) {
+   screen->device = 0;
return ret;
+   }
ret = nouveau_pushbuf_new(screen->client, screen->channel,
  4, 512 * 1024, 1,
  >pushbuf);
-   if (ret)
+   if (ret) {
+   screen->device = 0;
return ret;
+   }
  
  /* getting CPU time first appears to be more accurate */

  screen->cpu_gpu_time_delta = os_time_get();
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 0330164..54af655 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -411,6 +411,7 @@ nv30_screen_destroy(struct pipe_screen *pscreen)
  #define FAIL_SCREEN_INIT(str, err)\
 do {   \
NOUVEAU_ERR(str, err);  \
+  screen->base.device = 0;\
nv30_screen_destroy(pscreen);   \
return NULL;\
 } while(0)
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c 
b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index ec51d00..a1fad42 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -905,6 +905,7 @@ nv50_screen_create(struct nouveau_device *dev)
 return pscreen;
  
  fail:

+   screen->base.device = 0;
 nv50_screen_destroy(pscreen);
 return NULL;
  }
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index af8e5f7..28fee35 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -609,6 +609,7 @@ nvc0_screen_resize_tls_area(struct nvc0_screen *screen,
  #define FAIL_SCREEN_INIT(str, err)\
 do {   \
NOUVEAU_ERR(str, err);  \
+  screen->base.device = 0;\
nvc0_screen_destroy(pscreen);   \
return NULL;\
 } while(0)


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


Re: [Mesa-dev] [PATCH] nouveau: fix double free when screen_create fails

2015-10-27 Thread samuel.pitoiset



On 27/10/2015 11:37, Emil Velikov wrote:

On 22 October 2015 at 00:16, Julien Isorce  wrote:

The real fix is in nouveau_drm_winsys.c by setting dev to 0.
Which means dev's ownership has been passed to previous call.
Other changes are there to be consistent with what the
screen_create functions already do on errors.

Encountered this crash because nvc0_screen_create sometimes fails with:
nvc0_screen_create:717 - Error allocating PGRAPH context for M2MF: -16
Also see: https://bugs.freedesktop.org/show_bug.cgi?id=70354

Signed-off-by: Julien Isorce 
---
  src/gallium/drivers/nouveau/nv30/nv30_screen.c  | 5 -
  src/gallium/drivers/nouveau/nv50/nv50_screen.c  | 4 +++-
  src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 2 ++
  3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c 
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 0330164..9b8ddac 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -425,8 +425,10 @@ nv30_screen_create(struct nouveau_device *dev)
 unsigned oclass = 0;
 int ret, i;

-   if (!screen)
+   if (!screen) {
+  nouveau_device_del();
return NULL;
+   }


Imho having these in screen_create() seems like the wrong 'layer'.
Shouldn't one call nouveau_device_dev() from within
nouveau_drm_screen_unref
  and explicitly call the latter if the calloc() (here and in nv50/nvc0) fails ?


We can't do that because nouveau_drm_screen_unref() needs a valid 
nouveau_screen

object and in this case it is NULL.

I agree that it's not really an elegant fix but we don't really have the 
choice actually.

In my opinion, this is not that bad.



-Emil
___
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] nouveau: fix double free when screen_create fails

2015-10-27 Thread samuel.pitoiset



On 27/10/2015 12:52, Emil Velikov wrote:

On 27 October 2015 at 10:50, samuel.pitoiset <samuel.pitoi...@gmail.com> wrote:

On 27/10/2015 11:37, Emil Velikov wrote:

On 22 October 2015 at 00:16, Julien Isorce <julien.iso...@gmail.com>
wrote:

The real fix is in nouveau_drm_winsys.c by setting dev to 0.
Which means dev's ownership has been passed to previous call.
Other changes are there to be consistent with what the
screen_create functions already do on errors.

Encountered this crash because nvc0_screen_create sometimes fails with:
nvc0_screen_create:717 - Error allocating PGRAPH context for M2MF: -16
Also see: https://bugs.freedesktop.org/show_bug.cgi?id=70354

Signed-off-by: Julien Isorce <j.iso...@samsung.com>
---
   src/gallium/drivers/nouveau/nv30/nv30_screen.c  | 5 -
   src/gallium/drivers/nouveau/nv50/nv50_screen.c  | 4 +++-
   src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 2 ++
   3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 0330164..9b8ddac 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -425,8 +425,10 @@ nv30_screen_create(struct nouveau_device *dev)
  unsigned oclass = 0;
  int ret, i;

-   if (!screen)
+   if (!screen) {
+  nouveau_device_del();
 return NULL;
+   }


Imho having these in screen_create() seems like the wrong 'layer'.
Shouldn't one call nouveau_device_dev() from within
nouveau_drm_screen_unref
   and explicitly call the latter if the calloc() (here and in nv50/nvc0)
fails ?


We can't do that because nouveau_drm_screen_unref() needs a valid
nouveau_screen
object and in this case it is NULL.


Ouch I was under the impression that we've brought back the concept of
winsys in nouveau with the hash_table patches. Seems like we haven't
:(

If we are to do so (split things just like the radeon/amdgpu winsys)
then we can kill two birds with one stone. The missing device_del() on
calloc failure as well as other error paths in nvxx_screen_create().


Okay, I'll have a look at how radeon/amdgpu split those things.




I agree that it's not really an elegant fix but we don't really have the
choice actually.
In my opinion, this is not that bad.


I never said it's "bad" just the wrong place for the fix. Or in other
words - if we're to fix things might as well do it properly :-)


Sure, I agree. :)



-Emil


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


Re: [Mesa-dev] [PATCH v2 1/7] nvc0: fix crash when nv50_miptree_from_handle fails

2015-10-20 Thread samuel.pitoiset
Is there a particular situation where nv50_miptree_from_handle() fails? 
And did you check nv50?


Anyway, this patch is:
Reviewed-by: Samuel Pitoiset 

On 20/10/2015 18:34, Julien Isorce wrote:

Signed-off-by: Julien Isorce 
---
  src/gallium/drivers/nouveau/nvc0/nvc0_resource.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
index 12b5a02..15c803c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_resource.c
@@ -26,7 +26,8 @@ nvc0_resource_from_handle(struct pipe_screen * screen,
 } else {
struct pipe_resource *res = nv50_miptree_from_handle(screen,
 templ, whandle);
-  nv04_resource(res)->vtbl = _miptree_vtbl;
+  if (res)
+ nv04_resource(res)->vtbl = _miptree_vtbl;
return res;
 }
  }


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


Re: [Mesa-dev] [PATCH] nouveau: use bool instead of boolean

2015-07-18 Thread samuel.pitoiset



On 17/07/2015 23:08, Ilia Mirkin wrote:

On Fri, Jul 17, 2015 at 5:02 PM, Emil Velikov emil.l.veli...@gmail.com wrote:

On 16/07/15 22:39, Samuel Pitoiset wrote:

Signed-off-by: Samuel Pitoiset samuel.pitoi...@gmail.com
---
  src/gallium/drivers/nouveau/codegen/nv50_ir.h  |   2 +-
  .../drivers/nouveau/codegen/nv50_ir_driver.h   |  14 +--
  .../drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp  |   8 +-
  .../nouveau/codegen/nv50_ir_lowering_gm107.cpp |   2 +-
  .../drivers/nouveau/codegen/nv50_ir_peephole.cpp   |   4 +-
  src/gallium/drivers/nouveau/nouveau_buffer.c   | 118 ++---
  src/gallium/drivers/nouveau/nouveau_buffer.h   |   6 +-
  src/gallium/drivers/nouveau/nouveau_context.h  |   4 +-
  src/gallium/drivers/nouveau/nouveau_fence.c|  36 +++
  src/gallium/drivers/nouveau/nouveau_fence.h|  14 +--
  src/gallium/drivers/nouveau/nouveau_screen.c   |   6 +-
  src/gallium/drivers/nouveau/nouveau_screen.h   |   6 +-
  src/gallium/drivers/nouveau/nouveau_video.c|  56 +-
  src/gallium/drivers/nouveau/nouveau_winsys.h   |   4 +-
  src/gallium/drivers/nouveau/nv30/nv30_clear.c  |   2 +-
  src/gallium/drivers/nouveau/nv30/nv30_context.c|   4 +-
  src/gallium/drivers/nouveau/nv30/nv30_context.h|  10 +-
  src/gallium/drivers/nouveau/nv30/nv30_draw.c   |  22 ++--
  src/gallium/drivers/nouveau/nv30/nv30_fragprog.c   |   6 +-
  src/gallium/drivers/nouveau/nv30/nv30_miptree.c|   4 +-
  src/gallium/drivers/nouveau/nv30/nv30_push.c   |   6 +-
  src/gallium/drivers/nouveau/nv30/nv30_query.c  |   4 +-
  src/gallium/drivers/nouveau/nv30/nv30_resource.c   |   4 +-
  src/gallium/drivers/nouveau/nv30/nv30_resource.h   |   2 +-
  src/gallium/drivers/nouveau/nv30/nv30_screen.c |  10 +-
  src/gallium/drivers/nouveau/nv30/nv30_state.h  |   4 +-
  .../drivers/nouveau/nv30/nv30_state_validate.c |   8 +-
  src/gallium/drivers/nouveau/nv30/nv30_transfer.c   |  54 +-
  src/gallium/drivers/nouveau/nv30/nv30_vbo.c|  26 ++---
  src/gallium/drivers/nouveau/nv30/nv30_vertprog.c   |  12 +--
  src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c   |  46 
  src/gallium/drivers/nouveau/nv30/nvfx_shader.h |   4 +-
  src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c   |  50 -
  src/gallium/drivers/nouveau/nv50/nv50_blit.h   |  10 +-
  src/gallium/drivers/nouveau/nv50/nv50_context.c|  14 +--
  src/gallium/drivers/nouveau/nv50/nv50_context.h|  16 +--
  src/gallium/drivers/nouveau/nv50/nv50_miptree.c|  26 ++---
  src/gallium/drivers/nouveau/nv50/nv50_program.c|  18 ++--
  src/gallium/drivers/nouveau/nv50/nv50_program.h|   6 +-
  src/gallium/drivers/nouveau/nv50/nv50_push.c   |   8 +-
  src/gallium/drivers/nouveau/nv50/nv50_query.c  |  38 +++
  src/gallium/drivers/nouveau/nv50/nv50_resource.h   |   6 +-
  src/gallium/drivers/nouveau/nv50/nv50_screen.c |  18 ++--
  src/gallium/drivers/nouveau/nv50/nv50_screen.h |  16 +--
  .../drivers/nouveau/nv50/nv50_shader_state.c   |  18 ++--
  src/gallium/drivers/nouveau/nv50/nv50_state.c  |  24 ++---
  .../drivers/nouveau/nv50/nv50_state_validate.c |  14 +--
  src/gallium/drivers/nouveau/nv50/nv50_stateobj.h   |   6 +-
  src/gallium/drivers/nouveau/nv50/nv50_surface.c|  64 +--
  src/gallium/drivers/nouveau/nv50/nv50_tex.c|  22 ++--
  src/gallium/drivers/nouveau/nv50/nv50_vbo.c|  32 +++---
  src/gallium/drivers/nouveau/nvc0/nvc0_compute.c|  24 ++---
  src/gallium/drivers/nouveau/nvc0/nvc0_compute.h|   2 +-
  src/gallium/drivers/nouveau/nvc0/nvc0_context.c|  12 +--
  src/gallium/drivers/nouveau/nvc0/nvc0_context.h|  22 ++--
  src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c|  12 +--
  src/gallium/drivers/nouveau/nvc0/nvc0_program.c|  18 ++--
  src/gallium/drivers/nouveau/nvc0/nvc0_program.h|   6 +-
  src/gallium/drivers/nouveau/nvc0/nvc0_query.c  |  84 +++
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c |  24 ++---
  src/gallium/drivers/nouveau/nvc0/nvc0_screen.h |  16 +--
  .../drivers/nouveau/nvc0/nvc0_shader_state.c   |  12 +--
  src/gallium/drivers/nouveau/nvc0/nvc0_state.c  |  20 ++--
  .../drivers/nouveau/nvc0/nvc0_state_validate.c |  20 ++--
  src/gallium/drivers/nouveau/nvc0/nvc0_stateobj.h   |   8 +-
  src/gallium/drivers/nouveau/nvc0/nvc0_surface.c|  54 +-
  src/gallium/drivers/nouveau/nvc0/nvc0_tex.c|  38 +++
  src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c   |   8 +-
  src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c|  32 +++---
  .../drivers/nouveau/nvc0/nvc0_vbo_translate.c  |  18 ++--
  src/gallium/drivers/nouveau/nvc0/nve4_compute.c|  24 ++---
  .../winsys/nouveau/drm/nouveau_drm_winsys.c|   2 +-
  72 files changed, 685 insertions(+), 685 deletions(-)


Fwiw I'm like the idea, there is a small concern. There are some
differences between boolean (char) 

Re: [Mesa-dev] [PATCH] nvc0: fix geometry program revalidation of clipping params

2015-07-16 Thread samuel.pitoiset

Seems reasonable.

Please, let me know the result of the full piglit run.
If everything is okay, this patch is :

Reviewed-by: Samuel Pitoiset samuel.pitoi...@gmail.com

On 13/07/2015 20:08, Ilia Mirkin wrote:

This was, btw, introduced in commit 3a8ae6ac243b (nvc0: adapt to new
clip state). Back then there was no real geometry support yet.

On Mon, Jul 13, 2015 at 2:05 PM, Ilia Mirkin imir...@alum.mit.edu wrote:

Any one which, after using a geometry shader, enables an extra clip
distance. i.e. none.

On Mon, Jul 13, 2015 at 4:16 AM, Samuel Pitoiset
samuel.pitoi...@gmail.com wrote:

What piglit test does this fix?

On Sat, Jul 11, 2015 at 7:13 PM, Ilia Mirkin imir...@alum.mit.edu wrote:

Signed-off-by: Ilia Mirkin imir...@alum.mit.edu
Cc: mesa-sta...@lists.freedesktop.org
---

Even though in practice a geometry program will never be using UCP's,
we still were revalidating (aka recompiling) the program when more
clip planes became enabled (which also are used for regular clip
distances).

This seems like it should have led to massive fail, but I guess you
don't change the number of clip planes when using geometry shaders.
But I'm going to put this through a full piglit run just in case
there's something I'm missing.

  src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
index 785e52e..11f2b10 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
@@ -339,7 +339,7 @@ nvc0_check_program_ucps(struct nvc0_context *nvc0,
nvc0_vertprog_validate(nvc0);
 else
 if (likely(vp == nvc0-gmtyprog))
-  nvc0_vertprog_validate(nvc0);
+  nvc0_gmtyprog_validate(nvc0);
 else
nvc0_tevlprog_validate(nvc0);
  }
--
2.3.6

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




--
Best regards,
Samuel Pitoiset.


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


Re: [Mesa-dev] [PATCH] nv50: limit the maximum number of samplers to 16

2015-07-13 Thread samuel.pitoiset



On 13/07/2015 18:08, Emil Velikov wrote:

Is there some widely know issue with it ? mesa  envytools does not
mention anything (based of a quick scan).


There is no know issue with NV50_3D_BIND_TSC2, but Ilia doesn't seem to 
want to use it. :-)
That's why I followed his suggestion by reducing the max. number of 
samplers to 16 like for nvc0.


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