<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 25, 2017 at 10:39 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"><span class="">On Mon, Jan 23, 2017 at 10:21:54PM -0800, Ben Widawsky wrote:<br>
> On Gen9 hardware, the display engine is able to scanout a compressed<br>
> framebuffer by providing an offset to auxiliary compression information.<br>
> Unfortunately, the hardware is incapable of doing the same thing for the<br>
> fast clear color.<br>
><br>
> To mitigate this, the hardware introduced a new resolve type called a<br>
> partial resolve. The partial resolve will only do a resolve of the fast<br>
> clear color and leave the rest of the compressed data alone.<br>
><br>
> This patch enables using this resolve type for cases where the<br>
> framebuffer will be passed along to the kernel for display.<br>
><br>
> v2: Add early exit from intel_miptree_make_shareable() when it's<br>
> scanout.<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>
> Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>> (v1)<br>
<br>
</span>v2 is also<br>
<br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
<div class="HOEnZb"><div class="h5"><br>
> ---<br>
>  src/mesa/drivers/dri/i965/brw_<wbr>context.c       | 3 ++-<br>
>  src/mesa/drivers/dri/i965/<wbr>intel_mipmap_tree.c | 9 ++++++++-<br>
>  2 files changed, 10 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_context.c b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
> index 64b55a8cb7..adfd4c449e 100644<br>
> --- a/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
> +++ b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
> @@ -1360,7 +1360,8 @@ intel_resolve_for_dri2_flush(<wbr>struct brw_context *brw,<br>
>        if (rb->mt->num_samples <= 1) {<br>
>           assert(rb->mt_layer == 0 && rb->mt_level == 0 &&<br>
>                  rb->layer_count == 1);<br>
> -         intel_miptree_resolve_color(<wbr>brw, rb->mt, 0, 0, 1, 0);<br>
> +         intel_miptree_resolve_color(<wbr>brw, rb->mt, 0, 0, 1,<br>
> +                                     INTEL_RESOLVE_HINT_CLEAR_<wbr>COLOR);<br>
>        } else {<br>
>           intel_renderbuffer_downsample(<wbr>brw, rb);<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 217e80ae31..7edce7d92e 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>
> @@ -2415,7 +2415,14 @@ intel_miptree_make_shareable(<wbr>struct brw_context *brw,<br>
>     assert(mt->msaa_layout == INTEL_MSAA_LAYOUT_NONE || mt->num_samples <= 1);<br>
><br>
>     if (mt->mcs_buf) {<br>
> -      intel_miptree_all_slices_<wbr>resolve_color(brw, mt, 0);<br>
> +      intel_miptree_all_slices_<wbr>resolve_color(brw, mt, mt->is_scanout ?<br>
> +                                             INTEL_RESOLVE_HINT_CLEAR_COLOR :<br>
> +                                             INTEL_RESOLVE_HINT_FULL);<br></div></div></blockquote><div><br></div><div>Do we need to be checking modifiers here?  Just because it's marked as scanout doesn't mean that the client using it actually knows about CCS and will pass it on to the kernel.<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">
> +      if (mt->is_scanout) {<br>
> +         assert(!mt->hiz_buf);<br>
> +         return;<br>
> +      }<br>
> +<br>
>        mt->aux_disable |= (INTEL_AUX_DISABLE_CCS | INTEL_AUX_DISABLE_MCS);<br>
>        drm_intel_bo_unreference(mt-><wbr>mcs_buf->bo);<br>
>        free(mt->mcs_buf);<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>