[Mesa-dev] [PATCH 08/30] i965/miptree: Add tile_x/y to total_width/height

Chad Versace chadversary at chromium.org
Thu Jun 22 19:23:43 UTC 2017


On Fri 16 Jun 2017, Jason Ekstrand wrote:
> This is what we do in intel_image_target_renderbuffer_storage and it
> makes more sense than stomping them.  Because the image gets created as
> a 2D image with one miplevel, they should already be equal to the
> provided width/height.  Adding the tile offset makes some sense
> depending on how you interpret the fields.  Also, they're never used for
> any sort of state setup so I don't think it really matters anyway.
> ---

mt->total_height *is* used for state setup, for calculating qpitch in
brw_miptree_get_vertical_slice_pitch(), which is transitively called
from brw_upload_image_surfaces().

mt->total_width is never used for miptrees created for DRIimage's, as
far as I can tell.

Regardless, I believe that all code that accesses
DRIimage::offset,tile_x,tile_y is horribly broken, and this patch
accordingly does not alter the entropy.

For consistency with intel_image_target_renderbuffer_storage(), and no
other reason, this patch is
Reviewed-by: Chad Versace <chadversary at chromium.org>

Please update the commit message to mention that at least
mt->total_width is used.

>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 3bc6827..a1be37e 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -922,10 +922,10 @@ intel_miptree_create_for_dri_image(struct brw_context *brw,
>        return NULL;
>  
>     mt->target = target;
> -   mt->total_width = image->width;
> -   mt->total_height = image->height;
>     mt->level[0].slice[0].x_offset = image->tile_x;
>     mt->level[0].slice[0].y_offset = image->tile_y;
> +   mt->total_width += image->tile_x;
> +   mt->total_height += image->tile_y;
>  
>     /* From "OES_EGL_image" error reporting. We report GL_INVALID_OPERATION
>      * for EGL images from non-tile aligned sufaces in gen4 hw and earlier which has
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list