[Mesa-dev] [PATCH] i965: Fix 32 bit build warnings in intel_get_yf_ys_bo_size()

Kenneth Graunke kenneth at whitecape.org
Mon Jul 13 22:14:16 PDT 2015


On Monday, July 13, 2015 03:35:16 PM Anuj Phogat wrote:
> Along with fixing the type of pitch parameter, patch also changes
> the types of few local variables and function return type.
> 
> Warnings fixed are:
> intel_mipmap_tree.c:671:7: warning: passing argument 3 of
> 'intel_get_yf_ys_bo_size' from incompatible pointer type
> 
> intel_mipmap_tree.c:563:1: note: expected 'uint64_t *' but
> argument is of type 'long unsigned int *'
> 
> Reported-by: Kenneth Graunke <kenneth at whitecape.org>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index fb896a9..1529651 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -559,14 +559,14 @@ intel_lower_compressed_format(struct brw_context *brw, mesa_format format)
>  }
>  
>  /* This function computes Yf/Ys tiled bo size, alignment and pitch. */
> -static uint64_t
> +static unsigned long
>  intel_get_yf_ys_bo_size(struct intel_mipmap_tree *mt, unsigned *alignment,
> -                        uint64_t *pitch)
> +                        unsigned long *pitch)
>  {
>     const uint32_t bpp = mt->cpp * 8;
>     const uint32_t aspect_ratio = (bpp == 16 || bpp == 64) ? 2 : 1;
>     uint32_t tile_width, tile_height;
> -   uint64_t stride, size, aligned_y;
> +   unsigned long stride, size, aligned_y;
>  
>     assert(mt->tr_mode != INTEL_MIPTREE_TRMODE_NONE);

This looks good to me.  I don't think anything should overflow, though I
didn't check thoroughly.  Thanks Anuj :)

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150713/d96b002f/attachment.sig>


More information about the mesa-dev mailing list