Re: [Mesa-dev] [PATCH] mesa: framebuffer refcounting with atomic ops

2017-08-15 Thread Marek Olšák
I take back my Rb. If *ptr == fb, it will crash. Also, it's safer to first increment the fb counter and then decrement the *ptr counter. Basically, copy what pipe_reference_described does. Marek On Tue, Aug 15, 2017 at 3:04 PM, Marek Olšák wrote: > Reviewed-by: Marek Olšák > > Marek > > On T

Re: [Mesa-dev] [PATCH] mesa: framebuffer refcounting with atomic ops

2017-08-15 Thread Timothy Arceri
On 16/08/17 00:23, Tapani Pälli wrote: On 08/15/2017 05:14 PM, Timothy Arceri wrote: We seem to revisit this every few months. Please search your email for all the details but the short answer is this makes some race conditions worse. You will need to address and follow the previous suggestion

Re: [Mesa-dev] [PATCH] mesa: framebuffer refcounting with atomic ops

2017-08-15 Thread Tapani Pälli
On 08/15/2017 05:14 PM, Timothy Arceri wrote: We seem to revisit this every few months. Please search your email for all the details but the short answer is this makes some race conditions worse. You will need to address and follow the previous suggestions to be able to improve locking here.

Re: [Mesa-dev] [PATCH] mesa: framebuffer refcounting with atomic ops

2017-08-15 Thread Timothy Arceri
We seem to revisit this every few months. Please search your email for all the details but the short answer is this makes some race conditions worse. You will need to address and follow the previous suggestions to be able to improve locking here. On 15/08/17 23:04, Marek Olšák wrote: Reviewed

Re: [Mesa-dev] [PATCH] mesa: framebuffer refcounting with atomic ops

2017-08-15 Thread Marek Olšák
Reviewed-by: Marek Olšák Marek On Tue, Aug 15, 2017 at 2:03 PM, Tapani Pälli wrote: > Signed-off-by: Tapani Pälli > --- > src/mesa/main/framebuffer.c | 19 +-- > 1 file changed, 5 insertions(+), 14 deletions(-) > > Use atomic ops in same manner as for shader objects, IMO makes

[Mesa-dev] [PATCH] mesa: framebuffer refcounting with atomic ops

2017-08-15 Thread Tapani Pälli
Signed-off-by: Tapani Pälli --- src/mesa/main/framebuffer.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) Use atomic ops in same manner as for shader objects, IMO makes code easier to read. diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index