Re: [Mesa-dev] [PATCH V3] util/disk_cache: support caches for multiple architectures

2017-03-04 Thread Dieter Nützel

Works on r600g, Turks XT / HD6670.
I'm running my whole system with Marek's / Gregory's fixed glthread 
branch.

https://cgit.freedesktop.org/~mareko/mesa/?h=glthread
I have mesa_glthread=true in /etc/environment ;-)

Tested-by: Dieter Nützel 

Cheers,
Dieter

Am 04.03.2017 22:07, schrieb Timothy Arceri:

Previously we were deleting the entire cache if a user switched
between 32 and 64 bit applications.

V2: make the check more generic, it should now work with any
platform we are likely to support.

V3: Use suggestion from Emil to make even more generic/fix issue
with __ILP32__ not being declared on gcc for regular 32-bit builds.
---
 src/util/disk_cache.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 3abdec4..7543b0d 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -67,20 +67,37 @@ struct disk_cache {
/* Pointer to total size of all objects in cache (within 
index_mmap) */

uint64_t *size;

/* Pointer to stored keys, (within index_mmap). */
uint8_t *stored_keys;

/* Maximum size of all cached objects (in bytes). */
uint64_t max_size;
 };

+static const char *
+get_arch_bitness_str(void)
+{
+if (sizeof(void *) == 4)
+#ifdef __ILP32__
+return "ilp-32";
+#else
+return "32";
+#endif
+if (sizeof(void *) == 8)
+return "64";
+
+/* paranoia check which will be dropped by the optimiser */
+assert(!"unknown_arch");
+return "unknown_arch";
+}
+
 /* Create a directory named 'path' if it does not already exist.
  *
  * Returns: 0 if path already exists as a directory or if created.
  * -1 in all other cases.
  */
 static int
 mkdir_if_needed(char *path)
 {
struct stat sb;

@@ -170,20 +187,29 @@ remove_old_cache_directories(void *mem_ctx, char
*path, const char *timestamp)
 }

 static char *
 create_mesa_cache_dir(void *mem_ctx, char *path, const char 
*timestamp,

   const char *gpu_name)
 {
char *new_path = concatenate_and_mkdir(mem_ctx, path, "mesa");
if (new_path == NULL)
   return NULL;

+   /* Create a parent architecture directory so that we don't remove 
cache
+* files for other architectures. In theory we could share the 
cache
+* between architectures but we have no way of knowing if they were 
created

+* by a compatible Mesa version.
+*/
+   new_path = concatenate_and_mkdir(mem_ctx, new_path, 
get_arch_bitness_str());

+   if (new_path == NULL)
+  return NULL;
+
/* Remove cache directories for old Mesa versions */
remove_old_cache_directories(mem_ctx, new_path, timestamp);

new_path = concatenate_and_mkdir(mem_ctx, new_path, timestamp);
if (new_path == NULL)
   return NULL;

new_path = concatenate_and_mkdir(mem_ctx, new_path, gpu_name);
if (new_path == NULL)
   return NULL;

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


Re: [Mesa-dev] [PATCH] st/glsl_to_tgsi: Translate float ir_unop_neg into float MOV with modifier.

2017-03-04 Thread Ilia Mirkin
On Sat, Mar 4, 2017 at 9:21 PM, Francisco Jerez  wrote:
> Ilia Mirkin  writes:
>
>> Also, how is this happening in the first place? For example, we have:
>>
>>case ir_unop_bitcast_f2i:
>>case ir_unop_bitcast_f2u:
>>   /* Make sure we don't propagate the negate modifier to integer 
>> opcodes. */
>>   if (op[0].negate || op[0].abs)
>>  emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
>>   else
>>  result_src = op[0];
>>
>> Oh, but it's going directly into a ir_triop_csel, which is missing
>> this logic. It should be added there instead, IMHO. OTOH, the same
>> issue will hit in emit_block_mov() if you do. Would love to hear some
>> other opinions... Marek, Brian, Roland?
>>
>
> I considered doing something like that but it will be somewhat more
> involved than in the snippet above because you'll have to allocate
> temporaries to hold the negated source results in case that any of the
> csel sources has a modifier set -- Can look into it next week if you
> think it's the right thing to do.

Right, that's mildly annoying but definitely solvable.

One last thought from me - for ir_unop_abs, we do the MOV. So perhaps
we should just suck it up and do the MOV here.

But I'd really like to hear from others.

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


Re: [Mesa-dev] [PATCH 5/5] gallium/util: replace pipe_condvar_broadcast() with cnd_broadcast()

2017-03-04 Thread Timothy Arceri



On 05/03/17 11:30, Emil Velikov wrote:

On 4 March 2017 at 23:41, Timothy Arceri  wrote:

pipe_condvar_broadcast() was made unnecessary with fd33a6bcd7f12.

Fwiw I have some patches that do a similar cleanups on the thrd_*
side. Need to test them one of these days - since they're not as
trivial of a sed job.


---
 src/gallium/auxiliary/os/os_thread.h  | 5 +
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +-
 src/gallium/auxiliary/util/u_queue.c  | 4 ++--
 src/gallium/drivers/llvmpipe/lp_fence.c   | 2 +-
 src/gallium/drivers/rbug/rbug_core.c  | 6 +++---
 5 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index a8b5d92..6eca2ca 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }

 /* pipe_condvar
  */
 typedef cnd_t pipe_condvar;


I think we should we drop this typedef one as well.


Yeah I noticed that after sending. Will do a follow up.


We could also
follow-up with pipe_tsd_* front ?


My main aim is at this stage is to make u_queue generic enough to move 
it to src/util.



In either case, it might be worth checking with Jose/others to update
things on their end.

For the series:
Reviewed-by: Emil Velikov 


Thanks!



-Emil


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


Re: [Mesa-dev] [PATCH] st/glsl_to_tgsi: Translate float ir_unop_neg into float MOV with modifier.

2017-03-04 Thread Francisco Jerez
Ilia Mirkin  writes:

> Also, how is this happening in the first place? For example, we have:
>
>case ir_unop_bitcast_f2i:
>case ir_unop_bitcast_f2u:
>   /* Make sure we don't propagate the negate modifier to integer opcodes. 
> */
>   if (op[0].negate || op[0].abs)
>  emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
>   else
>  result_src = op[0];
>
> Oh, but it's going directly into a ir_triop_csel, which is missing
> this logic. It should be added there instead, IMHO. OTOH, the same
> issue will hit in emit_block_mov() if you do. Would love to hear some
> other opinions... Marek, Brian, Roland?
>

I considered doing something like that but it will be somewhat more
involved than in the snippet above because you'll have to allocate
temporaries to hold the negated source results in case that any of the
csel sources has a modifier set -- Can look into it next week if you
think it's the right thing to do.

>   -ilia
>
>
> On Sat, Mar 4, 2017 at 2:24 PM, Ilia Mirkin  wrote:
>> Hmmm... I wonder if this should only be done for the native_integers
>> case. I'm concerned that this will cause perf regressions on weaker hw
>> like nv30 and r300, as the neg will no longer be inserted as a
>> modifier into the next instruction. Any opinion on this?
>>
>> On Sat, Mar 4, 2017 at 2:16 PM, Francisco Jerez  
>> wrote:
>>> Otherwise result_src may be provided to an integer instruction whose
>>> negate modifier has different semantics.  Example is UCMP as in the
>>> bug linked below, where an unrelated change in the GLSL built-in
>>> lowering code for atan2 (e9ffd12827ac11a2d2002a42fa8eb1df847153ba)
>>> caused the generation of floating-point ir_unop_neg instructions
>>> followed by ir_triop_csel, which is lowered into UCMP on back-ends
>>> with native integer support.
>>>
>>> Fixes a regression of piglit glsl-fs-tan-1 on softpipe introduced by
>>> the above-mentioned glsl front-end commit.  Even though the commit
>>> that triggered the regression doesn't seem to have made it to any
>>> stable branches yet, this seems worth back-porting since I don't see
>>> any reason why the bug couldn't have been reproduced before that
>>> point.
>>>
>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817
>>> Tested-by: Vinson Lee 
>>> Cc: mesa-sta...@lists.freedesktop.org
>>> ---
>>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
>>> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>>> index af41bdb..6bf3c89 100644
>>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>>> @@ -1633,7 +1633,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* 
>>> ir, st_src_reg *op)
>>>   emit_asm(ir, TGSI_OPCODE_DNEG, result_dst, op[0]);
>>>else {
>>>   op[0].negate = ~op[0].negate;
>>> - result_src = op[0];
>>> + emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
>>>}
>>>break;
>>> case ir_unop_subroutine_to_int:
>>> --
>>> 2.10.2
>>>
>>> ___
>>> mesa-dev mailing list
>>> mesa-dev@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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


Re: [Mesa-dev] [PATCH 1/7] gallium/util: replace pipe_mutex with mtx_t

2017-03-04 Thread Timothy Arceri
Patches 5 & 6 were two big for the list. You can view them here [1]. 
They are the lock and unlock patches.


[1] https://github.com/tarceri/Mesa/compare/master...shader-cache-radeonsi5
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V2] gallium/util: replace pipe_thread with thrd_t

2017-03-04 Thread Timothy Arceri
pipe_thread was made unnecessary with fd33a6bcd7f12.

V2: fix compile error in u_queue.c
---
 src/gallium/auxiliary/os/os_thread.h  | 16 ++--
 src/gallium/auxiliary/util/u_queue.c  |  2 +-
 src/gallium/auxiliary/util/u_queue.h  |  2 +-
 src/gallium/drivers/ddebug/dd_pipe.h  |  2 +-
 src/gallium/drivers/llvmpipe/lp_rast_priv.h   |  2 +-
 src/gallium/drivers/radeon/r600_pipe_common.h |  2 +-
 src/gallium/drivers/rbug/rbug_core.c  |  2 +-
 src/gallium/state_trackers/nine/nine_state.c  |  4 ++--
 src/gallium/tests/unit/pipe_barrier_test.c|  2 +-
 9 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index a429f4e..ad2cda4 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -40,71 +40,67 @@
 #include "pipe/p_compiler.h"
 #include "util/u_debug.h" /* for assert */
 
 #include "c11/threads.h"
 
 #ifdef HAVE_PTHREAD
 #include 
 #endif
 
 
-/* pipe_thread
- */
-typedef thrd_t pipe_thread;
-
 #define PIPE_THREAD_ROUTINE( name, param ) \
int name( void *param )
 
-static inline pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), 
), void *param )
+static inline thrd_t pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ), 
void *param )
 {
-   pipe_thread thread;
+   thrd_t thread;
 #ifdef HAVE_PTHREAD
sigset_t saved_set, new_set;
int ret;
 
sigfillset(_set);
pthread_sigmask(SIG_SETMASK, _set, _set);
ret = thrd_create( , routine, param );
pthread_sigmask(SIG_SETMASK, _set, NULL);
 #else
int ret;
ret = thrd_create( , routine, param );
 #endif
if (ret)
   return 0;
 
return thread;
 }
 
-static inline int pipe_thread_wait( pipe_thread thread )
+static inline int pipe_thread_wait( thrd_t thread )
 {
return thrd_join( thread, NULL );
 }
 
-static inline int pipe_thread_destroy( pipe_thread thread )
+static inline int pipe_thread_destroy( thrd_t thread )
 {
return thrd_detach( thread );
 }
 
 static inline void pipe_thread_setname( const char *name )
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
pthread_setname_np(pthread_self(), name);
 #  endif
 #endif
(void)name;
 }
 
 
-static inline int pipe_thread_is_self( pipe_thread thread )
+static inline int pipe_thread_is_self( thrd_t thread )
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
 #  endif
 #endif
return 0;
 }
 
@@ -300,21 +296,21 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
 }
 
 
 
 /*
  * Thread statistics.
  */
 
 /* Return the time of a thread's CPU time clock. */
 static inline int64_t
-pipe_thread_get_time_nano(pipe_thread thread)
+pipe_thread_get_time_nano(thrd_t thread)
 {
 #if defined(PIPE_OS_LINUX) && defined(HAVE_PTHREAD)
struct timespec ts;
clockid_t cid;
 
pthread_getcpuclockid(thread, );
clock_gettime(cid, );
return (int64_t)ts.tv_sec * 10 + ts.tv_nsec;
 #else
return 0;
diff --git a/src/gallium/auxiliary/util/u_queue.c 
b/src/gallium/auxiliary/util/u_queue.c
index 2525230..b20abc8f 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -209,21 +209,21 @@ util_queue_init(struct util_queue *queue,
  CALLOC(max_jobs, sizeof(struct util_queue_job));
if (!queue->jobs)
   goto fail;
 
(void) mtx_init(>lock, mtx_plain);
 
queue->num_queued = 0;
cnd_init(>has_queued_cond);
cnd_init(>has_space_cond);
 
-   queue->threads = (pipe_thread*)CALLOC(num_threads, sizeof(pipe_thread));
+   queue->threads = (thrd_t*)CALLOC(num_threads, sizeof(thrd_t));
if (!queue->threads)
   goto fail;
 
/* start threads */
for (i = 0; i < num_threads; i++) {
   struct thread_input *input = MALLOC_STRUCT(thread_input);
   input->queue = queue;
   input->thread_index = i;
 
   queue->threads[i] = pipe_thread_create(util_queue_thread_func, input);
diff --git a/src/gallium/auxiliary/util/u_queue.h 
b/src/gallium/auxiliary/util/u_queue.h
index 8d4804f..635545f 100644
--- a/src/gallium/auxiliary/util/u_queue.h
+++ b/src/gallium/auxiliary/util/u_queue.h
@@ -53,21 +53,21 @@ struct util_queue_job {
util_queue_execute_func execute;
util_queue_execute_func cleanup;
 };
 
 /* Put this into your context. */
 struct util_queue {
const char *name;
mtx_t lock;
pipe_condvar has_queued_cond;
pipe_condvar has_space_cond;
-   pipe_thread *threads;
+   thrd_t *threads;
int num_queued;
unsigned num_threads;
int kill_threads;
int max_jobs;
int write_idx, read_idx; /* ring buffer pointers */
struct util_queue_job *jobs;
 
/* for 

[Mesa-dev] [PATCH 7/7] gallium/util: replace pipe_thread with thrd_t

2017-03-04 Thread Timothy Arceri
pipe_thread was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h  | 16 ++--
 src/gallium/auxiliary/util/u_queue.h  |  2 +-
 src/gallium/drivers/ddebug/dd_pipe.h  |  2 +-
 src/gallium/drivers/llvmpipe/lp_rast_priv.h   |  2 +-
 src/gallium/drivers/radeon/r600_pipe_common.h |  2 +-
 src/gallium/drivers/rbug/rbug_core.c  |  2 +-
 src/gallium/state_trackers/nine/nine_state.c  |  4 ++--
 src/gallium/tests/unit/pipe_barrier_test.c|  2 +-
 8 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index a429f4e..ad2cda4 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -40,71 +40,67 @@
 #include "pipe/p_compiler.h"
 #include "util/u_debug.h" /* for assert */
 
 #include "c11/threads.h"
 
 #ifdef HAVE_PTHREAD
 #include 
 #endif
 
 
-/* pipe_thread
- */
-typedef thrd_t pipe_thread;
-
 #define PIPE_THREAD_ROUTINE( name, param ) \
int name( void *param )
 
-static inline pipe_thread pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), 
), void *param )
+static inline thrd_t pipe_thread_create( PIPE_THREAD_ROUTINE((*routine), ), 
void *param )
 {
-   pipe_thread thread;
+   thrd_t thread;
 #ifdef HAVE_PTHREAD
sigset_t saved_set, new_set;
int ret;
 
sigfillset(_set);
pthread_sigmask(SIG_SETMASK, _set, _set);
ret = thrd_create( , routine, param );
pthread_sigmask(SIG_SETMASK, _set, NULL);
 #else
int ret;
ret = thrd_create( , routine, param );
 #endif
if (ret)
   return 0;
 
return thread;
 }
 
-static inline int pipe_thread_wait( pipe_thread thread )
+static inline int pipe_thread_wait( thrd_t thread )
 {
return thrd_join( thread, NULL );
 }
 
-static inline int pipe_thread_destroy( pipe_thread thread )
+static inline int pipe_thread_destroy( thrd_t thread )
 {
return thrd_detach( thread );
 }
 
 static inline void pipe_thread_setname( const char *name )
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
pthread_setname_np(pthread_self(), name);
 #  endif
 #endif
(void)name;
 }
 
 
-static inline int pipe_thread_is_self( pipe_thread thread )
+static inline int pipe_thread_is_self( thrd_t thread )
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
 #  endif
 #endif
return 0;
 }
 
@@ -300,21 +296,21 @@ pipe_tsd_set(pipe_tsd *tsd, void *value)
 }
 
 
 
 /*
  * Thread statistics.
  */
 
 /* Return the time of a thread's CPU time clock. */
 static inline int64_t
-pipe_thread_get_time_nano(pipe_thread thread)
+pipe_thread_get_time_nano(thrd_t thread)
 {
 #if defined(PIPE_OS_LINUX) && defined(HAVE_PTHREAD)
struct timespec ts;
clockid_t cid;
 
pthread_getcpuclockid(thread, );
clock_gettime(cid, );
return (int64_t)ts.tv_sec * 10 + ts.tv_nsec;
 #else
return 0;
diff --git a/src/gallium/auxiliary/util/u_queue.h 
b/src/gallium/auxiliary/util/u_queue.h
index 8d4804f..635545f 100644
--- a/src/gallium/auxiliary/util/u_queue.h
+++ b/src/gallium/auxiliary/util/u_queue.h
@@ -53,21 +53,21 @@ struct util_queue_job {
util_queue_execute_func execute;
util_queue_execute_func cleanup;
 };
 
 /* Put this into your context. */
 struct util_queue {
const char *name;
mtx_t lock;
pipe_condvar has_queued_cond;
pipe_condvar has_space_cond;
-   pipe_thread *threads;
+   thrd_t *threads;
int num_queued;
unsigned num_threads;
int kill_threads;
int max_jobs;
int write_idx, read_idx; /* ring buffer pointers */
struct util_queue_job *jobs;
 
/* for cleanup at exit(), protected by exit_mutex */
struct list_head head;
 };
diff --git a/src/gallium/drivers/ddebug/dd_pipe.h 
b/src/gallium/drivers/ddebug/dd_pipe.h
index dc7c325..64d5510 100644
--- a/src/gallium/drivers/ddebug/dd_pipe.h
+++ b/src/gallium/drivers/ddebug/dd_pipe.h
@@ -227,21 +227,21 @@ struct dd_context
 * After each draw call, a new dd_draw_record is created that contains
 * a copy of all states, the output of pipe_context::dump_debug_state,
 * and it has a fence number assigned. That's done without knowing whether
 * that draw call is problematic or not. The record is added into the list
 * of all records.
 *
 * An independent, separate thread loops over the list of records and checks
 * their fences. Records with signalled fences are freed. On fence timeout,
 * the thread dumps the record of the oldest unsignalled fence.
 */
-   pipe_thread thread;
+   thrd_t thread;
mtx_t mutex;
int kill_thread;
struct pipe_resource *fence;
struct pipe_transfer *fence_transfer;

[Mesa-dev] [PATCH 2/7] gallium/util: remove pipe_static_mutex()

2017-03-04 Thread Timothy Arceri
This was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/hud/hud_cpufreq.c | 2 +-
 src/gallium/auxiliary/hud/hud_diskstat.c| 2 +-
 src/gallium/auxiliary/hud/hud_nic.c | 2 +-
 src/gallium/auxiliary/hud/hud_sensors_temp.c| 2 +-
 src/gallium/auxiliary/os/os_thread.h| 3 ---
 src/gallium/auxiliary/rtasm/rtasm_execmem.c | 2 +-
 src/gallium/auxiliary/util/u_debug_flush.c  | 2 +-
 src/gallium/auxiliary/util/u_debug_memory.c | 2 +-
 src/gallium/auxiliary/util/u_debug_refcnt.c | 2 +-
 src/gallium/auxiliary/util/u_debug_symbol.c | 2 +-
 src/gallium/auxiliary/util/u_queue.c| 2 +-
 src/gallium/drivers/trace/tr_dump.c | 2 +-
 src/gallium/state_trackers/glx/xlib/xm_api.c| 2 +-
 src/gallium/state_trackers/nine/nine_lock.c | 2 +-
 src/gallium/state_trackers/omx/entrypoint.c | 2 +-
 src/gallium/state_trackers/vdpau/htab.c | 2 +-
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c   | 2 +-
 src/gallium/winsys/etnaviv/drm/etnaviv_drm_winsys.c | 2 +-
 src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c | 2 +-
 src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 2 +-
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c   | 2 +-
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c | 2 +-
 22 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_cpufreq.c 
b/src/gallium/auxiliary/hud/hud_cpufreq.c
index 78754b2..41e5827 100644
--- a/src/gallium/auxiliary/hud/hud_cpufreq.c
+++ b/src/gallium/auxiliary/hud/hud_cpufreq.c
@@ -55,21 +55,21 @@ struct cpufreq_info
int cpu_index;
 
/* EG. /sys/devices/system/cpu/cpu?/cpufreq/scaling_cur_freq */
char sysfs_filename[128];
uint64_t KHz;
uint64_t last_time;
 };
 
 static int gcpufreq_count = 0;
 static struct list_head gcpufreq_list;
-pipe_static_mutex(gcpufreq_mutex);
+static mtx_t gcpufreq_mutex = _MTX_INITIALIZER_NP;
 
 static struct cpufreq_info *
 find_cfi_by_index(int cpu_index, int mode)
 {
list_for_each_entry(struct cpufreq_info, cfi, _list, list) {
   if (cfi->mode != mode)
  continue;
   if (cfi->cpu_index == cpu_index)
  return cfi;
}
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c 
b/src/gallium/auxiliary/hud/hud_diskstat.c
index af6e62d..fb64e3d 100644
--- a/src/gallium/auxiliary/hud/hud_diskstat.c
+++ b/src/gallium/auxiliary/hud/hud_diskstat.c
@@ -75,21 +75,21 @@ struct diskstat_info
uint64_t last_time;
struct stat_s last_stat;
 };
 
 /* TODO: We don't handle dynamic block device / partition
  * arrival or removal.
  * Static globals specific to this HUD category.
  */
 static int gdiskstat_count = 0;
 static struct list_head gdiskstat_list;
-pipe_static_mutex(gdiskstat_mutex);
+static mtx_t gdiskstat_mutex = _MTX_INITIALIZER_NP;
 
 static struct diskstat_info *
 find_dsi_by_name(const char *n, int mode)
 {
list_for_each_entry(struct diskstat_info, dsi, _list, list) {
   if (dsi->mode != mode)
  continue;
   if (strcasecmp(dsi->name, n) == 0)
  return dsi;
}
diff --git a/src/gallium/auxiliary/hud/hud_nic.c 
b/src/gallium/auxiliary/hud/hud_nic.c
index 634add1..2fbeaa5 100644
--- a/src/gallium/auxiliary/hud/hud_nic.c
+++ b/src/gallium/auxiliary/hud/hud_nic.c
@@ -60,21 +60,21 @@ struct nic_info
char throughput_filename[128];
uint64_t last_time;
uint64_t last_nic_bytes;
 };
 
 /* TODO: We don't handle dynamic NIC arrival or removal.
  * Static globals specific to this HUD category.
  */
 static int gnic_count = 0;
 static struct list_head gnic_list;
-pipe_static_mutex(gnic_mutex);
+static mtx_t gnic_mutex = _MTX_INITIALIZER_NP;
 
 static struct nic_info *
 find_nic_by_name(const char *n, int mode)
 {
list_for_each_entry(struct nic_info, nic, _list, list) {
   if (nic->mode != mode)
  continue;
 
   if (strcasecmp(nic->name, n) == 0)
  return nic;
diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c 
b/src/gallium/auxiliary/hud/hud_sensors_temp.c
index 11b8a4c..4d723cc 100644
--- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
+++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
@@ -43,21 +43,21 @@
 #include 
 #include 
 #include 
 #include 
 
 /* TODO: We don't handle dynamic sensor discovery / arrival or removal.
  * Static globals specific to this HUD category.
  */
 static int gsensors_temp_count = 0;
 static struct list_head gsensors_temp_list;
-pipe_static_mutex(gsensor_temp_mutex);
+static mtx_t gsensor_temp_mutex = _MTX_INITIALIZER_NP;
 
 struct sensors_temp_info
 {
struct list_head list;
 
/* Combined chip and feature name, human readable. */
char name[64];
 
/* The type of measurement, critical or current. */
unsigned int mode;
diff --git a/src/gallium/auxiliary/os/os_thread.h 

[Mesa-dev] [PATCH 3/7] gallium/util: replace pipe_mutex_init() with mtx_init()

2017-03-04 Thread Timothy Arceri
pipe_mutex_init() was made unnecessary with fd33a6bcd7f12.

Replace was done using:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_init(\([^)]*\)):(void) mtx_init(\&\1, mtx_plain):g' {} \;
---
 src/gallium/auxiliary/os/os_thread.h  |  7 ++-
 src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c|  4 ++--
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_cache.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_slab.c|  2 +-
 src/gallium/auxiliary/util/u_debug_flush.c|  2 +-
 src/gallium/auxiliary/util/u_debug_refcnt.c   |  2 +-
 src/gallium/auxiliary/util/u_debug_symbol.c   |  2 +-
 src/gallium/auxiliary/util/u_queue.c  |  4 ++--
 src/gallium/auxiliary/util/u_range.h  |  2 +-
 src/gallium/auxiliary/util/u_ringbuffer.c |  2 +-
 src/gallium/drivers/ddebug/dd_context.c   |  2 +-
 src/gallium/drivers/freedreno/freedreno_screen.c  |  2 +-
 src/gallium/drivers/llvmpipe/lp_fence.c   |  2 +-
 src/gallium/drivers/llvmpipe/lp_scene.c   |  2 +-
 src/gallium/drivers/llvmpipe/lp_screen.c  |  2 +-
 src/gallium/drivers/nouveau/nv50/nv50_surface.c   |  2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c   |  2 +-
 src/gallium/drivers/r300/r300_screen.c|  2 +-
 src/gallium/drivers/radeon/r600_pipe_common.c |  4 ++--
 src/gallium/drivers/radeonsi/si_pipe.c|  2 +-
 src/gallium/drivers/radeonsi/si_state_shaders.c   |  4 ++--
 src/gallium/drivers/rbug/rbug_context.c   |  6 +++---
 src/gallium/drivers/rbug/rbug_screen.c|  2 +-
 src/gallium/drivers/svga/svga_screen.c|  4 ++--
 src/gallium/drivers/svga/svga_screen_cache.c  |  2 +-
 src/gallium/drivers/vc4/vc4_screen.c  |  2 +-
 src/gallium/state_trackers/dri/dri2.c |  2 +-
 src/gallium/state_trackers/glx/xlib/xm_api.c  |  2 +-
 src/gallium/state_trackers/nine/nine_queue.c  |  4 ++--
 src/gallium/state_trackers/nine/nine_state.c  |  6 +++---
 src/gallium/state_trackers/va/context.c   |  2 +-
 src/gallium/state_trackers/vdpau/decode.c |  2 +-
 src/gallium/state_trackers/vdpau/device.c |  2 +-
 src/gallium/targets/haiku-softpipe/GalliumContext.cpp |  2 +-
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c |  4 ++--
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |  6 +++---
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 10 +-
 src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c |  2 +-
 src/gallium/winsys/svga/drm/vmw_fence.c   |  2 +-
 src/gallium/winsys/svga/drm/vmw_screen_svga.c |  2 +-
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c   |  4 ++--
 src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c   |  2 +-
 46 files changed, 65 insertions(+), 68 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index a6a9fea..cccb531 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -101,23 +101,20 @@ static inline int pipe_thread_is_self( pipe_thread thread 
)
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
 #  endif
 #endif
return 0;
 }
 
-#define pipe_mutex_init(mutex) \
-   (void) mtx_init(&(mutex), mtx_plain)
-
 #define pipe_mutex_destroy(mutex) \
mtx_destroy(&(mutex))
 
 #define pipe_mutex_lock(mutex) \
(void) mtx_lock(&(mutex))
 
 #define pipe_mutex_unlock(mutex) \
(void) mtx_unlock(&(mutex))
 
 #define pipe_mutex_assert_locked(mutex) \
@@ -174,21 +171,21 @@ typedef struct {
uint64_t sequence;
mtx_t mutex;
pipe_condvar condvar;
 } pipe_barrier;
 
 static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
 {
barrier->count = count;
barrier->waiters = 0;
barrier->sequence = 0;
-   pipe_mutex_init(barrier->mutex);
+   (void) mtx_init(>mutex, mtx_plain);
cnd_init(>condvar);
 }
 
 static inline void pipe_barrier_destroy(pipe_barrier *barrier)
 {
assert(barrier->waiters == 0);
pipe_mutex_destroy(barrier->mutex);
cnd_destroy(>condvar);
 }
 
@@ -226,21 +223,21 @@ typedef struct
 {
mtx_t mutex;
pipe_condvar cond;
int counter;
 } pipe_semaphore;
 
 
 static inline void
 pipe_semaphore_init(pipe_semaphore *sema, int init_val)
 {
-   pipe_mutex_init(sema->mutex);
+   (void) mtx_init(>mutex, mtx_plain);
cnd_init(>cond);
sema->counter = init_val;
 }
 
 static inline void
 

[Mesa-dev] [PATCH 4/7] gallium/util: replace pipe_mutex_destroy() with mtx_destroy()

2017-03-04 Thread Timothy Arceri
pipe_mutex_destroy() was made unnecessary with fd33a6bcd7f12.

Replace was done with:
find ./src -type f -exec sed -i -- \
's:pipe_mutex_destroy(\([^)]*\)):mtx_destroy(\&\1):g' {} \;
---
 src/gallium/auxiliary/os/os_thread.h  |  7 ++-
 src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c|  4 ++--
 src/gallium/auxiliary/pipebuffer/pb_cache.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_slab.c|  2 +-
 src/gallium/auxiliary/util/u_queue.c  |  6 +++---
 src/gallium/auxiliary/util/u_range.h  |  2 +-
 src/gallium/auxiliary/util/u_ringbuffer.c |  2 +-
 src/gallium/drivers/ddebug/dd_context.c   |  4 ++--
 src/gallium/drivers/freedreno/freedreno_screen.c  |  2 +-
 src/gallium/drivers/llvmpipe/lp_fence.c   |  2 +-
 src/gallium/drivers/llvmpipe/lp_scene.c   |  2 +-
 src/gallium/drivers/llvmpipe/lp_screen.c  |  2 +-
 src/gallium/drivers/nouveau/nv50/nv50_surface.c   |  2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c   |  2 +-
 src/gallium/drivers/r300/r300_screen.c|  2 +-
 src/gallium/drivers/radeon/r600_pipe_common.c |  4 ++--
 src/gallium/drivers/radeonsi/si_pipe.c|  2 +-
 src/gallium/drivers/radeonsi/si_state_shaders.c   |  4 ++--
 src/gallium/drivers/svga/svga_screen.c|  4 ++--
 src/gallium/drivers/svga/svga_screen_cache.c  |  2 +-
 src/gallium/state_trackers/dri/dri_screen.c   |  2 +-
 src/gallium/state_trackers/nine/nine_queue.c  |  4 ++--
 src/gallium/state_trackers/nine/nine_state.c  |  2 +-
 src/gallium/state_trackers/va/context.c   |  2 +-
 src/gallium/state_trackers/vdpau/decode.c |  2 +-
 src/gallium/state_trackers/vdpau/device.c |  2 +-
 src/gallium/targets/haiku-softpipe/GalliumContext.cpp |  2 +-
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c |  4 ++--
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c |  2 +-
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 10 +-
 src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c |  2 +-
 src/gallium/winsys/svga/drm/vmw_surface.c |  2 +-
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c   |  4 ++--
 src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c   |  2 +-
 35 files changed, 50 insertions(+), 53 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index cccb531..571e3c6 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -101,23 +101,20 @@ static inline int pipe_thread_is_self( pipe_thread thread 
)
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
 #  endif
 #endif
return 0;
 }
 
-#define pipe_mutex_destroy(mutex) \
-   mtx_destroy(&(mutex))
-
 #define pipe_mutex_lock(mutex) \
(void) mtx_lock(&(mutex))
 
 #define pipe_mutex_unlock(mutex) \
(void) mtx_unlock(&(mutex))
 
 #define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
 
 static inline void
@@ -178,21 +175,21 @@ static inline void pipe_barrier_init(pipe_barrier 
*barrier, unsigned count)
barrier->count = count;
barrier->waiters = 0;
barrier->sequence = 0;
(void) mtx_init(>mutex, mtx_plain);
cnd_init(>condvar);
 }
 
 static inline void pipe_barrier_destroy(pipe_barrier *barrier)
 {
assert(barrier->waiters == 0);
-   pipe_mutex_destroy(barrier->mutex);
+   mtx_destroy(>mutex);
cnd_destroy(>condvar);
 }
 
 static inline void pipe_barrier_wait(pipe_barrier *barrier)
 {
pipe_mutex_lock(barrier->mutex);
 
assert(barrier->waiters < barrier->count);
barrier->waiters++;
 
@@ -231,21 +228,21 @@ static inline void
 pipe_semaphore_init(pipe_semaphore *sema, int init_val)
 {
(void) mtx_init(>mutex, mtx_plain);
cnd_init(>cond);
sema->counter = init_val;
 }
 
 static inline void
 pipe_semaphore_destroy(pipe_semaphore *sema)
 {
-   pipe_mutex_destroy(sema->mutex);
+   mtx_destroy(>mutex);
cnd_destroy(>cond);
 }
 
 /** Signal/increment semaphore counter */
 static inline void
 pipe_semaphore_signal(pipe_semaphore *sema)
 {
pipe_mutex_lock(sema->mutex);
sema->counter++;
cnd_signal(>cond);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c 
b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index fefdcef..b3b7828 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -985,21 +985,21 @@ fenced_bufmgr_destroy(struct pb_manager *mgr)
   pipe_mutex_lock(fenced_mgr->mutex);
   while (fenced_manager_check_signalled_locked(fenced_mgr, TRUE))
  ;
}
 
 #ifdef 

[Mesa-dev] [PATCH 1/7] gallium/util: replace pipe_mutex with mtx_t

2017-03-04 Thread Timothy Arceri
pipe_mutex was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h  | 14 +-
 src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c|  4 ++--
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_cache.h   |  2 +-
 src/gallium/auxiliary/pipebuffer/pb_slab.h|  2 +-
 src/gallium/auxiliary/util/u_debug_flush.c|  2 +-
 src/gallium/auxiliary/util/u_queue.h  |  4 ++--
 src/gallium/auxiliary/util/u_range.h  |  2 +-
 src/gallium/auxiliary/util/u_ringbuffer.c |  2 +-
 src/gallium/drivers/ddebug/dd_pipe.h  |  2 +-
 src/gallium/drivers/freedreno/freedreno_screen.h  |  2 +-
 src/gallium/drivers/llvmpipe/lp_fence.h   |  2 +-
 src/gallium/drivers/llvmpipe/lp_scene.h   |  2 +-
 src/gallium/drivers/llvmpipe/lp_screen.h  |  2 +-
 src/gallium/drivers/nouveau/nv50/nv50_surface.c   |  2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_surface.c   |  2 +-
 src/gallium/drivers/r300/r300_screen.h|  2 +-
 src/gallium/drivers/radeon/r600_pipe_common.h |  4 ++--
 src/gallium/drivers/radeonsi/si_pipe.h|  4 ++--
 src/gallium/drivers/radeonsi/si_shader.h  |  2 +-
 src/gallium/drivers/rbug/rbug_context.h   |  6 +++---
 src/gallium/drivers/rbug/rbug_screen.h|  2 +-
 src/gallium/drivers/svga/svga_screen.h|  4 ++--
 src/gallium/drivers/svga/svga_screen_cache.h  |  2 +-
 src/gallium/drivers/vc4/vc4_screen.h  |  4 ++--
 src/gallium/state_trackers/dri/dri_screen.h   |  2 +-
 src/gallium/state_trackers/glx/xlib/xm_api.h  |  2 +-
 src/gallium/state_trackers/hgl/hgl_context.h  |  2 +-
 src/gallium/state_trackers/nine/nine_queue.c  |  4 ++--
 src/gallium/state_trackers/nine/nine_state.c  |  6 +++---
 src/gallium/state_trackers/va/va_private.h|  2 +-
 src/gallium/state_trackers/vdpau/vdpau_private.h  |  4 ++--
 src/gallium/targets/haiku-softpipe/GalliumContext.h   |  2 +-
 src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h |  4 ++--
 src/gallium/winsys/radeon/drm/radeon_drm_bo.h |  2 +-
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.c |  2 +-
 src/gallium/winsys/radeon/drm/radeon_drm_winsys.h | 10 +-
 src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c |  2 +-
 src/gallium/winsys/svga/drm/vmw_fence.c   |  2 +-
 src/gallium/winsys/svga/drm/vmw_surface.h |  2 +-
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.h   |  4 ++--
 src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h   |  2 +-
 45 files changed, 67 insertions(+), 71 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index 6eca2ca..af350b8 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -101,48 +101,44 @@ static inline int pipe_thread_is_self( pipe_thread thread 
)
 {
 #if defined(HAVE_PTHREAD)
 #  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
   (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
 #  endif
 #endif
return 0;
 }
 
-/* pipe_mutex
- */
-typedef mtx_t pipe_mutex;
-
 #define pipe_static_mutex(mutex) \
-   static pipe_mutex mutex = _MTX_INITIALIZER_NP
+   static mtx_t mutex = _MTX_INITIALIZER_NP
 
 #define pipe_mutex_init(mutex) \
(void) mtx_init(&(mutex), mtx_plain)
 
 #define pipe_mutex_destroy(mutex) \
mtx_destroy(&(mutex))
 
 #define pipe_mutex_lock(mutex) \
(void) mtx_lock(&(mutex))
 
 #define pipe_mutex_unlock(mutex) \
(void) mtx_unlock(&(mutex))
 
 #define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
 
 static inline void
-__pipe_mutex_assert_locked(pipe_mutex *mutex)
+__pipe_mutex_assert_locked(mtx_t *mutex)
 {
 #ifdef DEBUG
/* NOTE: this would not work for recursive mutexes, but
-* pipe_mutex doesn't support those
+* mtx_t doesn't support those
 */
int ret = mtx_trylock(mutex);
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }
 
 /* pipe_condvar
  */
@@ -172,21 +168,21 @@ static inline void pipe_barrier_wait(pipe_barrier 
*barrier)
pthread_barrier_wait(barrier);
 }
 
 
 #else /* If the OS doesn't have its own, implement barriers using a mutex and 
a condvar */
 
 typedef struct {
unsigned count;
unsigned waiters;
uint64_t sequence;
-   pipe_mutex mutex;
+   mtx_t mutex;
pipe_condvar condvar;
 } pipe_barrier;
 
 static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
 {

Re: [Mesa-dev] [PATCH 5/5] gallium/util: replace pipe_condvar_broadcast() with cnd_broadcast()

2017-03-04 Thread Emil Velikov
On 4 March 2017 at 23:41, Timothy Arceri  wrote:
> pipe_condvar_broadcast() was made unnecessary with fd33a6bcd7f12.
Fwiw I have some patches that do a similar cleanups on the thrd_*
side. Need to test them one of these days - since they're not as
trivial of a sed job.

> ---
>  src/gallium/auxiliary/os/os_thread.h  | 5 +
>  src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +-
>  src/gallium/auxiliary/util/u_queue.c  | 4 ++--
>  src/gallium/drivers/llvmpipe/lp_fence.c   | 2 +-
>  src/gallium/drivers/rbug/rbug_core.c  | 6 +++---
>  5 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/src/gallium/auxiliary/os/os_thread.h 
> b/src/gallium/auxiliary/os/os_thread.h
> index a8b5d92..6eca2ca 100644
> --- a/src/gallium/auxiliary/os/os_thread.h
> +++ b/src/gallium/auxiliary/os/os_thread.h
> @@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
> assert(ret == thrd_busy);
> if (ret == thrd_success)
>mtx_unlock(mutex);
>  #endif
>  }
>
>  /* pipe_condvar
>   */
>  typedef cnd_t pipe_condvar;
>
I think we should we drop this typedef one as well. We could also
follow-up with pipe_tsd_* front ?
In either case, it might be worth checking with Jose/others to update
things on their end.

For the series:
Reviewed-by: Emil Velikov 

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


Re: [Mesa-dev] How about vk_features.txt?

2017-03-04 Thread Romain Failliot
Hi!

I'd like to know which information I should extract from this vk.xml file
so that we can track the progress of ANV and RADV Vulkan drivers.

Thanks!

-- 
Romain "Creak" Failliot
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/mesa: set result writemask based on ir type

2017-03-04 Thread Karol Herbst
thanks for the patch, works for me on that one trace as well

2017-03-04 20:05 GMT+01:00 Ilia Mirkin :
> On Sat, Mar 4, 2017 at 1:52 PM, Ilia Mirkin  wrote:
>> This prevents textureQueryLevels, which maps as LODQ, from ending up
>
> Erm, that should of course be textureQueryLod which maps to LODQ.
>
>> with a xyzw writemask, which is illegal.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100061
>> Signed-off-by: Ilia Mirkin 
>> Cc: mesa-sta...@lists.freedesktop.org
>> ---
>>
>> Untested beyond making sure that the shader in the above bug ends up with
>> a .xy writemask. I don't have access to a reasonable testing rig right now,
>> would be ideal if someone could give it a run through theirs...
>>
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
>> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> index af41bdb..63b681f 100644
>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> @@ -4165,6 +4165,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
>>  */
>> result_src = get_temp(ir->type);
>> result_dst = st_dst_reg(result_src);
>> +   result_dst.writemask = (1 << ir->type->vector_elements) - 1;
>>
>> switch (ir->op) {
>> case ir_tex:
>> --
>> 2.10.2
>>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V3] util/disk_cache: support caches for multiple architectures

2017-03-04 Thread Grazvydas Ignotas
On Sat, Mar 4, 2017 at 11:07 PM, Timothy Arceri  wrote:
> Previously we were deleting the entire cache if a user switched
> between 32 and 64 bit applications.
>
> V2: make the check more generic, it should now work with any
> platform we are likely to support.
>
> V3: Use suggestion from Emil to make even more generic/fix issue
> with __ILP32__ not being declared on gcc for regular 32-bit builds.

Now it works, launching steam (32bit) no longer wipes all cache from
64bit games, everything works as expected.
Tested-by: Grazvydas Ignotas 

Gražvydas
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 100060] wsi/wsi_common_wayland.c:25:41: fatal error: wayland-drm-client-protocol.h: No such file or directory

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100060

Emil Velikov  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Emil Velikov  ---
Should be fixed with

commit eaf4a106bdcf476078ef4f84c81329034a226650
Author: Emil Velikov 
Date:   Sat Mar 4 21:42:18 2017 +

automake: move wayland-drm prior to Vulkan

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] configure.ac: Allowing building without shader cache without zlib.

2017-03-04 Thread Emil Velikov
On 4 March 2017 at 22:43, Vinson Lee  wrote:
> On Sat, Mar 4, 2017 at 5:24 PM, Emil Velikov  wrote:
>> On 4 March 2017 at 22:13, Vinson Lee  wrote:
>>> Fixes: 85a9b1b562b6 ("util/disk_cache: compress individual cache entries")
>>> Signed-off-by: Vinson Lee 
>>> ---
>>>  configure.ac | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/configure.ac b/configure.ac
>>> index 943bc05adcd6..3526849b6dd2 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -786,7 +786,7 @@ dnl See if posix_memalign is available
>>>  AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
>>>
>>>  dnl Check for zlib
>>> -PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
>>> +PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED], [DEFINES="$DEFINES 
>>> -DENABLE_SHADER_CACHE"], [:])
>>>
>> Why - is it causing breakage or any system ?
>>
>> Afaict we really want to have this tested thoroughly and silently
>> disabling it is a very bad idea.
>>
>> -Emil
>
> Older distros have a zlib older than 1.2.8.

Tim I think you had something in mind about such cases, hehe ;-)

But seriously, seems like enterprise Linuxes are stuck with very old ones:
RHEL4 - 1.2.1
RHEL 5/6 - 1.2.3
SLES 10/11 - 1.2.3

Tim, I'll leave the rest to you - how/worth using third party package,
dropping to 1.2.3 or other ?
I'm leaning towards 1.2.3, unless there's some serious down sides with it.

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


[Mesa-dev] [PATCH 5/5] gallium/util: replace pipe_condvar_broadcast() with cnd_broadcast()

2017-03-04 Thread Timothy Arceri
pipe_condvar_broadcast() was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h  | 5 +
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +-
 src/gallium/auxiliary/util/u_queue.c  | 4 ++--
 src/gallium/drivers/llvmpipe/lp_fence.c   | 2 +-
 src/gallium/drivers/rbug/rbug_core.c  | 6 +++---
 5 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index a8b5d92..6eca2ca 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }
 
 /* pipe_condvar
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_broadcast(cond) \
-   cnd_broadcast(&(cond))
-
 
 /*
  * pipe_barrier
  */
 
 #if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || 
defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && !defined(PIPE_OS_ANDROID)
 
 typedef pthread_barrier_t pipe_barrier;
 
 static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
@@ -211,21 +208,21 @@ static inline void pipe_barrier_wait(pipe_barrier 
*barrier)
 
if (barrier->waiters < barrier->count) {
   uint64_t sequence = barrier->sequence;
 
   do {
  cnd_wait(>condvar, >mutex);
   } while (sequence == barrier->sequence);
} else {
   barrier->waiters = 0;
   barrier->sequence++;
-  pipe_condvar_broadcast(barrier->condvar);
+  cnd_broadcast(>condvar);
}
 
pipe_mutex_unlock(barrier->mutex);
 }
 
 
 #endif
 
 
 /*
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c 
b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index 541a6d9..cc42eea 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -239,21 +239,21 @@ pb_slab_buffer_map(struct pb_buffer *_buf,
 }
 
 
 static void
 pb_slab_buffer_unmap(struct pb_buffer *_buf)
 {
struct pb_slab_buffer *buf = pb_slab_buffer(_buf);
 
--buf->mapCount;
if (buf->mapCount == 0) 
-   pipe_condvar_broadcast(buf->event);
+   cnd_broadcast(>event);
 }
 
 
 static enum pipe_error 
 pb_slab_buffer_validate(struct pb_buffer *_buf, 
  struct pb_validate *vl,
  unsigned flags)
 {
struct pb_slab_buffer *buf = pb_slab_buffer(_buf);
return pb_validate(buf->slab->bo, vl, flags);
diff --git a/src/gallium/auxiliary/util/u_queue.c 
b/src/gallium/auxiliary/util/u_queue.c
index 3cef7d2..c84e0ad 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -89,21 +89,21 @@ remove_from_atexit_list(struct util_queue *queue)
 
 /
  * util_queue_fence
  */
 
 static void
 util_queue_fence_signal(struct util_queue_fence *fence)
 {
pipe_mutex_lock(fence->mutex);
fence->signalled = true;
-   pipe_condvar_broadcast(fence->cond);
+   cnd_broadcast(>cond);
pipe_mutex_unlock(fence->mutex);
 }
 
 void
 util_queue_fence_wait(struct util_queue_fence *fence)
 {
pipe_mutex_lock(fence->mutex);
while (!fence->signalled)
   cnd_wait(>cond, >mutex);
pipe_mutex_unlock(fence->mutex);
@@ -260,21 +260,21 @@ fail:
 }
 
 static void
 util_queue_killall_and_wait(struct util_queue *queue)
 {
unsigned i;
 
/* Signal all threads to terminate. */
pipe_mutex_lock(queue->lock);
queue->kill_threads = 1;
-   pipe_condvar_broadcast(queue->has_queued_cond);
+   cnd_broadcast(>has_queued_cond);
pipe_mutex_unlock(queue->lock);
 
for (i = 0; i < queue->num_threads; i++)
   pipe_thread_wait(queue->threads[i]);
queue->num_threads = 0;
 }
 
 void
 util_queue_destroy(struct util_queue *queue)
 {
diff --git a/src/gallium/drivers/llvmpipe/lp_fence.c 
b/src/gallium/drivers/llvmpipe/lp_fence.c
index 1a8e365..115589f 100644
--- a/src/gallium/drivers/llvmpipe/lp_fence.c
+++ b/src/gallium/drivers/llvmpipe/lp_fence.c
@@ -92,21 +92,21 @@ lp_fence_signal(struct lp_fence *fence)
 
fence->count++;
assert(fence->count <= fence->rank);
 
if (LP_DEBUG & DEBUG_FENCE)
   debug_printf("%s count=%u rank=%u\n", __FUNCTION__,
fence->count, fence->rank);
 
/* Wakeup all threads waiting on the mutex:
 */
-   pipe_condvar_broadcast(fence->signalled);
+   cnd_broadcast(>signalled);
 
pipe_mutex_unlock(fence->mutex);
 }
 
 boolean
 lp_fence_signalled(struct lp_fence *f)
 {
return f->count == f->rank;
 }
 
diff --git a/src/gallium/drivers/rbug/rbug_core.c 
b/src/gallium/drivers/rbug/rbug_core.c
index dedbc14..3bb781b 100644
--- a/src/gallium/drivers/rbug/rbug_core.c
+++ b/src/gallium/drivers/rbug/rbug_core.c
@@ -402,21 +402,21 @@ rbug_context_draw_step(struct rbug_rbug *tr_rbug, struct 
rbug_header *header, ui
 

[Mesa-dev] [PATCH 3/5] gallium/util: replace pipe_condvar_wait() with cnd_wait()

2017-03-04 Thread Timothy Arceri
pipe_condvar_wait() was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h | 7 ++-
 src/gallium/auxiliary/util/u_queue.c | 6 +++---
 src/gallium/auxiliary/util/u_ringbuffer.c| 4 ++--
 src/gallium/drivers/llvmpipe/lp_fence.c  | 2 +-
 src/gallium/drivers/rbug/rbug_context.c  | 2 +-
 src/gallium/state_trackers/nine/nine_queue.c | 4 ++--
 src/gallium/state_trackers/nine/nine_state.c | 2 +-
 7 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index e230d06..6895f4e 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }
 
 /* pipe_condvar
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_wait(cond, mutex) \
-   cnd_wait(&(cond), &(mutex))
-
 #define pipe_condvar_signal(cond) \
cnd_signal(&(cond))
 
 #define pipe_condvar_broadcast(cond) \
cnd_broadcast(&(cond))
 
 
 /*
  * pipe_barrier
  */
@@ -212,21 +209,21 @@ static inline void pipe_barrier_wait(pipe_barrier 
*barrier)
 {
pipe_mutex_lock(barrier->mutex);
 
assert(barrier->waiters < barrier->count);
barrier->waiters++;
 
if (barrier->waiters < barrier->count) {
   uint64_t sequence = barrier->sequence;
 
   do {
- pipe_condvar_wait(barrier->condvar, barrier->mutex);
+ cnd_wait(>condvar, >mutex);
   } while (sequence == barrier->sequence);
} else {
   barrier->waiters = 0;
   barrier->sequence++;
   pipe_condvar_broadcast(barrier->condvar);
}
 
pipe_mutex_unlock(barrier->mutex);
 }
 
@@ -270,21 +267,21 @@ pipe_semaphore_signal(pipe_semaphore *sema)
pipe_condvar_signal(sema->cond);
pipe_mutex_unlock(sema->mutex);
 }
 
 /** Wait for semaphore counter to be greater than zero */
 static inline void
 pipe_semaphore_wait(pipe_semaphore *sema)
 {
pipe_mutex_lock(sema->mutex);
while (sema->counter <= 0) {
-  pipe_condvar_wait(sema->cond, sema->mutex);
+  cnd_wait(>cond, >mutex);
}
sema->counter--;
pipe_mutex_unlock(sema->mutex);
 }
 
 
 
 /*
  * Thread-specific data.
  */
diff --git a/src/gallium/auxiliary/util/u_queue.c 
b/src/gallium/auxiliary/util/u_queue.c
index 87f0120..8fc2f3b 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -98,21 +98,21 @@ util_queue_fence_signal(struct util_queue_fence *fence)
fence->signalled = true;
pipe_condvar_broadcast(fence->cond);
pipe_mutex_unlock(fence->mutex);
 }
 
 void
 util_queue_fence_wait(struct util_queue_fence *fence)
 {
pipe_mutex_lock(fence->mutex);
while (!fence->signalled)
-  pipe_condvar_wait(fence->cond, fence->mutex);
+  cnd_wait(>cond, >mutex);
pipe_mutex_unlock(fence->mutex);
 }
 
 void
 util_queue_fence_init(struct util_queue_fence *fence)
 {
memset(fence, 0, sizeof(*fence));
pipe_mutex_init(fence->mutex);
cnd_init(>cond);
fence->signalled = true;
@@ -149,21 +149,21 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
}
 
while (1) {
   struct util_queue_job job;
 
   pipe_mutex_lock(queue->lock);
   assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs);
 
   /* wait if the queue is empty */
   while (!queue->kill_threads && queue->num_queued == 0)
- pipe_condvar_wait(queue->has_queued_cond, queue->lock);
+ cnd_wait(>has_queued_cond, >lock);
 
   if (queue->kill_threads) {
  pipe_mutex_unlock(queue->lock);
  break;
   }
 
   job = queue->jobs[queue->read_idx];
   memset(>jobs[queue->read_idx], 0, sizeof(struct util_queue_job));
   queue->read_idx = (queue->read_idx + 1) % queue->max_jobs;
 
@@ -298,21 +298,21 @@ util_queue_add_job(struct util_queue *queue,
struct util_queue_job *ptr;
 
assert(fence->signalled);
fence->signalled = false;
 
pipe_mutex_lock(queue->lock);
assert(queue->num_queued >= 0 && queue->num_queued <= queue->max_jobs);
 
/* if the queue is full, wait until there is space */
while (queue->num_queued == queue->max_jobs)
-  pipe_condvar_wait(queue->has_space_cond, queue->lock);
+  cnd_wait(>has_space_cond, >lock);
 
ptr = >jobs[queue->write_idx];
assert(ptr->job == NULL);
ptr->job = job;
ptr->fence = fence;
ptr->execute = execute;
ptr->cleanup = cleanup;
queue->write_idx = (queue->write_idx + 1) % queue->max_jobs;
 
queue->num_queued++;
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c 
b/src/gallium/auxiliary/util/u_ringbuffer.c
index 334be6a..adba9ea 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -78,21 +78,21 @@ void util_ringbuffer_enqueue( struct util_ringbuffer *ring,
 */

[Mesa-dev] [PATCH 4/5] gallium/util: replace pipe_condvar_signal() with cnd_signal()

2017-03-04 Thread Timothy Arceri
pipe_condvar_signal() was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h | 5 +
 src/gallium/auxiliary/util/u_queue.c | 4 ++--
 src/gallium/auxiliary/util/u_ringbuffer.c| 4 ++--
 src/gallium/state_trackers/nine/nine_queue.c | 4 ++--
 src/gallium/state_trackers/nine/nine_state.c | 4 ++--
 5 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index 6895f4e..a8b5d92 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }
 
 /* pipe_condvar
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_signal(cond) \
-   cnd_signal(&(cond))
-
 #define pipe_condvar_broadcast(cond) \
cnd_broadcast(&(cond))
 
 
 /*
  * pipe_barrier
  */
 
 #if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || 
defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && !defined(PIPE_OS_ANDROID)
 
@@ -257,21 +254,21 @@ pipe_semaphore_destroy(pipe_semaphore *sema)
pipe_mutex_destroy(sema->mutex);
cnd_destroy(>cond);
 }
 
 /** Signal/increment semaphore counter */
 static inline void
 pipe_semaphore_signal(pipe_semaphore *sema)
 {
pipe_mutex_lock(sema->mutex);
sema->counter++;
-   pipe_condvar_signal(sema->cond);
+   cnd_signal(>cond);
pipe_mutex_unlock(sema->mutex);
 }
 
 /** Wait for semaphore counter to be greater than zero */
 static inline void
 pipe_semaphore_wait(pipe_semaphore *sema)
 {
pipe_mutex_lock(sema->mutex);
while (sema->counter <= 0) {
   cnd_wait(>cond, >mutex);
diff --git a/src/gallium/auxiliary/util/u_queue.c 
b/src/gallium/auxiliary/util/u_queue.c
index 8fc2f3b..3cef7d2 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -161,21 +161,21 @@ static PIPE_THREAD_ROUTINE(util_queue_thread_func, input)
   if (queue->kill_threads) {
  pipe_mutex_unlock(queue->lock);
  break;
   }
 
   job = queue->jobs[queue->read_idx];
   memset(>jobs[queue->read_idx], 0, sizeof(struct util_queue_job));
   queue->read_idx = (queue->read_idx + 1) % queue->max_jobs;
 
   queue->num_queued--;
-  pipe_condvar_signal(queue->has_space_cond);
+  cnd_signal(>has_space_cond);
   pipe_mutex_unlock(queue->lock);
 
   if (job.job) {
  job.execute(job.job, thread_index);
  util_queue_fence_signal(job.fence);
  if (job.cleanup)
 job.cleanup(job.job, thread_index);
   }
}
 
@@ -309,21 +309,21 @@ util_queue_add_job(struct util_queue *queue,
 
ptr = >jobs[queue->write_idx];
assert(ptr->job == NULL);
ptr->job = job;
ptr->fence = fence;
ptr->execute = execute;
ptr->cleanup = cleanup;
queue->write_idx = (queue->write_idx + 1) % queue->max_jobs;
 
queue->num_queued++;
-   pipe_condvar_signal(queue->has_queued_cond);
+   cnd_signal(>has_queued_cond);
pipe_mutex_unlock(queue->lock);
 }
 
 int64_t
 util_queue_get_thread_time_nano(struct util_queue *queue, unsigned 
thread_index)
 {
/* Allow some flexibility by not raising an error. */
if (thread_index >= queue->num_threads)
   return 0;
 
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c 
b/src/gallium/auxiliary/util/u_ringbuffer.c
index adba9ea..a97236f 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -95,21 +95,21 @@ void util_ringbuffer_enqueue( struct util_ringbuffer *ring,
* typesystem a little - we're being passed a pointer to
* something, but probably not an array of packet structs:
*/
   ring->buf[ring->head] = packet[i];
   ring->head++;
   ring->head &= ring->mask;
}
 
/* Signal change:
 */
-   pipe_condvar_signal(ring->change);
+   cnd_signal(>change);
pipe_mutex_unlock(ring->mutex);
 }
 
 enum pipe_error util_ringbuffer_dequeue( struct util_ringbuffer *ring,
  struct util_packet *packet,
  unsigned max_dwords,
  boolean wait )
 {
const struct util_packet *ring_packet;
unsigned i;
@@ -147,14 +147,14 @@ enum pipe_error util_ringbuffer_dequeue( struct 
util_ringbuffer *ring,
 */
for (i = 0; i < ring_packet->dwords; i++) {
   packet[i] = ring->buf[ring->tail];
   ring->tail++;
   ring->tail &= ring->mask;
}
 
 out:
/* Signal change:
 */
-   pipe_condvar_signal(ring->change);
+   cnd_signal(>change);
pipe_mutex_unlock(ring->mutex);
return ret;
 }
diff --git a/src/gallium/state_trackers/nine/nine_queue.c 
b/src/gallium/state_trackers/nine/nine_queue.c
index fdfbdbb..b50b57b 100644
--- a/src/gallium/state_trackers/nine/nine_queue.c
+++ 

[Mesa-dev] [PATCH 2/5] gallium/util: replace pipe_condvar_destroy() with cnd_destroy()

2017-03-04 Thread Timothy Arceri
pipe_condvar_destroy() was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h  |  7 ++-
 src/gallium/auxiliary/util/u_queue.c  | 10 +-
 src/gallium/auxiliary/util/u_ringbuffer.c |  2 +-
 src/gallium/drivers/llvmpipe/lp_fence.c   |  2 +-
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index e1dc210..e230d06 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }
 
 /* pipe_condvar
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_destroy(cond) \
-   cnd_destroy(&(cond))
-
 #define pipe_condvar_wait(cond, mutex) \
cnd_wait(&(cond), &(mutex))
 
 #define pipe_condvar_signal(cond) \
cnd_signal(&(cond))
 
 #define pipe_condvar_broadcast(cond) \
cnd_broadcast(&(cond))
 
 
@@ -201,21 +198,21 @@ static inline void pipe_barrier_init(pipe_barrier 
*barrier, unsigned count)
barrier->waiters = 0;
barrier->sequence = 0;
pipe_mutex_init(barrier->mutex);
cnd_init(>condvar);
 }
 
 static inline void pipe_barrier_destroy(pipe_barrier *barrier)
 {
assert(barrier->waiters == 0);
pipe_mutex_destroy(barrier->mutex);
-   pipe_condvar_destroy(barrier->condvar);
+   cnd_destroy(>condvar);
 }
 
 static inline void pipe_barrier_wait(pipe_barrier *barrier)
 {
pipe_mutex_lock(barrier->mutex);
 
assert(barrier->waiters < barrier->count);
barrier->waiters++;
 
if (barrier->waiters < barrier->count) {
@@ -254,21 +251,21 @@ pipe_semaphore_init(pipe_semaphore *sema, int init_val)
 {
pipe_mutex_init(sema->mutex);
cnd_init(>cond);
sema->counter = init_val;
 }
 
 static inline void
 pipe_semaphore_destroy(pipe_semaphore *sema)
 {
pipe_mutex_destroy(sema->mutex);
-   pipe_condvar_destroy(sema->cond);
+   cnd_destroy(>cond);
 }
 
 /** Signal/increment semaphore counter */
 static inline void
 pipe_semaphore_signal(pipe_semaphore *sema)
 {
pipe_mutex_lock(sema->mutex);
sema->counter++;
pipe_condvar_signal(sema->cond);
pipe_mutex_unlock(sema->mutex);
diff --git a/src/gallium/auxiliary/util/u_queue.c 
b/src/gallium/auxiliary/util/u_queue.c
index dff5b15..87f0120 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -115,21 +115,21 @@ util_queue_fence_init(struct util_queue_fence *fence)
memset(fence, 0, sizeof(*fence));
pipe_mutex_init(fence->mutex);
cnd_init(>cond);
fence->signalled = true;
 }
 
 void
 util_queue_fence_destroy(struct util_queue_fence *fence)
 {
assert(fence->signalled);
-   pipe_condvar_destroy(fence->cond);
+   cnd_destroy(>cond);
pipe_mutex_destroy(fence->mutex);
 }
 
 /
  * util_queue implementation
  */
 
 struct thread_input {
struct util_queue *queue;
int thread_index;
@@ -242,22 +242,22 @@ util_queue_init(struct util_queue *queue,
   }
}
 
add_to_atexit_list(queue);
return true;
 
 fail:
FREE(queue->threads);
 
if (queue->jobs) {
-  pipe_condvar_destroy(queue->has_space_cond);
-  pipe_condvar_destroy(queue->has_queued_cond);
+  cnd_destroy(>has_space_cond);
+  cnd_destroy(>has_queued_cond);
   pipe_mutex_destroy(queue->lock);
   FREE(queue->jobs);
}
/* also util_queue_is_initialized can be used to check for success */
memset(queue, 0, sizeof(*queue));
return false;
 }
 
 static void
 util_queue_killall_and_wait(struct util_queue *queue)
@@ -274,22 +274,22 @@ util_queue_killall_and_wait(struct util_queue *queue)
   pipe_thread_wait(queue->threads[i]);
queue->num_threads = 0;
 }
 
 void
 util_queue_destroy(struct util_queue *queue)
 {
util_queue_killall_and_wait(queue);
remove_from_atexit_list(queue);
 
-   pipe_condvar_destroy(queue->has_space_cond);
-   pipe_condvar_destroy(queue->has_queued_cond);
+   cnd_destroy(>has_space_cond);
+   cnd_destroy(>has_queued_cond);
pipe_mutex_destroy(queue->lock);
FREE(queue->jobs);
FREE(queue->threads);
 }
 
 void
 util_queue_add_job(struct util_queue *queue,
void *job,
struct util_queue_fence *fence,
util_queue_execute_func execute,
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c 
b/src/gallium/auxiliary/util/u_ringbuffer.c
index e3be3ef..334be6a 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -40,21 +40,21 @@ struct util_ringbuffer *util_ringbuffer_create( unsigned 
dwords )
return ring;
 
 fail:
FREE(ring->buf);
FREE(ring);
return NULL;
 }
 
 void util_ringbuffer_destroy( struct util_ringbuffer *ring )
 {
-   pipe_condvar_destroy(ring->change);
+   cnd_destroy(>change);

[Mesa-dev] [PATCH 1/5] gallium/util: replace pipe_condvar_init() with cnd_init()

2017-03-04 Thread Timothy Arceri
pipe_condvar_init() was made unnecessary with fd33a6bcd7f12.
---
 src/gallium/auxiliary/os/os_thread.h  | 7 ++-
 src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +-
 src/gallium/auxiliary/util/u_queue.c  | 6 +++---
 src/gallium/auxiliary/util/u_ringbuffer.c | 2 +-
 src/gallium/drivers/llvmpipe/lp_fence.c   | 2 +-
 src/gallium/drivers/rbug/rbug_context.c   | 2 +-
 src/gallium/state_trackers/nine/nine_queue.c  | 4 ++--
 src/gallium/state_trackers/nine/nine_state.c  | 2 +-
 8 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_thread.h 
b/src/gallium/auxiliary/os/os_thread.h
index 0caf955..e1dc210 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -141,23 +141,20 @@ __pipe_mutex_assert_locked(pipe_mutex *mutex)
assert(ret == thrd_busy);
if (ret == thrd_success)
   mtx_unlock(mutex);
 #endif
 }
 
 /* pipe_condvar
  */
 typedef cnd_t pipe_condvar;
 
-#define pipe_condvar_init(cond)\
-   cnd_init(&(cond))
-
 #define pipe_condvar_destroy(cond) \
cnd_destroy(&(cond))
 
 #define pipe_condvar_wait(cond, mutex) \
cnd_wait(&(cond), &(mutex))
 
 #define pipe_condvar_signal(cond) \
cnd_signal(&(cond))
 
 #define pipe_condvar_broadcast(cond) \
@@ -197,21 +194,21 @@ typedef struct {
pipe_mutex mutex;
pipe_condvar condvar;
 } pipe_barrier;
 
 static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
 {
barrier->count = count;
barrier->waiters = 0;
barrier->sequence = 0;
pipe_mutex_init(barrier->mutex);
-   pipe_condvar_init(barrier->condvar);
+   cnd_init(>condvar);
 }
 
 static inline void pipe_barrier_destroy(pipe_barrier *barrier)
 {
assert(barrier->waiters == 0);
pipe_mutex_destroy(barrier->mutex);
pipe_condvar_destroy(barrier->condvar);
 }
 
 static inline void pipe_barrier_wait(pipe_barrier *barrier)
@@ -249,21 +246,21 @@ typedef struct
pipe_mutex mutex;
pipe_condvar cond;
int counter;
 } pipe_semaphore;
 
 
 static inline void
 pipe_semaphore_init(pipe_semaphore *sema, int init_val)
 {
pipe_mutex_init(sema->mutex);
-   pipe_condvar_init(sema->cond);
+   cnd_init(>cond);
sema->counter = init_val;
 }
 
 static inline void
 pipe_semaphore_destroy(pipe_semaphore *sema)
 {
pipe_mutex_destroy(sema->mutex);
pipe_condvar_destroy(sema->cond);
 }
 
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c 
b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index fdbcf9e..541a6d9 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -343,21 +343,21 @@ pb_slab_create(struct pb_slab_manager *mgr)
buf = slab->buffers;
for (i=0; i < numBuffers; ++i) {
   pipe_reference_init(>base.reference, 0);
   buf->base.size = mgr->bufSize;
   buf->base.alignment = 0;
   buf->base.usage = 0;
   buf->base.vtbl = _slab_buffer_vtbl;
   buf->slab = slab;
   buf->start = i* mgr->bufSize;
   buf->mapCount = 0;
-  pipe_condvar_init(buf->event);
+  cnd_init(>event);
   LIST_ADDTAIL(>head, >freeBuffers);
   slab->numFree++;
   buf++;
}
 
/* Add this slab to the list of partial slabs */
LIST_ADDTAIL(>head, >slabs);
 
return PIPE_OK;
 
diff --git a/src/gallium/auxiliary/util/u_queue.c 
b/src/gallium/auxiliary/util/u_queue.c
index 8dd4cb3..dff5b15 100644
--- a/src/gallium/auxiliary/util/u_queue.c
+++ b/src/gallium/auxiliary/util/u_queue.c
@@ -107,21 +107,21 @@ util_queue_fence_wait(struct util_queue_fence *fence)
while (!fence->signalled)
   pipe_condvar_wait(fence->cond, fence->mutex);
pipe_mutex_unlock(fence->mutex);
 }
 
 void
 util_queue_fence_init(struct util_queue_fence *fence)
 {
memset(fence, 0, sizeof(*fence));
pipe_mutex_init(fence->mutex);
-   pipe_condvar_init(fence->cond);
+   cnd_init(>cond);
fence->signalled = true;
 }
 
 void
 util_queue_fence_destroy(struct util_queue_fence *fence)
 {
assert(fence->signalled);
pipe_condvar_destroy(fence->cond);
pipe_mutex_destroy(fence->mutex);
 }
@@ -206,22 +206,22 @@ util_queue_init(struct util_queue *queue,
queue->max_jobs = max_jobs;
 
queue->jobs = (struct util_queue_job*)
  CALLOC(max_jobs, sizeof(struct util_queue_job));
if (!queue->jobs)
   goto fail;
 
pipe_mutex_init(queue->lock);
 
queue->num_queued = 0;
-   pipe_condvar_init(queue->has_queued_cond);
-   pipe_condvar_init(queue->has_space_cond);
+   cnd_init(>has_queued_cond);
+   cnd_init(>has_space_cond);
 
queue->threads = (pipe_thread*)CALLOC(num_threads, sizeof(pipe_thread));
if (!queue->threads)
   goto fail;
 
/* start threads */
for (i = 0; i < num_threads; i++) {
   struct thread_input *input = MALLOC_STRUCT(thread_input);
   input->queue = queue;
   input->thread_index = i;
diff --git 

[Mesa-dev] [Bug 100049] "ralloc: Make sure ralloc() allocations match malloc()'s alignment." causes seg fault in 32bit build

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100049

Dieter Nützel  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #3 from Dieter Nützel  ---
We only close tickets after patch is commited to Mesa git.

Greetings,
Dieter

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] configure.ac: Allowing building without shader cache without zlib.

2017-03-04 Thread Vinson Lee
On Sat, Mar 4, 2017 at 5:24 PM, Emil Velikov  wrote:
> On 4 March 2017 at 22:13, Vinson Lee  wrote:
>> Fixes: 85a9b1b562b6 ("util/disk_cache: compress individual cache entries")
>> Signed-off-by: Vinson Lee 
>> ---
>>  configure.ac | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 943bc05adcd6..3526849b6dd2 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -786,7 +786,7 @@ dnl See if posix_memalign is available
>>  AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
>>
>>  dnl Check for zlib
>> -PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
>> +PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED], [DEFINES="$DEFINES 
>> -DENABLE_SHADER_CACHE"], [:])
>>
> Why - is it causing breakage or any system ?
>
> Afaict we really want to have this tested thoroughly and silently
> disabling it is a very bad idea.
>
> -Emil

Older distros have a zlib older than 1.2.8.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] configure.ac: Allowing building without shader cache without zlib.

2017-03-04 Thread Emil Velikov
On 4 March 2017 at 22:13, Vinson Lee  wrote:
> Fixes: 85a9b1b562b6 ("util/disk_cache: compress individual cache entries")
> Signed-off-by: Vinson Lee 
> ---
>  configure.ac | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 943bc05adcd6..3526849b6dd2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -786,7 +786,7 @@ dnl See if posix_memalign is available
>  AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
>
>  dnl Check for zlib
> -PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
> +PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED], [DEFINES="$DEFINES 
> -DENABLE_SHADER_CACHE"], [:])
>
Why - is it causing breakage or any system ?

Afaict we really want to have this tested thoroughly and silently
disabling it is a very bad idea.

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


Re: [Mesa-dev] [PATCH] loader: Move non-error message to debug level

2017-03-04 Thread Emil Velikov
On 4 March 2017 at 22:07, Fabio Estevam  wrote:
> Currently when running mesa on imx6 the following loader warnings
> are seen:
>
> # kmscube -D /dev/dri/card1
> MESA-LOADER: device is not located on the PCI bus
> MESA-LOADER: device is not located on the PCI bus
> MESA-LOADER: device is not located on the PCI bus
> Using display 0x1920948 with EGL version 1.4
>
> As this is not an error message, change it to debug level in
> order to have a cleaner log output.
>
> Signed-off-by: Fabio Estevam 
> ---
>  src/loader/loader.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/loader/loader.c b/src/loader/loader.c
> index 3b28a0e..9b4752d 100644
> --- a/src/loader/loader.c
> +++ b/src/loader/loader.c
> @@ -282,7 +282,7 @@ drm_get_pci_id_for_fd(int fd, int *vendor_id, int 
> *chip_id)
>   ret = 1;
>}
>else {
> - log_(_LOADER_WARNING, "MESA-LOADER: device is not located on the 
> PCI bus\n");
> + log_(_LOADER_DEBUG, "MESA-LOADER: device is not located on the PCI 
> bus\n");
Right, too much copy/pasta, thanks.
Reviewed-by: Emil Velikov 

Barring any objections, I'll push it in a couple of days.

Hmm we really want some of the others to become FATAL. Then again
things are still quite icky in there, so I'd bother as we get to
removing moar code ;-)

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


[Mesa-dev] [PATCH] configure.ac: Allowing building without shader cache without zlib.

2017-03-04 Thread Vinson Lee
Fixes: 85a9b1b562b6 ("util/disk_cache: compress individual cache entries")
Signed-off-by: Vinson Lee 
---
 configure.ac | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 943bc05adcd6..3526849b6dd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -786,7 +786,7 @@ dnl See if posix_memalign is available
 AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
 
 dnl Check for zlib
-PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED])
+PKG_CHECK_MODULES([ZLIB], [zlib >= $ZLIB_REQUIRED], [DEFINES="$DEFINES 
-DENABLE_SHADER_CACHE"], [:])
 
 dnl Check for pthreads
 AX_PTHREAD
@@ -1807,7 +1807,6 @@ if test -n "$with_vulkan_drivers"; then
 fi
 
 
-DEFINES="$DEFINES -DENABLE_SHADER_CACHE"
 AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS")
 AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_glx" = xxlib -o \
   "x$enable_osmesa" = xyes -o \
-- 
2.12.0

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


[Mesa-dev] [PATCH] loader: Move non-error message to debug level

2017-03-04 Thread Fabio Estevam
Currently when running mesa on imx6 the following loader warnings
are seen:

# kmscube -D /dev/dri/card1
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
MESA-LOADER: device is not located on the PCI bus
Using display 0x1920948 with EGL version 1.4

As this is not an error message, change it to debug level in
order to have a cleaner log output.

Signed-off-by: Fabio Estevam 
---
 src/loader/loader.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/loader/loader.c b/src/loader/loader.c
index 3b28a0e..9b4752d 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -282,7 +282,7 @@ drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
  ret = 1;
   }
   else {
- log_(_LOADER_WARNING, "MESA-LOADER: device is not located on the PCI 
bus\n");
+ log_(_LOADER_DEBUG, "MESA-LOADER: device is not located on the PCI 
bus\n");
  ret = 0;
   }
   drmFreeDevice();
-- 
2.7.4

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


Re: [Mesa-dev] [PATCH] android: fix libz dynamic library dependencies

2017-03-04 Thread Emil Velikov
On 4 March 2017 at 21:11, Mauro Rossi  wrote:
> Fixes a series of libz related building errors:
>
> target SharedLib: gallium_dri_32
> (out/target/prod...SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so)
> external/elfutils/libelf/elf_compress.c:117: error: undefined reference to 
> 'deflateInit_'
> ...
> external/elfutils/libelf/elf_compress.c:244: error: undefined reference to 
> 'inflateEnd'
> clang++: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Fixes: 85a9b1b "util/disk_cache: compress individual cache entries"
Eh, I almost figured it out ... pushed to master.

Unrelated: where do we use the "host" libmesa_util ? Can we add a note
in src/util/Android.mk (since it's not obvious) or just remove the
hunk if it's not used.

Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] automake: move wayland-drm prior to Vulkan

2017-03-04 Thread Emil Velikov
From: Emil Velikov 

Earlier commit was picked from a larger series, but did not consider
that it removed the vulkan <> wayland-drm interdependency.

Rather than reverting everything, temporarily move wayland-drm further
up to resolve the issue. Since it [wayland-drm] does not have any
in-mesa dependencies that's perfectly safe.

Cc: Vedran Miletić 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100060
Fixes: e135ce6f088 ("vulkan: Build common Vulkan code earlier")
Signed-off-by: Emil Velikov 
---
Vedran, can you please give this a test ?
---
 src/Makefile.am | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index cab68b72d6..25b9253fc3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -75,6 +75,11 @@ endif
 # include only conditionally ?
 SUBDIRS += compiler
 
+## Optionally required by GBM, EGL and Vulkan
+if HAVE_PLATFORM_WAYLAND
+SUBDIRS += egl/wayland/wayland-drm
+endif
+
 if HAVE_VULKAN_COMMON
 SUBDIRS += vulkan
 endif
@@ -98,11 +103,6 @@ if HAVE_DRI_GLX
 SUBDIRS += glx
 endif
 
-## Optionally required by GBM and EGL
-if HAVE_PLATFORM_WAYLAND
-SUBDIRS += egl/wayland/wayland-drm
-endif
-
 ## Optionally required by EGL (aka PLATFORM_GBM)
 if HAVE_GBM
 SUBDIRS += gbm
-- 
2.11.1

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


[Mesa-dev] [PATCH] android: fix libz dynamic library dependencies

2017-03-04 Thread Mauro Rossi
Fixes a series of libz related building errors:

target SharedLib: gallium_dri_32
(out/target/prod...SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so)
external/elfutils/libelf/elf_compress.c:117: error: undefined reference to 
'deflateInit_'
...
external/elfutils/libelf/elf_compress.c:244: error: undefined reference to 
'inflateEnd'
clang++: error: linker command failed with exit code 1 (use -v to see
invocation)

Fixes: 85a9b1b "util/disk_cache: compress individual cache entries"
---
 Android.common.mk   | 2 ++
 src/util/Android.mk | 4 
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Android.common.mk b/Android.common.mk
index c27a77e..4b90fb9 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -128,3 +128,5 @@ endif
 
 # Quiet down the build system and remove any .h files from the sources
 LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
+
+LOCAL_SHARED_LIBRARIES += libz
diff --git a/src/util/Android.mk b/src/util/Android.mk
index a139e68..a39185a 100644
--- a/src/util/Android.mk
+++ b/src/util/Android.mk
@@ -53,8 +53,6 @@ $(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = 
$(PRIVATE_PYTHON) $^ > $@
 $(LOCAL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py
$(transform-generated-source)
 
-LOCAL_SHARED_LIBRARIES := libz
-
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
@@ -90,7 +88,5 @@ $(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = 
$(PRIVATE_PYTHON) $^ > $@
 $(LOCAL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py
$(transform-generated-source)
 
-LOCAL_SHARED_LIBRARIES := libz
-
 include $(MESA_COMMON_MK)
 include $(BUILD_HOST_STATIC_LIBRARY)
-- 
2.10.2

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


[Mesa-dev] [PATCH V3] util/disk_cache: support caches for multiple architectures

2017-03-04 Thread Timothy Arceri
Previously we were deleting the entire cache if a user switched
between 32 and 64 bit applications.

V2: make the check more generic, it should now work with any
platform we are likely to support.

V3: Use suggestion from Emil to make even more generic/fix issue
with __ILP32__ not being declared on gcc for regular 32-bit builds.
---
 src/util/disk_cache.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index 3abdec4..7543b0d 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -67,20 +67,37 @@ struct disk_cache {
/* Pointer to total size of all objects in cache (within index_mmap) */
uint64_t *size;
 
/* Pointer to stored keys, (within index_mmap). */
uint8_t *stored_keys;
 
/* Maximum size of all cached objects (in bytes). */
uint64_t max_size;
 };
 
+static const char *
+get_arch_bitness_str(void)
+{
+if (sizeof(void *) == 4)
+#ifdef __ILP32__
+return "ilp-32";
+#else
+return "32";
+#endif
+if (sizeof(void *) == 8)
+return "64";
+
+/* paranoia check which will be dropped by the optimiser */
+assert(!"unknown_arch");
+return "unknown_arch";
+}
+
 /* Create a directory named 'path' if it does not already exist.
  *
  * Returns: 0 if path already exists as a directory or if created.
  * -1 in all other cases.
  */
 static int
 mkdir_if_needed(char *path)
 {
struct stat sb;
 
@@ -170,20 +187,29 @@ remove_old_cache_directories(void *mem_ctx, char *path, 
const char *timestamp)
 }
 
 static char *
 create_mesa_cache_dir(void *mem_ctx, char *path, const char *timestamp,
   const char *gpu_name)
 {
char *new_path = concatenate_and_mkdir(mem_ctx, path, "mesa");
if (new_path == NULL)
   return NULL;
 
+   /* Create a parent architecture directory so that we don't remove cache
+* files for other architectures. In theory we could share the cache
+* between architectures but we have no way of knowing if they were created
+* by a compatible Mesa version.
+*/
+   new_path = concatenate_and_mkdir(mem_ctx, new_path, get_arch_bitness_str());
+   if (new_path == NULL)
+  return NULL;
+
/* Remove cache directories for old Mesa versions */
remove_old_cache_directories(mem_ctx, new_path, timestamp);
 
new_path = concatenate_and_mkdir(mem_ctx, new_path, timestamp);
if (new_path == NULL)
   return NULL;
 
new_path = concatenate_and_mkdir(mem_ctx, new_path, gpu_name);
if (new_path == NULL)
   return NULL;
-- 
2.9.3

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


Re: [Mesa-dev] [RFC] anv: Use on-the-fly surface states for dynamic buffer descriptors

2017-03-04 Thread Kristian H. Kristensen
Jason Ekstrand  writes:

> We have a performance problem with dynamic buffer descriptors.  Because
> we are currently implementing them by pushing an offset into the shader
> and adding that offset onto the already existing offset for the UBO/SSBO
> operation, all UBO/SSBO operations on dynamic descriptors are indirect.
> The back-end compiler implements indirect pull constant loads using what
> basically amounts to a texelFetch instruction.  For pull constant loads
> with constant offsets, however, we use an oword block read message which
> goes through the constant cache and reads a whole cache line at a time.
> Because of these two things, direct pull constant loads are much faster
> than indirect pull constant loads.  Because all loads from dynamically
> bound buffers are indirect, the user takes a substantial performance
> penalty when using this "performance" feature.
>
> There are two potential solutions I have seen for this problem.  The
> alternate solution is to continue pushing offsets into the shader but
> wire things up in the back-end compiler so that we use the oword block
> read messages anyway.  The only reason we can do this because we know a
> priori that the dynamic offsets are uniform and 16-byte aligned.
> Unfortunately, thanks to the 16-byte alignment requirement of the oword
> messages, we can't do some general "if the indirect offset is uniform,
> use an oword message" sort of thing.
>
> This solution, however, is recommended for a few of reasons:
>
>  1. Surface states are relatively cheap.  We've been using on-the-fly
> surface state setup for some time in GL and it works well.  Also,
> dynamic offsets with on-the-fly surface state should still be
> cheaper than allocating new descriptor sets every time you want to
> change a buffer offset which is really the only requirement of the
> dynamic offsets feature.
>
>  2. This requires substantially less compiler plumbing.  Not only can we
> delete the entire apply_dynamic_offsets pass but we can also avoid
> having to add architecture for passing dynamic offsets to the back-
> end compiler in such a way that it can continue using oword messages.
>
>  3. We get robust buffer access range-checking for free.  Because the
> offset and range are baked into the surface state, we no longer need
> to pass ranges around and do bounds-checking in the shader.
>
>  4. Once we finally get UBO pushing implemented, it will be much easier
> to handle pushing chunks of dynamic descriptors if the compiler
> remains blissfully unaware of dynamic descriptors.
>
> This commit improves performance of The Talos Principle on ULTRA
> settings by around 50% and brings it nicely into line with OpenGL
> performance.

Does the uniform analysis pass and the oword read result in a similar
improvement? I think both approaches are fine, but you might want to
keep the uniform pass around - there's a lot of URB reads and writes in
GS/HS/DS that are dynamically uniform but end up using per-slot offsets
unconditionally.

Kristian

> Cc: Kristian Høgsberg 
> ---
>  src/intel/vulkan/Makefile.sources|   1 -
>  src/intel/vulkan/anv_cmd_buffer.c|  47 +++
>  src/intel/vulkan/anv_descriptor_set.c|  62 
>  src/intel/vulkan/anv_nir_apply_dynamic_offsets.c | 172 
> ---
>  src/intel/vulkan/anv_pipeline.c  |   6 -
>  src/intel/vulkan/anv_private.h   |  13 +-
>  src/intel/vulkan/genX_cmd_buffer.c   |  30 +++-
>  7 files changed, 86 insertions(+), 245 deletions(-)
>  delete mode 100644 src/intel/vulkan/anv_nir_apply_dynamic_offsets.c
>
> diff --git a/src/intel/vulkan/Makefile.sources 
> b/src/intel/vulkan/Makefile.sources
> index fd149b2..24e2225 100644
> --- a/src/intel/vulkan/Makefile.sources
> +++ b/src/intel/vulkan/Makefile.sources
> @@ -32,7 +32,6 @@ VULKAN_FILES := \
>   anv_image.c \
>   anv_intel.c \
>   anv_nir.h \
> - anv_nir_apply_dynamic_offsets.c \
>   anv_nir_apply_pipeline_layout.c \
>   anv_nir_lower_input_attachments.c \
>   anv_nir_lower_push_constants.c \
> diff --git a/src/intel/vulkan/anv_cmd_buffer.c 
> b/src/intel/vulkan/anv_cmd_buffer.c
> index cab1dd7..a6ad48a 100644
> --- a/src/intel/vulkan/anv_cmd_buffer.c
> +++ b/src/intel/vulkan/anv_cmd_buffer.c
> @@ -507,42 +507,31 @@ void anv_CmdBindDescriptorSets(
>  
> assert(firstSet + descriptorSetCount < MAX_SETS);
>  
> +   uint32_t dynamic_slot = 0;
> for (uint32_t i = 0; i < descriptorSetCount; i++) {
>ANV_FROM_HANDLE(anv_descriptor_set, set, pDescriptorSets[i]);
>set_layout = layout->set[firstSet + i].layout;
>  
> -  if (cmd_buffer->state.descriptors[firstSet + i] != set) {
> - cmd_buffer->state.descriptors[firstSet + i] = set;
> - cmd_buffer->state.descriptors_dirty |= set_layout->shader_stages;
> -  }
> +  

Re: [Mesa-dev] [PATCH] st/glsl_to_tgsi: Translate float ir_unop_neg into float MOV with modifier.

2017-03-04 Thread Ilia Mirkin
Also, how is this happening in the first place? For example, we have:

   case ir_unop_bitcast_f2i:
   case ir_unop_bitcast_f2u:
  /* Make sure we don't propagate the negate modifier to integer opcodes. */
  if (op[0].negate || op[0].abs)
 emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
  else
 result_src = op[0];

Oh, but it's going directly into a ir_triop_csel, which is missing
this logic. It should be added there instead, IMHO. OTOH, the same
issue will hit in emit_block_mov() if you do. Would love to hear some
other opinions... Marek, Brian, Roland?

  -ilia


On Sat, Mar 4, 2017 at 2:24 PM, Ilia Mirkin  wrote:
> Hmmm... I wonder if this should only be done for the native_integers
> case. I'm concerned that this will cause perf regressions on weaker hw
> like nv30 and r300, as the neg will no longer be inserted as a
> modifier into the next instruction. Any opinion on this?
>
> On Sat, Mar 4, 2017 at 2:16 PM, Francisco Jerez  wrote:
>> Otherwise result_src may be provided to an integer instruction whose
>> negate modifier has different semantics.  Example is UCMP as in the
>> bug linked below, where an unrelated change in the GLSL built-in
>> lowering code for atan2 (e9ffd12827ac11a2d2002a42fa8eb1df847153ba)
>> caused the generation of floating-point ir_unop_neg instructions
>> followed by ir_triop_csel, which is lowered into UCMP on back-ends
>> with native integer support.
>>
>> Fixes a regression of piglit glsl-fs-tan-1 on softpipe introduced by
>> the above-mentioned glsl front-end commit.  Even though the commit
>> that triggered the regression doesn't seem to have made it to any
>> stable branches yet, this seems worth back-porting since I don't see
>> any reason why the bug couldn't have been reproduced before that
>> point.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817
>> Tested-by: Vinson Lee 
>> Cc: mesa-sta...@lists.freedesktop.org
>> ---
>>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
>> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> index af41bdb..6bf3c89 100644
>> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
>> @@ -1633,7 +1633,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* 
>> ir, st_src_reg *op)
>>   emit_asm(ir, TGSI_OPCODE_DNEG, result_dst, op[0]);
>>else {
>>   op[0].negate = ~op[0].negate;
>> - result_src = op[0];
>> + emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
>>}
>>break;
>> case ir_unop_subroutine_to_int:
>> --
>> 2.10.2
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] st/glsl_to_tgsi: Translate float ir_unop_neg into float MOV with modifier.

2017-03-04 Thread Ilia Mirkin
Hmmm... I wonder if this should only be done for the native_integers
case. I'm concerned that this will cause perf regressions on weaker hw
like nv30 and r300, as the neg will no longer be inserted as a
modifier into the next instruction. Any opinion on this?

On Sat, Mar 4, 2017 at 2:16 PM, Francisco Jerez  wrote:
> Otherwise result_src may be provided to an integer instruction whose
> negate modifier has different semantics.  Example is UCMP as in the
> bug linked below, where an unrelated change in the GLSL built-in
> lowering code for atan2 (e9ffd12827ac11a2d2002a42fa8eb1df847153ba)
> caused the generation of floating-point ir_unop_neg instructions
> followed by ir_triop_csel, which is lowered into UCMP on back-ends
> with native integer support.
>
> Fixes a regression of piglit glsl-fs-tan-1 on softpipe introduced by
> the above-mentioned glsl front-end commit.  Even though the commit
> that triggered the regression doesn't seem to have made it to any
> stable branches yet, this seems worth back-porting since I don't see
> any reason why the bug couldn't have been reproduced before that
> point.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817
> Tested-by: Vinson Lee 
> Cc: mesa-sta...@lists.freedesktop.org
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index af41bdb..6bf3c89 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -1633,7 +1633,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* 
> ir, st_src_reg *op)
>   emit_asm(ir, TGSI_OPCODE_DNEG, result_dst, op[0]);
>else {
>   op[0].negate = ~op[0].negate;
> - result_src = op[0];
> + emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
>}
>break;
> case ir_unop_subroutine_to_int:
> --
> 2.10.2
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] st/glsl_to_tgsi: Translate float ir_unop_neg into float MOV with modifier.

2017-03-04 Thread Francisco Jerez
Otherwise result_src may be provided to an integer instruction whose
negate modifier has different semantics.  Example is UCMP as in the
bug linked below, where an unrelated change in the GLSL built-in
lowering code for atan2 (e9ffd12827ac11a2d2002a42fa8eb1df847153ba)
caused the generation of floating-point ir_unop_neg instructions
followed by ir_triop_csel, which is lowered into UCMP on back-ends
with native integer support.

Fixes a regression of piglit glsl-fs-tan-1 on softpipe introduced by
the above-mentioned glsl front-end commit.  Even though the commit
that triggered the regression doesn't seem to have made it to any
stable branches yet, this seems worth back-porting since I don't see
any reason why the bug couldn't have been reproduced before that
point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99817
Tested-by: Vinson Lee 
Cc: mesa-sta...@lists.freedesktop.org
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index af41bdb..6bf3c89 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1633,7 +1633,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, 
st_src_reg *op)
  emit_asm(ir, TGSI_OPCODE_DNEG, result_dst, op[0]);
   else {
  op[0].negate = ~op[0].negate;
- result_src = op[0];
+ emit_asm(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
   }
   break;
case ir_unop_subroutine_to_int:
-- 
2.10.2

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


[Mesa-dev] [RFC] anv: Use on-the-fly surface states for dynamic buffer descriptors

2017-03-04 Thread Jason Ekstrand
We have a performance problem with dynamic buffer descriptors.  Because
we are currently implementing them by pushing an offset into the shader
and adding that offset onto the already existing offset for the UBO/SSBO
operation, all UBO/SSBO operations on dynamic descriptors are indirect.
The back-end compiler implements indirect pull constant loads using what
basically amounts to a texelFetch instruction.  For pull constant loads
with constant offsets, however, we use an oword block read message which
goes through the constant cache and reads a whole cache line at a time.
Because of these two things, direct pull constant loads are much faster
than indirect pull constant loads.  Because all loads from dynamically
bound buffers are indirect, the user takes a substantial performance
penalty when using this "performance" feature.

There are two potential solutions I have seen for this problem.  The
alternate solution is to continue pushing offsets into the shader but
wire things up in the back-end compiler so that we use the oword block
read messages anyway.  The only reason we can do this because we know a
priori that the dynamic offsets are uniform and 16-byte aligned.
Unfortunately, thanks to the 16-byte alignment requirement of the oword
messages, we can't do some general "if the indirect offset is uniform,
use an oword message" sort of thing.

This solution, however, is recommended for a few of reasons:

 1. Surface states are relatively cheap.  We've been using on-the-fly
surface state setup for some time in GL and it works well.  Also,
dynamic offsets with on-the-fly surface state should still be
cheaper than allocating new descriptor sets every time you want to
change a buffer offset which is really the only requirement of the
dynamic offsets feature.

 2. This requires substantially less compiler plumbing.  Not only can we
delete the entire apply_dynamic_offsets pass but we can also avoid
having to add architecture for passing dynamic offsets to the back-
end compiler in such a way that it can continue using oword messages.

 3. We get robust buffer access range-checking for free.  Because the
offset and range are baked into the surface state, we no longer need
to pass ranges around and do bounds-checking in the shader.

 4. Once we finally get UBO pushing implemented, it will be much easier
to handle pushing chunks of dynamic descriptors if the compiler
remains blissfully unaware of dynamic descriptors.

This commit improves performance of The Talos Principle on ULTRA
settings by around 50% and brings it nicely into line with OpenGL
performance.

Cc: Kristian Høgsberg 
---
 src/intel/vulkan/Makefile.sources|   1 -
 src/intel/vulkan/anv_cmd_buffer.c|  47 +++
 src/intel/vulkan/anv_descriptor_set.c|  62 
 src/intel/vulkan/anv_nir_apply_dynamic_offsets.c | 172 ---
 src/intel/vulkan/anv_pipeline.c  |   6 -
 src/intel/vulkan/anv_private.h   |  13 +-
 src/intel/vulkan/genX_cmd_buffer.c   |  30 +++-
 7 files changed, 86 insertions(+), 245 deletions(-)
 delete mode 100644 src/intel/vulkan/anv_nir_apply_dynamic_offsets.c

diff --git a/src/intel/vulkan/Makefile.sources 
b/src/intel/vulkan/Makefile.sources
index fd149b2..24e2225 100644
--- a/src/intel/vulkan/Makefile.sources
+++ b/src/intel/vulkan/Makefile.sources
@@ -32,7 +32,6 @@ VULKAN_FILES := \
anv_image.c \
anv_intel.c \
anv_nir.h \
-   anv_nir_apply_dynamic_offsets.c \
anv_nir_apply_pipeline_layout.c \
anv_nir_lower_input_attachments.c \
anv_nir_lower_push_constants.c \
diff --git a/src/intel/vulkan/anv_cmd_buffer.c 
b/src/intel/vulkan/anv_cmd_buffer.c
index cab1dd7..a6ad48a 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -507,42 +507,31 @@ void anv_CmdBindDescriptorSets(
 
assert(firstSet + descriptorSetCount < MAX_SETS);
 
+   uint32_t dynamic_slot = 0;
for (uint32_t i = 0; i < descriptorSetCount; i++) {
   ANV_FROM_HANDLE(anv_descriptor_set, set, pDescriptorSets[i]);
   set_layout = layout->set[firstSet + i].layout;
 
-  if (cmd_buffer->state.descriptors[firstSet + i] != set) {
- cmd_buffer->state.descriptors[firstSet + i] = set;
- cmd_buffer->state.descriptors_dirty |= set_layout->shader_stages;
-  }
+  cmd_buffer->state.descriptors[firstSet + i] = set;
 
   if (set_layout->dynamic_offset_count > 0) {
- anv_foreach_stage(s, set_layout->shader_stages) {
-anv_cmd_buffer_ensure_push_constant_field(cmd_buffer, s, dynamic);
-
-struct anv_push_constants *push =
-   cmd_buffer->state.push_constants[s];
-
-unsigned d = layout->set[firstSet + i].dynamic_offset_start;
-const uint32_t *offsets = pDynamicOffsets;
-struct anv_descriptor *desc = 

[Mesa-dev] [PATCH] anv: Accurately advertise dynamic descriptor limits

2017-03-04 Thread Jason Ekstrand
Cc: "17.0 13.0" 
---
 src/intel/vulkan/anv_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index fbcbd40..3fc51ac 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -565,9 +565,9 @@ void anv_GetPhysicalDeviceProperties(
   .maxPerStageResources = 128,
   .maxDescriptorSetSamplers = 256,
   .maxDescriptorSetUniformBuffers   = 256,
-  .maxDescriptorSetUniformBuffersDynamic= 256,
+  .maxDescriptorSetUniformBuffersDynamic= MAX_DYNAMIC_BUFFERS / 2,
   .maxDescriptorSetStorageBuffers   = 256,
-  .maxDescriptorSetStorageBuffersDynamic= 256,
+  .maxDescriptorSetStorageBuffersDynamic= MAX_DYNAMIC_BUFFERS / 2,
   .maxDescriptorSetSampledImages= 256,
   .maxDescriptorSetStorageImages= 256,
   .maxDescriptorSetInputAttachments = 256,
-- 
2.5.0.400.gff86faf

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


Re: [Mesa-dev] [PATCH] st/mesa: set result writemask based on ir type

2017-03-04 Thread Ilia Mirkin
On Sat, Mar 4, 2017 at 1:52 PM, Ilia Mirkin  wrote:
> This prevents textureQueryLevels, which maps as LODQ, from ending up

Erm, that should of course be textureQueryLod which maps to LODQ.

> with a xyzw writemask, which is illegal.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100061
> Signed-off-by: Ilia Mirkin 
> Cc: mesa-sta...@lists.freedesktop.org
> ---
>
> Untested beyond making sure that the shader in the above bug ends up with
> a .xy writemask. I don't have access to a reasonable testing rig right now,
> would be ideal if someone could give it a run through theirs...
>
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
> b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index af41bdb..63b681f 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4165,6 +4165,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
>  */
> result_src = get_temp(ir->type);
> result_dst = st_dst_reg(result_src);
> +   result_dst.writemask = (1 << ir->type->vector_elements) - 1;
>
> switch (ir->op) {
> case ir_tex:
> --
> 2.10.2
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] st/mesa: set result writemask based on ir type

2017-03-04 Thread Ilia Mirkin
This prevents textureQueryLevels, which maps as LODQ, from ending up
with a xyzw writemask, which is illegal.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100061
Signed-off-by: Ilia Mirkin 
Cc: mesa-sta...@lists.freedesktop.org
---

Untested beyond making sure that the shader in the above bug ends up with
a .xy writemask. I don't have access to a reasonable testing rig right now,
would be ideal if someone could give it a run through theirs...

 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp 
b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index af41bdb..63b681f 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4165,6 +4165,7 @@ glsl_to_tgsi_visitor::visit(ir_texture *ir)
 */
result_src = get_temp(ir->type);
result_dst = st_dst_reg(result_src);
+   result_dst.writemask = (1 << ir->type->vector_elements) - 1;
 
switch (ir->op) {
case ir_tex:
-- 
2.10.2

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


[Mesa-dev] [PATCH] anv: Add a helper for working with VK_WHOLE_SIZE for buffers

2017-03-04 Thread Jason Ekstrand
---
 src/intel/vulkan/anv_blorp.c  | 16 +++-
 src/intel/vulkan/anv_descriptor_set.c |  7 +++
 src/intel/vulkan/anv_image.c  |  4 ++--
 src/intel/vulkan/anv_private.h| 12 
 4 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c
index d79c5e0..05790d2 100644
--- a/src/intel/vulkan/anv_blorp.c
+++ b/src/intel/vulkan/anv_blorp.c
@@ -722,11 +722,17 @@ void anv_CmdFillBuffer(
struct blorp_batch batch;
blorp_batch_init(_buffer->device->blorp, , cmd_buffer, 0);
 
-   if (fillSize == VK_WHOLE_SIZE) {
-  fillSize = dst_buffer->size - dstOffset;
-  /* Make sure fillSize is a multiple of 4 */
-  fillSize &= ~3ull;
-   }
+   fillSize = anv_buffer_get_range(dst_buffer, dstOffset, fillSize);
+
+   /* From the Vulkan spec:
+*
+*"size is the number of bytes to fill, and must be either a multiple
+*of 4, or VK_WHOLE_SIZE to fill the range from offset to the end of
+*the buffer. If VK_WHOLE_SIZE is used and the remaining size of the
+*buffer is not a multiple of 4, then the nearest smaller multiple is
+*used."
+*/
+   fillSize &= ~3ull;
 
/* First, we compute the biggest format that can be used with the
 * given offsets and size.
diff --git a/src/intel/vulkan/anv_descriptor_set.c 
b/src/intel/vulkan/anv_descriptor_set.c
index 1e8991b..2a37d7d 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -672,10 +672,9 @@ anv_descriptor_set_write_buffer(struct anv_descriptor_set 
*set,
/* For buffers with dynamic offsets, we use the full possible range in the
 * surface state and do the actual range-checking in the shader.
 */
-   if (bind_layout->dynamic_offset_index >= 0 || range == VK_WHOLE_SIZE)
-  bview->range = buffer->size - offset;
-   else
-  bview->range = range;
+   if (bind_layout->dynamic_offset_index >= 0)
+  range = VK_WHOLE_SIZE;
+   bview->range = anv_buffer_get_range(buffer, offset, range);
 
/* If we're writing descriptors through a push command, we need to allocate
 * the surface state from the command buffer. Otherwise it will be
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 59f730c..f54c8ea 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -837,8 +837,8 @@ anv_CreateBufferView(VkDevice _device,
const uint32_t format_bs = isl_format_get_layout(view->format)->bpb / 8;
view->bo = buffer->bo;
view->offset = buffer->offset + pCreateInfo->offset;
-   view->range = pCreateInfo->range == VK_WHOLE_SIZE ?
- buffer->size - pCreateInfo->offset : pCreateInfo->range;
+   view->range = anv_buffer_get_range(buffer, pCreateInfo->offset,
+  pCreateInfo->range);
view->range = align_down_npot_u32(view->range, format_bs);
 
if (buffer->usage & VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT) {
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index c73196a..cf9874e 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1090,6 +1090,18 @@ struct anv_buffer {
VkDeviceSize offset;
 };
 
+static inline uint64_t
+anv_buffer_get_range(struct anv_buffer *buffer, uint64_t offset, uint64_t 
range)
+{
+   assert(offset <= buffer->size);
+   if (range == VK_WHOLE_SIZE) {
+  return buffer->size - offset;
+   } else {
+  assert(range <= buffer->size);
+  return range;
+   }
+}
+
 enum anv_cmd_dirty_bits {
ANV_CMD_DIRTY_DYNAMIC_VIEWPORT  = 1 << 0, /* 
VK_DYNAMIC_STATE_VIEWPORT */
ANV_CMD_DIRTY_DYNAMIC_SCISSOR   = 1 << 1, /* 
VK_DYNAMIC_STATE_SCISSOR */
-- 
2.5.0.400.gff86faf

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


[Mesa-dev] [Bug 100061] LODQ instruction generated with invalid dst mask

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100061

Bug ID: 100061
   Summary: LODQ instruction generated with invalid dst mask
   Product: Mesa
   Version: git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: Mesa core
  Assignee: mesa-dev@lists.freedesktop.org
  Reporter: imir...@alum.mit.edu
QA Contact: mesa-dev@lists.freedesktop.org

Created attachment 130064
  --> https://bugs.freedesktop.org/attachment.cgi?id=130064=edit
shader_test demonstrating the issue

The attached shader_test produces an instruction like this:

  2: LODQ TEMP[1], TEMP[1], SAMP[0], 2D

Which is clearly bogus (and hits an assert in nouveau code making sure that the
destmask is a subset of .xy). I tried to get this to happen with a much simpler
shader, but was unsuccessful. Haven't tried whittling this one down yet. It
comes from some radeonsi bug with a trace from Hitman.

My guess is that it's an issue in the st_glsl_to_tgsi register renumbering or
copy-prop passes... somehow. (Mostly because I hate them, and hope that this
hatred is vindicated by them having bugs.)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 100060] wsi/wsi_common_wayland.c:25:41: fatal error: wayland-drm-client-protocol.h: No such file or directory

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100060

Vedran Miletić  changed:

   What|Removed |Added

   Keywords||bisected, regression

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 100060] wsi/wsi_common_wayland.c:25:41: fatal error: wayland-drm-client-protocol.h: No such file or directory

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100060

Bug ID: 100060
   Summary: wsi/wsi_common_wayland.c:25:41: fatal error:
wayland-drm-client-protocol.h: No such file or
directory
   Product: Mesa
   Version: git
  Hardware: Other
OS: All
Status: NEW
  Severity: normal
  Priority: medium
 Component: EGL/Wayland
  Assignee: wayland-b...@lists.freedesktop.org
  Reporter: ved...@miletic.net
QA Contact: mesa-dev@lists.freedesktop.org

I configure with:

$ PKG_CONFIG_PATH=/usr/local/share/pkgconfig ./autogen.sh --enable-egl
--enable-driglx-direct --disable-gles1 --enable-gles2 --enable-shared-glapi
--enable-glx-tls --enable-dri --enable-texture-float --with-dri-drivers=""
--with-egl-platforms=drm,wayland,surfaceless,x11
--with-gallium-drivers=r600,radeonsi,swrast --with-vulkan-drivers=radeon
--enable-opencl --enable-opencl-icd --enable-nine --enable-gbm
--libdir=/usr/local/lib64 --enable-debug

Compilation fails with:

make[4]: Entering directory '/home/vedranm/workspace/mesa/src/vulkan'
  CC   wsi/wsi_common_wayland.lo
  CC   util/vk_enum_to_str.lo
  CC   wsi/wsi_common_x11.lo
  CCLD libvulkan_util.la
wsi/wsi_common_wayland.c:25:41: fatalna greška: wayland-drm-client-protocol.h:
No such file or directory
 #include 
 ^
kompajliranje prekinuto.
Makefile:652: recipe for target 'wsi/wsi_common_wayland.lo' failed
make[4]: *** [wsi/wsi_common_wayland.lo] Error 1
make[4]: *** Čekam nedovršene poslove
make[4]: Leaving directory '/home/vedranm/workspace/mesa/src/vulkan'
Makefile:551: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/vedranm/workspace/mesa/src/vulkan'
Makefile:856: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/vedranm/workspace/mesa/src'
Makefile:647: recipe for target 'all' failed

git bisect claims this is the first bad commit:

e135ce6f08841aaa26685964e5ba3cfb19fd3d36 is the first bad commit
commit e135ce6f08841aaa26685964e5ba3cfb19fd3d36
Author: Jason Ekstrand 
Date:   Wed Mar 1 19:18:56 2017 -0800

vulkan: Build common Vulkan code earlier

Reviewed-by: Emil Velikov 

:04 04 db0b4ca0d73b0d5626a926b989043f83c132433b
c84395fee4c5754797db796ccad822828c14422c M  src

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] nvc0: take extra pushbuf space into account for pushbuf_space calls

2017-03-04 Thread Samuel Pitoiset

Pushed.

On 03/04/2017 05:23 PM, Ilia Mirkin wrote:

I'm without keys for a little while, feel free to push this and the
tbo alignment patch for me.

On Sat, Mar 4, 2017 at 9:12 AM, Samuel Pitoiset
 wrote:

Looks like still fragile, but either way:

Reviewed-by: Samuel Pitoiset 


On 03/03/2017 02:18 AM, Ilia Mirkin wrote:


See detailed explanation of why this is needed in commit eb60a89bc3a.
This spot was missed/overlooked. Basically as a result of the fact
that BEGIN_* ends up calling PUSH_SPACE, which in turn adds an extra 8
to the requested amount, we have to be mindful of that when doing bare
nouveau_pushbuf_space calls.

Reportedly this fixes some crashes when replaying a hitman trace taken
on radeonsi.

Fixes: eb60a89bc3a ("nouveau: take extra push space into account for
pushbuf_space calls")
Cc: "13.0 17.0" 
Reported-by: Karol Herbst 
Signed-off-by: Ilia Mirkin 
---
 src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
index 15b4750..798761d 100644
--- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
+++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
@@ -515,7 +515,7 @@ nve4_compute_upload_input(struct nvc0_context *nvc0,
   struct nv04_resource *res = nv04_resource(info->indirect);
   uint32_t offset = res->offset + info->indirect_offset;

-  nouveau_pushbuf_space(push, 16, 0, 1);
+  nouveau_pushbuf_space(push, 32, 0, 1);
   PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);

   BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + 8);
@@ -655,7 +655,7 @@ nve4_launch_grid(struct pipe_context *pipe, const
struct pipe_grid_info *info)
   PUSH_DATA (push, 8);
   PUSH_DATA (push, 1);

-  nouveau_pushbuf_space(push, 16, 0, 1);
+  nouveau_pushbuf_space(push, 32, 0, 1);
   PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);

   BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + (8 / 4));




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


Re: [Mesa-dev] [PATCH] android: fix outdir for gen_enum_to_str files

2017-03-04 Thread Emil Velikov
On 3 March 2017 at 13:26, Eric Engestrom  wrote:
> On Friday, 2017-03-03 12:52:56 +0200, Tapani Pälli wrote:
>> when files are being generated the value of $intermediates var content can be
>> completely random, this makes sure that outdir is the wanted one.
>>
>> Fixes: 3f2cb699 ("android: vulkan: add support for libmesa_vulkan_util")
>> Signed-off-by: Tapani Pälli 
>
> Reviewed-by: Eric Engestrom 
>
> This can probably be applied to a lot of other places; even though it
> might not be fixing bugs there, it's still cleaner to reuse the var than
> copying the path.
>
This one here - it seems that we have a greater bug and this solution
is papering over it.
Still ... there's bigger fish to fry, so let's not sweat over it :-)

Pushed to master alongside the buffer_age implementation for EGL/Android.

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


Re: [Mesa-dev] [PATCH] nvc0: take extra pushbuf space into account for pushbuf_space calls

2017-03-04 Thread Ilia Mirkin
I'm without keys for a little while, feel free to push this and the
tbo alignment patch for me.

On Sat, Mar 4, 2017 at 9:12 AM, Samuel Pitoiset
 wrote:
> Looks like still fragile, but either way:
>
> Reviewed-by: Samuel Pitoiset 
>
>
> On 03/03/2017 02:18 AM, Ilia Mirkin wrote:
>>
>> See detailed explanation of why this is needed in commit eb60a89bc3a.
>> This spot was missed/overlooked. Basically as a result of the fact
>> that BEGIN_* ends up calling PUSH_SPACE, which in turn adds an extra 8
>> to the requested amount, we have to be mindful of that when doing bare
>> nouveau_pushbuf_space calls.
>>
>> Reportedly this fixes some crashes when replaying a hitman trace taken
>> on radeonsi.
>>
>> Fixes: eb60a89bc3a ("nouveau: take extra push space into account for
>> pushbuf_space calls")
>> Cc: "13.0 17.0" 
>> Reported-by: Karol Herbst 
>> Signed-off-by: Ilia Mirkin 
>> ---
>>  src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
>> b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
>> index 15b4750..798761d 100644
>> --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
>> +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
>> @@ -515,7 +515,7 @@ nve4_compute_upload_input(struct nvc0_context *nvc0,
>>struct nv04_resource *res = nv04_resource(info->indirect);
>>uint32_t offset = res->offset + info->indirect_offset;
>>
>> -  nouveau_pushbuf_space(push, 16, 0, 1);
>> +  nouveau_pushbuf_space(push, 32, 0, 1);
>>PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);
>>
>>BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + 8);
>> @@ -655,7 +655,7 @@ nve4_launch_grid(struct pipe_context *pipe, const
>> struct pipe_grid_info *info)
>>PUSH_DATA (push, 8);
>>PUSH_DATA (push, 1);
>>
>> -  nouveau_pushbuf_space(push, 16, 0, 1);
>> +  nouveau_pushbuf_space(push, 32, 0, 1);
>>PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);
>>
>>BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + (8 / 4));
>>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 99791] Wayland EGL do not fallback to software rendering anymore when the wl_drm interface is not available

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99791

Emil Velikov  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Emil Velikov  ---
Just realised that we forgot the bugzilla tag in the patch :-(
The following patch was merged and should address the issue.

Thanks for the help gents.

commit a1727aa75ed252cd19c296ccf83cb595be971744
Author: Daniel Stone 
Date:   Mon Feb 13 14:06:10 2017 +

egl/wayland: Don't use DRM format codes for SHM

-- 
You are receiving this mail because:
You are the QA Contact for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [ANNOUNCE] mesa 17.0.1

2017-03-04 Thread Emil Velikov
Mesa 17.0.1 is now available.

In this release we have:

GLX/GLVND fix for "The Binding of Isaac: Rebirth" and other games. When using
EGL under X11/DRI3 eglQuerySurface now returns correct geometry. A regression
in EGL/Wayland where the wrong format was passed is addressed.

There's a number of crash fixes affecting all Gallium drivers. An old
regression fix for r300 on BE hardware been fixed. The radeonsi driver
hasfixes for Tessellation shaders on Carrizo and Stoney hardware.

While on the nouveau side, compute shader have been improved on some nvc0
devices.

The vc4 and etnaviv drivers have also seen a couple of small fixes.

For the Intel drivers (both GL and Vulkan) we have a diverse collection of
patches - from CTS fixes for Sandy Bridge, to improved swizzle clears and
improved handling of GPUs without (Last Level Cache) LLC.

On integration side - we had some Android build fixes, the flags provided by
llvm-config are stripped more agressively fixing build issues on some cases.

We even have a new script to parse for bug fixes/possible nominations.


Bas Nieuwenhuizen (4):
  radv: Never try to create more than max_sets descriptor sets.
  radv: Reset emitted compute pipeline when calling secondary cmd buffer.
  radv: Only use PKT3_OCCLUSION_QUERY when it doesn't hang.
  radv: Use correct size for availability flag.

Ben Crocker (3):
  gallivm: Reenable PPC VSX (v3)
  gallivm: Improve debug output (V2)
  gallivm: Override getHostCPUName() "generic" w/ "pwr8" (v4)

Brendan King (1):
  egl/dri3: implement query surface hook

Christian Gmeiner (2):
  etnaviv: move pctx initialisation to avoid a null dereference
  etnaviv: remove number of pixel pipes validation

Connor Abbott (1):
  anv: fix Get*MemoryRequirements for !LLC

Daniel Stone (1):
  egl/wayland: Don't use DRM format codes for SHM

Dave Airlie (6):
  tgsi: fix memory leak in tgsi sanity check
  radv: change base aligmment for allocated memory.
  radv: fix cik macroModeIndex.
  radv: adopt some init config workarounds from radeonsi.
  radv: fix depth format in blit2d.
  radv: fix txs for sampler buffers

Emil Velikov (9):
  docs: add sha256 checksums for 17.0.0
  bin/get-extra-pick-list: use git merge-base to get the branchpoint
  bin/get-extra-pick-list: rework to use already_picked list
  bin/get-typod-pick-list.sh: limit `git grep ...' to only as needed
  bin/get-pick-list.sh: limit `git grep ...' only as needed
  bin/get-pick-list.sh: remove ancient way of nominating patches
  bin/get-fixes-pick-list.sh: add new script
  Update version to 17.0.1
  docs: add release notes for 17.0.1

Eric Anholt (1):
  vc4: Avoid emitting small immediates for UBO indirect load address guards.

Grazvydas Ignotas (3):
  r300g: only allow byteswapped formats on big endian
  gallium/u_queue: fix a crash with atexit handlers
  gallium/u_queue: set num_threads correctly if not all threads start

Hans de Goede (1):
  glx/glvnd: Fix GLXdispatchIndex sorting

Ilia Mirkin (4):
  gm107/ir: fix address offset bitfield for ATOMS
  nvc0: set the render condition in the compute object
  st/mesa: don't pass compare mode for stencil-sampled textures
  nvc0: disable linked tsc mode in compute launch descriptor

Jason Ekstrand (10):
  i965/sampler_state: Clamp min/max LOD to 14 on gen7+
  i965/sampler_state: Pass texObj into update_sampler_state
  i965/sampler_state: Set the "Base Mip Level" field on Sandy Bridge
  intel/blorp: Swizzle clear colors on the CPU
  i965/fs: Fix the inline nir_op_pack_double optimization
  anv: Add an invalidate_range helper
  anv/query: clflush the bo map on non-LLC platforms
  genxml: Make MI_STORE_DATA_IMM more consistent
  anv/query: Perform CmdResetQueryPool on the GPU
  intel/blorp: Explicitly flush all allocated state

Jose Maria Casanova Crespo (1):
  glsl: non-last member unsized array on SSBO must fail
compilation on GLSL ES 3.1

Kenneth Graunke (1):
  mesa: Do (TCS && !TES) draw time validation in ES as well.

Leo Liu (1):
  configure.ac: check require_basic_egl only if egl enabled

Lionel Landwerlin (2):
  anv: wsi: report presentation error per image request
  i965/fs: fix uninitialized memory access

Marek Olšák (6):
  radeonsi: fix UNSIGNED_BYTE index buffer fallback with non-zero start (v2)
  gallium/util: remove unused u_index_modify helpers
  gallium/u_index_modify: don't add PIPE_TRANSFER_UNSYNCHRONIZED
unconditionally
  gallium/u_queue: fix random crashes when the app calls exit()
  radeonsi: fix broken tessellation on Carrizo and Stoney
  amd/common: fix ASICREV_IS_POLARIS11_M for Polaris12

Mauro Rossi (2):
  android: radeonsi: fix sid_table.h generated header include path
  android: glsl: build shader cache sources

Michel Dänzer (1):
  configure.ac: Drop LLVM compiler flags more radically


Re: [Mesa-dev] [PATCH V2] util/disk_cache: support caches for multiple architectures

2017-03-04 Thread Grazvydas Ignotas
On Sat, Mar 4, 2017 at 4:44 PM, Emil Velikov  wrote:
> On 3 March 2017 at 23:37, Timothy Arceri  wrote:
>>
>> I'm tempted to just push this:
>> https://patchwork.freedesktop.org/patch/141891/
>>
>> And worry about issues later if that's not good enough.
>>
> Can we use anything like the following and polish later ? We already
> use __ILP32__ in mesa so we can assume the compiler is sane.
> This has the benefit of a) no build system glue, b) no special casing
> for arches - 64bit ppc/sparc/others anyone ?
>
> const char *
> get_arch_bitness_string(void)
> {
> if (sizeof(void *) == 4)
> #ifdef __ILP32__
> return "ilp-32";
> #else
> return "32";
> #endif
> if (sizeof(void *) == 8)
> return "64"
>
> # paranoia check which will be dropped by the optimiser
> assert(!"unknown_arch");
> return "unknown_arch";
> }

Yeah it's exactly what I was trying to suggest, so naturally I vote
for this solution.

Gražvydas
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: Rename brw_format_for_mesa_format() to brw_isl_format_for_mesa_format()

2017-03-04 Thread Jason Ekstrand

Hopefully, this doesn't conflict too badly with what Topi is doing.  If not,

Reviewed-by: Jason Ekstrand 


On March 3, 2017 2:40:41 PM Anuj Phogat  wrote:


Signed-off-by: Anuj Phogat 
---
 src/mesa/drivers/dri/i965/brw_blorp.c|  2 +-
 src/mesa/drivers/dri/i965/brw_context.c  |  2 +-
 src/mesa/drivers/dri/i965/brw_meta_util.c|  2 +-
 src/mesa/drivers/dri/i965/brw_state.h|  2 +-
 src/mesa/drivers/dri/i965/brw_surface_formats.c  | 14 +++---
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c |  4 ++--
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c|  2 +-
 7 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c 
b/src/mesa/drivers/dri/i965/brw_blorp.c

index 9f7ba3d..fdc9dd1 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -294,7 +294,7 @@ brw_blorp_to_isl_format(struct brw_context *brw, 
mesa_format format,

  assert(brw->format_supported_as_render_target[format]);
  return brw->render_target_format[format];
   } else {
- return brw_format_for_mesa_format(format);
+ return brw_isl_format_for_mesa_format(format);
   }
   break;
}
diff --git a/src/mesa/drivers/dri/i965/brw_context.c 
b/src/mesa/drivers/dri/i965/brw_context.c

index 3688ba4..42dfed0 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -205,7 +205,7 @@ intel_texture_view_requires_resolve(struct brw_context 
*brw,

!intel_miptree_is_lossless_compressed(brw, intel_tex->mt))
  return false;

-   const uint32_t brw_format = brw_format_for_mesa_format(intel_tex->_Format);
+   const uint32_t brw_format = 
brw_isl_format_for_mesa_format(intel_tex->_Format);


if (isl_format_supports_ccs_e(>screen->devinfo, brw_format))
   return false;
diff --git a/src/mesa/drivers/dri/i965/brw_meta_util.c 
b/src/mesa/drivers/dri/i965/brw_meta_util.c

index 07a160f..cbc2ded 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_util.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_util.c
@@ -288,7 +288,7 @@ brw_is_color_fast_clear_compatible(struct brw_context *brw,
 * this case. At least on Gen9 this really does seem to cause problems.
 */
if (brw->gen >= 9 &&
-   brw_format_for_mesa_format(mt->format) !=
+   brw_isl_format_for_mesa_format(mt->format) !=
brw->render_target_format[mt->format])
   return false;

diff --git a/src/mesa/drivers/dri/i965/brw_state.h 
b/src/mesa/drivers/dri/i965/brw_state.h

index 4b7e3c2..bd05b60 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -267,7 +267,7 @@ void gen4_init_vtable_surface_functions(struct 
brw_context *brw);

 uint32_t brw_get_surface_tiling_bits(uint32_t tiling);
 uint32_t brw_get_surface_num_multisamples(unsigned num_samples);

-uint32_t brw_format_for_mesa_format(mesa_format mesa_format);
+uint32_t brw_isl_format_for_mesa_format(mesa_format mesa_format);

 GLuint translate_tex_target(GLenum target);

diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c 
b/src/mesa/drivers/dri/i965/brw_surface_formats.c

index 706818d..7b17e11 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -29,7 +29,7 @@
 #include "brw_defines.h"

 uint32_t
-brw_format_for_mesa_format(mesa_format mesa_format)
+brw_isl_format_for_mesa_format(mesa_format mesa_format)
 {
/* This table is ordered according to the enum ordering in formats.h.  We do
 * expect that enum to be extended without our explicit initialization
@@ -303,7 +303,7 @@ brw_init_surface_formats(struct brw_context *brw)
   uint32_t texture, render;
   bool is_integer = _mesa_is_format_integer_color(format);

-  render = texture = brw_format_for_mesa_format(format);
+  render = texture = brw_isl_format_for_mesa_format(format);

   /* The value of ISL_FORMAT_R32G32B32A32_FLOAT is 0, so don't skip
* it.
@@ -536,7 +536,7 @@ translate_tex_format(struct brw_context *brw,
   return ISL_FORMAT_R32_FLOAT_X8X24_TYPELESS;

case MESA_FORMAT_RGBA_FLOAT32:
-  /* The value of this BRW_SURFACEFORMAT is 0, which tricks the
+  /* The value of this ISL surface format is 0, which tricks the
* assertion below.
*/
   return ISL_FORMAT_R32G32B32A32_FLOAT;
@@ -550,7 +550,7 @@ translate_tex_format(struct brw_context *brw,
  WARN_ONCE(true, "Demoting sRGB DXT1 texture to non-sRGB\n");
  mesa_format = MESA_FORMAT_RGB_DXT1;
   }
-  return brw_format_for_mesa_format(mesa_format);
+  return brw_isl_format_for_mesa_format(mesa_format);

case MESA_FORMAT_RGBA_ASTC_4x4:
case MESA_FORMAT_RGBA_ASTC_5x4:
@@ -566,7 +566,7 @@ translate_tex_format(struct brw_context *brw,
case MESA_FORMAT_RGBA_ASTC_10x10:
case MESA_FORMAT_RGBA_ASTC_12x10:

Re: [Mesa-dev] [PATCH 1/4] configure.ac: increase required swr llvm to 3.9.0

2017-03-04 Thread Emil Velikov
On 3 March 2017 at 20:34, Rowley, Timothy O  wrote:
>
>> On Mar 3, 2017, at 5:55 AM, Emil Velikov  wrote:
>>
>> On 3 March 2017 at 01:16, Tim Rowley  wrote:
>>> GS implementation uses the masked.{gather,store} intrinsics,
>>> introduced in llvm-3.9.0.
>>
>> Please mention in the commit message that the SCons build already
>> requires 3.9 or later.
>> Can you add a note about the LLVM requirement and GS support in
>> docs/relnotes/17.1.0.html, with a separate commit on top ?
>
> Both of these are in v2 of the patch set.
>
Amazing, tyvm.

>> With this we have some ~20 preprocessor conditionals which want to be
>> cleaned up. Look for
>> $ git grep  "LLVM_.*VERSION\|HAVE_LLVM" -- src/gallium/drivers/swr/
>
> Ah, good catch.  We’ve been ratcheting up our required llvm version without 
> cleaning out some of the cruft.  Internally we’re still using 3.8 so not all 
> of these can be removed.  I’ll work on that in a follow-up patch, as it’s 
> unrelated to the geometry shader implementation.
>
Skimming through the 3.9 specifics - they only handle removed
intrinsics - pmovsxbd/pmovsxwd/pmax/pmin. Thinking that new code
should be safe with 3.8 so one could just use it everywhere ?
And yes, separate cleanup patches is perfectly fine.

Thanks again,
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] drm-atomic: Include header file

2017-03-04 Thread Fabio Estevam
Include  header file to fix the following build warning:

  CC   kmscube-drm.o
drm-atomic.c: In function 'init_drm_atomic':
drm-atomic.c:346:14: warning: implicit declaration of function 'calloc' 
[-Wimplicit-function-declaration]
  drm.plane = calloc(1, sizeof(*drm.plane));
  ^
drm-atomic.c:346:14: warning: incompatible implicit declaration of built-in 
function 'calloc'
drm-atomic.c:346:14: note: include '' or provide a declaration of 
'calloc'

Signed-off-by: Fabio Estevam 
---
Hi Rob,

This one is against your recent kmscube tree at:
https://cgit.freedesktop.org/mesa/kmscube/

 drm-atomic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drm-atomic.c b/drm-atomic.c
index b4755e1..0b38c32 100644
--- a/drm-atomic.c
+++ b/drm-atomic.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-- 
2.7.4

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


Re: [Mesa-dev] [PATCH V2] util/disk_cache: support caches for multiple architectures

2017-03-04 Thread Emil Velikov
On 3 March 2017 at 23:37, Timothy Arceri  wrote:
> On 03/03/17 23:27, Grazvydas Ignotas wrote:
>>
>> On Fri, Mar 3, 2017 at 5:27 AM, Timothy Arceri 
>> wrote:
>>>
>>> Previously we were deleting the entire cache if a user switched
>>> between 32 and 64 bit applications.
>>>
>>> V2: make the check more generic, it should now work with any
>>> platform we are likely to support.
>>> ---
>>>  src/util/disk_cache.c | 19 +++
>>>  1 file changed, 19 insertions(+)
>>>
>>> diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
>>> index 3abdec4..92528a9 100644
>>> --- a/src/util/disk_cache.c
>>> +++ b/src/util/disk_cache.c
>>> @@ -40,20 +40,30 @@
>>>  #include "zlib.h"
>>>
>>>  #include "util/crc32.h"
>>>  #include "util/u_atomic.h"
>>>  #include "util/mesa-sha1.h"
>>>  #include "util/ralloc.h"
>>>  #include "main/errors.h"
>>>
>>>  #include "disk_cache.h"
>>>
>>> +#if defined(__ILP32__)
>>> +#if defined(__x86_64__) || defined(__arm__)
>>> +#define CACHE_ARCH "ilp-32"
>>> +#else
>>> +#define CACHE_ARCH "32"
>>> +#endif
>>> +#else
>>> +#define CACHE_ARCH "64"
>>> +#endif
>>
>>
>> That reports "64" for me on gcc -m32, I think only clang sets
>> __ILP32__ for non-x32 32bit build.
>
>
> Well that's annoying.
>
>> I'd still suggest using sizeof(void
>> *) directly in the code, perhaps within some "const char
>> *get_arch_bitness_string()" helper, that should be more reliable.
>
>
> I'm tempted to just push this:
> https://patchwork.freedesktop.org/patch/141891/
>
> And worry about issues later if that's not good enough.
>
Can we use anything like the following and polish later ? We already
use __ILP32__ in mesa so we can assume the compiler is sane.
This has the benefit of a) no build system glue, b) no special casing
for arches - 64bit ppc/sparc/others anyone ?

const char *
get_arch_bitness_string(void)
{
if (sizeof(void *) == 4)
#ifdef __ILP32__
return "ilp-32";
#else
return "32";
#endif
if (sizeof(void *) == 8)
return "64"

# paranoia check which will be dropped by the optimiser
assert(!"unknown_arch");
return "unknown_arch";
}


Thanks
Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] ralloc: don't leave out the alignment factor

2017-03-04 Thread Jonas Pfeil

Tested on the Raspberry Pi, works as intended. So

Tested by: Jonas Pfeil 

-Ursprüngliche Nachricht- 
From: Grazvydas Ignotas

Sent: Saturday, March 4, 2017 1:49 AM
To: mesa-dev@lists.freedesktop.org
Cc: Grazvydas Ignotas ; Jonas Pfeil
Subject: [PATCH] ralloc: don't leave out the alignment factor

Experimentation shows that without alignment factor gcc and clang choose
a factor of 16 even on IA-32, which doesn't match what malloc() uses (8).
The problem is it makes gcc assume the pointer is 16 byte aligned, so
with -O3 it starts using aligned SSE instructions that later fault,
so always specify a suitable alignment factor.

Cc: Jonas Pfeil 
Fixes: cd2b55e5 "ralloc: Make sure ralloc() allocations match malloc()'s 
alignment."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100049
Signed-off-by: Grazvydas Ignotas 
---
no commit access

src/util/ralloc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/util/ralloc.c b/src/util/ralloc.c
index 03283de..7bf192e 100644
--- a/src/util/ralloc.c
+++ b/src/util/ralloc.c
@@ -59,8 +59,10 @@ _CRTIMP int _vscprintf(const char *format, va_list 
argptr);

struct
#ifdef _MSC_VER
 __declspec(align(8))
+#elif defined(__LP64__)
+ __attribute__((aligned(16)))
#else
- __attribute__((aligned))
+ __attribute__((aligned(8)))
#endif
   ralloc_header
{
--
2.7.4

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


Re: [Mesa-dev] [PATCH] nvc0: take extra pushbuf space into account for pushbuf_space calls

2017-03-04 Thread Samuel Pitoiset

Looks like still fragile, but either way:

Reviewed-by: Samuel Pitoiset 

On 03/03/2017 02:18 AM, Ilia Mirkin wrote:

See detailed explanation of why this is needed in commit eb60a89bc3a.
This spot was missed/overlooked. Basically as a result of the fact
that BEGIN_* ends up calling PUSH_SPACE, which in turn adds an extra 8
to the requested amount, we have to be mindful of that when doing bare
nouveau_pushbuf_space calls.

Reportedly this fixes some crashes when replaying a hitman trace taken
on radeonsi.

Fixes: eb60a89bc3a ("nouveau: take extra push space into account for pushbuf_space 
calls")
Cc: "13.0 17.0" 
Reported-by: Karol Herbst 
Signed-off-by: Ilia Mirkin 
---
 src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c 
b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
index 15b4750..798761d 100644
--- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
+++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c
@@ -515,7 +515,7 @@ nve4_compute_upload_input(struct nvc0_context *nvc0,
   struct nv04_resource *res = nv04_resource(info->indirect);
   uint32_t offset = res->offset + info->indirect_offset;

-  nouveau_pushbuf_space(push, 16, 0, 1);
+  nouveau_pushbuf_space(push, 32, 0, 1);
   PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);

   BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + 8);
@@ -655,7 +655,7 @@ nve4_launch_grid(struct pipe_context *pipe, const struct 
pipe_grid_info *info)
   PUSH_DATA (push, 8);
   PUSH_DATA (push, 1);

-  nouveau_pushbuf_space(push, 16, 0, 1);
+  nouveau_pushbuf_space(push, 32, 0, 1);
   PUSH_REFN(push, res->bo, NOUVEAU_BO_RD | res->domain);

   BEGIN_1IC0(push, NVE4_CP(UPLOAD_EXEC), 1 + (8 / 4));


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


Re: [Mesa-dev] [PATCH V2] util/disk_cache: compress individual cache entries

2017-03-04 Thread Emil Velikov
On 2 March 2017 at 21:52, Timothy Arceri  wrote:
>
> On 03/03/17 01:49, Emil Velikov wrote:
>>
>> Hi Tim,
>>
>> On 2 March 2017 at 01:36, Timothy Arceri  wrote:
>>>
>>> This reduces the cache size for Deus Ex from ~160M to ~30M for
>>> radeonsi.
>>>
>>> I'm also seeing the following improvements in minimum fps in the
>>> Shadow of Mordor benchmark:
>>>
>>> no-cache:~10fps
>>> with-cache-no-compression:   ~15fps
>>> with-cache-and-compression:  ~20fps
>>>
>>> Note the with cache results are from the second run after closing
>>> and opening the game to avoid the in-memory cache.
>>>
>>> Since we only really care about decompression I went with
>>> Z_BEST_COMPRESSION as suggested on irc by Steinar H. Gunderson
>>> who has benchmarked decompression speeds.
>>>
>> Attempting to side-step the "which compression is best" topic, I'll
>> just mention:
>> zlib has been around for a long time than many others so,
>> a) chances are smaller that vendors that ship their own, but even if they
>> do
>> b) the API should be stable across the system and bundled one.
>>
>> If not we can reconsider if things get hairy ;-)
>>
>> A couple of small suggestions below.
>>
>>
>>> +ZLIB_REQUIRED=1.2.8
>>>
>> Any particular reason behind this version - afaict it's released in
>> 2013 and I'm wondering if some distros may be slow/missing it.
>>
>
> It's what's shipped with Fedora and therefore what I tested with. If distros
> are lagging behind I don't think this is a problem we need to be concerned
> with, it may prompt them to upgrade which I don't think is a bad thing.
>
I was thinking about Debian and friends, which tend to be slower than others.
From what I can tell they rarely consider external factors as a reason
to update.

That aside, they have 1.2.7 for "oldstable" and 1.2.8 for everything
else so everything's fine.

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


Re: [Mesa-dev] [PATCH] android: fix outdir for gen_enum_to_str files

2017-03-04 Thread Mauro Rossi
2017-03-03 20:01 GMT+01:00 Mauro Rossi :

> 2017-03-03 11:52 GMT+01:00 Tapani Pälli :
> > when files are being generated the value of $intermediates var content
> can be
> > completely random, this makes sure that outdir is the wanted one.
>
> The value of intermediates variable is local to the module and is set
> at the line:
>
> intermediates := $(call local-generated-sources-dir)
>
> For confirmation, why is $(vulkan_api_xml) variable ok
> and $(intermediates) not ok in the generation rules?
>
> Mauro


Nevermind
I saw the build error
Thanks Tapani

IOError: [Errno 2] No such file or directory:
'out/target/common/obj/PACKAGING/boot-jars-package-check_intermediates/util/vk_enum_to_str.c'
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/4] util/disk_cache: compress individual cache entries

2017-03-04 Thread Marek Olšák
It should be very easy to move the compression and I/O to another thread
using gallium/util/u_queue. It's a perfect match for this kind of thing.

Marek

On Mar 2, 2017 11:12 PM, "Grigori Goronzy"  wrote:

> On 2017-03-02 10:08, Timothy Arceri wrote:
>
>> On 02/03/17 18:45, Tobias Droste wrote:
>>
>>> Hi Timothy,
>>>
>>> if you plan to support multiple compression algorithms, shouldn't "struct
>>> cache_entry_file_data" contain some info about what compression
>>> algorithm was
>>> used to compress the data? Or is this already there and I missed it?
>>>
>>
>> I don't plan to support more than one. I'm just saying it's a
>> possibility for the future, depending on further analysis and
>> requirements from different hardware. But right now I would just like
>> to land zlib support so we have a baseline to work from.
>>
>>
> Like outlined on IRC, for the time being can you reconsider the
> compression level, though?
>
> The cache currently quite noticeably affects shader loading time on first
> hit, i.e. when the cache is cold. Cache I/O and compression is right now
> done synchronously, so it even happens without compression on a system with
> fast SSD. Here's a summary of the numbers I gathered from the initial
> loading screens of DE:MD on an Athlon X4 860k:
>
> No Cache 215 sec
>
> Cold Cache zlib BEST_COMPRESSION 285 sec
> Warm Cache zlib BEST_COMPRESSION 33 sec
>
> Cold Cache zlib BEST_SPEED   264 sec
> Warm Cache zlib BEST_SPEED   33 sec
>
> Cold Cache no compression266 sec
> Warm Cache no compression34 sec
>
> The total cache size for that game is 48 MiB with BEST_COMPRESSION, 56 MiB
> with BEST_SPEED and 170 MiB with no compression.
>
> What In conclude from these numbers is that
>
> a) the cache works really well! A warmed cache cuts down loading time by
> an order of magnitude,
> b) compression does a good job of reducing the cache size (which probably
> helps with traditional spinning disk HDDs, and when disk space is limited),
> c) decompression always seems Fast Enough On My Computer™.
>
> However, I also notice that BEST_COMPRESSION doesn't really affect the
> total size of the cache files much compared to BEST_SPEED, while it does
> noticeably increase the cold cache shader loading time. So in the end,
> BEST_SPEED might be a better compromise, particularly for systems with a
> slow CPU.
>
> Apart from that, consider the series
> Reviewed-by: Grigori Goronzy 
>
> Best regards
> Grigori
>
>
>>> Am Donnerstag, 2. März 2017, 03:20:05 CET schrieb Matt Turner:
>>>
 On Wed, Mar 1, 2017 at 2:19 PM, Timothy Arceri 

>>> wrote:
>>>
 IMO we should go with zlib and people can provide future patches with
> justifications/stats for using a different library over zlib just like
> we
> do for any other performance based patch.
>

 Yes, agreed. "Which compression should we use?" is one of the easiest
 bikesheds to paint.
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 https://lists.freedesktop.org/mailman/listinfo/mesa-dev

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


[Mesa-dev] [Bug 100049] "ralloc: Make sure ralloc() allocations match malloc()'s alignment." causes seg fault in 32bit build

2017-03-04 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=100049

raffa...@zoho.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from raffa...@zoho.com ---
(In reply to Grazvydas Ignotas from comment #1)
> Patch sent:
> https://patchwork.freedesktop.org/patch/142123/

It works now, thanks.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev