Re: [Mesa-dev] [PATCH 08/12] intel: Track miptrees for fake packed depth/stencil renderbuffers.

2011-12-06 Thread Chad Versace
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/05/2011 11:42 AM, Eric Anholt wrote:
 Right now the fake packed d/s RBs are creating two sub-renderbuffers
 with their own storage, and the hardware setup and the mapping code
 have been explicitly referencing them.  By setting miptrees on them,
 we'll be able to make our renderbuffer code for fake packed
 depth/stencil more consistent with all our other renderbuffers.
 
 The interesting new behavior here is that there is now a mt with a
 non-depthstencil format (X8Z24) that has a stencil_mt field
 associated.  This looks like it should be safe, and we'll need to be
 able to do this for floating point depth/stencil as well.
 ---
  src/mesa/drivers/dri/intel/intel_fbo.c |   10 ++
  src/mesa/drivers/dri/intel/intel_mipmap_tree.c |5 +++--
  2 files changed, 13 insertions(+), 2 deletions(-)
 


 @@ -614,6 +615,12 @@ intel_alloc_renderbuffer_storage(struct gl_context * 
 ctx, struct gl_renderbuffer
return false;
}
  
 +  depth_irb = intel_renderbuffer(depth_rb);
 +  stencil_irb = intel_renderbuffer(stencil_rb);
 +
 +  intel_miptree_reference(depth_irb-mt-stencil_mt, stencil_irb-mt);
 +  intel_miptree_reference(irb-mt, depth_irb-mt);
 +

I like the symmetry imposed by this hunk.

 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
 +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
 @@ -808,8 +808,9 @@ intel_miptree_map_depthstencil(struct intel_context 
 *intel,
   ptrdiff_t s_offset = intel_offset_S8(s_mt-region-pitch,
x + s_image_x + map-x,
y + s_image_y + map-y);
 - ptrdiff_t z_offset = ((y + z_image_y) * z_mt-region-pitch +
 -   (x + z_image_x));
 + ptrdiff_t z_offset = (((y + map-y + z_image_y) *
 +z_mt-region-pitch) +
 +   (x + map-x + z_image_x));
   uint8_t s = s_map[s_offset];
   uint32_t z = z_map[z_offset];

I think you intended to squash this hunk into the previous patch. But the hunk 
is
unnecessary anyway, because it just adds redundant parens.

With this hunk removed, the patch is
Reviewed-by:  Chad Versace chad.vers...@linux.intel.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJO3mJCAAoJEAIvNt057x8iYSMQAILU8eLY4CwJs7fNnx5Axitf
IT139qdf/HYfQo/Nkm/0i+OOmknCIYSDe7L6+6TqbktVWq0DLtNwvl/How+yKld+
EstdLb+xMdkbn2/eLJUvscrXYcOYAyl2fMq+G//UQBt1h8WLAF6e6oLye8Mm0Wjd
IFmYnSF761XVJ/mB7Jvy9rvIp41ZAkcNrOyFx4j+T/XaCyLh6TKWK72b9CJoXdZs
BxE62TBJ+a63/Zd/Tt8zGT1/sOD1uaV8xv3KlZkdN0ECQqQnzGtZMONCf84LS7+w
UTGwPCXZ2pNJRJ3mQeEY3K+3018/Hj4sxoMoHafhoPksz+q5Rx/Xa8Kig1Fls6WI
3fJ/z1QGapstrx40553O1R4xQKFXhMVv+0J6FU1I84mLwofo/z1/yku1sMpy4eGn
t4v42OqXrquq9J+r0bG3mmIFKCi4B90mKKW11FaebjUzSuDK15PiAUciAWNM13yR
BG98ib//arme4YF3YXL58JQoyI3vXF4rWTmARVgsehhr/6VkrE8JxxaH/KXY4kVa
QFx3kreSFrENsN0So/Ed1E69T/4lAU3kQCFTaCfLyu1pHU+OprEP0GzgvNHl3xx/
M60iT9ACfAoINb7ufiYn6jXwxLZHDU7MRzVBDv+9jA6Erv9zkcPr1/jvpUi5aQtz
lGSzVKHGvNp+IgIHlaqy
=Rwfa
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 08/12] intel: Track miptrees for fake packed depth/stencil renderbuffers.

2011-12-06 Thread Eric Anholt
On Tue, 06 Dec 2011 10:43:15 -0800, Chad Versace chad.vers...@linux.intel.com 
wrote:
 On 12/05/2011 11:42 AM, Eric Anholt wrote:

  --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
  +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
  @@ -808,8 +808,9 @@ intel_miptree_map_depthstencil(struct intel_context 
  *intel,
  ptrdiff_t s_offset = intel_offset_S8(s_mt-region-pitch,
   x + s_image_x + map-x,
   y + s_image_y + map-y);
  -   ptrdiff_t z_offset = ((y + z_image_y) * z_mt-region-pitch +
  - (x + z_image_x));
  +   ptrdiff_t z_offset = (((y + map-y + z_image_y) *
  +  z_mt-region-pitch) +
  + (x + map-x + z_image_x));
  uint8_t s = s_map[s_offset];
  uint32_t z = z_map[z_offset];
 
 I think you intended to squash this hunk into the previous patch. But the 
 hunk is
 unnecessary anyway, because it just adds redundant parens.

The addition of map-x/y isn't redundant.  How about folding this hunk
into HEAD~1 instead:

@@ -805,12 +805,12 @@ intel_miptree_map_depthstencil(struct intel_context *intel
 
   for (uint32_t y = 0; y  map-h; y++) {
 for (uint32_t x = 0; x  map-w; x++) {
+   int map_x = map-x + x, map_y = map-y + y;
ptrdiff_t s_offset = intel_offset_S8(s_mt-region-pitch,
-x + s_image_x + map-x,
-y + s_image_y + map-y);
-   ptrdiff_t z_offset = (((y + map-y + z_image_y) *
-  z_mt-region-pitch) +
- (x + map-x + z_image_x));
+map_x + s_image_x,
+map_y + s_image_y);
+   ptrdiff_t z_offset = ((map_y + z_image_y) * z_mt-region-pitch +
+ (map_x + z_image_x));
uint8_t s = s_map[s_offset];
uint32_t z = z_map[z_offset];


pgp431WwXfwrI.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 08/12] intel: Track miptrees for fake packed depth/stencil renderbuffers.

2011-12-06 Thread Chad Versace
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 12/06/2011 02:43 PM, Eric Anholt wrote:
 On Tue, 06 Dec 2011 10:43:15 -0800, Chad Versace 
 chad.vers...@linux.intel.com wrote:
 On 12/05/2011 11:42 AM, Eric Anholt wrote:
 
 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
 +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
 @@ -808,8 +808,9 @@ intel_miptree_map_depthstencil(struct intel_context 
 *intel,
 ptrdiff_t s_offset = intel_offset_S8(s_mt-region-pitch,
  x + s_image_x + map-x,
  y + s_image_y + map-y);
 -   ptrdiff_t z_offset = ((y + z_image_y) * z_mt-region-pitch +
 - (x + z_image_x));
 +   ptrdiff_t z_offset = (((y + map-y + z_image_y) *
 +  z_mt-region-pitch) +
 + (x + map-x + z_image_x));
 uint8_t s = s_map[s_offset];
 uint32_t z = z_map[z_offset];

 I think you intended to squash this hunk into the previous patch. But the 
 hunk is
 unnecessary anyway, because it just adds redundant parens.
 
 The addition of map-x/y isn't redundant.  How about folding this hunk
 into HEAD~1 instead:

Oops. You're right, the hunk needs to be folded into HEAD~1.

- 
Chad Versace
chad.vers...@linux.intel.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJO3qcUAAoJEAIvNt057x8iLtAP/0nm2cPke+rRkTdiyqsiTn0R
ZdI3d8bWhczw3JBqOGRFfYh5jRGYLOL8fd9D2O/btf7/vp40eFGBWds0urbPZox9
QE9ZQGGD3T5QTuYN8Xt3DXXD34myjYSb8E81KvqEzvmqqJ0ZebSroydZsYhaJVM8
JTIAjRewQqux6/3x0zGw4MbCTxGmqTfPc2o2LxnXWSpR+195DsXxBEUOkaUVfgMt
FjnsqIpQaDrHnlRvgUDYVTR2SvZQEqtwvmoUEOWmqvI8SYYdlqD39DFK5NbHRfiy
rNXzqhdH8sH0gYFRbfD9dPCwposSQvdaLBXi/ALZBCZAl18zsbdj63A8alo/YX8J
QGWH/L1f6M+0HrSh/0Se6q/xuLd1Zo/U25lUzxHMNRAOXLgUWYFKajQz8aICO4Ia
j8G7wS/4UVmaO3DfLQgHvCF3sRm4DfNvPJWEHjO/uq+P+4vxoFGWcwj9KH/hI1pV
Y5CGYP+DfrHdTHvGt1rZYAqczmn3nmUOG6bNMMZOIrD1NKzJ3Vrw0qc7kfr3TDoo
3aNfG8kddjpTpVDPPum8s+2Zkdce53M1SlPnnLUZfYPO7eI8fLbLFYGqoJ2Li6Pw
TDJ7zA3Eo+TjvSeeYZS7BPlxT+n78N0Ka9pq4Uua9/ZgEnwK7hWhQxOEHXQWW7ve
IyHBkpAdfUzuNnaWAM73
=yQUi
-END PGP SIGNATURE-
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev