Re: [Mesa-dev] [RFC PATCH 0/5] ARB_gpu_shader5 interpolateAt* GLSL plumbing

2013-11-11 Thread Marek Olšák
On Sun, Nov 10, 2013 at 9:51 AM, Chris Forbes chr...@ijw.co.nz wrote:
 Here is the driver-independent part of ARB_gpu_shader5's
 interpolateAtCentroid, interpolateAtOffset builtins.

 Before I go further with this approach, I'd like feedback on the following:

 1) I've (ab)used ir_var_shader_in variable mode in function signatures to
 enforce the strange restrictions interpolateAt* have. Is this crazy/awful?

 2) I intend to implement interpolateAtSample() by:

 - Adding a new builtin uniform (perhaps gl_SamplePositionsMESA); which
will be an array of vec2, containing the full palette of current sample
positions. This could be formally exposed by another extension at a later
point.

 - Compiling interpolateAtSample(x, sample_num) as if the shader author wrote:
interpolateAtOffset(x, gl_SamplePositionsMESA[sample_num] - vec2(0.5))

I think our Evergreen-Cayman hardware implements interpolateAtSample
with interpolateAtOffset, so this looks good. Not sure about the newer
chips.

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


Re: [Mesa-dev] [PATCH] i965: implement blit path for PBO glDrawPixels

2013-11-11 Thread Alexander Monakov
Ping.  A week ago a few people who looked at the older version of this
patch posted on IRC didn't point out obvious flaws.  Can this get a
review please?

On Mon, Nov 4, 2013 at 1:34 AM, Alexander Monakov amona...@gmail.com wrote:
 Hello,

 This patch implements accelerated path for glDrawPixels from a PBO in
 i965. The code follows what intel_pixel_read, intel_pixel_copy,
 intel_pixel_bitmap and intel_tex_image are doing. Piglit quick.tests
 show no regressions. In my testing on IVB, performance improvement is
 huge (about 30x, didn't measure exactly) since generic path goes via
 _mesa_unpack_color_span_float, memcpy, extract_float_rgba.

 I don't have commit access so please commit the patch for me if approved.

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


Re: [Mesa-dev] [PATCH] EGL: fix build without libdrm

2013-11-11 Thread Maarten Lankhorst
op 10-11-13 19:32, Samuel Thibault schreef:
 This fixes building EGL without libdrm support.

 Signed-off-by: Samuel Thibault samuel.thiba...@ens-lyon.org
Applied, thanks.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Kevin Rogovin
This patch adds a function interface for enabling no wrap on batch commands,
adds to it assert enforcement that the number bytes added to the
batch buffer does not exceed a passed value and finally this is used
in brw_try_draw_prims() to help make sure that estimated_max_prim_size
is a good value.

---
 src/mesa/drivers/dri/i965/brw_context.h   | 64 +++
 src/mesa/drivers/dri/i965/brw_draw.c  |  4 +-
 src/mesa/drivers/dri/i965/brw_state_batch.c   | 15 ++-
 src/mesa/drivers/dri/i965/intel_batchbuffer.h |  5 +++
 4 files changed, 84 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
b/src/mesa/drivers/dri/i965/brw_context.h
index 8b1cbb3..953f2cf 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1028,8 +1028,29 @@ struct brw_context
uint32_t reset_count;
 
struct intel_batchbuffer batch;
+
+   /*!\var no_batch_wrap
+ While no_batch_wrap is true, the batch buffer must not
+ be flushed. Use the functions begin_no_batch_wrap() and
+ end_no_batch_wrap() to mark the start and end points
+ that the batch buffer must not be flushed.
+*/
bool no_batch_wrap;
 
+   /*!\var max_expected_batch_size_during_no_batch_wrap
+ If \ref no_batch_wrap is true, specifies the number
+ of bytes that are expected before \ref no_batch_wrap
+ is set to false.
+*/
+   int max_expected_batch_size_during_no_batch_wrap;
+
+   /*!\var number_bytes_consumed_during_no_batch_wrap
+ records the number of bytes consumed so far
+ in the batch buffer since the last time \ref 
+ no_batch_wrap was set to true
+*/
+   int number_bytes_consumed_during_no_batch_wrap;
+
struct {
   drm_intel_bo *bo;
   GLuint offset;
@@ -1450,6 +1471,49 @@ is_power_of_two(uint32_t value)
return (value  (value - 1)) == 0;
 }
 
+/*!\fn begin_no_batch_wrap
+  Function to mark the start of a sequence of commands and state 
+  added to the batch buffer that must not be partitioned by
+  a flush. 
+  Requirements: 
+  - no_batch_wrap is false
+
+  Output/side effects:
+  - no_batch_wrap set to true
+  - max_expected_batch_size_during_no_batch_wrap set
+  - number_bytes_consumed_during_no_batch_wrap reset to 0
+
+  \ref brw GL context
+  \ref pmax_expected_batch_size value specifying expected maximum number of 
bytes to 
+be consumed in the batch buffer  
+ */ 
+static INLINE void
+begin_no_batch_wrap(struct brw_context *brw, int pmax_expected_batch_size)
+{
+   assert(!brw-no_batch_wrap);
+   brw-no_batch_wrap=true;
+   brw-max_expected_batch_size_during_no_batch_wrap=pmax_expected_batch_size;
+   brw-number_bytes_consumed_during_no_batch_wrap=0;
+}
+
+/*!\fn end_no_batch_wrap
+  Function to mark the end of a sequence of commands and state 
+  added to the batch buffer that must not be partitioned by
+  a flush. 
+  Requirements:
+  - no_batch_wrap is true
+
+  Output/side effects:
+  - no_batch_wrap set to false
+ */
+static INLINE void
+end_no_batch_wrap(struct brw_context *brw)
+{
+   assert(brw-no_batch_wrap);
+   brw-no_batch_wrap=false;
+}
+
+
 /*==
  * brw_vtbl.c
  */
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c 
b/src/mesa/drivers/dri/i965/brw_draw.c
index 7b33b76..12f0ffe 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -416,14 +416,14 @@ retry:
* *_set_prim or intel_batchbuffer_flush(), which only impacts
* brw-state.dirty.brw.
*/
+  begin_no_batch_wrap(brw, estimated_max_prim_size);
   if (brw-state.dirty.brw) {
-brw-no_batch_wrap = true;
 brw_upload_state(brw);
   }
 
   brw_emit_prim(brw, prims[i], brw-primitive);
+  end_no_batch_wrap(brw);
 
-  brw-no_batch_wrap = false;
 
   if (dri_bufmgr_check_aperture_space(brw-batch.bo, 1)) {
 if (!fail_next) {
diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c 
b/src/mesa/drivers/dri/i965/brw_state_batch.c
index c71d2f3..ff51c21 100644
--- a/src/mesa/drivers/dri/i965/brw_state_batch.c
+++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
@@ -9,8 +9,7 @@
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
- 
+ the following conditions: 
  The above copyright notice and this permission notice (including the
  next paragraph) shall be included in all copies or substantial
  portions of the Software.
@@ -127,6 +126,18 @@ brw_state_batch(struct brw_context *brw,
assert(size  batch-bo-size);
offset = ROUND_DOWN_TO(batch-state_batch_offset - size, alignment);
 
+#ifdef DEBUG
+   if(brw-no_batch_wrap) {
+  /*
+although the request is for size bytes, the consumption can be greater
+because 

Re: [Mesa-dev] Batchbuffer question

2013-11-11 Thread Rogovin, Kevin
Hi,

 I've submitted a patch, though not in this thread, not too sure if it should 
have or not. The patch label is

 [PATCH] nicer-no-wrap-patch 

Bheers,
 -Kevin

From: Kenneth Graunke [kenn...@whitecape.org]
Sent: Friday, November 08, 2013 11:38 PM
To: Rogovin, Kevin; mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] Batchbuffer question

On 11/08/2013 04:49 AM, Rogovin, Kevin wrote:
 Hi all,

 As I was poking into the magicks for the batchbuffer, I saw the
 following logical bits of code, that make sense by themselves but get
 me paranoid together. Firstly in intel_batchbuffer_begin() [
 intel_batchbuffer.h, and this is what BEGIN_BATCH maps to] there is a
 intel_batchbuffer_require_space() call that if too much room is
 needed then calls intel_batchbuffer_begin():

 from intel_batchbuffer_require_space():

   115if (intel_batchbuffer_space(brw)  sz)
   116   intel_batchbuffer_flush(brw);

 and from intel_batchbuffer_space():

80 intel_batchbuffer_space(struct brw_context *brw)
81 {
82return (brw-batch.state_batch_offset - brw-batch.reserved_space)
83   - brw-batch.used*4;
84 }


 Now, for allocating space for state, there is brw_state_batch():


   128offset = ROUND_DOWN_TO(batch-state_batch_offset - size, alignment);
   129
   130/* If allocating from the top would wrap below the batchbuffer, or
   131 * if the batch's used space (plus the reserved pad) collides with 
 our
   132 * space, then flush and try again.
   133 */
   134if (batch-state_batch_offset  size ||
   135offset  4*batch-used + batch-reserved_space) {
   136   intel_batchbuffer_flush(brw);
   137   offset = ROUND_DOWN_TO(batch-state_batch_offset - size, 
 alignment);
   138}


 These taken together, I interpret as meaning that state and commands
 try to be separated by atleast batch-reserved_space bytes. I guess
 state could take up more than (batch-bo-size -
 batch-reserved_space) from that second ROUND_DOWN_TO, but that would
 only happen right after a flush and any state or command afterwards
 would flush too.

 Now my questions: 1) it looks like the reserved space is not to be
 used for either state or commands. Is that correct? What is it used
 for?

To explain a bit more...we store commands (like 3DSTATE_VS) and indirect
state (like BLEND_STATE) in the same buffer (the batchbuffer).

We emit commands starting at the top of the buffer, since they need to
be in order.  Indirect state is always pointed to by a command (i.e.
3DSTATE_BLEND_STATE_POINTERS), so it can be in any order.  We fill
indirect state backwards, starting from the end of the buffer.

Should they meet in the middle, we flush the batch and start a new one.

It's sort of like how the stack and heap start at opposite sides and
grow towards each other.

When we finish a batch, we need to append a few final commands.  These
use the reserved space.  From intel_batchbuffer.c:

   brw-batch.reserved_space = 0;

   brw_finish_batch(brw);

   /* Mark the end of the buffer. */
   intel_batchbuffer_emit_dword(brw, MI_BATCH_BUFFER_END);
   if (brw-batch.used  1) {
  /* Round batchbuffer usage to 2 DWORDs. */
  intel_batchbuffer_emit_dword(brw, MI_NOOP);
   }

MI_BATCH_BUFFER_END is fairly self-explanatory, but there are others.
On Gen4-5, we need to take a snapshot of the PS_DEPTH_COUNT register in
order to make occlusion queries, so there's a PIPE_CONTROL.  With my
upcoming performance monitor changes, we also need to take snapshots of
the observability architecture counters as well, so there will be an
MI_REPORT_PERF_COUNT.

See the comments above the BATCH_RESERVED #define, which list all the
things we might emit.

Note that, prior to emitting this state, we set
brw-batch.reserved_space to 0, which makes that space available for
these final commands.  So we'll always have space and never try to flush
in the middle of flushing.

 2) if a function first calls brw_state_batch() to place state and it
 barely fits and then calls BEGIN_BATCH that does not fit, then the
 command will refer to an offset on the previous batch buffer, that
 cannot be good. Or does this never happen for other reasons? If so
 what are those reasons?

Leaving additional indirect state in the buffer is harmless.  We do need
to remove commands.

OpenGL draw calls involve emitting a bunch of commands, finishing with a
3DPRIMITIVE command.  Prior to emitting anything, we call:

  intel_batchbuffer_save_state(brw);

which saves batch-used and the current number of relocations.  If we
run out of space before emitting the 3DPRIMITIVE, we call:

intel_batchbuffer_reset_to_saved(brw);

which resets the batch-used to the saved value, effectively throwing
away those commands.  It also calls into libdrm to throw away the extra
relocations.

Hope this helps!

--Ken
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org

[Mesa-dev] [Bug 71492] New: Regression with clearview

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71492

  Priority: medium
Bug ID: 71492
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: Regression with clearview
  Severity: normal
Classification: Unclassified
OS: All
  Reporter: jfons...@vmware.com
  Hardware: Other
Status: NEW
   Version: git
 Component: Mesa core
   Product: Mesa

Mesa started to show bogus vertices with the trace
http://people.freedesktop.org/~jrfonseca/traces/clearview-5.30b.trace (see
attached screenshot).

After bisecting 59b01ca252bd6706f08cd80a864819d71dfe741c is the first bad
commit:

commit 59b01ca252bd6706f08cd80a864819d71dfe741c
Author: Fredrik Höglund fred...@kde.org
Date:   Tue Apr 9 20:54:25 2013 +0200

mesa: Add ARB_vertex_attrib_binding

update_array() and update_array_format() are changed to update the new
attrib and binding states, and the client arrays become derived state.

Reviewed-by: Eric Anholt e...@anholt.net

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


[Mesa-dev] [Bug 71492] Regression with clearview

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71492

--- Comment #1 from José Fonseca jfons...@vmware.com ---
Created attachment 89027
  -- https://bugs.freedesktop.org/attachment.cgi?id=89027action=edit
Screenshot at call 20022

Screenshot at call  20022

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


[Mesa-dev] [Bug 71492] Regression with clearview

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71492

José Fonseca jfons...@vmware.com changed:

   What|Removed |Added

   Assignee|mesa-dev@lists.freedesktop. |fred...@kde.org
   |org |
 CC||bri...@vmware.com,
   ||e...@anholt.net,
   ||jfons...@vmware.com

--- Comment #2 from José Fonseca jfons...@vmware.com ---
BTW, this was with llvmpipe.

I haven't tested with other Mesa drivers, but given the change is in mesa core,
I strongly suspect it would affect all drivers the same.

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


[Mesa-dev] [PATCH] gallivm, llvmpipe: fix float-srgb conversion to handle NaNs

2013-11-11 Thread sroland
From: Roland Scheidegger srol...@vmware.com

d3d10 requires us to convert NaNs to zero for any float-int conversion.
We don't really do that but mostly seems to work. In particular I suspect the
very common float-unorm8 path only really passes because it relies on sse2
pack intrinsics which just happen to work by luck for NaNs (float-int
conversion in hw gives integer indeterminate value, which just happens to be
-0x8000 hence gets converted to zero in the end after pack intrinsics).
However, float-srgb didn't get so lucky, because we need to clamp before
blending and clamping resulted in NaN behavior being undefined (and actually
got converted to 1.0 by clamping with sse2). Fix this by using a zero/one clamp
with defined nan behavior as we can handle the NaN for free this way.
I suspect there's more bugs lurking in this area (e.g. converting floats to
snorm) as we don't really use defined NaN behavior everywhere but this seems
to be good enough.
While here respecify nan behavior modes a bit, in particular the return_second
mode didn't really do what we wanted. From the caller's perspective, we really
wanted to say we need the non-nan result, but we already know the second arg
isn't a NaN. So we use this now instead, which means that cpu architectures
which actually implement min/max by always returning non-nan (that is adhering
to ieee754-2008 rules) don't need to bend over backwards for nothing.
---
 src/gallium/auxiliary/gallivm/lp_bld_arit.c|   44 +---
 src/gallium/auxiliary/gallivm/lp_bld_arit.h|   12 --
 src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c |2 +-
 src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c|   11 ++---
 src/gallium/drivers/llvmpipe/lp_state_fs.c |4 +-
 5 files changed, 45 insertions(+), 28 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c 
b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 00052ed..70929e7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -123,8 +123,10 @@ lp_build_min_simple(struct lp_build_context *bld,
   }
}
else if (type.floating  util_cpu_caps.has_altivec) {
-  debug_printf(%s: altivec doesn't support nan behavior modes\n,
-   __FUNCTION__);
+  if (nan_behavior == GALLIVM_NAN_RETURN_NAN) {
+ debug_printf(%s: altivec doesn't support nan return nan behavior\n,
+  __FUNCTION__);
+  }
   if (type.width == 32  type.length == 4) {
  intrinsic = llvm.ppc.altivec.vminfp;
  intr_size = 128;
@@ -159,8 +161,6 @@ lp_build_min_simple(struct lp_build_context *bld,
   }
} else if (util_cpu_caps.has_altivec) {
   intr_size = 128;
-  debug_printf(%s: altivec doesn't support nan behavior modes\n,
-   __FUNCTION__);
   if (type.width == 8) {
  if (!type.sign) {
 intrinsic = llvm.ppc.altivec.vminub;
@@ -191,7 +191,7 @@ lp_build_min_simple(struct lp_build_context *bld,
*/
   if (util_cpu_caps.has_sse  type.floating 
   nan_behavior != GALLIVM_NAN_BEHAVIOR_UNDEFINED 
-  nan_behavior != GALLIVM_NAN_RETURN_SECOND) {
+  nan_behavior != GALLIVM_NAN_RETURN_OTHER_SECOND_NONNAN) {
  LLVMValueRef isnan, max;
  max = lp_build_intrinsic_binary_anylength(bld-gallivm, intrinsic,
type,
@@ -227,7 +227,7 @@ lp_build_min_simple(struct lp_build_context *bld,
  return lp_build_select(bld, cond, a, b);
   }
  break;
-  case GALLIVM_NAN_RETURN_SECOND:
+  case GALLIVM_NAN_RETURN_OTHER_SECOND_NONNAN:
  cond = lp_build_cmp_ordered(bld, PIPE_FUNC_LESS, a, b);
  return lp_build_select(bld, cond, a, b);
   case GALLIVM_NAN_BEHAVIOR_UNDEFINED:
@@ -299,8 +299,10 @@ lp_build_max_simple(struct lp_build_context *bld,
   }
}
else if (type.floating  util_cpu_caps.has_altivec) {
-  debug_printf(%s: altivec doesn't support nan behavior modes\n,
-   __FUNCTION__);
+  if (nan_behavior == GALLIVM_NAN_RETURN_NAN) {
+ debug_printf(%s: altivec doesn't support nan return nan behavior\n,
+  __FUNCTION__);
+  }
   if (type.width == 32 || type.length == 4) {
  intrinsic = llvm.ppc.altivec.vmaxfp;
  intr_size = 128;
@@ -336,8 +338,6 @@ lp_build_max_simple(struct lp_build_context *bld,
   }
} else if (util_cpu_caps.has_altivec) {
  intr_size = 128;
- debug_printf(%s: altivec doesn't support nan behavior modes\n,
-  __FUNCTION__);
  if (type.width == 8) {
if (!type.sign) {
  intrinsic = llvm.ppc.altivec.vmaxub;
@@ -362,7 +362,7 @@ lp_build_max_simple(struct lp_build_context *bld,
if(intrinsic) {
   if (util_cpu_caps.has_sse  type.floating 
   nan_behavior != GALLIVM_NAN_BEHAVIOR_UNDEFINED 
-  nan_behavior != GALLIVM_NAN_RETURN_SECOND) {

[Mesa-dev] [PATCH] r600/llvm: Store inputs in function arguments

2013-11-11 Thread Vincent Lejeune
---
 src/gallium/drivers/r600/r600_llvm.c | 119 +++
 src/gallium/drivers/r600/r600_shader.c   |   1 +
 src/gallium/drivers/radeon/radeon_llvm.h |   1 +
 3 files changed, 121 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_llvm.c 
b/src/gallium/drivers/r600/r600_llvm.c
index 5afe3cb..a2ff0ec 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -77,6 +77,11 @@ static void llvm_load_system_value(
default: assert(!unknown system value);
}
 
+#if HAVE_LLVM = 0x0304
+   ctx-system_values[index] = 
LLVMBuildExtractElement(ctx-gallivm.builder,
+   LLVMGetParam(ctx-main_fn, 0), 
lp_build_const_int32((ctx-gallivm), chan),
+   );
+#else
LLVMValueRef reg = lp_build_const_int32(
ctx-soa.bld_base.base.gallivm, chan);
ctx-system_values[index] = build_intrinsic(
@@ -84,8 +89,49 @@ static void llvm_load_system_value(
llvm.R600.load.input,
ctx-soa.bld_base.base.elem_type, reg, 1,
LLVMReadNoneAttribute);
+#endif
 }
 
+#if HAVE_LLVM = 0x0304
+static LLVMValueRef
+llvm_load_input_vector(
+   struct radeon_llvm_context * ctx, unsigned location, unsigned ijregs,
+   boolean interp)
+{
+   LLVMTypeRef VecType;
+   LLVMValueRef Args[3] = {
+   lp_build_const_int32((ctx-gallivm), location)
+   };
+   unsigned ArgCount = 1;
+   if (interp) {
+   VecType = 
LLVMVectorType(ctx-soa.bld_base.base.elem_type, 2);
+   LLVMValueRef IJIndex = LLVMGetParam(ctx-main_fn, 
ijregs / 2);
+   Args[ArgCount++] = 
LLVMBuildExtractElement(ctx-gallivm.builder, IJIndex,
+   lp_build_const_int32((ctx-gallivm), 2 * 
(ijregs % 2)), );
+   Args[ArgCount++] = 
LLVMBuildExtractElement(ctx-gallivm.builder, IJIndex,
+   lp_build_const_int32((ctx-gallivm), 2 * 
(ijregs % 2) + 1), );
+   LLVMValueRef HalfVec[2] = {
+   build_intrinsic(ctx-gallivm.builder, 
llvm.R600.interp.xy,
+   VecType, Args, ArgCount, 
LLVMReadNoneAttribute),
+   build_intrinsic(ctx-gallivm.builder, 
llvm.R600.interp.zw,
+   VecType, Args, ArgCount, 
LLVMReadNoneAttribute)
+   };
+   LLVMValueRef MaskInputs[4] = {
+   lp_build_const_int32((ctx-gallivm), 0),
+   lp_build_const_int32((ctx-gallivm), 1),
+   lp_build_const_int32((ctx-gallivm), 2),
+   lp_build_const_int32((ctx-gallivm), 3)
+   };
+   LLVMValueRef Mask = LLVMConstVector(MaskInputs, 4);
+   return LLVMBuildShuffleVector(ctx-gallivm.builder, 
HalfVec[0], HalfVec[1],
+   Mask, );
+   } else {
+   VecType = 
LLVMVectorType(ctx-soa.bld_base.base.elem_type, 4);
+   return build_intrinsic(ctx-gallivm.builder, 
llvm.R600.interp.const,
+   VecType, Args, ArgCount, LLVMReadNoneAttribute);
+   }
+}
+#else
 static LLVMValueRef
 llvm_load_input_helper(
struct radeon_llvm_context * ctx,
@@ -110,7 +156,22 @@ llvm_load_input_helper(
return build_intrinsic(bb-gallivm-builder, intrinsic,
bb-elem_type, arg[0], arg_count, LLVMReadNoneAttribute);
 }
+#endif
 
+#if HAVE_LLVM = 0x0304
+static LLVMValueRef
+llvm_face_select_helper(
+   struct radeon_llvm_context * ctx,
+   LLVMValueRef face, LLVMValueRef front_color, LLVMValueRef back_color)
+{
+   const struct lp_build_context * bb = ctx-soa.bld_base.base;
+   LLVMValueRef is_front = LLVMBuildFCmp(
+   bb-gallivm-builder, LLVMRealUGT, face,
+   lp_build_const_float(bb-gallivm, 0.0f),);
+   return LLVMBuildSelect(bb-gallivm-builder, is_front,
+   front_color, back_color, );
+}
+#else
 static LLVMValueRef
 llvm_face_select_helper(
struct radeon_llvm_context * ctx,
@@ -124,6 +185,7 @@ llvm_face_select_helper(
return LLVMBuildSelect(bb-gallivm-builder, is_front,
front_color, back_color, );
 }
+#endif
 
 static void llvm_load_input(
struct radeon_llvm_context * ctx,
@@ -132,11 +194,55 @@ static void llvm_load_input(
 {
const struct r600_shader_io * input = ctx-r600_inputs[input_index];
unsigned chan;
+#if HAVE_LLVM  0x0304
unsigned interp = 0;
int ij_index;
+#endif
int two_side = (ctx-two_side  input-name == TGSI_SEMANTIC_COLOR);
LLVMValueRef v;
+#if HAVE_LLVM = 0x0304
+   boolean 

Re: [Mesa-dev] [PATCH] r600/llvm: Store inputs in function arguments

2013-11-11 Thread Tom Stellard
On Mon, Nov 11, 2013 at 03:45:53PM +0100, Vincent Lejeune wrote:

Reviewed-by: Tom Stellard thomas.stell...@amd.com

 ---
  src/gallium/drivers/r600/r600_llvm.c | 119 
 +++
  src/gallium/drivers/r600/r600_shader.c   |   1 +
  src/gallium/drivers/radeon/radeon_llvm.h |   1 +
  3 files changed, 121 insertions(+)
 
 diff --git a/src/gallium/drivers/r600/r600_llvm.c 
 b/src/gallium/drivers/r600/r600_llvm.c
 index 5afe3cb..a2ff0ec 100644
 --- a/src/gallium/drivers/r600/r600_llvm.c
 +++ b/src/gallium/drivers/r600/r600_llvm.c
 @@ -77,6 +77,11 @@ static void llvm_load_system_value(
   default: assert(!unknown system value);
   }
  
 +#if HAVE_LLVM = 0x0304
 + ctx-system_values[index] = 
 LLVMBuildExtractElement(ctx-gallivm.builder,
 + LLVMGetParam(ctx-main_fn, 0), 
 lp_build_const_int32((ctx-gallivm), chan),
 + );
 +#else
   LLVMValueRef reg = lp_build_const_int32(
   ctx-soa.bld_base.base.gallivm, chan);
   ctx-system_values[index] = build_intrinsic(
 @@ -84,8 +89,49 @@ static void llvm_load_system_value(
   llvm.R600.load.input,
   ctx-soa.bld_base.base.elem_type, reg, 1,
   LLVMReadNoneAttribute);
 +#endif
  }
  
 +#if HAVE_LLVM = 0x0304
 +static LLVMValueRef
 +llvm_load_input_vector(
 + struct radeon_llvm_context * ctx, unsigned location, unsigned ijregs,
 + boolean interp)
 +{
 + LLVMTypeRef VecType;
 + LLVMValueRef Args[3] = {
 + lp_build_const_int32((ctx-gallivm), location)
 + };
 + unsigned ArgCount = 1;
 + if (interp) {
 + VecType = 
 LLVMVectorType(ctx-soa.bld_base.base.elem_type, 2);
 + LLVMValueRef IJIndex = LLVMGetParam(ctx-main_fn, 
 ijregs / 2);
 + Args[ArgCount++] = 
 LLVMBuildExtractElement(ctx-gallivm.builder, IJIndex,
 + lp_build_const_int32((ctx-gallivm), 2 * 
 (ijregs % 2)), );
 + Args[ArgCount++] = 
 LLVMBuildExtractElement(ctx-gallivm.builder, IJIndex,
 + lp_build_const_int32((ctx-gallivm), 2 * 
 (ijregs % 2) + 1), );
 + LLVMValueRef HalfVec[2] = {
 + build_intrinsic(ctx-gallivm.builder, 
 llvm.R600.interp.xy,
 + VecType, Args, ArgCount, 
 LLVMReadNoneAttribute),
 + build_intrinsic(ctx-gallivm.builder, 
 llvm.R600.interp.zw,
 + VecType, Args, ArgCount, 
 LLVMReadNoneAttribute)
 + };
 + LLVMValueRef MaskInputs[4] = {
 + lp_build_const_int32((ctx-gallivm), 0),
 + lp_build_const_int32((ctx-gallivm), 1),
 + lp_build_const_int32((ctx-gallivm), 2),
 + lp_build_const_int32((ctx-gallivm), 3)
 + };
 + LLVMValueRef Mask = LLVMConstVector(MaskInputs, 4);
 + return LLVMBuildShuffleVector(ctx-gallivm.builder, 
 HalfVec[0], HalfVec[1],
 + Mask, );
 + } else {
 + VecType = 
 LLVMVectorType(ctx-soa.bld_base.base.elem_type, 4);
 + return build_intrinsic(ctx-gallivm.builder, 
 llvm.R600.interp.const,
 + VecType, Args, ArgCount, LLVMReadNoneAttribute);
 + }
 +}
 +#else
  static LLVMValueRef
  llvm_load_input_helper(
   struct radeon_llvm_context * ctx,
 @@ -110,7 +156,22 @@ llvm_load_input_helper(
   return build_intrinsic(bb-gallivm-builder, intrinsic,
   bb-elem_type, arg[0], arg_count, LLVMReadNoneAttribute);
  }
 +#endif
  
 +#if HAVE_LLVM = 0x0304
 +static LLVMValueRef
 +llvm_face_select_helper(
 + struct radeon_llvm_context * ctx,
 + LLVMValueRef face, LLVMValueRef front_color, LLVMValueRef back_color)
 +{
 + const struct lp_build_context * bb = ctx-soa.bld_base.base;
 + LLVMValueRef is_front = LLVMBuildFCmp(
 + bb-gallivm-builder, LLVMRealUGT, face,
 + lp_build_const_float(bb-gallivm, 0.0f),);
 + return LLVMBuildSelect(bb-gallivm-builder, is_front,
 + front_color, back_color, );
 +}
 +#else
  static LLVMValueRef
  llvm_face_select_helper(
   struct radeon_llvm_context * ctx,
 @@ -124,6 +185,7 @@ llvm_face_select_helper(
   return LLVMBuildSelect(bb-gallivm-builder, is_front,
   front_color, back_color, );
  }
 +#endif
  
  static void llvm_load_input(
   struct radeon_llvm_context * ctx,
 @@ -132,11 +194,55 @@ static void llvm_load_input(
  {
   const struct r600_shader_io * input = ctx-r600_inputs[input_index];
   unsigned chan;
 +#if HAVE_LLVM  0x0304
   unsigned interp = 0;
   int ij_index;
 +#endif
   int two_side = (ctx-two_side 

Re: [Mesa-dev] Batchbuffer question

2013-11-11 Thread Paul Berry
On 8 November 2013 13:38, Kenneth Graunke kenn...@whitecape.org wrote:

 On 11/08/2013 04:49 AM, Rogovin, Kevin wrote:
  Hi all,
 
  As I was poking into the magicks for the batchbuffer, I saw the
  following logical bits of code, that make sense by themselves but get
  me paranoid together. Firstly in intel_batchbuffer_begin() [
  intel_batchbuffer.h, and this is what BEGIN_BATCH maps to] there is a
  intel_batchbuffer_require_space() call that if too much room is
  needed then calls intel_batchbuffer_begin():
 
  from intel_batchbuffer_require_space():
 
115if (intel_batchbuffer_space(brw)  sz)
116   intel_batchbuffer_flush(brw);
 
  and from intel_batchbuffer_space():
 
 80 intel_batchbuffer_space(struct brw_context *brw)
 81 {
 82return (brw-batch.state_batch_offset -
 brw-batch.reserved_space)
 83   - brw-batch.used*4;
 84 }
 
 
  Now, for allocating space for state, there is brw_state_batch():
 
 
128offset = ROUND_DOWN_TO(batch-state_batch_offset - size,
 alignment);
129
130/* If allocating from the top would wrap below the batchbuffer,
 or
131 * if the batch's used space (plus the reserved pad) collides
 with our
132 * space, then flush and try again.
133 */
134if (batch-state_batch_offset  size ||
135offset  4*batch-used + batch-reserved_space) {
136   intel_batchbuffer_flush(brw);
137   offset = ROUND_DOWN_TO(batch-state_batch_offset - size,
 alignment);
138}
 
 
  These taken together, I interpret as meaning that state and commands
  try to be separated by atleast batch-reserved_space bytes. I guess
  state could take up more than (batch-bo-size -
  batch-reserved_space) from that second ROUND_DOWN_TO, but that would
  only happen right after a flush and any state or command afterwards
  would flush too.
 
  Now my questions: 1) it looks like the reserved space is not to be
  used for either state or commands. Is that correct? What is it used
  for?

 To explain a bit more...we store commands (like 3DSTATE_VS) and indirect
 state (like BLEND_STATE) in the same buffer (the batchbuffer).

 We emit commands starting at the top of the buffer, since they need to
 be in order.  Indirect state is always pointed to by a command (i.e.
 3DSTATE_BLEND_STATE_POINTERS), so it can be in any order.  We fill
 indirect state backwards, starting from the end of the buffer.

 Should they meet in the middle, we flush the batch and start a new one.

 It's sort of like how the stack and heap start at opposite sides and
 grow towards each other.

 When we finish a batch, we need to append a few final commands.  These
 use the reserved space.  From intel_batchbuffer.c:

brw-batch.reserved_space = 0;

brw_finish_batch(brw);

/* Mark the end of the buffer. */
intel_batchbuffer_emit_dword(brw, MI_BATCH_BUFFER_END);
if (brw-batch.used  1) {
   /* Round batchbuffer usage to 2 DWORDs. */
   intel_batchbuffer_emit_dword(brw, MI_NOOP);
}

 MI_BATCH_BUFFER_END is fairly self-explanatory, but there are others.
 On Gen4-5, we need to take a snapshot of the PS_DEPTH_COUNT register in
 order to make occlusion queries, so there's a PIPE_CONTROL.  With my
 upcoming performance monitor changes, we also need to take snapshots of
 the observability architecture counters as well, so there will be an
 MI_REPORT_PERF_COUNT.

 See the comments above the BATCH_RESERVED #define, which list all the
 things we might emit.

 Note that, prior to emitting this state, we set
 brw-batch.reserved_space to 0, which makes that space available for
 these final commands.  So we'll always have space and never try to flush
 in the middle of flushing.

  2) if a function first calls brw_state_batch() to place state and it
  barely fits and then calls BEGIN_BATCH that does not fit, then the
  command will refer to an offset on the previous batch buffer, that
  cannot be good. Or does this never happen for other reasons? If so
  what are those reasons?

 Leaving additional indirect state in the buffer is harmless.  We do need
 to remove commands.

 OpenGL draw calls involve emitting a bunch of commands, finishing with a
 3DPRIMITIVE command.  Prior to emitting anything, we call:

   intel_batchbuffer_save_state(brw);

 which saves batch-used and the current number of relocations.  If we
 run out of space before emitting the 3DPRIMITIVE, we call:

 intel_batchbuffer_reset_to_saved(brw);

 which resets the batch-used to the saved value, effectively throwing
 away those commands.  It also calls into libdrm to throw away the extra
 relocations.


Ken,

When you say If we run out of space before emitting the 3DPRIMITIVE, it
sounds from context like you are saying if we run out of batch buffer
space.  I used to think the same thing, however before answering Kevin's
email I looked at the code, and found that this isn't the case.  In fact,
we only use intel_batchbuffer_reset_to_saved() if 

Re: [Mesa-dev] dri3proto requirement (Was: Add DRI3+Present loader)

2013-11-11 Thread Brian Paul

On 11/08/2013 11:49 AM, Eric Anholt wrote:

Jose Fonseca jfons...@vmware.com writes:


This change seems makes dri3proto a hard requirement to build with
automake.  Is that strictly necessary?  I tried to find ubuntu
packages for it to install on my build slave, but it doesn't seem they
exist yet.


Well, we could build more build infrastructure for not building it, but
there are released tarballs and it's a tiny little set of headers.


Since DRI3 depends on several new packages which aren't readily 
available yet (yum, apt-get, etc), I'm really glad to have the 
--disable-dri3 option (Thanks, Armin).


I've tried building the libxshmfence-1.0 package on two different 
systems now and both failed:


$ ./configure --prefix=/usr/local
seems to work

$ make
[...]
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -std=gnu99 
-DHAVE_CONFIG_H -I. -I.. -g -O2 -MT xshmfence.lo -MD -MP -MF 
.deps/xshmfence.Tpo -c -o xshmfence.lo xshmfence.c

../libtool: line 831: X--tag=CC: command not found
../libtool: line 864: libtool: ignoring unknown tag : command not found
../libtool: line 831: X--mode=compile: command not found
../libtool: line 997: *** Warning: inferring the mode of operation is 
deprecated.: command not found
../libtool: line 998: *** Future versions of Libtool will require 
--mode=MODE be specified.: command not found

../libtool: line 1141: Xgcc: command not found
../libtool: line 1141: X-std=gnu99: command not found
../libtool: line 1141: X-DHAVE_CONFIG_H: command not found
../libtool: line 1141: X-I.: command not found
../libtool: line 1141: X-I..: command not found
../libtool: line 1141: X-g: command not found
../libtool: line 1141: X-O2: command not found
../libtool: line 1141: X-MT: command not found
../libtool: line 1141: Xxshmfence.lo: command not found
../libtool: line 1141: X-MD: command not found
../libtool: line 1141: X-MP: command not found
../libtool: line 1141: X-MF: command not found
../libtool: line 1141: X.deps/xshmfence.Tpo: No such file or directory
../libtool: line 1141: X-c: command not found
../libtool: line 1192: Xxshmfence.lo: command not found
../libtool: line 1197: libtool: compile: cannot determine name of 
library object from `': command not found

make[2]: *** [xshmfence.lo] Error 1


-Brian

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


Re: [Mesa-dev] [PATCH] glx: conditionaly build dri3 and present loader (v3)

2013-11-11 Thread Brian Paul

On 11/08/2013 05:00 PM, Matt Turner wrote:

On Fri, Nov 8, 2013 at 3:06 PM, Armin K kre...@email.com wrote:

This patch makes it possible to disable DRI3 if desired.


Reviewed-by: Matt Turner matts...@gmail.com

Unless non-Linux users still need to be able to disable DRI3, by the
time Mesa 10.0 is released I think we want to require these bits for
DRI builds. I'll plan to revert most of this commit before the
release.


I'd like to keep the --disable-dri3 option until the new dependencies 
are easy to resolve (see my other msg).


And if the dependencies aren't easily resolved with yum, apt-get etc. 
let's at least update the documentation with some pointers to where to 
find these things.


Thanks.

-Brian

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


Re: [Mesa-dev] dri3proto requirement (Was: Add DRI3+Present loader)

2013-11-11 Thread Jose Fonseca
I

- Original Message -
 On 11/08/2013 11:49 AM, Eric Anholt wrote:
  Jose Fonseca jfons...@vmware.com writes:
 
  This change seems makes dri3proto a hard requirement to build with
  automake.  Is that strictly necessary?  I tried to find ubuntu
  packages for it to install on my build slave, but it doesn't seem they
  exist yet.
 
  Well, we could build more build infrastructure for not building it, but
  there are released tarballs and it's a tiny little set of headers.
 
 Since DRI3 depends on several new packages which aren't readily
 available yet (yum, apt-get, etc), I'm really glad to have the
 --disable-dri3 option (Thanks, Armin).

I think xshmfence is only used for DRI3, so its requirement could be equally 
forfeited when --disable-dri3 is set.

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


Re: [Mesa-dev] dri3proto requirement (Was: Add DRI3+Present loader)

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 7:58 AM, Brian Paul bri...@vmware.com wrote:
 On 11/08/2013 11:49 AM, Eric Anholt wrote:

 Jose Fonseca jfons...@vmware.com writes:

 This change seems makes dri3proto a hard requirement to build with
 automake.  Is that strictly necessary?  I tried to find ubuntu
 packages for it to install on my build slave, but it doesn't seem they
 exist yet.


 Well, we could build more build infrastructure for not building it, but
 there are released tarballs and it's a tiny little set of headers.


 Since DRI3 depends on several new packages which aren't readily available
 yet (yum, apt-get, etc), I'm really glad to have the --disable-dri3 option
 (Thanks, Armin).

 I've tried building the libxshmfence-1.0 package on two different systems
 now and both failed:

 $ ./configure --prefix=/usr/local
 seems to work

 $ make
 [...]
 /bin/bash ../libtool  --tag=CC   --mode=compile gcc -std=gnu99
 -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT xshmfence.lo -MD -MP -MF
 .deps/xshmfence.Tpo -c -o xshmfence.lo xshmfence.c
 ../libtool: line 831: X--tag=CC: command not found
 ../libtool: line 864: libtool: ignoring unknown tag : command not found
 ../libtool: line 831: X--mode=compile: command not found
 ../libtool: line 997: *** Warning: inferring the mode of operation is
 deprecated.: command not found
 ../libtool: line 998: *** Future versions of Libtool will require
 --mode=MODE be specified.: command not found
 ../libtool: line 1141: Xgcc: command not found
 ../libtool: line 1141: X-std=gnu99: command not found
 ../libtool: line 1141: X-DHAVE_CONFIG_H: command not found
 ../libtool: line 1141: X-I.: command not found
 ../libtool: line 1141: X-I..: command not found
 ../libtool: line 1141: X-g: command not found
 ../libtool: line 1141: X-O2: command not found
 ../libtool: line 1141: X-MT: command not found
 ../libtool: line 1141: Xxshmfence.lo: command not found
 ../libtool: line 1141: X-MD: command not found
 ../libtool: line 1141: X-MP: command not found
 ../libtool: line 1141: X-MF: command not found
 ../libtool: line 1141: X.deps/xshmfence.Tpo: No such file or directory
 ../libtool: line 1141: X-c: command not found
 ../libtool: line 1192: Xxshmfence.lo: command not found
 ../libtool: line 1197: libtool: compile: cannot determine name of library
 object from `': command not found
 make[2]: *** [xshmfence.lo] Error 1


 -Brian

I saw this too. I think it's some kind of packaging failure (autotools
versions much too old on Keith's system?).

I was able to work around it by running autogen.sh to regenerate the scripts. :(
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] dri3proto requirement (Was: Add DRI3+Present loader)

2013-11-11 Thread Brian Paul

On 11/11/2013 10:14 AM, Matt Turner wrote:

On Mon, Nov 11, 2013 at 7:58 AM, Brian Paul bri...@vmware.com wrote:

On 11/08/2013 11:49 AM, Eric Anholt wrote:


Jose Fonseca jfons...@vmware.com writes:


This change seems makes dri3proto a hard requirement to build with
automake.  Is that strictly necessary?  I tried to find ubuntu
packages for it to install on my build slave, but it doesn't seem they
exist yet.



Well, we could build more build infrastructure for not building it, but
there are released tarballs and it's a tiny little set of headers.



Since DRI3 depends on several new packages which aren't readily available
yet (yum, apt-get, etc), I'm really glad to have the --disable-dri3 option
(Thanks, Armin).

I've tried building the libxshmfence-1.0 package on two different systems
now and both failed:

$ ./configure --prefix=/usr/local
seems to work

$ make
[...]
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -std=gnu99
-DHAVE_CONFIG_H -I. -I.. -g -O2 -MT xshmfence.lo -MD -MP -MF
.deps/xshmfence.Tpo -c -o xshmfence.lo xshmfence.c
../libtool: line 831: X--tag=CC: command not found
../libtool: line 864: libtool: ignoring unknown tag : command not found
../libtool: line 831: X--mode=compile: command not found
../libtool: line 997: *** Warning: inferring the mode of operation is
deprecated.: command not found
../libtool: line 998: *** Future versions of Libtool will require
--mode=MODE be specified.: command not found
../libtool: line 1141: Xgcc: command not found
../libtool: line 1141: X-std=gnu99: command not found
../libtool: line 1141: X-DHAVE_CONFIG_H: command not found
../libtool: line 1141: X-I.: command not found
../libtool: line 1141: X-I..: command not found
../libtool: line 1141: X-g: command not found
../libtool: line 1141: X-O2: command not found
../libtool: line 1141: X-MT: command not found
../libtool: line 1141: Xxshmfence.lo: command not found
../libtool: line 1141: X-MD: command not found
../libtool: line 1141: X-MP: command not found
../libtool: line 1141: X-MF: command not found
../libtool: line 1141: X.deps/xshmfence.Tpo: No such file or directory
../libtool: line 1141: X-c: command not found
../libtool: line 1192: Xxshmfence.lo: command not found
../libtool: line 1197: libtool: compile: cannot determine name of library
object from `': command not found
make[2]: *** [xshmfence.lo] Error 1


-Brian


I saw this too. I think it's some kind of packaging failure (autotools
versions much too old on Keith's system?).

I was able to work around it by running autogen.sh to regenerate the scripts. :(


The tarball doesn't contain the autogen.sh script.  And I don't see a 
pointer to the git tree in the tarball.  There's no README or anything.


-Brian


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


Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Matt Turner
Need a better commit message. I like the kernel's guidelines which
remind us that the summary becomes the globally-unique identifier for
the patch.

Style comments:

On Mon, Nov 11, 2013 at 1:35 AM, Kevin Rogovin kevin.rogo...@intel.com wrote:
 This patch adds a function interface for enabling no wrap on batch commands,
 adds to it assert enforcement that the number bytes added to the
 batch buffer does not exceed a passed value and finally this is used
 in brw_try_draw_prims() to help make sure that estimated_max_prim_size
 is a good value.

 ---
  src/mesa/drivers/dri/i965/brw_context.h   | 64 
 +++
  src/mesa/drivers/dri/i965/brw_draw.c  |  4 +-
  src/mesa/drivers/dri/i965/brw_state_batch.c   | 15 ++-
  src/mesa/drivers/dri/i965/intel_batchbuffer.h |  5 +++
  4 files changed, 84 insertions(+), 4 deletions(-)

 diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
 b/src/mesa/drivers/dri/i965/brw_context.h
 index 8b1cbb3..953f2cf 100644
 --- a/src/mesa/drivers/dri/i965/brw_context.h
 +++ b/src/mesa/drivers/dri/i965/brw_context.h
 @@ -1028,8 +1028,29 @@ struct brw_context
 uint32_t reset_count;

 struct intel_batchbuffer batch;
 +
 +   /*!\var no_batch_wrap
 + While no_batch_wrap is true, the batch buffer must not
 + be flushed. Use the functions begin_no_batch_wrap() and
 + end_no_batch_wrap() to mark the start and end points
 + that the batch buffer must not be flushed.
 +*/

Multiline comments should be

/*
 *
 *
 */

and put a space after /*

 bool no_batch_wrap;

 +   /*!\var max_expected_batch_size_during_no_batch_wrap
 + If \ref no_batch_wrap is true, specifies the number
 + of bytes that are expected before \ref no_batch_wrap
 + is set to false.
 +*/
 +   int max_expected_batch_size_during_no_batch_wrap;
 +
 +   /*!\var number_bytes_consumed_during_no_batch_wrap
 + records the number of bytes consumed so far
 + in the batch buffer since the last time \ref
 + no_batch_wrap was set to true
 +*/
 +   int number_bytes_consumed_during_no_batch_wrap;
 +
 struct {
drm_intel_bo *bo;
GLuint offset;
 @@ -1450,6 +1471,49 @@ is_power_of_two(uint32_t value)
 return (value  (value - 1)) == 0;
  }

 +/*!\fn begin_no_batch_wrap
 +  Function to mark the start of a sequence of commands and state
 +  added to the batch buffer that must not be partitioned by
 +  a flush.
 +  Requirements:
 +  - no_batch_wrap is false
 +
 +  Output/side effects:
 +  - no_batch_wrap set to true
 +  - max_expected_batch_size_during_no_batch_wrap set
 +  - number_bytes_consumed_during_no_batch_wrap reset to 0
 +
 +  \ref brw GL context
 +  \ref pmax_expected_batch_size value specifying expected maximum number of 
 bytes to
 +be consumed in the batch buffer
 + */
 +static INLINE void
 +begin_no_batch_wrap(struct brw_context *brw, int pmax_expected_batch_size)
 +{
 +   assert(!brw-no_batch_wrap);
 +   brw-no_batch_wrap=true;
 +   
 brw-max_expected_batch_size_during_no_batch_wrap=pmax_expected_batch_size;
 +   brw-number_bytes_consumed_during_no_batch_wrap=0;
 +}
 +
 +/*!\fn end_no_batch_wrap
 +  Function to mark the end of a sequence of commands and state
 +  added to the batch buffer that must not be partitioned by
 +  a flush.
 +  Requirements:
 +  - no_batch_wrap is true
 +
 +  Output/side effects:
 +  - no_batch_wrap set to false
 + */
 +static INLINE void
 +end_no_batch_wrap(struct brw_context *brw)
 +{
 +   assert(brw-no_batch_wrap);
 +   brw-no_batch_wrap=false;
 +}
 +
 +
  /*==
   * brw_vtbl.c
   */
 diff --git a/src/mesa/drivers/dri/i965/brw_draw.c 
 b/src/mesa/drivers/dri/i965/brw_draw.c
 index 7b33b76..12f0ffe 100644
 --- a/src/mesa/drivers/dri/i965/brw_draw.c
 +++ b/src/mesa/drivers/dri/i965/brw_draw.c
 @@ -416,14 +416,14 @@ retry:
 * *_set_prim or intel_batchbuffer_flush(), which only impacts
 * brw-state.dirty.brw.
 */
 +  begin_no_batch_wrap(brw, estimated_max_prim_size);
if (brw-state.dirty.brw) {
 -brw-no_batch_wrap = true;
  brw_upload_state(brw);
}

brw_emit_prim(brw, prims[i], brw-primitive);
 +  end_no_batch_wrap(brw);

 -  brw-no_batch_wrap = false;

if (dri_bufmgr_check_aperture_space(brw-batch.bo, 1)) {
  if (!fail_next) {
 diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c 
 b/src/mesa/drivers/dri/i965/brw_state_batch.c
 index c71d2f3..ff51c21 100644
 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c
 +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
 @@ -9,8 +9,7 @@
   without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense, and/or sell copies of the Software, and to
   permit persons to whom the Software is furnished to do so, subject to
 - the following conditions:
 -
 + the following conditions:

Don't think you meant to make this change?

   The above 

Re: [Mesa-dev] dri3proto requirement (Was: Add DRI3+Present loader)

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 9:19 AM, Brian Paul bri...@vmware.com wrote:
 The tarball doesn't contain the autogen.sh script.  And I don't see a
 pointer to the git tree in the tarball.  There's no README or anything.

Oh. :(

The repo is git://anongit.freedesktop.org/xorg/lib/libxshmfence

You can get the effect of autogen.sh by running `autoreconf -vfi`
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] Batchbuffer question

2013-11-11 Thread Kenneth Graunke
On 11/11/2013 07:31 AM, Paul Berry wrote:
 On 8 November 2013 13:38, Kenneth Graunke kenn...@whitecape.org
 mailto:kenn...@whitecape.org wrote:
 
 On 11/08/2013 04:49 AM, Rogovin, Kevin wrote:
  Hi all,
 
  As I was poking into the magicks for the batchbuffer, I saw the
  following logical bits of code, that make sense by themselves but get
  me paranoid together. Firstly in intel_batchbuffer_begin() [
  intel_batchbuffer.h, and this is what BEGIN_BATCH maps to] there is a
  intel_batchbuffer_require_space() call that if too much room is
  needed then calls intel_batchbuffer_begin():
 
  from intel_batchbuffer_require_space():
 
115if (intel_batchbuffer_space(brw)  sz)
116   intel_batchbuffer_flush(brw);
 
  and from intel_batchbuffer_space():
 
 80 intel_batchbuffer_space(struct brw_context *brw)
 81 {
 82return (brw-batch.state_batch_offset -
 brw-batch.reserved_space)
 83   - brw-batch.used*4;
 84 }
 
 
  Now, for allocating space for state, there is brw_state_batch():
 
 
128offset = ROUND_DOWN_TO(batch-state_batch_offset - size,
 alignment);
129
130/* If allocating from the top would wrap below the
 batchbuffer, or
131 * if the batch's used space (plus the reserved pad)
 collides with our
132 * space, then flush and try again.
133 */
134if (batch-state_batch_offset  size ||
135offset  4*batch-used + batch-reserved_space) {
136   intel_batchbuffer_flush(brw);
137   offset = ROUND_DOWN_TO(batch-state_batch_offset -
 size, alignment);
138}
 
 
  These taken together, I interpret as meaning that state and commands
  try to be separated by atleast batch-reserved_space bytes. I guess
  state could take up more than (batch-bo-size -
  batch-reserved_space) from that second ROUND_DOWN_TO, but that would
  only happen right after a flush and any state or command afterwards
  would flush too.
 
  Now my questions: 1) it looks like the reserved space is not to be
  used for either state or commands. Is that correct? What is it used
  for?
 
 To explain a bit more...we store commands (like 3DSTATE_VS) and indirect
 state (like BLEND_STATE) in the same buffer (the batchbuffer).
 
 We emit commands starting at the top of the buffer, since they need to
 be in order.  Indirect state is always pointed to by a command (i.e.
 3DSTATE_BLEND_STATE_POINTERS), so it can be in any order.  We fill
 indirect state backwards, starting from the end of the buffer.
 
 Should they meet in the middle, we flush the batch and start a new one.
 
 It's sort of like how the stack and heap start at opposite sides and
 grow towards each other.
 
 When we finish a batch, we need to append a few final commands.  These
 use the reserved space.  From intel_batchbuffer.c:
 
brw-batch.reserved_space = 0;
 
brw_finish_batch(brw);
 
/* Mark the end of the buffer. */
intel_batchbuffer_emit_dword(brw, MI_BATCH_BUFFER_END);
if (brw-batch.used  1) {
   /* Round batchbuffer usage to 2 DWORDs. */
   intel_batchbuffer_emit_dword(brw, MI_NOOP);
}
 
 MI_BATCH_BUFFER_END is fairly self-explanatory, but there are others.
 On Gen4-5, we need to take a snapshot of the PS_DEPTH_COUNT register in
 order to make occlusion queries, so there's a PIPE_CONTROL.  With my
 upcoming performance monitor changes, we also need to take snapshots of
 the observability architecture counters as well, so there will be an
 MI_REPORT_PERF_COUNT.
 
 See the comments above the BATCH_RESERVED #define, which list all the
 things we might emit.
 
 Note that, prior to emitting this state, we set
 brw-batch.reserved_space to 0, which makes that space available for
 these final commands.  So we'll always have space and never try to flush
 in the middle of flushing.
 
  2) if a function first calls brw_state_batch() to place state and it
  barely fits and then calls BEGIN_BATCH that does not fit, then the
  command will refer to an offset on the previous batch buffer, that
  cannot be good. Or does this never happen for other reasons? If so
  what are those reasons?
 
 Leaving additional indirect state in the buffer is harmless.  We do need
 to remove commands.
 
 OpenGL draw calls involve emitting a bunch of commands, finishing with a
 3DPRIMITIVE command.  Prior to emitting anything, we call:
 
   intel_batchbuffer_save_state(brw);
 
 which saves batch-used and the current number of relocations.  If we
 run out of space before emitting the 3DPRIMITIVE, we call:
 
 intel_batchbuffer_reset_to_saved(brw);
 
 which 

[Mesa-dev] [RFC] Haiku viewport / framebuffer invalidation

2013-11-11 Thread Alexander von Gluck IV
I've been banging my head against a wall for a while now on this.

So the Haiku applications that call glViewport(.. for window
resizes,etc never actually execute the Driver's Viewport call.
(aka ctx-Driver.Viewport:
http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/targets/haiku-softpipe/GalliumContext.cpp#n346)

I found void GLAPIENTRY _mesa_Viewport in viewport.c, however I
have a feeling this never gets called as softpipe is a Gallium
driver not a Mesa driver.

I know there are stamp's in the st_context and st_framebuffer, however
++'ing them on a window resize doesn't seem to solve the issue.

Our libGL actually is aware of window resizes, so I have a fix in that
manually calls the viewport calls on resize.. however I don't think
this is a good long term fix as the viewport is always forced to the
size of the window (which isn't correct was far as I know)

http://cgit.freedesktop.org/mesa/mesa/commit/?id=e759f1c111018949db114e76ebf1a723525fb802

Thoughts?

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


Re: [Mesa-dev] [PATCH] mesa: Add ARB_texture_view to Mesa core

2013-11-11 Thread Ian Romanick
On 11/05/2013 11:36 AM, Courtney Goeltzenleuchter wrote:
 On Tue, Nov 5, 2013 at 12:22 PM, Ian Romanick i...@freedesktop.org
 mailto:i...@freedesktop.org wrote:
 
 On 11/05/2013 09:44 AM, Chris Forbes wrote:
  So, you can create a GL_LUMINANCE view of a GL_LUMINANCE texture.
  Hmm...
 
  My understanding is you can't actually, since views can only be
  created from immutable-format textures, and GL_LUMINANCE is not a
  sized internalformat, so it can't be used with TexStorage?
 
 I was just using GL_LUMINANCE as shorthand for GL_LUMINANCE4,
 GL_LUMINANCE8, GL_LUMINANCE12, and GL_LUMINANCE16.  As far as I can
 tell,
 
 glGenTextures(1, tex);
 glBindTexture(GL_TEXTURE_2D, tex);
 glTexStorage2D(GL_TEXTURE_2D,
 8,
 GL_LUMINANCE8,
 1024, 1024);
 
 is perfectly valid.  Sayeth GL_ARB_texture_storage:
 
 Accepted by the internalformat parameter of TexStorage* when
 implemented on OpenGL ES:
 
 ALPHA8_EXT 0x803C
 LUMINANCE8_EXT 0x8040
 LUMINANCE8_ALPHA8_EXT  0x8045
 
 I guess that means GL_LUMINANCE4, GL_LUMINANCE12, and GL_LUMINANCE16 are
 out.  As are all GL_INTENSITY formats.  There are still these three
 legacy formats to handle.
 
 So, if we support GL_ARB_texture_view in a compatibility profile,
 
 glGenTextures(1, view);
 glTextureView(view,
 GL_TEXTURE_2D,
 tex,
 GL_LUMINANCE8,
 1, 1, 1, 1);
 
 is also valid.
 
 Right?
 
  
 The spec is pickier than that.  For 8bit texels the allowed internal
 formats are: R8UI, R8I, R8, R8_SNORM
 I use the table specified in the ARB_texture_view to translate the
 target internalFormat passed to glTextureView into a VIEW_CLASS.
 GL_LUMINANCE8 does not have a valid VIEW_CLASS and could not match the
 internal format of the source texture.

I don't think it matters that GL_LUMINANCE8 is missing from the table or
that it doesn't have a VIEW_CLASS.  The GL_ARB_texture_view spec says
(emphasis mine):

   The two textures' internal formats must be compatible according to
   Table 3.X.2 (Compatible internal formats for TextureView) if the
   internal format exists in that table and *the internal formats
   must be identical if not in that table*, or else an
   INVALID_OPERATION error is generated.

In my above code example, the internal formats are identical.  By my
reading of the above quoted text, that code is legal.  We should modify
one of the texture_view tests to use these legacy formats, and try that
test on NVIDIA with a compatibility profile.

 That makes me wonder, should I be trying to map the target
 internalformat into a driver internal format?
 
 Courtney
 
 -- 
 Courtney Goeltzenleuchter
 LunarG

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


[Mesa-dev] [Bug 71506] New: indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

  Priority: medium
Bug ID: 71506
  Keywords: regression
  Assignee: mesa-dev@lists.freedesktop.org
   Summary: indirect_glx.c:350: multiple definition of
`indirect_create_context'
  Severity: blocker
Classification: Unclassified
OS: Linux (All)
  Reporter: v...@freedesktop.org
  Hardware: x86-64 (AMD64)
Status: NEW
   Version: git
 Component: Mesa core
   Product: Mesa

indirect_glx.c:350: multiple definition of `indirect_create_context'

mesa: ab2da985b67704ac556da591e227b41f3a2e1419 (master)

$ ./autogen.sh --disable-dri3 --disable-xvmc --with-dri-drivers=
--with-gallium-drivers=swrast
$ make check
[...]
  CXXLDglx-test
../../../src/glx/.libs/libglx.a(indirect_glx.o): In function
`indirect_create_context':
src/glx/indirect_glx.c:350: multiple definition of `indirect_create_context'
fake_glx_screen.o:src/glx/tests/fake_glx_screen.cpp:56: first defined here

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


Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Ian Romanick
On 11/11/2013 01:35 AM, Kevin Rogovin wrote:
 This patch adds a function interface for enabling no wrap on batch commands,
 adds to it assert enforcement that the number bytes added to the
 batch buffer does not exceed a passed value and finally this is used
 in brw_try_draw_prims() to help make sure that estimated_max_prim_size
 is a good value.

My style comments in addition to Matt's are below.

 ---
  src/mesa/drivers/dri/i965/brw_context.h   | 64 
 +++
  src/mesa/drivers/dri/i965/brw_draw.c  |  4 +-
  src/mesa/drivers/dri/i965/brw_state_batch.c   | 15 ++-
  src/mesa/drivers/dri/i965/intel_batchbuffer.h |  5 +++
  4 files changed, 84 insertions(+), 4 deletions(-)
 
 diff --git a/src/mesa/drivers/dri/i965/brw_context.h 
 b/src/mesa/drivers/dri/i965/brw_context.h
 index 8b1cbb3..953f2cf 100644
 --- a/src/mesa/drivers/dri/i965/brw_context.h
 +++ b/src/mesa/drivers/dri/i965/brw_context.h
 @@ -1028,8 +1028,29 @@ struct brw_context
 uint32_t reset_count;
  
 struct intel_batchbuffer batch;
 +
 +   /*!\var no_batch_wrap
 + While no_batch_wrap is true, the batch buffer must not
 + be flushed. Use the functions begin_no_batch_wrap() and
 + end_no_batch_wrap() to mark the start and end points
 + that the batch buffer must not be flushed.
 +*/

The way we've been using Doxygen comments is more like:

  /**
   * Brief description
   *
   * Detailed description in the cases where it's actually
   * necessary.
   */
 bool no_batch_wrap;
  
 +   /*!\var max_expected_batch_size_during_no_batch_wrap
 + If \ref no_batch_wrap is true, specifies the number
 + of bytes that are expected before \ref no_batch_wrap
 + is set to false.
 +*/
 +   int max_expected_batch_size_during_no_batch_wrap;
 +
 +   /*!\var number_bytes_consumed_during_no_batch_wrap
 + records the number of bytes consumed so far
 + in the batch buffer since the last time \ref 
 + no_batch_wrap was set to true
 +*/
 +   int number_bytes_consumed_during_no_batch_wrap;
 +
 struct {
drm_intel_bo *bo;
GLuint offset;
 @@ -1450,6 +1471,49 @@ is_power_of_two(uint32_t value)
 return (value  (value - 1)) == 0;
  }
  
 +/*!\fn begin_no_batch_wrap
 +  Function to mark the start of a sequence of commands and state 
 +  added to the batch buffer that must not be partitioned by
 +  a flush. 
 +  Requirements: 
 +  - no_batch_wrap is false
 +
 +  Output/side effects:
 +  - no_batch_wrap set to true
 +  - max_expected_batch_size_during_no_batch_wrap set
 +  - number_bytes_consumed_during_no_batch_wrap reset to 0
 +
 +  \ref brw GL context
 +  \ref pmax_expected_batch_size value specifying expected maximum number of 
 bytes to 
 +be consumed in the batch buffer  
 + */ 

Likewise for functions:

/**
 * Brief description of function
 *
 * Details about the implementation assumptions, etc.
 *
 * \param brw   Context pointer
 * \param pmax_expected_batch_size  Value specifying expected maximum
 *  number of bytes to be consumed in
 *  the batch buffer.
 */
 +static INLINE void
 +begin_no_batch_wrap(struct brw_context *brw, int pmax_expected_batch_size)
 +{
 +   assert(!brw-no_batch_wrap);
 +   brw-no_batch_wrap=true;
 +   
 brw-max_expected_batch_size_during_no_batch_wrap=pmax_expected_batch_size;
 +   brw-number_bytes_consumed_during_no_batch_wrap=0;
 +}
 +
 +/*!\fn end_no_batch_wrap
 +  Function to mark the end of a sequence of commands and state 
 +  added to the batch buffer that must not be partitioned by
 +  a flush. 
 +  Requirements:
 +  - no_batch_wrap is true
 +
 +  Output/side effects:
 +  - no_batch_wrap set to false
 + */
 +static INLINE void
 +end_no_batch_wrap(struct brw_context *brw)
 +{
 +   assert(brw-no_batch_wrap);
 +   brw-no_batch_wrap=false;
 +}
 +
 +
  /*==
   * brw_vtbl.c
   */
 diff --git a/src/mesa/drivers/dri/i965/brw_draw.c 
 b/src/mesa/drivers/dri/i965/brw_draw.c
 index 7b33b76..12f0ffe 100644
 --- a/src/mesa/drivers/dri/i965/brw_draw.c
 +++ b/src/mesa/drivers/dri/i965/brw_draw.c
 @@ -416,14 +416,14 @@ retry:
 * *_set_prim or intel_batchbuffer_flush(), which only impacts
 * brw-state.dirty.brw.
 */
 +  begin_no_batch_wrap(brw, estimated_max_prim_size);
if (brw-state.dirty.brw) {
 -  brw-no_batch_wrap = true;
brw_upload_state(brw);
}
  
brw_emit_prim(brw, prims[i], brw-primitive);
 +  end_no_batch_wrap(brw);
  
 -  brw-no_batch_wrap = false;
  
if (dri_bufmgr_check_aperture_space(brw-batch.bo, 1)) {
if (!fail_next) {
 diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c 
 b/src/mesa/drivers/dri/i965/brw_state_batch.c
 index c71d2f3..ff51c21 100644
 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c
 +++ 

[Mesa-dev] [PATCH 12/27] gallium/drivers: enable automake subdir-objects

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/drivers/freedreno/Makefile.am | 2 ++
 src/gallium/drivers/ilo/Makefile.am   | 2 ++
 src/gallium/drivers/nouveau/Makefile.am   | 2 ++
 src/gallium/drivers/r300/Makefile.am  | 2 ++
 src/gallium/drivers/r600/Makefile.am  | 2 ++
 src/gallium/drivers/svga/Makefile.am  | 2 ++
 6 files changed, 12 insertions(+)

diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index 22fd790..a7b307a 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/ilo/Makefile.am 
b/src/gallium/drivers/ilo/Makefile.am
index 0aa4a33..b5f6400 100644
--- a/src/gallium/drivers/ilo/Makefile.am
+++ b/src/gallium/drivers/ilo/Makefile.am
@@ -21,6 +21,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/nouveau/Makefile.am 
b/src/gallium/drivers/nouveau/Makefile.am
index c4b51d9..369dada 100644
--- a/src/gallium/drivers/nouveau/Makefile.am
+++ b/src/gallium/drivers/nouveau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/r300/Makefile.am 
b/src/gallium/drivers/r300/Makefile.am
index 4edeb47..9d66003 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/r600/Makefile.am 
b/src/gallium/drivers/r600/Makefile.am
index 0490ba2..cede6fa 100644
--- a/src/gallium/drivers/r600/Makefile.am
+++ b/src/gallium/drivers/r600/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
diff --git a/src/gallium/drivers/svga/Makefile.am 
b/src/gallium/drivers/svga/Makefile.am
index 7eacd90..b6fed00 100644
--- a/src/gallium/drivers/svga/Makefile.am
+++ b/src/gallium/drivers/svga/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
+
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 13/27] targets/r300: move drm_target.c to common folder

2013-11-11 Thread Emil Velikov
... and symlink for each target.
Make automake's subdir-objects work for r300.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/targets/r300/common/drm_target.c | 54 
 src/gallium/targets/r300/dri/Makefile.am |  2 +-
 src/gallium/targets/r300/dri/drm_target.c|  1 +
 src/gallium/targets/r300/drm_target.c| 54 
 4 files changed, 56 insertions(+), 55 deletions(-)
 create mode 100644 src/gallium/targets/r300/common/drm_target.c
 create mode 12 src/gallium/targets/r300/dri/drm_target.c
 delete mode 100644 src/gallium/targets/r300/drm_target.c

diff --git a/src/gallium/targets/r300/common/drm_target.c 
b/src/gallium/targets/r300/common/drm_target.c
new file mode 100644
index 000..2c10bbd
--- /dev/null
+++ b/src/gallium/targets/r300/common/drm_target.c
@@ -0,0 +1,54 @@
+/**
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * Software), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include target-helpers/inline_debug_helper.h
+#include state_tracker/drm_driver.h
+#include radeon/drm/radeon_drm_public.h
+#include radeon/drm/radeon_winsys.h
+#include r300/r300_public.h
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+   struct radeon_winsys *sws;
+
+   sws = radeon_drm_winsys_create(fd);
+   if (!sws)
+  return NULL;
+
+   if (!sws-screen) {
+  sws-screen = r300_screen_create(sws);
+  if (!sws-screen)
+ return NULL;
+
+  sws-screen = debug_screen_wrap(sws-screen);
+   }
+
+   return sws-screen;
+}
+
+DRM_DRIVER_DESCRIPTOR(r300, radeon, create_screen, NULL)
diff --git a/src/gallium/targets/r300/dri/Makefile.am 
b/src/gallium/targets/r300/dri/Makefile.am
index 4b41c30..3f659c9 100644
--- a/src/gallium/targets/r300/dri/Makefile.am
+++ b/src/gallium/targets/r300/dri/Makefile.am
@@ -42,7 +42,7 @@ dri_LTLIBRARIES = r300_dri.la
 
 nodist_EXTRA_r300_dri_la_SOURCES = dummy.cpp
 r300_dri_la_SOURCES = \
-   ../drm_target.c
+   drm_target.c
 
 r300_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
 
diff --git a/src/gallium/targets/r300/dri/drm_target.c 
b/src/gallium/targets/r300/dri/drm_target.c
new file mode 12
index 000..6955421
--- /dev/null
+++ b/src/gallium/targets/r300/dri/drm_target.c
@@ -0,0 +1 @@
+../common/drm_target.c
\ No newline at end of file
diff --git a/src/gallium/targets/r300/drm_target.c 
b/src/gallium/targets/r300/drm_target.c
deleted file mode 100644
index 2c10bbd..000
--- a/src/gallium/targets/r300/drm_target.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * Software), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 

[Mesa-dev] [PATCH 18/27] targets/vdpau: move linker flags to Automake.inc

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc   |  7 +++
 src/gallium/targets/r600/vdpau/Makefile.am | 10 +++---
 src/gallium/targets/radeonsi/vdpau/Makefile.am | 10 +++---
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  7 +++
 4 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index b242bb4..765fdd2 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -36,3 +36,10 @@ GALLIUM_VIDEO_CFLAGS = \
$(PTHREAD_CFLAGS) \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
+
+GALLIUM_VDPAU_LINKER_FLAGS = \
+   -module \
+   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
+   -export-symbols-regex $(VDPAU_EXPORTS) \
+   -shared \
+   -no-undefined
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 742df52..3a65a6f 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# Note: Make sure VDPAU_EXPORTS is defined before including Automake.inc
+VDPAU_EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -28,18 +30,12 @@ AM_CFLAGS = \
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_r600.la
 
-EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
-
 libvdpau_r600_la_SOURCES = \
drm_target.c \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libvdpau_r600_la_LDFLAGS = \
-   -module \
-   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -export-symbols-regex $(EXPORTS) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_r600_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 9b14634..cd4dcfc 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# Note: Make sure VDPAU_EXPORTS is defined before including Automake.inc
+VDPAU_EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -28,19 +30,13 @@ AM_CFLAGS = \
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_radeonsi.la
 
-EXPORTS = '^(vdp_imp_device_create_x11|radeon_drm_winsys_create)$$'
-
 nodist_EXTRA_libvdpau_radeonsi_la_SOURCES = dummy.cpp
 libvdpau_radeonsi_la_SOURCES = \
drm_target.c \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libvdpau_radeonsi_la_LDFLAGS = \
-   -module \
-   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -export-symbols-regex $(EXPORTS) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_radeonsi_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 20eb920..8a15d46 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -20,6 +20,8 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+# Note: Make sure VDPAU_EXPORTS is defined before including Automake.inc
+VDPAU_EXPORTS = '^(vdp_imp_device_create_x11|nouveau_drm_screen_create)$$'
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
@@ -34,10 +36,7 @@ libvdpau_nouveau_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libvdpau_nouveau_la_LDFLAGS = \
-   -module \
-   -version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_nouveau_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 02/27] Android: remove unused MESA_ENABLED_APIS variable

2013-11-11 Thread Emil Velikov
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/mesa/Android.libmesa_dricore.mk | 2 --
 src/mesa/Android.libmesa_st_mesa.mk | 2 --
 src/mesa/program/Android.mk | 2 --
 3 files changed, 6 deletions(-)

diff --git a/src/mesa/Android.libmesa_dricore.mk 
b/src/mesa/Android.libmesa_dricore.mk
index 3679b50..0db5825 100644
--- a/src/mesa/Android.libmesa_dricore.mk
+++ b/src/mesa/Android.libmesa_dricore.mk
@@ -38,8 +38,6 @@ include $(CLEAR_VARS)
 LOCAL_MODULE := libmesa_dricore
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
-MESA_ENABLED_APIS := ES1 ES2 GL
-
 LOCAL_SRC_FILES := \
$(MESA_FILES)
 
diff --git a/src/mesa/Android.libmesa_st_mesa.mk 
b/src/mesa/Android.libmesa_st_mesa.mk
index e7203c4..e6374a6 100644
--- a/src/mesa/Android.libmesa_st_mesa.mk
+++ b/src/mesa/Android.libmesa_st_mesa.mk
@@ -37,8 +37,6 @@ include $(CLEAR_VARS)
 
 LOCAL_MODULE := libmesa_st_mesa
 
-MESA_ENABLED_APIS := ES1 ES2
-
 LOCAL_SRC_FILES := \
$(MESA_GALLIUM_FILES)
 
diff --git a/src/mesa/program/Android.mk b/src/mesa/program/Android.mk
index 29a1b6a..e85afe6 100644
--- a/src/mesa/program/Android.mk
+++ b/src/mesa/program/Android.mk
@@ -47,8 +47,6 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 
 intermediates := $(call local-intermediates-dir)
 
-MESA_ENABLED_APIS := ES1 ES2
-
 # TODO(chadv): In Makefile.sources, move these vars to a different list so we 
can
 # remove this kludge.
 generated_sources_basenames := \
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 14/27] targets/r600: move drm_target.c to common folder

2013-11-11 Thread Emil Velikov
... and symlink for each target.
Make automake's subdir-objects work for r600.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/targets/r600/common/drm_target.c | 69 
 src/gallium/targets/r600/dri/Makefile.am |  2 +-
 src/gallium/targets/r600/dri/drm_target.c|  1 +
 src/gallium/targets/r600/drm_target.c| 69 
 src/gallium/targets/r600/vdpau/Makefile.am   |  2 +-
 src/gallium/targets/r600/vdpau/drm_target.c  |  1 +
 src/gallium/targets/r600/xvmc/Makefile.am|  2 +-
 src/gallium/targets/r600/xvmc/drm_target.c   |  1 +
 8 files changed, 75 insertions(+), 72 deletions(-)
 create mode 100644 src/gallium/targets/r600/common/drm_target.c
 create mode 12 src/gallium/targets/r600/dri/drm_target.c
 delete mode 100644 src/gallium/targets/r600/drm_target.c
 create mode 12 src/gallium/targets/r600/vdpau/drm_target.c
 create mode 12 src/gallium/targets/r600/xvmc/drm_target.c

diff --git a/src/gallium/targets/r600/common/drm_target.c 
b/src/gallium/targets/r600/common/drm_target.c
new file mode 100644
index 000..28004ac
--- /dev/null
+++ b/src/gallium/targets/r600/common/drm_target.c
@@ -0,0 +1,69 @@
+/**
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * Software), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include state_tracker/drm_driver.h
+#include target-helpers/inline_debug_helper.h
+#include radeon/drm/radeon_drm_public.h
+#include radeon/drm/radeon_winsys.h
+#include r600/r600_public.h
+
+static struct pipe_screen *create_screen(int fd)
+{
+   struct radeon_winsys *radeon;
+
+   radeon = radeon_drm_winsys_create(fd);
+   if (!radeon)
+  return NULL;
+
+   if (!radeon-screen) {
+  radeon-screen = r600_screen_create(radeon);
+  if (!radeon-screen)
+ return NULL;
+
+  radeon-screen = debug_screen_wrap(radeon-screen);
+   }
+
+   return radeon-screen;
+}
+
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+  return throttle_ret;
+   default:
+  break;
+   }
+   return NULL;
+}
+
+DRM_DRIVER_DESCRIPTOR(r600, radeon, create_screen, drm_configuration)
diff --git a/src/gallium/targets/r600/dri/Makefile.am 
b/src/gallium/targets/r600/dri/Makefile.am
index c7fca32..b5ea37a 100644
--- a/src/gallium/targets/r600/dri/Makefile.am
+++ b/src/gallium/targets/r600/dri/Makefile.am
@@ -41,7 +41,7 @@ dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = r600_dri.la
 
 r600_dri_la_SOURCES = \
-   ../drm_target.c
+   drm_target.c
 
 r600_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
 
diff --git a/src/gallium/targets/r600/dri/drm_target.c 
b/src/gallium/targets/r600/dri/drm_target.c
new file mode 12
index 000..6955421
--- /dev/null
+++ b/src/gallium/targets/r600/dri/drm_target.c
@@ -0,0 +1 @@
+../common/drm_target.c
\ No newline at end of file
diff --git a/src/gallium/targets/r600/drm_target.c 
b/src/gallium/targets/r600/drm_target.c
deleted file mode 100644
index 28004ac..000
--- a/src/gallium/targets/r600/drm_target.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * Software), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit 

[Mesa-dev] [PATCH 16/27] gallium/drivers: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
* minimise flags duplication
* distingush between VISIBILITY C and CXX flags
* set only required flags - C and/or CXX

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc  | 22 ++
 src/gallium/drivers/freedreno/Makefile.am | 10 --
 src/gallium/drivers/galahad/Makefile.am   |  4 +---
 src/gallium/drivers/i915/Makefile.am  |  8 +++-
 src/gallium/drivers/identity/Makefile.am  |  4 +---
 src/gallium/drivers/ilo/Makefile.am   |  8 ++--
 src/gallium/drivers/llvmpipe/Makefile.am  | 13 ++---
 src/gallium/drivers/noop/Makefile.am  |  4 +---
 src/gallium/drivers/nouveau/Makefile.am   | 10 --
 src/gallium/drivers/r300/Makefile.am  | 12 +---
 src/gallium/drivers/r600/Makefile.am  | 28 ++--
 src/gallium/drivers/radeon/Makefile.am| 22 +++---
 src/gallium/drivers/radeonsi/Makefile.am  | 14 +-
 src/gallium/drivers/rbug/Makefile.am  | 13 +++--
 src/gallium/drivers/softpipe/Makefile.am  |  7 ++-
 src/gallium/drivers/svga/Makefile.am  |  9 ++---
 src/gallium/drivers/trace/Makefile.am |  3 +--
 17 files changed, 83 insertions(+), 108 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index fabc2af..5cb0b26 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -3,3 +3,25 @@ GALLIUM_CFLAGS = \
-I$(top_srcdir)/src/gallium/include \
-I$(top_srcdir)/src/gallium/auxiliary \
$(DEFINES)
+
+# src/gallium/auxiliary must appear before src/gallium/drivers
+# because there are stupidly two rbug_context.h files in
+# different directories, and which one is included by the
+# preprocessor is determined by the ordering of the -I flags.
+GALLIUM_DRIVER_CFLAGS = \
+   -I$(srcdir)/include \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(DEFINES) \
+   $(VISIBILITY_CFLAGS)
+
+GALLIUM_DRIVER_CXXFLAGS = \
+   -I$(srcdir)/include \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   $(DEFINES) \
+   $(VISIBILITY_CXXFLAGS)
diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index a7b307a..7947dd1 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -3,16 +3,14 @@ AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libfreedreno.la
-
 AM_CFLAGS = \
-Wno-packed-bitfield-compat \
-   -I$(top_srcdir)/src/gallium/drivers \
-I$(top_srcdir)/src/gallium/drivers/freedreno/a3xx \
-I$(top_srcdir)/src/gallium/drivers/freedreno/a2xx \
-   $(GALLIUM_CFLAGS) \
-   $(FREEDRENO_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_DRIVER_CFLAGS) \
+   $(FREEDRENO_CFLAGS)
+
+noinst_LTLIBRARIES = libfreedreno.la
 
 libfreedreno_la_SOURCES = \
$(C_SOURCES) \
diff --git a/src/gallium/drivers/galahad/Makefile.am 
b/src/gallium/drivers/galahad/Makefile.am
index 5f64b93..17572c3 100644
--- a/src/gallium/drivers/galahad/Makefile.am
+++ b/src/gallium/drivers/galahad/Makefile.am
@@ -7,9 +7,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libgalahad.la
 
diff --git a/src/gallium/drivers/i915/Makefile.am 
b/src/gallium/drivers/i915/Makefile.am
index 4e6f464..a4a3e86 100644
--- a/src/gallium/drivers/i915/Makefile.am
+++ b/src/gallium/drivers/i915/Makefile.am
@@ -23,11 +23,9 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-noinst_LTLIBRARIES = libi915.la
+AM_CFLAGS = \
+   $(GALLIUM_DRIVER_CFLAGS)
 
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/include \
-   $(GALLIUM_CFLAGS)
+noinst_LTLIBRARIES = libi915.la
 
 libi915_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/identity/Makefile.am 
b/src/gallium/drivers/identity/Makefile.am
index 1caf328..7fcbc7c 100644
--- a/src/gallium/drivers/identity/Makefile.am
+++ b/src/gallium/drivers/identity/Makefile.am
@@ -2,9 +2,7 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_DRIVER_CFLAGS)
 
 noinst_LTLIBRARIES = libidentity.la
 
diff --git a/src/gallium/drivers/ilo/Makefile.am 
b/src/gallium/drivers/ilo/Makefile.am
index b5f6400..04d4da8 100644
--- a/src/gallium/drivers/ilo/Makefile.am
+++ 

[Mesa-dev] [PATCH 08/27] dri/common: move source file lists to Makefile.sources

2013-11-11 Thread Emil Velikov
* Allow the lists to be shared among build systems.
* Update automake and Android build systems.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
Reviewed-by: Ian Romanick ian.d.roman...@intel.com
---
 src/mesa/drivers/dri/common/Android.mk   |  2 +-
 src/mesa/drivers/dri/common/Makefile.am  | 10 --
 src/mesa/drivers/dri/common/Makefile.sources |  8 
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/common/Android.mk 
b/src/mesa/drivers/dri/common/Android.mk
index b3dac29..0489a32 100644
--- a/src/mesa/drivers/dri/common/Android.mk
+++ b/src/mesa/drivers/dri/common/Android.mk
@@ -40,7 +40,7 @@ LOCAL_C_INCLUDES := \
 $(intermediates) \
 $(MESA_DRI_C_INCLUDES)
 
-LOCAL_SRC_FILES := $(mesa_dri_common_SOURCES)
+LOCAL_SRC_FILES := $(DRI_COMMON_FILES)
 
 LOCAL_GENERATED_SOURCES := \
 $(intermediates)/xmlpool/options.h
diff --git a/src/mesa/drivers/dri/common/Makefile.am 
b/src/mesa/drivers/dri/common/Makefile.am
index 7f87ed6..e500bdb 100644
--- a/src/mesa/drivers/dri/common/Makefile.am
+++ b/src/mesa/drivers/dri/common/Makefile.am
@@ -21,6 +21,8 @@
 
 SUBDIRS = xmlpool
 
+include Makefile.sources
+
 AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/ \
@@ -35,13 +37,9 @@ noinst_LTLIBRARIES = \
libmegadriver_stub.la \
libdri_test_stubs.la
 
-libdricommon_la_SOURCES = \
-   utils.c \
-   dri_util.c \
-   xmlconfig.c
+libdricommon_la_SOURCES = $(DRI_COMMON_FILES)
 
-libdri_test_stubs_la_SOURCES = \
-   dri_test.c
+libdri_test_stubs_la_SOURCES = $(test_stubs_FILES)
 libdri_test_stubs_la_CFLAGS = $(AM_CFLAGS) -DNO_MAIN
 
 libmegadriver_stub_la_SOURCES = megadriver_stub.c
diff --git a/src/mesa/drivers/dri/common/Makefile.sources 
b/src/mesa/drivers/dri/common/Makefile.sources
index 040b717..8469b49 100644
--- a/src/mesa/drivers/dri/common/Makefile.sources
+++ b/src/mesa/drivers/dri/common/Makefile.sources
@@ -1,11 +1,8 @@
-mesa_dri_common_gallium_SOURCES := \
+DRI_COMMON_FILES := \
utils.c \
dri_util.c \
xmlconfig.c
 
-mesa_dri_common_SOURCES := \
-   $(mesa_dri_common_gallium_SOURCES)
-
 # Paths are relative to MESA_TOP.
 mesa_dri_common_INCLUDES := \
include \
@@ -14,3 +11,6 @@ mesa_dri_common_INCLUDES := \
src/mapi \
src/mesa \
src/mesa/drivers/dri/common
+
+test_stubs_FILES := \
+   dri_test.c
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 07/27] gtest: enable subdir-objects to prevent automake warnings

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gtest/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gtest/Makefile.am b/src/gtest/Makefile.am
index 4188c6b..23ea749 100644
--- a/src/gtest/Makefile.am
+++ b/src/gtest/Makefile.am
@@ -18,6 +18,7 @@
 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
+AUTOMAKE_OPTIONS = subdir-objects
 
 AM_CFLAGS = $(DEFINES) -I$(top_srcdir)/src/gtest/include
 AM_CXXFLAGS = $(DEFINES) -I$(top_srcdir)/src/gtest/include
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 23/27] targets/xvmc: move linker flags to Automake.inc

2013-11-11 Thread Emil Velikov
Minimise duplication and sources of error
(eg nouveau was missing shared and no-undefined)

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc | 7 +++
 src/gallium/targets/r600/xvmc/Makefile.am| 5 +
 src/gallium/targets/xvmc-nouveau/Makefile.am | 5 +
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index f67b295..f33bc37 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -44,6 +44,13 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
-shared \
-no-undefined
 
+# TODO: add -export-symbols-regex
+GALLIUM_XVMC_LINKER_FLAGS = \
+   -module \
+   -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
+   -shared \
+   -no-undefined
+
 GALLIUM_VDPAU_LIB_DEPS = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 367f597..1a75f52 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -33,10 +33,7 @@ libXvMCr600_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libXvMCr600_la_LDFLAGS = \
-   -module \
-   -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-   -shared \
-   -no-undefined
+   $(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCr600_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 37013f1..4328c05 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -34,10 +34,7 @@ libXvMCnouveau_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
 
 libXvMCnouveau_la_LDFLAGS = \
-   -module \
-   -version-number $(XVMC_MAJOR):$(XVMC_MINOR)
-   -shared \
-   -no-undefined
+   $(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCnouveau_la_LIBADD = \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 15/27] targets/radeonsi: move drm_target.c to a common folder

2013-11-11 Thread Emil Velikov
... and symlink to each target.
Make automake's subdir-objects work for radeonsi.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/targets/radeonsi/common/drm_target.c | 69 
 src/gallium/targets/radeonsi/dri/Makefile.am |  2 +-
 src/gallium/targets/radeonsi/dri/drm_target.c|  1 +
 src/gallium/targets/radeonsi/drm_target.c| 69 
 src/gallium/targets/radeonsi/vdpau/Makefile.am   |  2 +-
 src/gallium/targets/radeonsi/vdpau/drm_target.c  |  1 +
 6 files changed, 73 insertions(+), 71 deletions(-)
 create mode 100644 src/gallium/targets/radeonsi/common/drm_target.c
 create mode 12 src/gallium/targets/radeonsi/dri/drm_target.c
 delete mode 100644 src/gallium/targets/radeonsi/drm_target.c
 create mode 12 src/gallium/targets/radeonsi/vdpau/drm_target.c

diff --git a/src/gallium/targets/radeonsi/common/drm_target.c 
b/src/gallium/targets/radeonsi/common/drm_target.c
new file mode 100644
index 000..9eef368
--- /dev/null
+++ b/src/gallium/targets/radeonsi/common/drm_target.c
@@ -0,0 +1,69 @@
+/**
+ *
+ * Copyright 2013 Advanced Micro Devices, Inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * Software), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include state_tracker/drm_driver.h
+#include target-helpers/inline_debug_helper.h
+#include radeon/drm/radeon_drm_public.h
+#include radeon/drm/radeon_winsys.h
+#include radeonsi/radeonsi_public.h
+
+static struct pipe_screen *create_screen(int fd)
+{
+   struct radeon_winsys *radeon;
+
+   radeon = radeon_drm_winsys_create(fd);
+   if (!radeon)
+  return NULL;
+
+   if (!radeon-screen) {
+  radeon-screen = radeonsi_screen_create(radeon);
+  if (!radeon-screen)
+ return NULL;
+
+  radeon-screen = debug_screen_wrap(radeon-screen);
+   }
+
+   return radeon-screen;
+}
+
+static const struct drm_conf_ret throttle_ret = {
+   .type = DRM_CONF_INT,
+   .val.val_int = 2,
+};
+
+static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
+{
+   switch (conf) {
+   case DRM_CONF_THROTTLE:
+  return throttle_ret;
+   default:
+  break;
+   }
+   return NULL;
+}
+
+DRM_DRIVER_DESCRIPTOR(radeonsi, radeon, create_screen, drm_configuration)
diff --git a/src/gallium/targets/radeonsi/dri/Makefile.am 
b/src/gallium/targets/radeonsi/dri/Makefile.am
index 8a78f1b..9eb21cd 100644
--- a/src/gallium/targets/radeonsi/dri/Makefile.am
+++ b/src/gallium/targets/radeonsi/dri/Makefile.am
@@ -42,7 +42,7 @@ dri_LTLIBRARIES = radeonsi_dri.la
 
 nodist_EXTRA_radeonsi_dri_la_SOURCES = dummy.cpp
 radeonsi_dri_la_SOURCES = \
-   ../drm_target.c
+   drm_target.c
 
 radeonsi_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
 
diff --git a/src/gallium/targets/radeonsi/dri/drm_target.c 
b/src/gallium/targets/radeonsi/dri/drm_target.c
new file mode 12
index 000..6955421
--- /dev/null
+++ b/src/gallium/targets/radeonsi/dri/drm_target.c
@@ -0,0 +1 @@
+../common/drm_target.c
\ No newline at end of file
diff --git a/src/gallium/targets/radeonsi/drm_target.c 
b/src/gallium/targets/radeonsi/drm_target.c
deleted file mode 100644
index 9eef368..000
--- a/src/gallium/targets/radeonsi/drm_target.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * Software), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished 

[Mesa-dev] [PATCH 26/27] targets/dri: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
Greatly reduce duplication and provide a sane minimum of
CFLAGS for all DRI targets.

Note: This commit adds VISIBILITY_CFLAGS to the following:
* freedreno
* i915
* ilo
* nouveau
* vmwgfx

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc  | 13 +
 src/gallium/targets/dri-freedreno/Makefile.am |  9 +
 src/gallium/targets/dri-i915/Makefile.am  |  9 +
 src/gallium/targets/dri-ilo/Makefile.am   |  9 +
 src/gallium/targets/dri-nouveau/Makefile.am   |  9 +
 src/gallium/targets/dri-swrast/Makefile.am|  9 +
 src/gallium/targets/dri-vmwgfx/Makefile.am|  9 +
 src/gallium/targets/r300/dri/Makefile.am  | 10 +-
 src/gallium/targets/r600/dri/Makefile.am  | 10 +-
 src/gallium/targets/radeonsi/dri/Makefile.am  | 10 +-
 10 files changed, 22 insertions(+), 75 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 5ed6a3d..2a3ad21 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -26,6 +26,19 @@ GALLIUM_DRIVER_CXXFLAGS = \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
 
+GALLIUM_DRI_CFLAGS = \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   -I$(top_srcdir)/src/gallium/winsys \
+   -I$(top_srcdir)/src/mesa \
+   -I$(top_srcdir)/src/mapi \
+   $(DEFINES) \
+   $(PTHREAD_CFLAGS) \
+   $(LIBDRM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
+
 GALLIUM_VIDEO_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index 228fafc..2708dd3 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -23,15 +23,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE \
-DGALLIUM_NOOP
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 851c412..582c270 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -23,15 +23,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE \
-DGALLIUM_GALAHAD \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 776c970..3633d08 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -24,15 +24,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE \
-DGALLIUM_GALAHAD
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 17b2c4a..120e242 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -23,15 +23,8 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
+   $(GALLIUM_DRI_CFLAGS)
 AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys \
-   -I$(top_srcdir)/src/mesa \
-   -I$(top_srcdir)/src/mapi \
-   -I$(top_builddir)/src/mesa/drivers/dri/common \
-DGALLIUM_RBUG \
-DGALLIUM_TRACE
 
diff --git a/src/gallium/targets/dri-swrast/Makefile.am 
b/src/gallium/targets/dri-swrast/Makefile.am
index cddbbe3..11166ae 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -23,17 +23,10 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
   

[Mesa-dev] [PATCH 25/27] targets/xvmc: do not link against libtrace.la

2013-11-11 Thread Emil Velikov
In order to use the trace driver, one needs to define
GALLIUM_TRACE. Neither one of the two targets was
defining it, thus we're safe to remove libtrace.la.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/targets/r600/xvmc/Makefile.am| 1 -
 src/gallium/targets/xvmc-nouveau/Makefile.am | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index a21da80..7fe9b1a 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -38,7 +38,6 @@ libXvMCr600_la_LDFLAGS = \
 libXvMCr600_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(RADEON_LIBS)
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index bd30e4d..4a45f41 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -39,7 +39,6 @@ libXvMCnouveau_la_LDFLAGS = \
 libXvMCnouveau_la_LIBADD = \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(NOUVEAU_LIBS)
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 09/27] st/xvmc: enable automake subdir-objects

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/state_trackers/xvmc/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/xvmc/Makefile.am 
b/src/gallium/state_trackers/xvmc/Makefile.am
index c110912..3968238 100644
--- a/src/gallium/state_trackers/xvmc/Makefile.am
+++ b/src/gallium/state_trackers/xvmc/Makefile.am
@@ -20,6 +20,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 
+AUTOMAKE_OPTIONS = subdir-objects
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 19/27] targets/vdpau: consolidate lib deps into Automake.inc

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc   | 7 +++
 src/gallium/targets/r600/vdpau/Makefile.am | 5 +
 src/gallium/targets/radeonsi/vdpau/Makefile.am | 5 +
 src/gallium/targets/vdpau-nouveau/Makefile.am  | 5 +
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 765fdd2..86e9b1e 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -43,3 +43,10 @@ GALLIUM_VDPAU_LINKER_FLAGS = \
-export-symbols-regex $(VDPAU_EXPORTS) \
-shared \
-no-undefined
+
+GALLIUM_VDPAU_LIB_DEPS = \
+   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
+   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
+   $(VDPAU_LIBS) \
+   $(LIBDRM_LIBS)
+
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 3a65a6f..5d63eed 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -38,14 +38,11 @@ libvdpau_r600_la_LDFLAGS = \
$(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_r600_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
-   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(VDPAU_LIBS) \
-   $(LIBDRM_LIBS) \
$(RADEON_LIBS)
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index cd4dcfc..22d3c28 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -39,16 +39,13 @@ libvdpau_radeonsi_la_LDFLAGS = \
$(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_radeonsi_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
-   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
+   $(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(VDPAU_LIBS) \
-   $(LIBDRM_LIBS) \
$(RADEON_LIBS)
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 8a15d46..001cb4e 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -39,14 +39,11 @@ libvdpau_nouveau_la_LDFLAGS = \
$(GALLIUM_VDPAU_LINKER_FLAGS)
 
 libvdpau_nouveau_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-   $(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(VDPAU_LIBS) \
-   $(LIBDRM_LIBS) \
$(NOUVEAU_LIBS)
 
 if HAVE_MESA_LLVM
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 11/27] r300: move the final sources list to Makefile.sources

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/drivers/r300/Makefile.am  | 13 ++---
 src/gallium/drivers/r300/Makefile.sources | 14 +-
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/gallium/drivers/r300/Makefile.am 
b/src/gallium/drivers/r300/Makefile.am
index 524df24..4edeb47 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -3,7 +3,6 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 noinst_LTLIBRARIES = libr300.la libr300-helper.la
 check_PROGRAMS = r300_compiler_tests
-testdir = compiler/tests
 TESTS = r300_compiler_tests
 
 AM_CFLAGS = \
@@ -22,13 +21,7 @@ r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
$(GALLIUM_DRI_LIB_DEPS)
 r300_compiler_tests_CPPFLAGS = \
-I$(top_srcdir)/src/gallium/drivers/r300/compiler
-r300_compiler_tests_SOURCES = \
-   $(testdir)/r300_compiler_tests.c \
-   $(testdir)/radeon_compiler_optimize_tests.c \
-   $(testdir)/radeon_compiler_regalloc_tests.c \
-   $(testdir)/radeon_compiler_util_tests.c \
-   $(testdir)/rc_test_helpers.c \
-   $(testdir)/unit_test.c
+r300_compiler_tests_SOURCES = $(COMPILER_TESTS_SOURCES)
 
 libr300_la_SOURCES = $(C_SOURCES)
 
@@ -39,6 +32,4 @@ libr300_la_SOURCES = $(C_SOURCES)
 #
 # Solve this by building them into a separate helper library that can be linked
 # in place of libmesagallium.
-libr300_helper_la_SOURCES = \
-   ralloc.c \
-   register_allocate.c
+libr300_helper_la_SOURCES = $(HELPER_SOURCES)
diff --git a/src/gallium/drivers/r300/Makefile.sources 
b/src/gallium/drivers/r300/Makefile.sources
index 10ceffb..0e9ab52 100644
--- a/src/gallium/drivers/r300/Makefile.sources
+++ b/src/gallium/drivers/r300/Makefile.sources
@@ -1,4 +1,4 @@
-C_SOURCES = \
+C_SOURCES := \
r300_blit.c \
r300_chipset.c \
r300_context.c \
@@ -57,3 +57,15 @@ C_SOURCES = \
compiler/r3xx_vertprog.c \
compiler/r3xx_vertprog_dump.c \
compiler/memory_pool.c
+
+COMPILER_TESTS_SOURCES := \
+   compiler/tests/r300_compiler_tests.c \
+   compiler/tests/radeon_compiler_optimize_tests.c \
+   compiler/tests/radeon_compiler_regalloc_tests.c \
+   compiler/tests/radeon_compiler_util_tests.c \
+   compiler/tests/rc_test_helpers.c \
+   compiler/tests/unit_test.c
+
+HELPER_SOURCES := \
+   ralloc.c \
+   register_allocate.c
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 01/27] st/egl: use *_FILE over *_SOURCES names for filelists

2013-11-11 Thread Emil Velikov
Silence automake warnings about missing program/library whenever
the _SOURCES suffix is used for temporary variable names.

  warning: variable 'gdi_SOURCES' is defined but no program or
  library has 'gdi' as canonical name (possible typo)

Reported-by: Ilia Mirkin imir...@alum.mit.edu
Reported-by: Johannes Obermayr johannesoberm...@gmx.de
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70581
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/state_trackers/egl/Android.mk   |  6 +++---
 src/gallium/state_trackers/egl/Makefile.am  | 12 ++--
 src/gallium/state_trackers/egl/Makefile.sources | 18 +-
 src/gallium/state_trackers/egl/SConscript   | 10 +-
 4 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/src/gallium/state_trackers/egl/Android.mk 
b/src/gallium/state_trackers/egl/Android.mk
index 2627608..b27e14b 100644
--- a/src/gallium/state_trackers/egl/Android.mk
+++ b/src/gallium/state_trackers/egl/Android.mk
@@ -23,14 +23,14 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# get common_SOURCES, android_SOURCES
+# get common_FILES, android_FILES
 include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
 LOCAL_SRC_FILES := \
-   $(common_SOURCES) \
-   $(android_SOURCES)
+   $(common_FILES) \
+   $(android_FILES)
 
 LOCAL_CFLAGS := -DHAVE_ANDROID_BACKEND
 
diff --git a/src/gallium/state_trackers/egl/Makefile.am 
b/src/gallium/state_trackers/egl/Makefile.am
index da360bb..c069c29 100644
--- a/src/gallium/state_trackers/egl/Makefile.am
+++ b/src/gallium/state_trackers/egl/Makefile.am
@@ -32,10 +32,10 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include
 
 noinst_LTLIBRARIES = libegl.la
-libegl_la_SOURCES = $(common_SOURCES)
+libegl_la_SOURCES = $(common_FILES)
 
 if HAVE_EGL_PLATFORM_X11
-libegl_la_SOURCES += $(x11_SOURCES) $(x11_drm_SOURCES)
+libegl_la_SOURCES += $(x11_FILES) $(x11_drm_FILES)
 AM_CFLAGS += \
$(X11_INCLUDES) \
$(LIBDRM_CFLAGS) \
@@ -49,7 +49,7 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_WAYLAND
-libegl_la_SOURCES += $(wayland_SOURCES)
+libegl_la_SOURCES += $(wayland_FILES)
 AM_CFLAGS += \
$(LIBDRM_CFLAGS) \
$(WAYLAND_CFLAGS)
@@ -62,7 +62,7 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_DRM
-libegl_la_SOURCES += $(drm_SOURCES)
+libegl_la_SOURCES += $(drm_FILES)
 AM_CFLAGS += \
$(LIBDRM_CFLAGS)
 AM_CPPFLAGS += \
@@ -73,14 +73,14 @@ AM_CPPFLAGS += \
 endif
 
 if HAVE_EGL_PLATFORM_FBDEV
-libegl_la_SOURCES += $(fbdev_SOURCES)
+libegl_la_SOURCES += $(fbdev_FILES)
 AM_CPPFLAGS += \
-I$(top_srcdir)/src/gallium/winsys/sw \
-DHAVE_FBDEV_BACKEND
 endif
 
 if HAVE_EGL_PLATFORM_NULL
-libegl_la_SOURCES += $(null_SOURCES)
+libegl_la_SOURCES += $(null_FILES)
 AM_CPPFLAGS += \
-I$(top_srcdir)/src/gallium/winsys/sw \
-DHAVE_NULL_BACKEND
diff --git a/src/gallium/state_trackers/egl/Makefile.sources 
b/src/gallium/state_trackers/egl/Makefile.sources
index aaf6b8b..2f60b3a 100644
--- a/src/gallium/state_trackers/egl/Makefile.sources
+++ b/src/gallium/state_trackers/egl/Makefile.sources
@@ -1,4 +1,4 @@
-common_SOURCES := \
+common_FILES := \
common/egl_g3d_api.c \
common/egl_g3d.c \
common/egl_g3d_image.c \
@@ -7,33 +7,33 @@ common_SOURCES := \
common/native_helper.c \
common/native_wayland_drm_bufmgr.c
 
-android_SOURCES := \
+android_FILES := \
android/native_android.cpp
 
-drm_SOURCES := \
+drm_FILES := \
drm/modeset.c \
drm/native_drm.c
 
-fbdev_SOURCES := \
+fbdev_FILES := \
fbdev/native_fbdev.c
 
-gdi_SOURCES := \
+gdi_FILES := \
gdi/native_gdi.c
 
-null_SOURCES := \
+null_FILES := \
null/native_null.c
 
-x11_SOURCES := \
+x11_FILES := \
x11/glxinit.c \
x11/native_dri2.c \
x11/native_x11.c \
x11/native_ximage.c
 
-x11_drm_SOURCES := \
+x11_drm_FILES := \
x11/x11_screen.c \
x11/dri2.c
 
-wayland_SOURCES := \
+wayland_FILES := \
wayland/native_drm.c \
wayland/native_shm.c \
wayland/native_wayland.c
diff --git a/src/gallium/state_trackers/egl/SConscript 
b/src/gallium/state_trackers/egl/SConscript
index b86f8b5..bd0ee02 100644
--- a/src/gallium/state_trackers/egl/SConscript
+++ b/src/gallium/state_trackers/egl/SConscript
@@ -11,11 +11,11 @@ env.Append(CPPPATH = [
 '.',
 ])
 
-sources = env.ParseSourceList('Makefile.sources', 'common_SOURCES')
+sources = env.ParseSourceList('Makefile.sources', 'common_FILES')
 
 if env['platform'] == 'windows':
 env.Append(CPPDEFINES = ['HAVE_GDI_BACKEND'])
-sources.append(env.ParseSourceList('Makefile.sources', 'gdi_SOURCES'))
+sources.append(env.ParseSourceList('Makefile.sources', 'gdi_FILES'))
 else:
 if env['drm']:
 env.PkgUseModules('DRM')
@@ -25,10 +25,10 @@ else:
 '#/src/glx',
 '#/src/mapi',
 ])
-sources.append(env.ParseSourceList('Makefile.sources', 'x11_SOURCES'))
+   

[Mesa-dev] [PATCH 10/27] r300: add symlink to ralloc.c and register_allocate.c

2013-11-11 Thread Emil Velikov
Make automake's subdir-objects work.
Update includes.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/drivers/r300/Makefile.am | 6 +++---
 src/gallium/drivers/r300/ralloc.c| 1 +
 src/gallium/drivers/r300/register_allocate.c | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
 create mode 12 src/gallium/drivers/r300/ralloc.c
 create mode 12 src/gallium/drivers/r300/register_allocate.c

diff --git a/src/gallium/drivers/r300/Makefile.am 
b/src/gallium/drivers/r300/Makefile.am
index 14aaf03..524df24 100644
--- a/src/gallium/drivers/r300/Makefile.am
+++ b/src/gallium/drivers/r300/Makefile.am
@@ -8,7 +8,7 @@ TESTS = r300_compiler_tests
 
 AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/mesa/program \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/glsl \
-I$(top_srcdir)/src/mapi \
@@ -40,5 +40,5 @@ libr300_la_SOURCES = $(C_SOURCES)
 # Solve this by building them into a separate helper library that can be linked
 # in place of libmesagallium.
 libr300_helper_la_SOURCES = \
-   $(top_srcdir)/src/glsl/ralloc.c \
-   $(top_srcdir)/src/mesa/program/register_allocate.c
+   ralloc.c \
+   register_allocate.c
diff --git a/src/gallium/drivers/r300/ralloc.c 
b/src/gallium/drivers/r300/ralloc.c
new file mode 12
index 000..c5402db
--- /dev/null
+++ b/src/gallium/drivers/r300/ralloc.c
@@ -0,0 +1 @@
+../../../glsl/ralloc.c
\ No newline at end of file
diff --git a/src/gallium/drivers/r300/register_allocate.c 
b/src/gallium/drivers/r300/register_allocate.c
new file mode 12
index 000..2117950
--- /dev/null
+++ b/src/gallium/drivers/r300/register_allocate.c
@@ -0,0 +1 @@
+../../../mesa/program/register_allocate.c
\ No newline at end of file
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 17/27] targets/vdpau: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
Store the compiler flags into a variable, in order to minimise
flags duplication (amongst vdpau and xvmc).

Note: this commit add VISIBILITY_CFLAGS to the nouveau target

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc   | 11 +++
 src/gallium/targets/r600/vdpau/Makefile.am |  8 +---
 src/gallium/targets/radeonsi/vdpau/Makefile.am |  8 +---
 src/gallium/targets/vdpau-nouveau/Makefile.am  |  7 +--
 4 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 5cb0b26..b242bb4 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -25,3 +25,14 @@ GALLIUM_DRIVER_CXXFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
$(DEFINES) \
$(VISIBILITY_CXXFLAGS)
+
+GALLIUM_VIDEO_CFLAGS = \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   -I$(top_srcdir)/src/gallium/drivers \
+   -I$(top_srcdir)/src/gallium/winsys \
+   $(DEFINES) \
+   $(PTHREAD_CFLAGS) \
+   $(LIBDRM_CFLAGS) \
+   $(VISIBILITY_CFLAGS)
diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 70af0bf..742df52 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -23,13 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_r600.la
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index a4d97fe..9b14634 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -23,13 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_radeonsi.la
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 213725a..20eb920 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -23,12 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 vdpaudir = $(VDPAU_LIB_INSTALL_DIR)
 vdpau_LTLIBRARIES = libvdpau_nouveau.la
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 20/27] targets/vdpau: drop unused libraries from linker

2013-11-11 Thread Emil Velikov
In order for one to use trace, noop, rbug and/or galahad, they must
set the corresponding GALLIUM_* CFLAG.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/targets/r600/vdpau/Makefile.am | 1 -
 src/gallium/targets/radeonsi/vdpau/Makefile.am | 3 ---
 src/gallium/targets/vdpau-nouveau/Makefile.am  | 1 -
 3 files changed, 5 deletions(-)

diff --git a/src/gallium/targets/r600/vdpau/Makefile.am 
b/src/gallium/targets/r600/vdpau/Makefile.am
index 5d63eed..7f43fbb 100644
--- a/src/gallium/targets/r600/vdpau/Makefile.am
+++ b/src/gallium/targets/r600/vdpau/Makefile.am
@@ -40,7 +40,6 @@ libvdpau_r600_la_LDFLAGS = \
 libvdpau_r600_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(RADEON_LIBS)
diff --git a/src/gallium/targets/radeonsi/vdpau/Makefile.am 
b/src/gallium/targets/radeonsi/vdpau/Makefile.am
index 22d3c28..0292b2b 100644
--- a/src/gallium/targets/radeonsi/vdpau/Makefile.am
+++ b/src/gallium/targets/radeonsi/vdpau/Makefile.am
@@ -41,9 +41,6 @@ libvdpau_radeonsi_la_LDFLAGS = \
 libvdpau_radeonsi_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/radeonsi/libradeonsi.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
-   $(top_builddir)/src/gallium/drivers/rbug/librbug.la \
-   $(top_builddir)/src/gallium/drivers/noop/libnoop.la \
$(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(RADEON_LIBS)
diff --git a/src/gallium/targets/vdpau-nouveau/Makefile.am 
b/src/gallium/targets/vdpau-nouveau/Makefile.am
index 001cb4e..fbaad03 100644
--- a/src/gallium/targets/vdpau-nouveau/Makefile.am
+++ b/src/gallium/targets/vdpau-nouveau/Makefile.am
@@ -41,7 +41,6 @@ libvdpau_nouveau_la_LDFLAGS = \
 libvdpau_nouveau_la_LIBADD = \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
-   $(top_builddir)/src/gallium/drivers/trace/libtrace.la \
$(GALLIUM_VDPAU_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
$(NOUVEAU_LIBS)
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 27/27] targets/dri: move linker flags out of configure into Automake.inc

2013-11-11 Thread Emil Velikov
Previous assumption was that the same set of flags can be reused
for both classic and gallium drivers. With megadriver work done
the classic drivers ended up using their own (single) instance of
the flags.

Move these into Automake.inc and rename to indicate that those
are gallium specific. Additionally silence an automake/autoconf
warning XXX is not a standard libtool library name, due to
the parsing issues of the module tag.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 configure.ac  | 2 --
 src/gallium/Automake.inc  | 8 
 src/gallium/targets/dri-freedreno/Makefile.am | 2 +-
 src/gallium/targets/dri-i915/Makefile.am  | 2 +-
 src/gallium/targets/dri-ilo/Makefile.am   | 2 +-
 src/gallium/targets/dri-nouveau/Makefile.am   | 2 +-
 src/gallium/targets/dri-swrast/Makefile.am| 2 +-
 src/gallium/targets/dri-vmwgfx/Makefile.am| 2 +-
 src/gallium/targets/r300/dri/Makefile.am  | 2 +-
 src/gallium/targets/r600/dri/Makefile.am  | 2 +-
 src/gallium/targets/radeonsi/dri/Makefile.am  | 2 +-
 11 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/configure.ac b/configure.ac
index b126bb0..b12ab70 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1050,7 +1050,6 @@ if test x$enable_dri = xyes; then
 DRI_LIB_DEPS=$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm 
$PTHREAD_LIBS $DLOPEN_LIBS
 GALLIUM_DRI_LIB_DEPS=$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS 
$EXPAT_LIBS -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS
 
-DRI_DRIVER_LDFLAGS=-module -avoid-version -shared -Wl,-Bsymbolic
 fi
 
 AM_CONDITIONAL(NEED_MEGADRIVER, test -n $DRI_DIRS)
@@ -1058,7 +1057,6 @@ AM_CONDITIONAL(NEED_LIBMESA, test x$enable_xlib_glx = 
xyes -o \
   x$enable_osmesa = xyes -o \
   -n $DRI_DIRS)
 AC_SUBST([DRI_LIB_DEPS])
-AC_SUBST([DRI_DRIVER_LDFLAGS])
 AC_SUBST([GALLIUM_DRI_LIB_DEPS])
 
 case $DRI_DIRS in
diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 2a3ad21..b6b9b36 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -50,6 +50,14 @@ GALLIUM_VIDEO_CFLAGS = \
$(LIBDRM_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
+
+# TODO: add -export-symbols-regex
+GALLIUM_DRI_LINKER_FLAGS = \
+   -module \
+   -avoid-version \
+   -shared \
+   -Wl,-Bsymbolic
+
 GALLIUM_VDPAU_LINKER_FLAGS = \
-module \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
diff --git a/src/gallium/targets/dri-freedreno/Makefile.am 
b/src/gallium/targets/dri-freedreno/Makefile.am
index 2708dd3..94500b0 100644
--- a/src/gallium/targets/dri-freedreno/Makefile.am
+++ b/src/gallium/targets/dri-freedreno/Makefile.am
@@ -32,7 +32,7 @@ AM_CPPFLAGS = \
 dridir = $(DRI_DRIVER_INSTALL_DIR)
 dri_LTLIBRARIES = kgsl_dri.la msm_dri.la
 
-COMMON_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
+COMMON_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
 
 COMMON_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-i915/Makefile.am 
b/src/gallium/targets/dri-i915/Makefile.am
index 582c270..3f8468f 100644
--- a/src/gallium/targets/dri-i915/Makefile.am
+++ b/src/gallium/targets/dri-i915/Makefile.am
@@ -35,7 +35,7 @@ dri_LTLIBRARIES = i915_dri.la
 
 i915_dri_la_SOURCES = target.c
 
-i915_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
+i915_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
 
 i915_dri_la_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-ilo/Makefile.am 
b/src/gallium/targets/dri-ilo/Makefile.am
index 3633d08..418e2ea 100644
--- a/src/gallium/targets/dri-ilo/Makefile.am
+++ b/src/gallium/targets/dri-ilo/Makefile.am
@@ -35,7 +35,7 @@ noinst_LTLIBRARIES = ilo_dri.la
 ilo_dri_la_SOURCES = target.c
 
 # need -rpath to create a noinst shared library
-ilo_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS) \
+ilo_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS) \
 -rpath $(abs_builddir)
 
 ilo_dri_la_LIBADD = \
diff --git a/src/gallium/targets/dri-nouveau/Makefile.am 
b/src/gallium/targets/dri-nouveau/Makefile.am
index 120e242..1988067 100644
--- a/src/gallium/targets/dri-nouveau/Makefile.am
+++ b/src/gallium/targets/dri-nouveau/Makefile.am
@@ -34,7 +34,7 @@ dri_LTLIBRARIES = nouveau_dri.la
 nodist_EXTRA_nouveau_dri_la_SOURCES = dummy.cpp
 nouveau_dri_la_SOURCES = target.c
 
-nouveau_dri_la_LDFLAGS = $(DRI_DRIVER_LDFLAGS)
+nouveau_dri_la_LDFLAGS = $(GALLIUM_DRI_LINKER_FLAGS)
 
 nouveau_dri_la_LIBADD = \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \
diff --git a/src/gallium/targets/dri-swrast/Makefile.am 
b/src/gallium/targets/dri-swrast/Makefile.am
index 11166ae..ec1576b 100644
--- a/src/gallium/targets/dri-swrast/Makefile.am
+++ b/src/gallium/targets/dri-swrast/Makefile.am
@@ -42,7 +42,7 @@ swrast_dri_la_SOURCES = \
$(top_srcdir)/src/mesa/drivers/dri/common/dri_util.c \

[Mesa-dev] [PATCH 04/27] freedreno: compact a2xx and a3xx makefiles into parent ones

2013-11-11 Thread Emil Velikov
From: Johannes Obermayr johannesoberm...@gmx.de

Nearly everything within the three Makefile.am's is identical.
Let's simplify things a little.

v2: Rebase and rewrite the commit message (Emil Velikov)

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 configure.ac   |  2 --
 src/gallium/drivers/freedreno/Makefile.am  | 12 +++-
 src/gallium/drivers/freedreno/Makefile.sources | 32 ++
 src/gallium/drivers/freedreno/a2xx/Makefile.am | 14 --
 .../drivers/freedreno/a2xx/Makefile.sources| 15 --
 src/gallium/drivers/freedreno/a3xx/Makefile.am | 14 --
 .../drivers/freedreno/a3xx/Makefile.sources| 15 --
 7 files changed, 36 insertions(+), 68 deletions(-)
 delete mode 100644 src/gallium/drivers/freedreno/a2xx/Makefile.am
 delete mode 100644 src/gallium/drivers/freedreno/a2xx/Makefile.sources
 delete mode 100644 src/gallium/drivers/freedreno/a3xx/Makefile.am
 delete mode 100644 src/gallium/drivers/freedreno/a3xx/Makefile.sources

diff --git a/configure.ac b/configure.ac
index f756b73..b126bb0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1981,8 +1981,6 @@ AC_CONFIG_FILES([Makefile
src/gallium/auxiliary/pipe-loader/Makefile
src/gallium/drivers/Makefile
src/gallium/drivers/freedreno/Makefile
-   src/gallium/drivers/freedreno/a2xx/Makefile
-   src/gallium/drivers/freedreno/a3xx/Makefile
src/gallium/drivers/galahad/Makefile
src/gallium/drivers/i915/Makefile
src/gallium/drivers/identity/Makefile
diff --git a/src/gallium/drivers/freedreno/Makefile.am 
b/src/gallium/drivers/freedreno/Makefile.am
index 9f5a80a..22fd790 100644
--- a/src/gallium/drivers/freedreno/Makefile.am
+++ b/src/gallium/drivers/freedreno/Makefile.am
@@ -12,11 +12,7 @@ AM_CFLAGS = \
$(FREEDRENO_CFLAGS) \
$(VISIBILITY_CFLAGS)
 
-SUBDIRS = a2xx a3xx
-
-libfreedreno_la_SOURCES = $(C_SOURCES)
-
-libfreedreno_la_LIBADD = \
-   a3xx/libfd3xx.la \
-   a2xx/libfd2xx.la
-
+libfreedreno_la_SOURCES = \
+   $(C_SOURCES) \
+   $(a2xx_SOURCES) \
+   $(a3xx_SOURCES)
diff --git a/src/gallium/drivers/freedreno/Makefile.sources 
b/src/gallium/drivers/freedreno/Makefile.sources
index 02a88b6..e54bff0 100644
--- a/src/gallium/drivers/freedreno/Makefile.sources
+++ b/src/gallium/drivers/freedreno/Makefile.sources
@@ -9,3 +9,35 @@ C_SOURCES := \
freedreno_context.c \
freedreno_screen.c \
freedreno_gmem.c
+
+a2xx_SOURCES := \
+   a2xx/fd2_blend.c \
+   a2xx/fd2_compiler.c \
+   a2xx/fd2_context.c \
+   a2xx/fd2_draw.c \
+   a2xx/fd2_emit.c \
+   a2xx/fd2_gmem.c \
+   a2xx/fd2_program.c \
+   a2xx/fd2_rasterizer.c \
+   a2xx/fd2_screen.c \
+   a2xx/fd2_texture.c \
+   a2xx/fd2_util.c \
+   a2xx/fd2_zsa.c \
+   a2xx/disasm-a2xx.c \
+   a2xx/ir-a2xx.c
+
+a3xx_SOURCES := \
+   a3xx/fd3_blend.c \
+   a3xx/fd3_compiler.c \
+   a3xx/fd3_context.c \
+   a3xx/fd3_draw.c \
+   a3xx/fd3_emit.c \
+   a3xx/fd3_gmem.c \
+   a3xx/fd3_program.c \
+   a3xx/fd3_rasterizer.c \
+   a3xx/fd3_screen.c \
+   a3xx/fd3_texture.c \
+   a3xx/fd3_util.c \
+   a3xx/fd3_zsa.c \
+   a3xx/disasm-a3xx.c \
+   a3xx/ir-a3xx.c
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.am 
b/src/gallium/drivers/freedreno/a2xx/Makefile.am
deleted file mode 100644
index b8a5ac1..000
--- a/src/gallium/drivers/freedreno/a2xx/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-include Makefile.sources
-include $(top_srcdir)/src/gallium/Automake.inc
-
-noinst_LTLIBRARIES = libfd2xx.la
-
-AM_CFLAGS = \
-   -Wno-packed-bitfield-compat \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/drivers/freedreno \
-   $(GALLIUM_CFLAGS) \
-   $(FREEDRENO_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-
-libfd2xx_la_SOURCES = $(C_SOURCES)
diff --git a/src/gallium/drivers/freedreno/a2xx/Makefile.sources 
b/src/gallium/drivers/freedreno/a2xx/Makefile.sources
deleted file mode 100644
index 1ef2852..000
--- a/src/gallium/drivers/freedreno/a2xx/Makefile.sources
+++ /dev/null
@@ -1,15 +0,0 @@
-C_SOURCES := \
-   fd2_blend.c \
-   fd2_compiler.c \
-   fd2_context.c \
-   fd2_draw.c \
-   fd2_emit.c \
-   fd2_gmem.c \
-   fd2_program.c \
-   fd2_rasterizer.c \
-   fd2_screen.c \
-   fd2_texture.c \
-   fd2_util.c \
-   fd2_zsa.c \
-   disasm-a2xx.c \
-   ir-a2xx.c
diff --git a/src/gallium/drivers/freedreno/a3xx/Makefile.am 
b/src/gallium/drivers/freedreno/a3xx/Makefile.am
deleted file mode 100644
index 6b8b2e4..000
--- a/src/gallium/drivers/freedreno/a3xx/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-include Makefile.sources
-include $(top_srcdir)/src/gallium/Automake.inc
-
-noinst_LTLIBRARIES = libfd3xx.la
-
-AM_CFLAGS = \
-  

[Mesa-dev] [PATCH 05/27] scons: move SConscript from gallium/targets/ to mesa/drivers/dri/common/

2013-11-11 Thread Emil Velikov
Store scons side by side with the other build systems.

v2: cleanup after a failed rebase

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/SConscript |  1 -
 src/gallium/targets/SConscript.dri | 83 --
 src/mesa/drivers/SConscript|  5 +-
 src/mesa/drivers/dri/common/SConscript | 83 ++
 4 files changed, 87 insertions(+), 85 deletions(-)
 delete mode 100644 src/gallium/targets/SConscript.dri
 create mode 100644 src/mesa/drivers/dri/common/SConscript

diff --git a/src/gallium/SConscript b/src/gallium/SConscript
index c68519d..6e27be2 100644
--- a/src/gallium/SConscript
+++ b/src/gallium/SConscript
@@ -124,7 +124,6 @@ if not env['embedded']:
 
 if env['dri']:
 SConscript([
-'targets/SConscript.dri',
 'targets/dri-swrast/SConscript',
 'targets/dri-vmwgfx/SConscript',
 ])
diff --git a/src/gallium/targets/SConscript.dri 
b/src/gallium/targets/SConscript.dri
deleted file mode 100644
index 8b15532..000
--- a/src/gallium/targets/SConscript.dri
+++ /dev/null
@@ -1,83 +0,0 @@
-###
-# SConcscript file for dri targets
-
-Import('*')
-
-drienv = env.Clone()
-
-drienv.Replace(CPPPATH = [
-'#src/mesa/drivers/dri/common',
-xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
-'#include',
-'#include/GL/internal',
-'#src/mapi',
-'#src/gallium/include',
-'#src/gallium/auxiliary',
-'#src/gallium/drivers',
-'#src/gallium/winsys',
-'#src/mesa',
-'#src/mesa/main',
-'#src/mesa/glapi',
-'#src/mesa/math',
-'#src/mesa/transform',
-'#src/mesa/shader',
-'#src/mesa/swrast',
-'#src/mesa/swrast_setup',
-'#src/egl/main',
-'#src/egl/drivers/dri',
-])
-
-driswenv = drienv.Clone()
-driswenv.Append(CPPDEFINES = [
-'__NOT_HAVE_DRM_H',
-])
-
-drienv.PkgUseModules('DRM')
-
-dri_common_utils = drienv.SharedObject(
-target = 'utils.o',
-source = '#src/mesa/drivers/dri/common/utils.c'
-)
-
-dri_common_xmlconfig = drienv.SharedObject(
-target = 'xmlconfig.o',
-source = '#src/mesa/drivers/dri/common/xmlconfig.c'
-)
-
-dri_common_dri_util = drienv.SharedObject(
-target = 'dri_util.o',
-source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
-
-dri_common_drisw_util = driswenv.SharedObject(
-target = 'drisw_util.o',
-source = '#src/mesa/drivers/dri/common/dri_util.c'
-)
-
-
-COMMON_DRI_SW_OBJECTS = [
-dri_common_utils,
-dri_common_xmlconfig,
-dri_common_drisw_util,
-]
-
-COMMON_DRI_DRM_OBJECTS = [
-dri_common_utils,
-dri_common_xmlconfig,
-dri_common_dri_util,
-]
-
-drienv.AppendUnique(LIBS = [
-'expat',
-])
-
-driswenv.AppendUnique(LIBS = [
-'expat',
-])
-
-Export([
-'drienv',
-'driswenv',
-'COMMON_DRI_SW_OBJECTS',
-'COMMON_DRI_DRM_OBJECTS',
-])
diff --git a/src/mesa/drivers/SConscript b/src/mesa/drivers/SConscript
index 355e680..5db5957 100644
--- a/src/mesa/drivers/SConscript
+++ b/src/mesa/drivers/SConscript
@@ -6,7 +6,10 @@ if env['x11']:
 SConscript('x11/SConscript')
 
 if env['dri']:
-SConscript('dri/common/xmlpool/SConscript')
+SConscript([
+'dri/common/xmlpool/SConscript',
+'dri/common/SConscript',
+])
 
 if env['platform'] == 'windows':
 SConscript('windows/gdi/SConscript')
diff --git a/src/mesa/drivers/dri/common/SConscript 
b/src/mesa/drivers/dri/common/SConscript
new file mode 100644
index 000..8b15532
--- /dev/null
+++ b/src/mesa/drivers/dri/common/SConscript
@@ -0,0 +1,83 @@
+###
+# SConcscript file for dri targets
+
+Import('*')
+
+drienv = env.Clone()
+
+drienv.Replace(CPPPATH = [
+'#src/mesa/drivers/dri/common',
+xmlpool_options.dir.dir, # Dir to generated xmlpool/options.h
+'#include',
+'#include/GL/internal',
+'#src/mapi',
+'#src/gallium/include',
+'#src/gallium/auxiliary',
+'#src/gallium/drivers',
+'#src/gallium/winsys',
+'#src/mesa',
+'#src/mesa/main',
+'#src/mesa/glapi',
+'#src/mesa/math',
+'#src/mesa/transform',
+'#src/mesa/shader',
+'#src/mesa/swrast',
+'#src/mesa/swrast_setup',
+'#src/egl/main',
+'#src/egl/drivers/dri',
+])
+
+driswenv = drienv.Clone()
+driswenv.Append(CPPDEFINES = [
+'__NOT_HAVE_DRM_H',
+])
+
+drienv.PkgUseModules('DRM')
+
+dri_common_utils = drienv.SharedObject(
+target = 'utils.o',
+source = '#src/mesa/drivers/dri/common/utils.c'
+)
+
+dri_common_xmlconfig = drienv.SharedObject(
+target = 'xmlconfig.o',
+source = '#src/mesa/drivers/dri/common/xmlconfig.c'
+)
+
+dri_common_dri_util = drienv.SharedObject(
+target = 'dri_util.o',
+source = '#src/mesa/drivers/dri/common/dri_util.c'
+)
+
+dri_common_drisw_util = driswenv.SharedObject(
+target = 'drisw_util.o',
+source = '#src/mesa/drivers/dri/common/dri_util.c'
+)
+
+
+COMMON_DRI_SW_OBJECTS = [
+

[Mesa-dev] [PATCH 06/27] gbm: enable subdir-objects to prevent automake warnings

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gbm/Makefile.am | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index 1282b14..9b3fb0d 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = main/gbm.pc
 
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 03/27] scons: drop obsolete enabled_apis variable

2013-11-11 Thread Emil Velikov
The variable was forgotten during the FEATURE_* removal.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/mesa/SConscript | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/src/mesa/SConscript b/src/mesa/SConscript
index 4213498..a2bb9f1 100644
--- a/src/mesa/SConscript
+++ b/src/mesa/SConscript
@@ -18,9 +18,6 @@ env.Append(CPPPATH = [
 Dir('.'), # src/mesa build path
 ])
 
-enabled_apis = []
-enabled_apis += ['GL']
-
 if env['platform'] == 'windows':
 env.Append(CPPDEFINES = [
 '_GDI32_', # prevent gl* being declared __declspec(dllimport) in MS 
headers
@@ -340,10 +337,6 @@ mesa_sources = (
 
 GLAPI = '#src/mapi/glapi/'
 
-if env['gles']:
-
-enabled_apis += ['ES1', 'ES2']
-
 get_hash_header = env.CodeGenerate(
   target = 'main/get_hash.h',
   script = 'main/get_hash_generator.py',
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 21/27] gallium/winsys: compact compiler flags into Automake.inc

2013-11-11 Thread Emil Velikov
Cleanup the duplicating flags and consolidate into a sigle variable.

Note: this patch adds VISIBILITY_CFLAGS to the following targets
* freedreno/drm
* i915/{drm,sw}
* nouveau/drm
* sw/fbdev
* sw/null
* sw/wayland
* sw/wrapper
* sw/xlib

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc | 6 ++
 src/gallium/winsys/freedreno/drm/Makefile.am | 2 +-
 src/gallium/winsys/i915/drm/Makefile.am  | 3 +--
 src/gallium/winsys/i915/sw/Makefile.am   | 3 +--
 src/gallium/winsys/intel/drm/Makefile.am | 5 ++---
 src/gallium/winsys/nouveau/drm/Makefile.am   | 3 +--
 src/gallium/winsys/radeon/drm/Makefile.am| 6 ++
 src/gallium/winsys/svga/drm/Makefile.am  | 7 ++-
 src/gallium/winsys/sw/dri/Makefile.am| 5 ++---
 src/gallium/winsys/sw/fbdev/Makefile.am  | 4 ++--
 src/gallium/winsys/sw/null/Makefile.am   | 4 ++--
 src/gallium/winsys/sw/wayland/Makefile.am| 4 ++--
 src/gallium/winsys/sw/wrapper/Makefile.am| 4 ++--
 src/gallium/winsys/sw/xlib/Makefile.am   | 4 ++--
 14 files changed, 28 insertions(+), 32 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index 86e9b1e..f67b295 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -50,3 +50,9 @@ GALLIUM_VDPAU_LIB_DEPS = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS)
 
+GALLIUM_WINSYS_CFLAGS = \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/src/gallium/include \
+   -I$(top_srcdir)/src/gallium/auxiliary \
+   $(DEFINES) \
+   $(VISIBILITY_CFLAGS)
diff --git a/src/gallium/winsys/freedreno/drm/Makefile.am 
b/src/gallium/winsys/freedreno/drm/Makefile.am
index 8a74dcd..cf4c24c 100644
--- a/src/gallium/winsys/freedreno/drm/Makefile.am
+++ b/src/gallium/winsys/freedreno/drm/Makefile.am
@@ -25,7 +25,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(FREEDRENO_CFLAGS)
 
 noinst_LTLIBRARIES = libfreedrenodrm.la
diff --git a/src/gallium/winsys/i915/drm/Makefile.am 
b/src/gallium/winsys/i915/drm/Makefile.am
index 7a64925..82c477d 100644
--- a/src/gallium/winsys/i915/drm/Makefile.am
+++ b/src/gallium/winsys/i915/drm/Makefile.am
@@ -24,9 +24,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(INTEL_CFLAGS)
 
 noinst_LTLIBRARIES = libi915drm.la
diff --git a/src/gallium/winsys/i915/sw/Makefile.am 
b/src/gallium/winsys/i915/sw/Makefile.am
index 186fee3..39f6022 100644
--- a/src/gallium/winsys/i915/sw/Makefile.am
+++ b/src/gallium/winsys/i915/sw/Makefile.am
@@ -24,9 +24,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(INTEL_CFLAGS)
 
 noinst_LTLIBRARIES = libi915sw.la
diff --git a/src/gallium/winsys/intel/drm/Makefile.am 
b/src/gallium/winsys/intel/drm/Makefile.am
index 3c4a271..30f4486 100644
--- a/src/gallium/winsys/intel/drm/Makefile.am
+++ b/src/gallium/winsys/intel/drm/Makefile.am
@@ -25,9 +25,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(INTEL_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_WINSYS_CFLAGS) \
+   $(INTEL_CFLAGS)
 
 noinst_LTLIBRARIES = libintelwinsys.la
 
diff --git a/src/gallium/winsys/nouveau/drm/Makefile.am 
b/src/gallium/winsys/nouveau/drm/Makefile.am
index f9645f5..9c94ea4 100644
--- a/src/gallium/winsys/nouveau/drm/Makefile.am
+++ b/src/gallium/winsys/nouveau/drm/Makefile.am
@@ -24,9 +24,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/drivers \
-   $(GALLIUM_CFLAGS) \
+   $(GALLIUM_WINSYS_CFLAGS) \
$(NOUVEAU_CFLAGS)
 
 noinst_LTLIBRARIES = libnouveaudrm.la
diff --git a/src/gallium/winsys/radeon/drm/Makefile.am 
b/src/gallium/winsys/radeon/drm/Makefile.am
index d5c5474..b413b0b 100644
--- a/src/gallium/winsys/radeon/drm/Makefile.am
+++ b/src/gallium/winsys/radeon/drm/Makefile.am
@@ -2,10 +2,8 @@ include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   -I$(top_srcdir)/include \
-   $(GALLIUM_CFLAGS) \
-   $(RADEON_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
+   $(GALLIUM_WINSYS_CFLAGS) \
+   $(RADEON_CFLAGS)
 
 noinst_LTLIBRARIES = libradeonwinsys.la
 
diff --git a/src/gallium/winsys/svga/drm/Makefile.am 
b/src/gallium/winsys/svga/drm/Makefile.am
index d7ada3c..69398b8 100644
--- a/src/gallium/winsys/svga/drm/Makefile.am
+++ b/src/gallium/winsys/svga/drm/Makefile.am
@@ -23,16 +23,13 @@
 

[Mesa-dev] [PATCH 24/27] targets/xvmc: consolidate lib deps into Automake.inc

2013-11-11 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/Automake.inc | 6 ++
 src/gallium/targets/r600/xvmc/Makefile.am| 5 +
 src/gallium/targets/xvmc-nouveau/Makefile.am | 5 +
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/gallium/Automake.inc b/src/gallium/Automake.inc
index f33bc37..5ed6a3d 100644
--- a/src/gallium/Automake.inc
+++ b/src/gallium/Automake.inc
@@ -57,6 +57,12 @@ GALLIUM_VDPAU_LIB_DEPS = \
$(VDPAU_LIBS) \
$(LIBDRM_LIBS)
 
+GALLIUM_XVMC_LIB_DEPS = \
+   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
+   $(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
+   $(XVMC_LIBS) \
+   $(LIBDRM_LIBS)
+
 GALLIUM_WINSYS_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src/gallium/include \
diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 1a75f52..a21da80 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -36,14 +36,11 @@ libXvMCr600_la_LDFLAGS = \
$(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCr600_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
$(top_builddir)/src/gallium/drivers/r600/libr600.la \
-   $(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
$(top_builddir)/src/gallium/winsys/radeon/drm/libradeonwinsys.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(XVMC_LIBS) \
-   $(LIBDRM_LIBS) \
$(RADEON_LIBS)
 
 if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index 4328c05..bd30e4d 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -37,14 +37,11 @@ libXvMCnouveau_la_LDFLAGS = \
$(GALLIUM_XVMC_LINKER_FLAGS)
 
 libXvMCnouveau_la_LIBADD = \
-   $(top_builddir)/src/gallium/auxiliary/libgallium.la \
-   $(top_builddir)/src/gallium/state_trackers/xvmc/libxvmctracker.la \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+   $(GALLIUM_XVMC_LIB_DEPS) \
$(GALLIUM_DRI_LIB_DEPS) \
-   $(XVMC_LIBS) \
-   $(LIBDRM_LIBS) \
$(NOUVEAU_LIBS)
 
 if HAVE_MESA_LLVM
-- 
1.8.4.2

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


[Mesa-dev] [PATCH 22/27] targets/xvmc: use drop duplicated compiler flags

2013-11-11 Thread Emil Velikov
Automake.inc already has GALLIUM_VIDEO_CFLAGS, which
provide the essential compiler flags needed.

Note: this commit adds VISIBILITY_CFLAGS to nouveau.

Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
---
 src/gallium/targets/r600/xvmc/Makefile.am| 8 +---
 src/gallium/targets/xvmc-nouveau/Makefile.am | 7 +--
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/gallium/targets/r600/xvmc/Makefile.am 
b/src/gallium/targets/r600/xvmc/Makefile.am
index 44cd511..367f597 100644
--- a/src/gallium/targets/r600/xvmc/Makefile.am
+++ b/src/gallium/targets/r600/xvmc/Makefile.am
@@ -23,13 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS) \
-   $(VISIBILITY_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 xvmcdir = $(XVMC_LIB_INSTALL_DIR)
 xvmc_LTLIBRARIES = libXvMCr600.la
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am 
b/src/gallium/targets/xvmc-nouveau/Makefile.am
index f3d6b1e..37013f1 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -23,12 +23,7 @@
 include $(top_srcdir)/src/gallium/Automake.inc
 
 AM_CFLAGS = \
-   $(GALLIUM_CFLAGS) \
-   $(PTHREAD_CFLAGS) \
-   $(LIBDRM_CFLAGS)
-AM_CPPFLAGS = \
-   -I$(top_srcdir)/src/gallium/drivers \
-   -I$(top_srcdir)/src/gallium/winsys
+   $(GALLIUM_VIDEO_CFLAGS)
 
 xvmcdir = $(XVMC_LIB_INSTALL_DIR)
 xvmc_LTLIBRARIES = libXvMCnouveau.la
-- 
1.8.4.2

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


Re: [Mesa-dev] [RFC] Haiku viewport / framebuffer invalidation

2013-11-11 Thread Jose Fonseca


- Original Message -
 I've been banging my head against a wall for a while now on this.
 
 So the Haiku applications that call glViewport(.. for window
 resizes,etc never actually execute the Driver's Viewport call.
 (aka ctx-Driver.Viewport:
 http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/targets/haiku-softpipe/GalliumContext.cpp#n346)
 
 I found void GLAPIENTRY _mesa_Viewport in viewport.c, however I
 have a feeling this never gets called as softpipe is a Gallium
 driver not a Mesa driver.

They execute src/mesa/state_tracker/st_cb_viewport.c

I'm not sure I fully understand the Haiku case, but I suggest you look at the 
WGL state tracker, particular src/gallium/state_trackers/wgl/stw_framebuffer.c 
and friends, as it might be useful for you.

On Windows, we get a callback (stw_call_window_proc) whenever windows get 
resized. We simply note down the new size, and set a flag must_resize. The 
actual resize happens when stw_framebuffer::validate happens, in 
stw_st_framebuffer_validate. 

I hope this helps.

Jose

 
 I know there are stamp's in the st_context and st_framebuffer, however
 ++'ing them on a window resize doesn't seem to solve the issue.
 
 Our libGL actually is aware of window resizes, so I have a fix in that
 manually calls the viewport calls on resize.. however I don't think
 this is a good long term fix as the viewport is always forced to the
 size of the window (which isn't correct was far as I know)
 
 http://cgit.freedesktop.org/mesa/mesa/commit/?id=e759f1c111018949db114e76ebf1a723525fb802
 
 Thoughts?
 
  -- Alex
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 07/18] i915: Wire up initial support for DRI_RENDERER_QUERY extension

2013-11-11 Thread Ian Romanick
On 11/09/2013 02:44 AM, Daniel Vetter wrote:
 On Fri, Oct 11, 2013 at 03:10:14PM -0700, Ian Romanick wrote:
 From: Ian Romanick ian.d.roman...@intel.com

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 ---
  src/mesa/drivers/dri/i915/intel_screen.c | 79 
 
  1 file changed, 79 insertions(+)

 diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
 b/src/mesa/drivers/dri/i915/intel_screen.c
 index 4f8c342..fa4fdc0 100644
 --- a/src/mesa/drivers/dri/i915/intel_screen.c
 +++ b/src/mesa/drivers/dri/i915/intel_screen.c
 @@ -27,6 +27,7 @@
  
  #include errno.h
  #include time.h
 +#include sys/sysinfo.h
  #include main/glheader.h
  #include main/context.h
  #include main/framebuffer.h
 @@ -741,6 +742,84 @@ static struct __DRIimageExtensionRec 
 intelImageExtension = {
  .createImageFromFds = intel_create_image_from_fds
  };
  
 +static int
 +i915_query_renderer_integer(__DRIscreen *psp, int param, int *value)
 +{
 +   const struct intel_screen *const intelScreen =
 +  (struct intel_screen *) psp-driverPrivate;
 +
 +   switch (param) {
 +   case __DRI2_RENDERER_VENDOR_ID:
 +  value[0] = 0x8086;
 +  return 0;
 +   case __DRI2_RENDERER_DEVICE_ID:
 +  value[0] = intelScreen-deviceID;
 +  return 0;
 +   case __DRI2_RENDERER_ACCELERATED:
 +  value[0] = 1;
 +  return 0;
 +   case __DRI2_RENDERER_VIDEO_MEMORY: {
 +  struct sysinfo info;
 +  uint64_t system_memory_bytes;
 +  unsigned system_memory_megabytes;
 +
 +  /* Once a batch uses more than 75% of the maximum mappable size, we
 +   * assume that there's some fragmentation, and we start doing extra
 +   * flushing, etc.  That's the big cliff apps will care about.
 +   */
 +  const unsigned long agp_bytes = drmAgpSize(psp-fd);
 
 So despite me shooting at this in the next patch saying that this is
 - the wrong interface, it doesn't actually really tell you what you want
   to know (since it fails to take pinnned crap into account),
 - doesn't work on half the platforms i915_dri supports already,
 - and is massively deprecated on all others and a major pain for us to
   keep on live support in the kernel

In fairness, you missed this specific issue on your first review and
shot at it after I committed it. :(  There was no malice... just
timezone fail.  In the future, I'll CC you any Mesa changes that
interact with the kernel so that you'll notice them sooner.

 you've decided to raise this particular zombie and commited it shortly
 before the branch point. Please rip this out asap before it shows up
 anywhere in a release and use the gem aperture ioctl instead.
 
 That would also fix things for gen4, where the hardwired 2G isn't really
 the truth of things either.

 Yours, decently pissed,
 -Daniel

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


[Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Ian Romanick
From: Ian Romanick ian.d.roman...@intel.com

Systems with little physical memory installed will report less than
2GiB, and some systems may (hypothetically?) have a larger address space
for the GPU.  My IVB still reports 1534.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Cc: Daniel Vetter dan...@ffwll.ch
Cc: 10.0 mesa-sta...@lists.freedesktop.org
---
 src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index e39d654..592150b 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, 
int *value)
   /* Once a batch uses more than 75% of the maximum mappable size, we
* assume that there's some fragmentation, and we start doing extra
* flushing, etc.  That's the big cliff apps will care about.
-   *
-   * Can only map 2G onto the GPU through the GTT.
*/
-  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
+  size_t aper_size;
+  size_t mappable_size;
+
+  drm_intel_get_aperture_sizes(psp-fd, mappable_size, aper_size);
+
+  const unsigned gpu_mappable_megabytes =
+ (aper_size / (1024 * 1024)) * 3 / 4;
 
   const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
   const long system_page_size = sysconf(_SC_PAGE_SIZE);
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 1/4] i915: Use drm_intel_get_aperture_sizes instead of drmAgpSize

2013-11-11 Thread Ian Romanick
From: Ian Romanick ian.d.roman...@intel.com

Send the zombie back to the grave before it infects the townsfolk.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Cc: Daniel Vetter dan...@ffwll.ch
Cc: 10.0 mesa-sta...@lists.freedesktop.org
---
 src/mesa/drivers/dri/i915/intel_screen.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 2c309ed..5b84780 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -722,9 +722,13 @@ i915_query_renderer_integer(__DRIscreen *psp, int param, 
int *value)
* assume that there's some fragmentation, and we start doing extra
* flushing, etc.  That's the big cliff apps will care about.
*/
-  const unsigned long agp_bytes = drmAgpSize(psp-fd);
+  size_t aper_size;
+  size_t mappable_size;
+
+  drm_intel_get_aperture_sizes(psp-fd, mappable_size, aper_size);
+
   const unsigned gpu_mappable_megabytes =
- (agp_bytes / (1024 * 1024)) * 3 / 4;
+ (aper_size / (1024 * 1024)) * 3 / 4;
 
   const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
   const long system_page_size = sysconf(_SC_PAGE_SIZE);
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 3/4] dri: Change value param to unsigned

2013-11-11 Thread Ian Romanick
From: Ian Romanick ian.d.roman...@intel.com

This silences some compiler warnings in i915 and i965.  See also
75982a5.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Cc: 10.0 mesa-sta...@lists.freedesktop.org
---
 src/mesa/drivers/dri/common/utils.c  | 2 +-
 src/mesa/drivers/dri/common/utils.h  | 2 +-
 src/mesa/drivers/dri/i915/intel_screen.c | 2 +-
 src/mesa/drivers/dri/i965/intel_screen.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/common/utils.c 
b/src/mesa/drivers/dri/common/utils.c
index b30fca9..9c94832 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -494,7 +494,7 @@ driIndexConfigAttrib(const __DRIconfig *config, int index,
  * Zero if a recognized value of \c param is supplied, -1 otherwise.
  */
 int
-driQueryRendererIntegerCommon(__DRIscreen *psp, int param, int *value)
+driQueryRendererIntegerCommon(__DRIscreen *psp, int param, unsigned int *value)
 {
switch (param) {
case __DRI2_RENDERER_VERSION: {
diff --git a/src/mesa/drivers/dri/common/utils.h 
b/src/mesa/drivers/dri/common/utils.h
index 5d6ef87..22af123 100644
--- a/src/mesa/drivers/dri/common/utils.h
+++ b/src/mesa/drivers/dri/common/utils.h
@@ -66,6 +66,6 @@ driIndexConfigAttrib(const __DRIconfig *config, int index,
 unsigned int *attrib, unsigned int *value);
 
 int
-driQueryRendererIntegerCommon(__DRIscreen *psp, int param, int *value);
+driQueryRendererIntegerCommon(__DRIscreen *psp, int param, unsigned int 
*value);
 
 #endif /* DRI_DEBUG_H */
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 5b84780..0dd6507 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -702,7 +702,7 @@ static struct __DRIimageExtensionRec intelImageExtension = {
 };
 
 static int
-i915_query_renderer_integer(__DRIscreen *psp, int param, int *value)
+i915_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
 {
const struct intel_screen *const intelScreen =
   (struct intel_screen *) psp-driverPrivate;
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index 592150b..4f7584a 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -804,7 +804,7 @@ static struct __DRIimageExtensionRec intelImageExtension = {
 };
 
 static int
-brw_query_renderer_integer(__DRIscreen *psp, int param, int *value)
+brw_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value)
 {
const struct intel_screen *const intelScreen =
   (struct intel_screen *) psp-driverPrivate;
-- 
1.8.1.4

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


[Mesa-dev] [PATCH 4/4] i915: Actually enable __DRI2rendererQueryExtensionRec

2013-11-11 Thread Ian Romanick
From: Ian Romanick ian.d.roman...@intel.com

More rebase fail.  This code was written long before i915 and i965 were
split, so most of the code in i9[16]5/intel_screen.c only needed to
exist in one place.  It looks like I fixed n-1 of those places after
rebasing on the split.

I only found this from the defined-but-not-used warning for
intelRendererQueryExtension was .  I noticed this while fixing the
other, related warnings.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Cc: 10.0 mesa-sta...@lists.freedesktop.org
Cc: Daniel Vetter dan...@ffwll.ch
---
If anyone wants to make the argument that this should land on the
release branch, I'll drop it.  In some ways that would make the first
patch in the series moot as drmAgpSize could never be called.

 src/mesa/drivers/dri/i915/intel_screen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 0dd6507..f225595 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -789,6 +789,7 @@ static const __DRIextension *intelScreenExtensions[] = {
 intelTexBufferExtension.base,
 intelFlushExtension.base,
 intelImageExtension.base,
+intelRendererQueryExtension.base,
 dri2ConfigQueryExtension.base,
 NULL
 };
-- 
1.8.1.4

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


Re: [Mesa-dev] [PATCH V3 00/13] ARB_draw_indirect for i965

2013-11-11 Thread Paul Berry
On 9 November 2013 01:02, Chris Forbes chr...@ijw.co.nz wrote:

 This series adds support for ARB_draw_indirect and ARB_multi_draw_indirect
 on Gen7+.

 Big changes:
 - Get rid of overcomplicated state tracking for the indirect bo in i965.
 - Make primcount==0 produce GL_INVALID_VALUE in MultiDraw*Indirect
 - Small tidyups for clarity

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


Patches 1, 6, and 12 are:

Acked-by: Paul Berry stereotype...@gmail.com

The remainder are:

Reviewed-by: Paul Berry stereotype...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] nicer-no-wrap-patch

2013-11-11 Thread Eric Anholt
Kevin Rogovin kevin.rogo...@intel.com writes:

 This patch adds a function interface for enabling no wrap on batch commands,
 adds to it assert enforcement that the number bytes added to the
 batch buffer does not exceed a passed value and finally this is used
 in brw_try_draw_prims() to help make sure that estimated_max_prim_size
 is a good value.

I don't like adding overhead to every batch operation.  You can just do
an assert like I did in 185b5a54c94ce11487146042c8eec24909187ed6


pgpgsiOZon9hC.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH V3 00/13] ARB_draw_indirect for i965

2013-11-11 Thread Chris Forbes
Thanks, Paul.

Now just seeking r-b for 1, 6, and 12. Anyone?

On Tue, Nov 12, 2013 at 8:37 AM, Paul Berry stereotype...@gmail.com wrote:
 On 9 November 2013 01:02, Chris Forbes chr...@ijw.co.nz wrote:

 This series adds support for ARB_draw_indirect and ARB_multi_draw_indirect
 on Gen7+.

 Big changes:
 - Get rid of overcomplicated state tracking for the indirect bo in i965.
 - Make primcount==0 produce GL_INVALID_VALUE in MultiDraw*Indirect
 - Small tidyups for clarity

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


 Patches 1, 6, and 12 are:

 Acked-by: Paul Berry stereotype...@gmail.com

 The remainder are:

 Reviewed-by: Paul Berry stereotype...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] tests: Fix make check for out of tree builds.

2013-11-11 Thread Rico Schüller
Signed-off-by: Rico Schüller kgbric...@web.de
---
 src/mapi/shared-glapi/tests/Makefile.am | 1 +
 src/mesa/main/tests/Makefile.am | 1 +
 2 Dateien geändert, 2 Zeilen hinzugefügt(+)

diff --git a/src/mapi/shared-glapi/tests/Makefile.am 
b/src/mapi/shared-glapi/tests/Makefile.am
index 98065fc..7e71b4f 100644
--- a/src/mapi/shared-glapi/tests/Makefile.am
+++ b/src/mapi/shared-glapi/tests/Makefile.am
@@ -3,6 +3,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS)
 AM_CPPFLAGS = \
-I$(top_srcdir)/src/gtest/include \
-I$(top_srcdir)/src/mapi \
+   -I$(top_builddir)/src/mapi \
-I$(top_srcdir)/include
 
 TESTS = shared-glapi-test
diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
index 97713f2..0d3a51f 100644
--- a/src/mesa/main/tests/Makefile.am
+++ b/src/mesa/main/tests/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/gtest/include \
-I$(top_srcdir)/src/mapi \
-I$(top_srcdir)/src/mesa \
+   -I$(top_builddir)/src/mesa \
-I$(top_srcdir)/include \
$(DEFINES) $(INCLUDE_DIRS)
 
-- 
1.7.11.7

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

Vinson Lee v...@freedesktop.org changed:

   What|Removed |Added

 CC||i...@freedesktop.org,
   ||kenn...@whitecape.org

--- Comment #1 from Vinson Lee v...@freedesktop.org ---
17c94de33baf66ad5c264b7a046394c651bc6126 is the first bad commit
commit 17c94de33baf66ad5c264b7a046394c651bc6126
Author: Ian Romanick ian.d.roman...@intel.com
Date:   Mon Sep 10 17:11:33 2012 +0300

mesa/dri: Add basic plumbing for GLX_ARB_robustness reset notification
strategy

No drivers advertise the DRI2 extension yet, so no driver should ever
see a value other than false for notify_reset.

The changes in nouveau use tabs because nouveau seems to have it's own
indentation rules.

Signed-off-by: Ian Romanick ian.d.roman...@intel.com
Reviewed-by: Kenneth Graunke kenn...@whitecape.org

:04 04 76b2737e9b48d9c042d4bc05020803c7328d605a
dba600f5c9a4c2e147e30e60fbd5b7f286aaa17a Msrc
bisect run success

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


Re: [Mesa-dev] [PATCH] mesa: Add ARB_texture_view to Mesa core

2013-11-11 Thread Courtney Goeltzenleuchter
On Mon, Nov 11, 2013 at 11:15 AM, Ian Romanick i...@freedesktop.org wrote:

 On 11/05/2013 11:36 AM, Courtney Goeltzenleuchter wrote:
  On Tue, Nov 5, 2013 at 12:22 PM, Ian Romanick i...@freedesktop.org
  mailto:i...@freedesktop.org wrote:
 
  On 11/05/2013 09:44 AM, Chris Forbes wrote:
   So, you can create a GL_LUMINANCE view of a GL_LUMINANCE texture.
   Hmm...
  
   My understanding is you can't actually, since views can only be
   created from immutable-format textures, and GL_LUMINANCE is not a
   sized internalformat, so it can't be used with TexStorage?
 
  I was just using GL_LUMINANCE as shorthand for GL_LUMINANCE4,
  GL_LUMINANCE8, GL_LUMINANCE12, and GL_LUMINANCE16.  As far as I can
  tell,
 
  glGenTextures(1, tex);
  glBindTexture(GL_TEXTURE_2D, tex);
  glTexStorage2D(GL_TEXTURE_2D,
  8,
  GL_LUMINANCE8,
  1024, 1024);
 
  is perfectly valid.  Sayeth GL_ARB_texture_storage:
 
  Accepted by the internalformat parameter of TexStorage* when
  implemented on OpenGL ES:
 
  ALPHA8_EXT 0x803C
  LUMINANCE8_EXT 0x8040
  LUMINANCE8_ALPHA8_EXT  0x8045
 
  I guess that means GL_LUMINANCE4, GL_LUMINANCE12, and GL_LUMINANCE16
 are
  out.  As are all GL_INTENSITY formats.  There are still these three
  legacy formats to handle.
 
  So, if we support GL_ARB_texture_view in a compatibility profile,
 
  glGenTextures(1, view);
  glTextureView(view,
  GL_TEXTURE_2D,
  tex,
  GL_LUMINANCE8,
  1, 1, 1, 1);
 
  is also valid.
 
  Right?
 
 
  The spec is pickier than that.  For 8bit texels the allowed internal
  formats are: R8UI, R8I, R8, R8_SNORM
  I use the table specified in the ARB_texture_view to translate the
  target internalFormat passed to glTextureView into a VIEW_CLASS.
  GL_LUMINANCE8 does not have a valid VIEW_CLASS and could not match the
  internal format of the source texture.

 I don't think it matters that GL_LUMINANCE8 is missing from the table or
 that it doesn't have a VIEW_CLASS.  The GL_ARB_texture_view spec says
 (emphasis mine):

The two textures' internal formats must be compatible according to
Table 3.X.2 (Compatible internal formats for TextureView) if the
internal format exists in that table and *the internal formats
must be identical if not in that table*, or else an
INVALID_OPERATION error is generated.

 In my above code example, the internal formats are identical.  By my
 reading of the above quoted text, that code is legal.  We should modify
 one of the texture_view tests to use these legacy formats, and try that
 test on NVIDIA with a compatibility profile.


Good point. I'll talk with Jon about testing that if we don't already.

Courtney



  That makes me wonder, should I be trying to map the target
  internalformat into a driver internal format?
 
  Courtney
 
  --
  Courtney Goeltzenleuchter
  LunarG




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


Re: [Mesa-dev] [PATCH 1/2 v3] i965: add XRGB to tiled_memcpy

2013-11-11 Thread Chad Versace

On 11/07/2013 01:59 PM, Courtney Goeltzenleuchter wrote:

MESA_FORMAT_XRGB is equivalent to MESA_FORMAT_ARGB in terms
of storage on the device, so okay to use this optimized copy routine.

This series builds on work from Frank Henigman to optimize the
process of uploading a texture to the GPU. This series adds support for
MESA_XRGB_ and full miptrees where were found to be common activities
in the Smokin' Guns game. The issue was found while profiling the app
but that part is not benchmarked. Smokin-Guns uses mipmap textures with
an internal format of GL_RGB (MESA_XRGB_ in the driver).

These changes need a performance tool to run against to show how they
improve execution performance for specific texture formats. Using this
benchmark I've measured the following improvement on my Ivybridge
Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz.

Using 1024x1024, RGBA  source, mipmap
 THIS PATCH


I don't understand. What do you mean by ``THIS PATCH``? That all these
numbers were obtained with this patch? But that doesn't make sense, because
these are before-and-after numbers. And it can't be just this patch, because
these numbers are identical to the numbers quoted in patch 2.


internal-format Before (MB/sec) XRGB (MB/sec)   mipmap (MB/sec)
GL_RGBA 628.15  627.15  615.90
GL_RGB  265.95  456.35  611.53
512x512
GL_RGBA 600.23  597.00  619.95
GL_RGB  255.50  440.62  611.28
256x256
GL_RGBA 489.08  487.80  587.42
GL_RGB  229.03  376.63  585.00

Test shows similar pattern for 512x512 and 256x256.


The above table confuses me. There is a column named Before, but no column
named After. There 'internal-format' exists in the same location as '512x512'
and '256x256', but 'internal-format' is not a size.


Benchmark has been sent to mesa-dev list: teximage_enh



 -8- 

Courtney Goeltzenleuchter (2):
   i965: add XRGB to tiled_memcpy
   i965: Enhance tiled_memcpy to support all levels

  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 11 ---
  1 file changed, 8 insertions(+), 3 deletions(-)

--
1.8.1.2

 -8- 

Commit messages should not contain coverletter metadata, such
as the above snippet. This also applies to patch 2.


Signed-off-by: Courtney Goeltzenleuchter court...@lunarg.com
---
  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c 
b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index 0384bcc..b1826fa 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -571,7 +571,8 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 (texImage-TexFormat == MESA_FORMAT_A8  format == GL_ALPHA)) {
cpp = 1;
mem_copy = memcpy;
-   } else if (texImage-TexFormat == MESA_FORMAT_ARGB) {
+   } else if ((texImage-TexFormat == MESA_FORMAT_ARGB)
+ || (texImage-TexFormat == MESA_FORMAT_XRGB)) {
cpp = 4;
if (format == GL_BGRA) {
   mem_copy = memcpy;



The code change itself looks good. I'm just having a hard time making sense
out of the commit message.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 2/3] gbm: Add support for __DRIimage based getBuffers when available

2013-11-11 Thread Kristian Høgsberg
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

Signed-off-by: Kristian Høgsberg k...@bitplanet.net
Cc: 10.0 mesa-sta...@lists.freedesktop.org
---
 src/egl/drivers/dri2/platform_drm.c | 46 ++---
 src/gbm/backends/dri/gbm_dri.c  | 28 +-
 src/gbm/backends/dri/gbm_driint.h   |  8 ++-
 3 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_drm.c 
b/src/egl/drivers/dri2/platform_drm.c
index 7b1e3a1..181b29d 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -175,13 +175,12 @@ dri2_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *surf)
 }
 
 static int
-get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+get_back_bo(struct dri2_egl_surface *dri2_surf)
 {
struct dri2_egl_display *dri2_dpy =
   dri2_egl_display(dri2_surf-base.Resource.Display);
-   struct gbm_dri_bo *bo;
struct gbm_dri_surface *surf = dri2_surf-gbm_surf;
-   int i, name, pitch;
+   int i;
 
if (dri2_surf-back == NULL) {
   for (i = 0; i  ARRAY_SIZE(dri2_surf-color_buffers); i++) {
@@ -201,6 +200,17 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, 
__DRIbuffer *buffer)
if (dri2_surf-back-bo == NULL)
   return -1;
 
+   return 0;
+}
+
+static void
+back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+{
+   struct dri2_egl_display *dri2_dpy =
+  dri2_egl_display(dri2_surf-base.Resource.Display);
+   struct gbm_dri_bo *bo;
+   int name, pitch;
+
bo = (struct gbm_dri_bo *) dri2_surf-back-bo;
 
dri2_dpy-image-queryImage(bo-image, __DRI_IMAGE_ATTRIB_NAME, name);
@@ -211,8 +221,6 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer 
*buffer)
buffer-pitch = pitch;
buffer-cpp = 4;
buffer-flags = 0;
-
-   return 0;
 }
 
 static int
@@ -254,10 +262,11 @@ dri2_get_buffers_with_format(__DRIdrawable *driDrawable,
 
   switch (attachments[i]) {
   case __DRI_BUFFER_BACK_LEFT:
-if (get_back_bo(dri2_surf, dri2_surf-buffers[j])  0) {
+if (get_back_bo(dri2_surf)  0) {
_eglError(EGL_BAD_ALLOC, failed to allocate color buffer);
return NULL;
 }
+ back_bo_to_dri_buffer(dri2_surf, dri2_surf-buffers[j]);
 break;
   default:
 if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
@@ -312,6 +321,27 @@ dri2_get_buffers(__DRIdrawable * driDrawable,
return buffer;
 }
 
+static int
+dri_image_get_buffers(__DRIdrawable *driDrawable,
+  unsigned int format,
+  uint32_t *stamp,
+  void *loaderPrivate,
+  uint32_t buffer_mask,
+  struct __DRIimageList *buffers)
+{
+   struct dri2_egl_surface *dri2_surf = loaderPrivate;
+   struct gbm_dri_bo *bo;
+
+   if (get_back_bo(dri2_surf)  0)
+  return 0;
+
+   bo = (struct gbm_dri_bo *) dri2_surf-back-bo;
+   buffers-image_mask = __DRI_IMAGE_BUFFER_BACK;
+   buffers-back = bo-image;
+
+   return 1;
+}
+
 static void
 dri2_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
 {
@@ -348,9 +378,8 @@ dri2_query_buffer_age(_EGLDriver *drv,
   _EGLDisplay *disp, _EGLSurface *surface)
 {
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface);
-   __DRIbuffer buffer;
 
-   if (get_back_bo(dri2_surf, buffer)  0) {
+   if (get_back_bo(dri2_surf)  0) {
   _eglError(EGL_BAD_ALLOC, dri2_query_buffer_age);
   return 0;
}
@@ -469,6 +498,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy-gbm_dri-get_buffers = dri2_get_buffers;
dri2_dpy-gbm_dri-flush_front_buffer = dri2_flush_front_buffer;
dri2_dpy-gbm_dri-get_buffers_with_format = dri2_get_buffers_with_format;
+   dri2_dpy-gbm_dri-image_get_buffers = dri_image_get_buffers;
 
dri2_dpy-gbm_dri-base.base.surface_lock_front_buffer = lock_front_buffer;
dri2_dpy-gbm_dri-base.base.surface_release_buffer = release_buffer;
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index e95fcc7..6c63c75 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -104,6 +104,24 @@ dri_get_buffers_with_format(__DRIdrawable * driDrawable,
count, out_count, surf-dri_private);
 }
 
+static int
+image_get_buffers(__DRIdrawable *driDrawable,
+  unsigned int format,
+  uint32_t *stamp,
+  void *loaderPrivate,
+  uint32_t buffer_mask,
+  struct __DRIimageList *buffers)
+{
+   struct gbm_dri_surface *surf = loaderPrivate;
+   struct gbm_dri_device *dri = gbm_dri_device(surf-base.gbm);
+
+   if (dri-image_get_buffers == NULL)
+  return 0;
+
+   return dri-image_get_buffers(driDrawable, format, stamp,
+   

[Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Kristian Høgsberg
Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

For the intel dri driver, this consolidates window system color buffer
allocation in intel_create_image().

Signed-off-by: Kristian Høgsberg k...@bitplanet.net
---
 src/mesa/drivers/dri/common/dri_util.c   | 75 
 src/mesa/drivers/dri/common/dri_util.h   | 10 +
 src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
 src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
 4 files changed, 89 insertions(+), 107 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24c..a7328e4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -115,6 +115,7 @@ driCreateNewScreen2(int scrn, int fd,
 {
 static const __DRIextension *emptyExtensionList[] = { NULL };
 __DRIscreen *psp;
+int i;
 
 psp = calloc(1, sizeof(*psp));
 if (!psp)
@@ -161,6 +162,11 @@ driCreateNewScreen2(int scrn, int fd,
return NULL;
 }
 
+for (i = 0; psp-extensions[i]; i++) {
+   if (strcmp(psp-extensions[i]-name, __DRI_IMAGE) == 0)
+  psp-image_extension = (__DRIimageExtension *) psp-extensions[i];
+}
+
 int gl_version_override = _mesa_get_gl_version_override();
 if (gl_version_override = 31) {
psp-max_gl_core_version = MAX2(psp-max_gl_core_version,
@@ -862,6 +868,75 @@ driImageFormatToGLFormat(uint32_t image_format)
}
 }
 
+struct dri_image_buffer {
+   __DRIbuffer base;
+   __DRIimage *image;
+};
+
+__DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height)
+{
+   struct dri_image_buffer *buffer;
+   __DRIimageExtension *image = screen-image_extension;
+   int dri_format, name, stride;
+
+   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+  attachment == __DRI_BUFFER_BACK_LEFT);
+
+   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
+* format / 8.  The image format code is stored in the __DRIimage, but the
+* __DRIbuffer we create from the image, only stores the cpp. */
+
+   switch (format) {
+   case 32:
+  dri_format = __DRI_IMAGE_FORMAT_XRGB;
+  break;
+   case 16:
+  dri_format = __DRI_IMAGE_FORMAT_RGB565;
+  break;
+   default:
+  return NULL;
+   }
+
+   buffer = calloc(1, sizeof *buffer);
+   if (buffer == NULL)
+  return NULL;
+
+   buffer-image = image-createImage(screen,
+  width, height, dri_format,
+  __DRI_IMAGE_USE_SHARE |
+  __DRI_IMAGE_USE_SCANOUT,
+  buffer);
+
+   if (buffer-image == NULL) {
+  free(buffer);
+  return NULL;
+   }
+
+   image-queryImage(buffer-image, __DRI_IMAGE_ATTRIB_NAME, name);
+   image-queryImage(buffer-image, __DRI_IMAGE_ATTRIB_STRIDE, stride);
+
+   buffer-base.attachment = attachment;
+   buffer-base.name = name;
+   buffer-base.pitch = stride;
+   buffer-base.cpp = format / 8;
+
+   return buffer-base;
+}
+
+void
+driReleaseBuffer(__DRIscreen *screen, __DRIbuffer *_buffer)
+{
+   struct dri_image_buffer *buffer = (struct dri_image_buffer *) _buffer;
+   __DRIimageExtension *image = screen-image_extension;
+
+   image-destroyImage(buffer-image);
+   free(buffer);
+}
+
+
 /** Image driver interface */
 const __DRIimageDriverExtension driImageDriverExtension = {
 .base = { __DRI_IMAGE_DRIVER, __DRI_IMAGE_DRIVER_VERSION },
diff --git a/src/mesa/drivers/dri/common/dri_util.h 
b/src/mesa/drivers/dri/common/dri_util.h
index 79a8564..240213d 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -165,6 +165,7 @@ struct __DRIscreenRec {
 int max_gl_es2_version;
 
 const __DRIextension **extensions;
+   __DRIimageExtension *image_extension;
 
 const __DRIswrastLoaderExtension *swrast_loader;
 
@@ -291,4 +292,13 @@ driUpdateFramebufferSize(struct gl_context *ctx, const 
__DRIdrawable *dPriv);
 
 extern const __DRIimageDriverExtension driImageDriverExtension;
 
+extern __DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height);
+
+extern void
+driReleaseBuffer(__DRIscreen *screen, __DRIbuffer *_buffer);
+
+
 #endif /* _DRI_UTIL_H_ */
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
b/src/mesa/drivers/dri/i915/intel_screen.c
index 2c309ed..a143652 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -1185,58 +1185,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
return (const __DRIconfig**) intel_screen_make_configs(psp);
 }
 
-struct intel_buffer {
-   

[Mesa-dev] [PATCH 3/3] wayland: Use __DRIimage based getBuffers implementation when available

2013-11-11 Thread Kristian Høgsberg
This lets us allocate color buffers as __DRIimages and pass them into
the driver instead of having to create a __DRIbuffer with the flink
that requires.

Signed-off-by: Kristian Høgsberg k...@bitplanet.net
Cc: 10.0 mesa-sta...@lists.freedesktop.org
---
 src/egl/drivers/dri2/egl_dri2.h |   3 +-
 src/egl/drivers/dri2/platform_wayland.c | 140 ++--
 2 files changed, 96 insertions(+), 47 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index c7d6484..bbe5602 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -117,7 +117,7 @@ struct dri2_egl_display
 
__DRIdri2LoaderExtensiondri2_loader_extension;
__DRIswrastLoaderExtension  swrast_loader_extension;
-   const __DRIextension *extensions[4];
+   const __DRIextension *extensions[5];
const __DRIextension**driver_extensions;
 
 #ifdef HAVE_X11_PLATFORM
@@ -189,7 +189,6 @@ struct dri2_egl_surface
 #ifdef HAVE_WAYLAND_PLATFORM
   struct wl_buffer   *wl_buffer;
   __DRIimage *dri_image;
-  int pitch, name;
 #endif
 #ifdef HAVE_DRM_PLATFORM
   struct gbm_bo   *bo;
diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index c0de16b..f9065bb 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -257,12 +257,11 @@ dri2_release_buffers(struct dri2_egl_surface *dri2_surf)
 }
 
 static int
-get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+get_back_bo(struct dri2_egl_surface *dri2_surf)
 {
struct dri2_egl_display *dri2_dpy =
   dri2_egl_display(dri2_surf-base.Resource.Display);
-   __DRIimage *image;
-   int i, name, pitch;
+   int i;
 
/* There might be a buffer release already queued that wasn't processed */
wl_display_dispatch_queue_pending(dri2_dpy-wl_dpy, dri2_dpy-wl_queue);
@@ -295,23 +294,30 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, 
__DRIbuffer *buffer)
if (dri2_surf-back-dri_image == NULL)
   return -1;
 
+   dri2_surf-back-locked = 1;
+
+   return 0;
+}
+
+
+static void
+back_bo_to_dri_buffer(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
+{
+   struct dri2_egl_display *dri2_dpy =
+  dri2_egl_display(dri2_surf-base.Resource.Display);
+   __DRIimage *image;
+   int name, pitch;
+
image = dri2_surf-back-dri_image;
 
dri2_dpy-image-queryImage(image, __DRI_IMAGE_ATTRIB_NAME, name);
dri2_dpy-image-queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, pitch);
 
-   dri2_surf-back-name = name;
-   dri2_surf-back-pitch = pitch;
-
buffer-attachment = __DRI_BUFFER_BACK_LEFT;
buffer-name = name;
buffer-pitch = pitch;
buffer-cpp = 4;
buffer-flags = 0;
-
-   dri2_surf-back-locked = 1;
-
-   return 0;
 }
 
 static int
@@ -337,16 +343,12 @@ get_aux_bo(struct dri2_egl_surface *dri2_surf,
return 0;
 }
 
-static __DRIbuffer *
-dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
-int *width, int *height,
-unsigned int *attachments, int count,
-int *out_count, void *loaderPrivate)
+static int
+update_buffers(struct dri2_egl_surface *dri2_surf)
 {
-   struct dri2_egl_surface *dri2_surf = loaderPrivate;
struct dri2_egl_display *dri2_dpy =
   dri2_egl_display(dri2_surf-base.Resource.Display);
-   int i, j;
+   int i;
 
if (dri2_surf-base.Type == EGL_WINDOW_BIT 
(dri2_surf-base.Width != dri2_surf-wl_win-width || 
@@ -360,22 +362,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
   dri2_surf-dy = dri2_surf-wl_win-dy;
}
 
-   for (i = 0, j = 0; i  2 * count; i += 2, j++) {
-  switch (attachments[i]) {
-  case __DRI_BUFFER_BACK_LEFT:
-if (get_back_bo(dri2_surf, dri2_surf-buffers[j])  0) {
-   _eglError(EGL_BAD_ALLOC, failed to allocate color buffer);
-   return NULL;
-}
-break;
-  default:
-if (get_aux_bo(dri2_surf, attachments[i], attachments[i + 1],
-   dri2_surf-buffers[j])  0) {
-   _eglError(EGL_BAD_ALLOC, failed to allocate aux buffer);
-   return NULL;
-}
-break;
-  }
+   if (get_back_bo(dri2_surf)  0) {
+  _eglError(EGL_BAD_ALLOC, failed to allocate color buffer);
+  return -1;
}
 
/* If we have an extra unlocked buffer at this point, we had to do triple
@@ -391,6 +380,36 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
   }
}
 
+   return 0;
+}
+
+static __DRIbuffer *
+dri2_get_buffers_with_format(__DRIdrawable * driDrawable,
+int *width, int *height,
+unsigned int *attachments, int count,
+int *out_count, void *loaderPrivate)
+{
+   struct dri2_egl_surface *dri2_surf = loaderPrivate;
+   int i, j;
+
+   if (update_buffers(dri2_surf)  0)
+  return NULL;
+

Re: [Mesa-dev] [PATCH 2/2] i965: Enhance tiled_memcpy to support all levels

2013-11-11 Thread Chad Versace

On 11/08/2013 08:13 AM, Courtney Goeltzenleuchter wrote:

Support all levels of a supported texture format.

Using 1024x1024, RGBA  source, mipmap
THIS PATCH
internal-format Before (MB/sec) XRGB (MB/sec)   mipmap (MB/sec)
GL_RGBA 628.15  627.15  615.90
GL_RGB  265.95  456.35  611.53
512x512
GL_RGBA 600.23  597.00  619.95
GL_RGB  255.50  440.62  611.28
256x256
GL_RGBA 489.08  487.80  587.42
GL_RGB  229.03  376.63  585.00

Test shows similar pattern for 512x512 and 256x256.

Benchmark has been sent to mesa-dev list: teximage_enh

Courtney Goeltzenleuchter (2):
   i965: add XRGB to tiled_memcpy
   i965: Enhance tiled_memcpy to support all levels

  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 11 ---
  1 file changed, 8 insertions(+), 3 deletions(-)

--
1.8.1.2

Signed-off-by: Courtney Goeltzenleuchter court...@lunarg.com
---
  src/mesa/drivers/dri/i965/intel_tex_subimage.c | 8 ++--
  1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c 
b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index b1826fa..50f802f 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -543,7 +543,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 uint32_t cpp;
 mem_copy_fn mem_copy = NULL;

-   /* This fastpath is restricted to specific texture types: level 0 of
+   /* This fastpath is restricted to specific texture types:
  * a 2D BGRA, RGBA, L8 or A8 texture. It could be generalized to support
  * more types.
  *
@@ -555,7 +555,6 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 if (!brw-has_llc ||
 type != GL_UNSIGNED_BYTE ||
 texImage-TexObject-Target != GL_TEXTURE_2D ||
-   texImage-Level != 0 ||
 pixels == NULL ||
 _mesa_is_bufferobj(packing-BufferObj) ||
 packing-Alignment  4 ||
@@ -631,6 +630,11 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
 packing-Alignment, packing-RowLength, packing-SkipPixels,
 packing-SkipRows, for_glTexImage);

+   /* Adjust x and y offset based on miplevel
+*/


One small nitpick. The above comment is short enough to fit on a single line.
There's no need to place '*/' on a line by itself.


+   xoffset += image-mt-level[texImage-Level].level_x;
+   yoffset += image-mt-level[texImage-Level].level_y;
+
 linear_to_tiled(
xoffset * cpp, (xoffset + width) * cpp,
yoffset, yoffset + height,



The code looks good, though I haven't tested it yet. But, I see the same
issues with the commit message that I had with patch 1.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 07/18] i915: Wire up initial support for DRI_RENDERER_QUERY extension

2013-11-11 Thread Daniel Vetter
On Mon, Nov 11, 2013 at 11:03:49AM -0800, Ian Romanick wrote:
 On 11/09/2013 02:44 AM, Daniel Vetter wrote:
  On Fri, Oct 11, 2013 at 03:10:14PM -0700, Ian Romanick wrote:
  From: Ian Romanick ian.d.roman...@intel.com
 
  Signed-off-by: Ian Romanick ian.d.roman...@intel.com
  ---
   src/mesa/drivers/dri/i915/intel_screen.c | 79 
  
   1 file changed, 79 insertions(+)
 
  diff --git a/src/mesa/drivers/dri/i915/intel_screen.c 
  b/src/mesa/drivers/dri/i915/intel_screen.c
  index 4f8c342..fa4fdc0 100644
  --- a/src/mesa/drivers/dri/i915/intel_screen.c
  +++ b/src/mesa/drivers/dri/i915/intel_screen.c
  @@ -27,6 +27,7 @@
   
   #include errno.h
   #include time.h
  +#include sys/sysinfo.h
   #include main/glheader.h
   #include main/context.h
   #include main/framebuffer.h
  @@ -741,6 +742,84 @@ static struct __DRIimageExtensionRec 
  intelImageExtension = {
   .createImageFromFds = intel_create_image_from_fds
   };
   
  +static int
  +i915_query_renderer_integer(__DRIscreen *psp, int param, int *value)
  +{
  +   const struct intel_screen *const intelScreen =
  +  (struct intel_screen *) psp-driverPrivate;
  +
  +   switch (param) {
  +   case __DRI2_RENDERER_VENDOR_ID:
  +  value[0] = 0x8086;
  +  return 0;
  +   case __DRI2_RENDERER_DEVICE_ID:
  +  value[0] = intelScreen-deviceID;
  +  return 0;
  +   case __DRI2_RENDERER_ACCELERATED:
  +  value[0] = 1;
  +  return 0;
  +   case __DRI2_RENDERER_VIDEO_MEMORY: {
  +  struct sysinfo info;
  +  uint64_t system_memory_bytes;
  +  unsigned system_memory_megabytes;
  +
  +  /* Once a batch uses more than 75% of the maximum mappable size, we
  +   * assume that there's some fragmentation, and we start doing extra
  +   * flushing, etc.  That's the big cliff apps will care about.
  +   */
  +  const unsigned long agp_bytes = drmAgpSize(psp-fd);
  
  So despite me shooting at this in the next patch saying that this is
  - the wrong interface, it doesn't actually really tell you what you want
to know (since it fails to take pinnned crap into account),
  - doesn't work on half the platforms i915_dri supports already,
  - and is massively deprecated on all others and a major pain for us to
keep on live support in the kernel
 
 In fairness, you missed this specific issue on your first review and
 shot at it after I committed it. :(  There was no malice... just
 timezone fail.  In the future, I'll CC you any Mesa changes that
 interact with the kernel so that you'll notice them sooner.

Yeah, I try to read most of mesa-devel, but can't really go into details
of the patches everywhere. I only replied to the i965 patch since Ken's
review made me curious to check the details. Then your reply later on made
me check the previous patch.

Anyway, I've cooled off now, just happy that we've caught this zoombie in
the nick of time ;-)

Another thing I've noticed is that you adjust the advertised vram size
with the available memory. I don't think that's an issue already since the
aperture space checker in libdrm (which mesa uses to avoid overfilling
batches) doesn't do that. But it'll be one on memory constrained
phones/tablets and also with the much bigger gtt on bdw.

I think the right fix for that is to adjust the
aperture.aper_available_size in the kernel, so that all users of this
interface have correct data. The kernel already adjusts this for pinned
objects and similar stuff, so would fit neatly. I'll wip up a kernel patch
for that. I guess we could leave the current stuff in for 10.0 and remove
it in master once the kernel fix has landed.

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] i965: Delete #define's and use local variables inside function

2013-11-11 Thread Chad Versace

On 11/07/2013 04:51 PM, Anuj Phogat wrote:

X_f, Y_f, Xp_f, Yp_f variables are used just inside
translate_dst_to_src().So, they can be defined just as
local variables.

Signed-off-by: Anuj Phogat anuj.pho...@gmail.com


Reviewed-by: Chad Versace chad.vers...@linux.intel.com

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #2 from Ian Romanick i...@freedesktop.org ---
That is bizarre.  I always 'make check' as part of my build, and I haven't seen
that failure.  There must be something different about your configure flags
that allows this to happen.  Something is happening that causes
src/glx/indirect_glx.o go get pulled in when linking glx-test, and it should
not.

Can you attach the output of 'nm -u src/glx/tests/*.o'?

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


Re: [Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Daniel Vetter
On Mon, Nov 11, 2013 at 11:19:07AM -0800, Ian Romanick wrote:
 From: Ian Romanick ian.d.roman...@intel.com
 
 Systems with little physical memory installed will report less than
 2GiB, and some systems may (hypothetically?) have a larger address space
 for the GPU.  My IVB still reports 1534.
 
 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 Cc: Daniel Vetter dan...@ffwll.ch
 Cc: 10.0 mesa-sta...@lists.freedesktop.org
 ---
  src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
  1 file changed, 7 insertions(+), 3 deletions(-)
 
 diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
 b/src/mesa/drivers/dri/i965/intel_screen.c
 index e39d654..592150b 100644
 --- a/src/mesa/drivers/dri/i965/intel_screen.c
 +++ b/src/mesa/drivers/dri/i965/intel_screen.c
 @@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, 
 int *value)
/* Once a batch uses more than 75% of the maximum mappable size, we
 * assume that there's some fragmentation, and we start doing extra
 * flushing, etc.  That's the big cliff apps will care about.
 -   *
 -   * Can only map 2G onto the GPU through the GTT.
 */
 -  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
 +  size_t aper_size;
 +  size_t mappable_size;
 +
 +  drm_intel_get_aperture_sizes(psp-fd, mappable_size, aper_size);

Hm, I haven't seen the (presumably) libdrm patch that adds this yet float
by, but you really want to match the uint64_t libdrm uses internally for
gtt_size here ... ;-)

With that fixed both patches are
Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch
I'll look at the wrapper as soon as it hits my inbox.
-Daniel


 +
 +  const unsigned gpu_mappable_megabytes =
 + (aper_size / (1024 * 1024)) * 3 / 4;
  
const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
const long system_page_size = sysconf(_SC_PAGE_SIZE);
 -- 
 1.8.1.4
 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] i915, i965: Fix memory leak in intel_miptree_create_for_bo.

2013-11-11 Thread Chad Versace

On 09/27/2013 10:20 PM, Vinson Lee wrote:

Fixes Resource leak defects reported by Coverity.

Signed-off-by: Vinson Lee v...@freedesktop.org


Thanks. Committed.

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #3 from Vinson Lee v...@freedesktop.org ---
Created attachment 89058
  -- https://bugs.freedesktop.org/attachment.cgi?id=89058action=edit
nm -u src/glx/tests/*.o

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #4 from Ian Romanick i...@freedesktop.org ---
Hrm... diffing that with mine doesn't show anything obvious.  How about 'nm -u
src/glx/.libs/create_context.o'?  I get:

[idr@mumford-wire master-64]$ nm -u src/glx/.libs/create_context.o 
 U __assert_fail
 U free
 U GetGLXScreenConfigs
 U _GLOBAL_OFFSET_TABLE_
 U __glXSendErrorForXcb
 U indirect_create_context_attribs
 U xcb_generate_id
 U xcb_glx_create_context_attribs_arb_checked
 U xcb_request_check
 U XGetXCBConnection

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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #5 from Vinson Lee v...@freedesktop.org ---
I see the same output.

$ nm -u src/glx/.libs/create_context.o
 U __assert_fail
 U free
 U GetGLXScreenConfigs
 U _GLOBAL_OFFSET_TABLE_
 U __glXSendErrorForXcb
 U indirect_create_context_attribs
 U xcb_generate_id
 U xcb_glx_create_context_attribs_arb_checked
 U xcb_request_check
 U XGetXCBConnection

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


Re: [Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Ian Romanick
On 11/11/2013 01:35 PM, Daniel Vetter wrote:
 On Mon, Nov 11, 2013 at 11:19:07AM -0800, Ian Romanick wrote:
 From: Ian Romanick ian.d.roman...@intel.com

 Systems with little physical memory installed will report less than
 2GiB, and some systems may (hypothetically?) have a larger address space
 for the GPU.  My IVB still reports 1534.

 Signed-off-by: Ian Romanick ian.d.roman...@intel.com
 Cc: Daniel Vetter dan...@ffwll.ch
 Cc: 10.0 mesa-sta...@lists.freedesktop.org
 ---
  src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
  1 file changed, 7 insertions(+), 3 deletions(-)

 diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
 b/src/mesa/drivers/dri/i965/intel_screen.c
 index e39d654..592150b 100644
 --- a/src/mesa/drivers/dri/i965/intel_screen.c
 +++ b/src/mesa/drivers/dri/i965/intel_screen.c
 @@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int 
 param, int *value)
/* Once a batch uses more than 75% of the maximum mappable size, we
 * assume that there's some fragmentation, and we start doing extra
 * flushing, etc.  That's the big cliff apps will care about.
 -   *
 -   * Can only map 2G onto the GPU through the GTT.
 */
 -  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
 +  size_t aper_size;
 +  size_t mappable_size;
 +
 +  drm_intel_get_aperture_sizes(psp-fd, mappable_size, aper_size);
 
 Hm, I haven't seen the (presumably) libdrm patch that adds this yet float
 by, but you really want to match the uint64_t libdrm uses internally for
 gtt_size here ... ;-)
 
 With that fixed both patches are
 Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch
 I'll look at the wrapper as soon as it hits my inbox.

Eh... drm_intel_get_aperture_sizes has been around for almost 2.5 years.

commit 9d77603d8b95aee4f2408e437c55af15ee05b608
Author: Chris Wilson ch...@chris-wilson.co.uk
AuthorDate: Sat Jun 4 12:47:19 2011 +0100
Commit: Chris Wilson ch...@chris-wilson.co.uk
CommitDate: Sat Jun 4 13:01:11 2011 +0100

intel: Add interface to query aperture sizes.

Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk

Should I submit a libdrm patch to change it's interface from size_t to
uint64_t?

 -Daniel
 
 
 +
 +  const unsigned gpu_mappable_megabytes =
 + (aper_size / (1024 * 1024)) * 3 / 4;
  
const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
const long system_page_size = sysconf(_SC_PAGE_SIZE);
 -- 
 1.8.1.4

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


Re: [Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Chad Versace

On 11/11/2013 01:22 PM, Kristian Høgsberg wrote:

Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

For the intel dri driver, this consolidates window system color buffer
allocation in intel_create_image().

Signed-off-by: Kristian Høgsberg k...@bitplanet.net
---
  src/mesa/drivers/dri/common/dri_util.c   | 75 
  src/mesa/drivers/dri/common/dri_util.h   | 10 +
  src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
  src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
  4 files changed, 89 insertions(+), 107 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c 
b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24c..a7328e4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c




+__DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height)
+{
+   struct dri_image_buffer *buffer;
+   __DRIimageExtension *image = screen-image_extension;
+   int dri_format, name, stride;
+
+   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+  attachment == __DRI_BUFFER_BACK_LEFT);
+
+   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
+* format / 8.  The image format code is stored in the __DRIimage, but the
+* __DRIbuffer we create from the image, only stores the cpp. */
+
+   switch (format) {
+   case 32:
+  dri_format = __DRI_IMAGE_FORMAT_XRGB;
+  break;
+   case 16:
+  dri_format = __DRI_IMAGE_FORMAT_RGB565;
+  break;
+   default:
+  return NULL;
+   }
+
+   buffer = calloc(1, sizeof *buffer);
+   if (buffer == NULL)
+  return NULL;
+
+   buffer-image = image-createImage(screen,
+  width, height, dri_format,
+  __DRI_IMAGE_USE_SHARE |
+  __DRI_IMAGE_USE_SCANOUT,
+  buffer);


It's incorrect to specify __DRI_IMAGE_USE_SCANOUT regardless of
attachment type. GBM, Wayland, and Android use driAllocateBuffer
to allocate more than just the scanout buffer. They use it to
allocate auxillary buffers too. If i965 were to respect the
caching restrictions implied by __DRI_IMAGE_USE_SCANOUT, its
use for aux buffers would hurt performance. (As far as I can
tell, though, intel_create_image() wrongly ignores __DRI_IMAGE_USE_SCANOUT).

Instead, I think you should set the USE_SCANOUT bit if and only if
attachment is one of __DRI_BUFFER_(BACK|FRONT)_(LEFT|RIGHT).


+
+   if (buffer-image == NULL) {
+  free(buffer);
+  return NULL;
+   }
+
+   image-queryImage(buffer-image, __DRI_IMAGE_ATTRIB_NAME, name);
+   image-queryImage(buffer-image, __DRI_IMAGE_ATTRIB_STRIDE, stride);
+
+   buffer-base.attachment = attachment;
+   buffer-base.name = name;
+   buffer-base.pitch = stride;
+   buffer-base.cpp = format / 8;
+
+   return buffer-base;
+}


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


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #6 from Ian Romanick i...@freedesktop.org ---
I'm really confused now. :(  You're sure that bisect is good?  There's nothing
in that commit that modifies any file under src/glx.

I'm also not able to reproduce this even using your configure options.

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


Re: [Mesa-dev] [PATCH 1/2 v3] i965: add XRGB to tiled_memcpy

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 1:19 PM, Chad Versace
chad.vers...@linux.intel.com wrote:
 On 11/07/2013 01:59 PM, Courtney Goeltzenleuchter wrote:

 MESA_FORMAT_XRGB is equivalent to MESA_FORMAT_ARGB in terms
 of storage on the device, so okay to use this optimized copy routine.

 This series builds on work from Frank Henigman to optimize the
 process of uploading a texture to the GPU. This series adds support for
 MESA_XRGB_ and full miptrees where were found to be common activities
 in the Smokin' Guns game. The issue was found while profiling the app
 but that part is not benchmarked. Smokin-Guns uses mipmap textures with
 an internal format of GL_RGB (MESA_XRGB_ in the driver).

 These changes need a performance tool to run against to show how they
 improve execution performance for specific texture formats. Using this
 benchmark I've measured the following improvement on my Ivybridge
 Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz.

 Using 1024x1024, RGBA  source, mipmap
  THIS PATCH


 I don't understand. What do you mean by ``THIS PATCH``? That all these
 numbers were obtained with this patch? But that doesn't make sense, because
 these are before-and-after numbers. And it can't be just this patch, because
 these numbers are identical to the numbers quoted in patch 2.

The first column is before, the second is after patch 1, and the
third is after patch 2. Instead of doing before-after patch 1 in
patch 1's commit, and after patch 1-after patch 2 in patch 2's
commit, he just pasted the same data in and added THIS PATCH above
the column that corresponds to the patch.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] tests: Fix make check for out of tree builds.

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 12:18 PM, Rico Schüller kgbric...@web.de wrote:
 Signed-off-by: Rico Schüller kgbric...@web.de
 ---
  src/mapi/shared-glapi/tests/Makefile.am | 1 +
  src/mesa/main/tests/Makefile.am | 1 +
  2 Dateien geändert, 2 Zeilen hinzugefügt(+)

 diff --git a/src/mapi/shared-glapi/tests/Makefile.am 
 b/src/mapi/shared-glapi/tests/Makefile.am
 index 98065fc..7e71b4f 100644
 --- a/src/mapi/shared-glapi/tests/Makefile.am
 +++ b/src/mapi/shared-glapi/tests/Makefile.am
 @@ -3,6 +3,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS)
  AM_CPPFLAGS = \
 -I$(top_srcdir)/src/gtest/include \
 -I$(top_srcdir)/src/mapi \
 +   -I$(top_builddir)/src/mapi \
 -I$(top_srcdir)/include

  TESTS = shared-glapi-test
 diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am
 index 97713f2..0d3a51f 100644
 --- a/src/mesa/main/tests/Makefile.am
 +++ b/src/mesa/main/tests/Makefile.am
 @@ -7,6 +7,7 @@ AM_CPPFLAGS = \
 -I$(top_srcdir)/src/gtest/include \
 -I$(top_srcdir)/src/mapi \
 -I$(top_srcdir)/src/mesa \
 +   -I$(top_builddir)/src/mesa \
 -I$(top_srcdir)/include \
 $(DEFINES) $(INCLUDE_DIRS)

 --
 1.7.11.7

Thanks! Reviewed-by and committed.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Kristian Høgsberg
On Mon, Nov 11, 2013 at 1:57 PM, Chad Versace
chad.vers...@linux.intel.com wrote:
 On 11/11/2013 01:22 PM, Kristian Høgsberg wrote:

 Drivers that only call getBuffers to request color buffers can use these
 generic, __DRIimage based helpers to implement the allocBuffer and
 releaseBuffer functions of __DRIdri2Extension.

 For the intel dri driver, this consolidates window system color buffer
 allocation in intel_create_image().

 Signed-off-by: Kristian Høgsberg k...@bitplanet.net
 ---
   src/mesa/drivers/dri/common/dri_util.c   | 75
 
   src/mesa/drivers/dri/common/dri_util.h   | 10 +
   src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
   src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
   4 files changed, 89 insertions(+), 107 deletions(-)

 diff --git a/src/mesa/drivers/dri/common/dri_util.c
 b/src/mesa/drivers/dri/common/dri_util.c
 index 86cf24c..a7328e4 100644
 --- a/src/mesa/drivers/dri/common/dri_util.c
 +++ b/src/mesa/drivers/dri/common/dri_util.c



 +__DRIbuffer *
 +driAllocateBuffer(__DRIscreen *screen,
 +  unsigned attachment, unsigned format,
 +  int width, int height)
 +{
 +   struct dri_image_buffer *buffer;
 +   __DRIimageExtension *image = screen-image_extension;
 +   int dri_format, name, stride;
 +
 +   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
 +  attachment == __DRI_BUFFER_BACK_LEFT);
 +
 +   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
 +* format / 8.  The image format code is stored in the __DRIimage, but
 the
 +* __DRIbuffer we create from the image, only stores the cpp. */
 +
 +   switch (format) {
 +   case 32:
 +  dri_format = __DRI_IMAGE_FORMAT_XRGB;
 +  break;
 +   case 16:
 +  dri_format = __DRI_IMAGE_FORMAT_RGB565;
 +  break;
 +   default:
 +  return NULL;
 +   }
 +
 +   buffer = calloc(1, sizeof *buffer);
 +   if (buffer == NULL)
 +  return NULL;
 +
 +   buffer-image = image-createImage(screen,
 +  width, height, dri_format,
 +  __DRI_IMAGE_USE_SHARE |
 +  __DRI_IMAGE_USE_SCANOUT,
 +  buffer);


 It's incorrect to specify __DRI_IMAGE_USE_SCANOUT regardless of
 attachment type. GBM, Wayland, and Android use driAllocateBuffer
 to allocate more than just the scanout buffer. They use it to
 allocate auxillary buffers too. If i965 were to respect the
 caching restrictions implied by __DRI_IMAGE_USE_SCANOUT, its
 use for aux buffers would hurt performance. (As far as I can
 tell, though, intel_create_image() wrongly ignores __DRI_IMAGE_USE_SCANOUT).

 Instead, I think you should set the USE_SCANOUT bit if and only if
 attachment is one of __DRI_BUFFER_(BACK|FRONT)_(LEFT|RIGHT).

The commit message says:

Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

which is true for the Intel DRI driver.  The DRI2 interface allows the
driver to ask for auxillary buffers, but since we stopped supporting
multiple processes rendering to the same X window, our driver no
longer does that.  This is under driver control and thus if a driver
knows it will never ask for aux buffers, it can use these helpers.

Kristian

 +
 +   if (buffer-image == NULL) {
 +  free(buffer);
 +  return NULL;
 +   }
 +
 +   image-queryImage(buffer-image, __DRI_IMAGE_ATTRIB_NAME, name);
 +   image-queryImage(buffer-image, __DRI_IMAGE_ATTRIB_STRIDE, stride);
 +
 +   buffer-base.attachment = attachment;
 +   buffer-base.name = name;
 +   buffer-base.pitch = stride;
 +   buffer-base.cpp = format / 8;
 +
 +   return buffer-base;
 +}


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


Re: [Mesa-dev] [PATCH 2/4] i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB

2013-11-11 Thread Daniel Vetter
On Mon, Nov 11, 2013 at 01:45:43PM -0800, Ian Romanick wrote:
 On 11/11/2013 01:35 PM, Daniel Vetter wrote:
  On Mon, Nov 11, 2013 at 11:19:07AM -0800, Ian Romanick wrote:
  From: Ian Romanick ian.d.roman...@intel.com
 
  Systems with little physical memory installed will report less than
  2GiB, and some systems may (hypothetically?) have a larger address space
  for the GPU.  My IVB still reports 1534.
 
  Signed-off-by: Ian Romanick ian.d.roman...@intel.com
  Cc: Daniel Vetter dan...@ffwll.ch
  Cc: 10.0 mesa-sta...@lists.freedesktop.org
  ---
   src/mesa/drivers/dri/i965/intel_screen.c | 10 +++---
   1 file changed, 7 insertions(+), 3 deletions(-)
 
  diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
  b/src/mesa/drivers/dri/i965/intel_screen.c
  index e39d654..592150b 100644
  --- a/src/mesa/drivers/dri/i965/intel_screen.c
  +++ b/src/mesa/drivers/dri/i965/intel_screen.c
  @@ -823,10 +823,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int 
  param, int *value)
 /* Once a batch uses more than 75% of the maximum mappable size, we
  * assume that there's some fragmentation, and we start doing extra
  * flushing, etc.  That's the big cliff apps will care about.
  -   *
  -   * Can only map 2G onto the GPU through the GTT.
  */
  -  const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
  +  size_t aper_size;
  +  size_t mappable_size;
  +
  +  drm_intel_get_aperture_sizes(psp-fd, mappable_size, aper_size);
  
  Hm, I haven't seen the (presumably) libdrm patch that adds this yet float
  by, but you really want to match the uint64_t libdrm uses internally for
  gtt_size here ... ;-)
  
  With that fixed both patches are
  Reviewed-by: Daniel Vetter daniel.vet...@ffwll.ch
  I'll look at the wrapper as soon as it hits my inbox.
 
 Eh... drm_intel_get_aperture_sizes has been around for almost 2.5 years.
 
 commit 9d77603d8b95aee4f2408e437c55af15ee05b608
 Author: Chris Wilson ch...@chris-wilson.co.uk
 AuthorDate: Sat Jun 4 12:47:19 2011 +0100
 Commit: Chris Wilson ch...@chris-wilson.co.uk
 CommitDate: Sat Jun 4 13:01:11 2011 +0100
 
 intel: Add interface to query aperture sizes.
 
 Signed-off-by: Chris Wilson ch...@chris-wilson.co.uk

Oops, indeed. I seem to be blind.

 Should I submit a libdrm patch to change it's interface from size_t to
 uint64_t?

Would be an abi break I think (at least on 32 bit), so not worth the
trouble. I'll scowl a bit at Chris for failing to predict the future and
add it to the list of things to fix for bdw. Patches are r-b as is.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #7 from Armin K kre...@email.com ---
If you revert changes to Makefile.am made by these two commits, test builds and
passess fine:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c5330226f391a7a29b6538851090b0ef730a239

http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cce5538673148ffcd7aa9479f6b88cf9a641352

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


Re: [Mesa-dev] [PATCH 1/3] i965: Add a warning if something ever hits a bug I noticed.

2013-11-11 Thread Matt Turner
On Tue, Nov 5, 2013 at 5:35 PM, Eric Anholt e...@anholt.net wrote:
 We'd have to map the VBO and rewrite things to a lower stride to fix it.
 ---

These three are

Reviewed-by: Matt Turner matts...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 71506] indirect_glx.c:350: multiple definition of `indirect_create_context'

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=71506

--- Comment #8 from Armin K kre...@email.com ---
Even to be more precise, (manually) reverting this commit fixes the issue, at
least here:

http://cgit.freedesktop.org/mesa/mesa/commit/?id=0cce5538673148ffcd7aa9479f6b88cf9a641352

Reproducible with GCC 4.8.2 and Binutils 2.23.2.

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


Re: [Mesa-dev] [PATCH] i965/fs: Fix message setup for SIMD8 spills.

2013-11-11 Thread Paul Berry
On 5 November 2013 16:21, Eric Anholt e...@anholt.net wrote:

 In the SIMD16 spilling changes, I replaced a 1 in the spill path with
 mlen, but obviously it wasn't mlen before because spills have the g0
 header along with the payload. The interface I was trying to use was
 asking for how many physical regs we're writing, so we're looking for 1
 or 2.

 I'm guessing this actually passed piglit because the high 8 bits of the
 execution mask in SIMD8 mode are all 0s.


Reviewed-by: Paul Berry stereotype...@gmail.com


 ---
  src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
 b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
 index 63ac530..83917f5 100644
 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
 +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
 @@ -757,7 +757,7 @@ fs_generator::generate_scratch_write(fs_inst *inst,
 struct brw_reg src)
retype(brw_message_reg(inst-base_mrf + 1),
 BRW_REGISTER_TYPE_UD),
retype(src, BRW_REGISTER_TYPE_UD));
 brw_oword_block_write_scratch(p, brw_message_reg(inst-base_mrf),
 - inst-mlen, inst-offset);
 + dispatch_width / 8, inst-offset);
  }

  void
 --
 1.8.4.rc3

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

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


Re: [Mesa-dev] [PATCH 3/3] i965/fs: Try a different pre-scheduling heuristic if the first spills.

2013-11-11 Thread Matt Turner
On Wed, Nov 6, 2013 at 6:47 PM, Eric Anholt e...@anholt.net wrote:
 Since LIFO fails on some shaders in one particular way, and non-LIFO
 systematically fails in another way on different kinds of shaders, try
 them both. and pick whichever one successfully register allocates first.
 Slightly prefer non-LIFO in case we produce extra dependencies in register
 allocation, since it should start out with fewer stalls than LIFO.

 This is madness, but I haven't come up with another way to get unigine
 tropics to not spill while keeping other programs from not spilling and
 retaining the non-unigine performance wins from texture-grf.

 total instructions in shared programs: 1626728 - 1626288 (-0.03%)
 instructions in affected programs: 1015 - 575 (-43.35%)
 GAINED:50
 LOST:  0
 ---

And these three are

Reviewed-by: Matt Turner matts...@gmail.com
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 07/27] gtest: enable subdir-objects to prevent automake warnings

2013-11-11 Thread Matt Turner
On Mon, Nov 11, 2013 at 10:53 AM, Emil Velikov emil.l.veli...@gmail.com wrote:
 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
 ---
  src/gtest/Makefile.am | 1 +
  1 file changed, 1 insertion(+)

 diff --git a/src/gtest/Makefile.am b/src/gtest/Makefile.am
 index 4188c6b..23ea749 100644
 --- a/src/gtest/Makefile.am
 +++ b/src/gtest/Makefile.am
 @@ -18,6 +18,7 @@
  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 DEALINGS
  # IN THE SOFTWARE.
 +AUTOMAKE_OPTIONS = subdir-objects

Put a newline before AUTOMAKE_OPTIONS.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [Bug 61364] LLVM assertion when starting X11

2013-11-11 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=61364

--- Comment #10 from Tom Stellard tstel...@gmail.com ---
This should be fixed now in mesa master when linking with llvm static
libraries.  Can you re-test?

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


Re: [Mesa-dev] [PATCH 15/37] r300: move the final sources list to Makefile.sources

2013-11-11 Thread Tom Stellard
On Sat, Nov 02, 2013 at 07:00:45PM +, Emil Velikov wrote:
 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com

Can you make sure make check still works with this patch, if it does,
then:

Reviewed-by: Tom Stellard thomas.stell...@amd.com

 ---
  src/gallium/drivers/r300/Makefile.am  | 13 ++---
  src/gallium/drivers/r300/Makefile.sources | 14 +-
  2 files changed, 15 insertions(+), 12 deletions(-)
 
 diff --git a/src/gallium/drivers/r300/Makefile.am 
 b/src/gallium/drivers/r300/Makefile.am
 index 524df24..4edeb47 100644
 --- a/src/gallium/drivers/r300/Makefile.am
 +++ b/src/gallium/drivers/r300/Makefile.am
 @@ -3,7 +3,6 @@ include $(top_srcdir)/src/gallium/Automake.inc
  
  noinst_LTLIBRARIES = libr300.la libr300-helper.la
  check_PROGRAMS = r300_compiler_tests
 -testdir = compiler/tests
  TESTS = r300_compiler_tests
  
  AM_CFLAGS = \
 @@ -22,13 +21,7 @@ r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
   $(GALLIUM_DRI_LIB_DEPS)
  r300_compiler_tests_CPPFLAGS = \
   -I$(top_srcdir)/src/gallium/drivers/r300/compiler
 -r300_compiler_tests_SOURCES = \
 - $(testdir)/r300_compiler_tests.c \
 - $(testdir)/radeon_compiler_optimize_tests.c \
 - $(testdir)/radeon_compiler_regalloc_tests.c \
 - $(testdir)/radeon_compiler_util_tests.c \
 - $(testdir)/rc_test_helpers.c \
 - $(testdir)/unit_test.c
 +r300_compiler_tests_SOURCES = $(COMPILER_TESTS_SOURCES)
  
  libr300_la_SOURCES = $(C_SOURCES)
  
 @@ -39,6 +32,4 @@ libr300_la_SOURCES = $(C_SOURCES)
  #
  # Solve this by building them into a separate helper library that can be 
 linked
  # in place of libmesagallium.
 -libr300_helper_la_SOURCES = \
 - ralloc.c \
 - register_allocate.c
 +libr300_helper_la_SOURCES = $(HELPER_SOURCES)
 diff --git a/src/gallium/drivers/r300/Makefile.sources 
 b/src/gallium/drivers/r300/Makefile.sources
 index 10ceffb..0e9ab52 100644
 --- a/src/gallium/drivers/r300/Makefile.sources
 +++ b/src/gallium/drivers/r300/Makefile.sources
 @@ -1,4 +1,4 @@
 -C_SOURCES = \
 +C_SOURCES := \
   r300_blit.c \
   r300_chipset.c \
   r300_context.c \
 @@ -57,3 +57,15 @@ C_SOURCES = \
   compiler/r3xx_vertprog.c \
   compiler/r3xx_vertprog_dump.c \
   compiler/memory_pool.c
 +
 +COMPILER_TESTS_SOURCES := \
 + compiler/tests/r300_compiler_tests.c \
 + compiler/tests/radeon_compiler_optimize_tests.c \
 + compiler/tests/radeon_compiler_regalloc_tests.c \
 + compiler/tests/radeon_compiler_util_tests.c \
 + compiler/tests/rc_test_helpers.c \
 + compiler/tests/unit_test.c
 +
 +HELPER_SOURCES := \
 + ralloc.c \
 + register_allocate.c
 -- 
 1.8.4.2
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 14/37] r300: add symlink to ralloc.c and register_allocate.c

2013-11-11 Thread Tom Stellard
On Sat, Nov 02, 2013 at 07:00:44PM +, Emil Velikov wrote:
 Make automake's subdir-objects work.
 Update includes.
 
 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
 ---
  src/gallium/drivers/r300/Makefile.am | 6 +++---
  src/gallium/drivers/r300/ralloc.c| 1 +
  src/gallium/drivers/r300/register_allocate.c | 1 +
  3 files changed, 5 insertions(+), 3 deletions(-)
  create mode 12 src/gallium/drivers/r300/ralloc.c
  create mode 12 src/gallium/drivers/r300/register_allocate.c
 
 diff --git a/src/gallium/drivers/r300/Makefile.am 
 b/src/gallium/drivers/r300/Makefile.am
 index 14aaf03..524df24 100644
 --- a/src/gallium/drivers/r300/Makefile.am
 +++ b/src/gallium/drivers/r300/Makefile.am
 @@ -8,7 +8,7 @@ TESTS = r300_compiler_tests
  
  AM_CFLAGS = \
   -I$(top_srcdir)/src/gallium/drivers \
 - -I$(top_srcdir)/include \
 + -I$(top_srcdir)/src/mesa/program \
   -I$(top_srcdir)/src/mesa \
   -I$(top_srcdir)/src/glsl \
   -I$(top_srcdir)/src/mapi \
 @@ -40,5 +40,5 @@ libr300_la_SOURCES = $(C_SOURCES)
  # Solve this by building them into a separate helper library that can be 
 linked
  # in place of libmesagallium.
  libr300_helper_la_SOURCES = \
 - $(top_srcdir)/src/glsl/ralloc.c \
 - $(top_srcdir)/src/mesa/program/register_allocate.c
 + ralloc.c \
 + register_allocate.c
 diff --git a/src/gallium/drivers/r300/ralloc.c 
 b/src/gallium/drivers/r300/ralloc.c
 new file mode 12
 index 000..c5402db
 --- /dev/null
 +++ b/src/gallium/drivers/r300/ralloc.c
 @@ -0,0 +1 @@
 +../../../glsl/ralloc.c
 \ No newline at end of file
 diff --git a/src/gallium/drivers/r300/register_allocate.c 
 b/src/gallium/drivers/r300/register_allocate.c
 new file mode 12
 index 000..2117950
 --- /dev/null
 +++ b/src/gallium/drivers/r300/register_allocate.c
 @@ -0,0 +1 @@
 +../../../mesa/program/register_allocate.c

Will this still work with out-of-tree builds?

-Tom

 \ No newline at end of file
 -- 
 1.8.4.2
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] i965: Link test program with -ldl.

2013-11-11 Thread Matt Turner
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71512
---
 src/mesa/drivers/dri/i965/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/Makefile.am 
b/src/mesa/drivers/dri/i965/Makefile.am
index 8c0f9a3..6bce3c1 100644
--- a/src/mesa/drivers/dri/i965/Makefile.am
+++ b/src/mesa/drivers/dri/i965/Makefile.am
@@ -48,6 +48,7 @@ TEST_LIBS = \
../common/libmegadriver_stub.la \
$(DRI_LIB_DEPS) \
 ../../../libmesa.la \
+   $(DLOPEN_LIBS) \
 -lrt \
../common/libdri_test_stubs.la
 
-- 
1.8.3.2

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


[Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Petr Sebor
Otherwise, the function would enable generic vertex attributes 0 and 1 of the
array object it does not own. This was causing crashes in Euro Truck Simulator 
2,
since the incorrectly enabled generic attribute 0 in the foreign context got
precedence before vertex position attribute at later time, leading to NULL
pointer dereference.

Signed-off-by: Petr Sebor p...@scssoft.com
---
This version is really much better for the reasons both you and Ian mentioned.
And... works for me! Thanks!

Petr
---
 src/mesa/drivers/common/meta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index f818416..3be 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1515,6 +1515,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
sizeof(struct vertex), OFFSET(x));
   _mesa_VertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE,
sizeof(struct vertex), OFFSET(s));
+
+  _mesa_EnableVertexAttribArray(0);
+  _mesa_EnableVertexAttribArray(1);
}
 
/* Generate a relevant fragment shader program for the texture target */
@@ -1591,8 +1594,6 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
_mesa_DeleteObjectARB(vs);
_mesa_BindAttribLocation(ShaderProg, 0, position);
_mesa_BindAttribLocation(ShaderProg, 1, texcoords);
-   _mesa_EnableVertexAttribArray(0);
-   _mesa_EnableVertexAttribArray(1);
link_program_with_debug(ctx, ShaderProg);
ralloc_free(mem_ctx);
if (texture_2d)
-- 
1.8.3.2

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


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Brian Paul

On 11/11/2013 04:19 PM, Petr Sebor wrote:

Otherwise, the function would enable generic vertex attributes 0 and 1 of the
array object it does not own. This was causing crashes in Euro Truck Simulator 
2,
since the incorrectly enabled generic attribute 0 in the foreign context got
precedence before vertex position attribute at later time, leading to NULL
pointer dereference.

Signed-off-by: Petr Sebor p...@scssoft.com


Reviewed-by: Brian Paul bri...@vmware.com

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


Re: [Mesa-dev] [PATCH 1/3] dri: Add helpers for implementing allocBuffer/releaseBuffer with __DRIimage

2013-11-11 Thread Chad Versace

On 11/11/2013 02:20 PM, Kristian Høgsberg wrote:

On Mon, Nov 11, 2013 at 1:57 PM, Chad Versace
chad.vers...@linux.intel.com wrote:

On 11/11/2013 01:22 PM, Kristian Høgsberg wrote:


Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

For the intel dri driver, this consolidates window system color buffer
allocation in intel_create_image().

Signed-off-by: Kristian Høgsberg k...@bitplanet.net
---
   src/mesa/drivers/dri/common/dri_util.c   | 75

   src/mesa/drivers/dri/common/dri_util.h   | 10 +
   src/mesa/drivers/dri/i915/intel_screen.c | 56 +---
   src/mesa/drivers/dri/i965/intel_screen.c | 55 +--
   4 files changed, 89 insertions(+), 107 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c
b/src/mesa/drivers/dri/common/dri_util.c
index 86cf24c..a7328e4 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c





+__DRIbuffer *
+driAllocateBuffer(__DRIscreen *screen,
+  unsigned attachment, unsigned format,
+  int width, int height)
+{
+   struct dri_image_buffer *buffer;
+   __DRIimageExtension *image = screen-image_extension;
+   int dri_format, name, stride;
+
+   assert(attachment == __DRI_BUFFER_FRONT_LEFT ||
+  attachment == __DRI_BUFFER_BACK_LEFT);
+
+   /* We just need a __DRI_IMAGE_FORMAT code that has a cpp that matches
+* format / 8.  The image format code is stored in the __DRIimage, but
the
+* __DRIbuffer we create from the image, only stores the cpp. */
+
+   switch (format) {
+   case 32:
+  dri_format = __DRI_IMAGE_FORMAT_XRGB;
+  break;
+   case 16:
+  dri_format = __DRI_IMAGE_FORMAT_RGB565;
+  break;
+   default:
+  return NULL;
+   }
+
+   buffer = calloc(1, sizeof *buffer);
+   if (buffer == NULL)
+  return NULL;
+
+   buffer-image = image-createImage(screen,
+  width, height, dri_format,
+  __DRI_IMAGE_USE_SHARE |
+  __DRI_IMAGE_USE_SCANOUT,
+  buffer);



It's incorrect to specify __DRI_IMAGE_USE_SCANOUT regardless of
attachment type. GBM, Wayland, and Android use driAllocateBuffer
to allocate more than just the scanout buffer. They use it to
allocate auxillary buffers too. If i965 were to respect the
caching restrictions implied by __DRI_IMAGE_USE_SCANOUT, its
use for aux buffers would hurt performance. (As far as I can
tell, though, intel_create_image() wrongly ignores __DRI_IMAGE_USE_SCANOUT).

Instead, I think you should set the USE_SCANOUT bit if and only if
attachment is one of __DRI_BUFFER_(BACK|FRONT)_(LEFT|RIGHT).


The commit message says:

Drivers that only call getBuffers to request color buffers can use these
generic, __DRIimage based helpers to implement the allocBuffer and
releaseBuffer functions of __DRIdri2Extension.

which is true for the Intel DRI driver.  The DRI2 interface allows the
driver to ask for auxillary buffers, but since we stopped supporting
multiple processes rendering to the same X window, our driver no
longer does that.  This is under driver control and thus if a driver
knows it will never ask for aux buffers, it can use these helpers.

Kristian


Ah, thanks for correcting me. I also solved the questions I had regarding
patch 3, so this series is
Reviewed-by: Chad Versace chad.vers...@linux.intel.com

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


Re: [Mesa-dev] [PATCH] meta: enable vertex attributes in the context of the newly created array object

2013-11-11 Thread Ian Romanick
On 11/11/2013 03:19 PM, Petr Sebor wrote:
 Otherwise, the function would enable generic vertex attributes 0 and 1 of the
 array object it does not own. This was causing crashes in Euro Truck 
 Simulator 2,
 since the incorrectly enabled generic attribute 0 in the foreign context got
 precedence before vertex position attribute at later time, leading to NULL
 pointer dereference.
 
 Signed-off-by: Petr Sebor p...@scssoft.com

Looks good to me.

Reviewed-by: Ian Romanick ian.d.roman...@intel.com

 ---
 This version is really much better for the reasons both you and Ian mentioned.
 And... works for me! Thanks!
 
 Petr
 ---
  src/mesa/drivers/common/meta.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
 index f818416..3be 100644
 --- a/src/mesa/drivers/common/meta.c
 +++ b/src/mesa/drivers/common/meta.c
 @@ -1515,6 +1515,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
 sizeof(struct vertex), OFFSET(x));
_mesa_VertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE,
 sizeof(struct vertex), OFFSET(s));
 +
 +  _mesa_EnableVertexAttribArray(0);
 +  _mesa_EnableVertexAttribArray(1);
 }
  
 /* Generate a relevant fragment shader program for the texture target */
 @@ -1591,8 +1594,6 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
 _mesa_DeleteObjectARB(vs);
 _mesa_BindAttribLocation(ShaderProg, 0, position);
 _mesa_BindAttribLocation(ShaderProg, 1, texcoords);
 -   _mesa_EnableVertexAttribArray(0);
 -   _mesa_EnableVertexAttribArray(1);
 link_program_with_debug(ctx, ShaderProg);
 ralloc_free(mem_ctx);
 if (texture_2d)
 

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


Re: [Mesa-dev] [PATCH 2/3] r600/llvm: Free binary.code/binary.config in r600_llvm_compile

2013-11-11 Thread Tom Stellard
On Thu, Nov 07, 2013 at 06:08:15PM -0600, Aaron Watry wrote:
 radeon_llvm_compile allocates memory for binary.code, binary.config, or 
 neither depending on
 what's being done.
 
 We need to make sure to free that memory after it's no longer needed.
 ---
  src/gallium/drivers/r600/r600_llvm.c | 7 +++
  1 file changed, 7 insertions(+)
 
 diff --git a/src/gallium/drivers/r600/r600_llvm.c 
 b/src/gallium/drivers/r600/r600_llvm.c
 index f52ae84..084ba2a 100644
 --- a/src/gallium/drivers/r600/r600_llvm.c
 +++ b/src/gallium/drivers/r600/r600_llvm.c
 @@ -745,6 +745,13 @@ unsigned r600_llvm_compile(
   }
   }
  
 + if (binary.code){
 + FREE(binary.code);
 + }
 + if (binary.config){
 + FREE(binary.config);
 + }
 +

You don't need to check for NULL here.   FREE accepts NULL pointers.

-Tom

   return r;
  }
  
 -- 
 1.8.3.2
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/3] r600/llvm: initialize radeon_llvm_binary

2013-11-11 Thread Tom Stellard
On Thu, Nov 07, 2013 at 06:08:14PM -0600, Aaron Watry wrote:
 use memset to initialize to 0's... otherwise code_size and config_size could 
 be uninitialized when read later in this method. It's also hard to do NULL 
 checks on uninitialized pointers.
 ---
  src/gallium/drivers/r600/r600_llvm.c | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/src/gallium/drivers/r600/r600_llvm.c 
 b/src/gallium/drivers/r600/r600_llvm.c
 index 5afe3cb..f52ae84 100644
 --- a/src/gallium/drivers/r600/r600_llvm.c
 +++ b/src/gallium/drivers/r600/r600_llvm.c
 @@ -712,6 +712,7 @@ unsigned r600_llvm_compile(
   const char * gpu_family = r600_llvm_gpu_string(family);
   unsigned i;
  
 +memset(binary, 0, sizeof(struct radeon_llvm_binary));

The indentation looks wrong here, otherwise this patch is:

Reviewed-by: Tom Stellard thomas.stell...@amd.com

   r = radeon_llvm_compile(mod, binary, gpu_family, dump);
  
   assert(binary.code_size % 4 == 0);
 -- 
 1.8.3.2
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 3/3] radeon/llvm: Free elf_buffer after use

2013-11-11 Thread Tom Stellard
On Thu, Nov 07, 2013 at 06:08:16PM -0600, Aaron Watry wrote:
 Prevents a memory leak.
 ---
  src/gallium/drivers/radeon/radeon_llvm_emit.c | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c 
 b/src/gallium/drivers/radeon/radeon_llvm_emit.c
 index d2e5642..e35c212 100644
 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
 +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
 @@ -176,6 +176,9 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct 
 radeon_llvm_binary *binary,
   if (elf){
   elf_end(elf);
   }
 + if (elf_buffer){
 + FREE(elf_buffer);
 + }

We don't need the NULL check here either.

-Tom

   LLVMDisposeMemoryBuffer(out_buffer);
   LLVMDisposeTargetMachine(tm);
   return 0;
 -- 
 1.8.3.2
 
 ___
 mesa-dev mailing list
 mesa-dev@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


  1   2   >