<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 25, 2017 at 10:58 AM, Pohjolainen, Topi <span dir="ltr"><<a href="mailto:topi.pohjolainen@gmail.com" target="_blank">topi.pohjolainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Jan 23, 2017 at 10:21:41PM -0800, Ben Widawsky wrote:<br>
> This provides a common function or creating miptrees when there is an<br>
> existing DRIimage to use. That provides an easy way to add CCS<br>
> allocation.<br>
><br>
> Signed-off-by: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
> Acked-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
> ---<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_fbo.c         | 17 ++++++++---------<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 25 ++++++++++++++++++++++++-<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h | 10 ++++++++++<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c   | 17 ++++++++---------<br>
>  4 files changed, 50 insertions(+), 19 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c b/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
> index de0cd6aca2..f6e17599b8 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_fbo.c<br>
> @@ -362,15 +362,14 @@ intel_image_target_<wbr>renderbuffer_storage(struct gl_context *ctx,<br>
>      * buffer's content to the main buffer nor for invalidating the aux buffer's<br>
>      * content.<br>
>      */<br>
> -   irb->mt = intel_miptree_create_for_bo(<wbr>brw,<br>
> -                                         image->bo,<br>
> -                                         image->format,<br>
> -                                         image->offset,<br>
> -                                         image->width,<br>
> -                                         image->height,<br>
> -                                         1,<br>
> -                                         image->pitch,<br>
> -                                         MIPTREE_LAYOUT_DISABLE_AUX);<br>
> +   irb->mt = intel_miptree_create_for_<wbr>image(brw,<br>
> +                                            image,<br>
> +                                            image->format,<br>
> +                                            image->offset,<br>
> +                                            image->width,<br>
> +                                            image->height,<br>
> +                                            image->pitch,<br>
> +                                            0);<br>
>     if (!irb->mt)<br>
>        return;<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> index ed514239e2..34b6591eb0 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c<br>
> @@ -24,7 +24,6 @@<br>
>   */<br>
><br>
>  #include <GL/gl.h><br>
> -#include <GL/internal/dri_interface.h><br>
><br>
>  #include "intel_batchbuffer.h"<br>
>  #include "intel_mipmap_tree.h"<br>
> @@ -32,6 +31,7 @@<br>
>  #include "intel_tex.h"<br>
>  #include "intel_blit.h"<br>
>  #include "intel_fbo.h"<br>
> +#include "intel_image.h"<br>
><br>
>  #include "brw_blorp.h"<br>
>  #include "brw_context.h"<br>
> @@ -810,6 +810,29 @@ intel_miptree_create_for_bo(<wbr>struct brw_context *brw,<br>
>     return mt;<br>
>  }<br>
><br>
> +struct intel_mipmap_tree *<br>
> +intel_miptree_create_for_<wbr>image(struct brw_context *intel,<br>
> +                               __DRIimage *image,<br>
> +                               mesa_format format,<br>
> +                               uint32_t offset,<br>
> +                               uint32_t width,<br>
> +                               uint32_t height,<br>
> +                               uint32_t pitch,<br>
> +                               uint32_t layout_flags)<br>
> +{<br>
> +   layout_flags = (layout_flags & MIPTREE_LAYOUT_FOR_SCANOUT) ?<br>
> +      MIPTREE_LAYOUT_FOR_SCANOUT : MIPTREE_LAYOUT_DISABLE_AUX;<br>
<br>
</div></div>Before flags were unconditionally MIPTREE_LAYOUT_DISABLE_AUX. This should be<br>
mentioned in the commit message. And probably that functionally aux gets<br>
disabled because current logic does that for scanout?<br><div class="HOEnZb"><div class="h5"></div></div></blockquote><div><br></div><div>Yeah, I don't really get this either.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
> +   return intel_miptree_create_for_bo(<wbr>intel,<br>
> +                                      image->bo,<br>
> +                                      format,<br>
> +                                      offset,<br>
> +                                      width,<br>
> +                                      height,<br>
> +                                      1,<br>
> +                                      pitch,<br>
> +                                      layout_flags);<br>
> +}<br>
> +<br>
>  /**<br>
>   * For a singlesample renderbuffer, this simply wraps the given BO with a<br>
>   * miptree.<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> index 476c46b135..cf8f1a7687 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.h<br>
> @@ -720,6 +720,16 @@ intel_miptree_create_for_bo(<wbr>struct brw_context *brw,<br>
>                              int pitch,<br>
>                              uint32_t layout_flags);<br>
><br>
> +struct intel_mipmap_tree *<br>
> +intel_miptree_create_for_<wbr>image(struct brw_context *intel,<br>
> +                               __DRIimage *image,<br>
> +                               mesa_format format,<br>
> +                               uint32_t offset,<br>
> +                               uint32_t width,<br>
> +                               uint32_t height,<br>
> +                               uint32_t pitch,<br>
> +                               uint32_t layout_flags);<br>
> +<br>
>  void<br>
>  intel_update_winsys_<wbr>renderbuffer_miptree(struct brw_context *intel,<br>
>                                           struct intel_renderbuffer *irb,<br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c b/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c<br>
> index 141996f707..2d79183b16 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>intel_tex_image.c<br>
> @@ -221,11 +221,11 @@ create_mt_for_planar_dri_<wbr>image(struct brw_context *brw,<br>
>         * invalidating the aux buffer's content.<br>
>         */<br>
>        struct intel_mipmap_tree *mt =<br>
> -         intel_miptree_create_for_bo(<wbr>brw, image->bo, format,<br>
> -                                     image->offsets[index],<br>
> -                                     width, height, 1,<br>
> -                                     image->strides[index],<br>
> -                                     MIPTREE_LAYOUT_DISABLE_AUX);<br>
> +         intel_miptree_create_for_<wbr>image(brw, image, format,<br>
> +                                        image->offsets[index],<br>
> +                                        width, height,<br>
> +                                        image->strides[index],<br>
> +                                        0);<br>
>        if (mt == NULL)<br>
>           return NULL;<br>
><br>
> @@ -259,10 +259,9 @@ create_mt_for_dri_image(struct brw_context *brw,<br>
>      * buffer's content to the main buffer nor for invalidating the aux buffer's<br>
>      * content.<br>
>      */<br>
> -   mt = intel_miptree_create_for_bo(<wbr>brw, image->bo, image->format,<br>
> -                                    0, image->width, image->height, 1,<br>
> -                                    image->pitch,<br>
> -                                    MIPTREE_LAYOUT_DISABLE_AUX);<br>
> +   mt = intel_miptree_create_for_<wbr>image(brw, image, image->format,<br>
> +                                       0, image->width, image->height,<br>
> +                                       image->pitch, 0);<br>
>     if (mt == NULL)<br>
>        return NULL;<br>
><br>
> --<br>
> 2.11.0<br>
><br>
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>