[Mesa-dev] [PATCH] intel: flush fake front buffer if server is about to destroy it.

Anuj Phogat anuj.phogat at gmail.com
Wed Jun 5 19:36:20 PDT 2013


On Fri, May 31, 2013 at 1:55 PM, Paul Berry <stereotype441 at gmail.com> wrote:
> Fixes piglit test "spec/!OpenGL 1.0/gl-1.0-front-invalidate-back"
> ---
> This patch depends on "[PATCH 2/2] intel: flush fake front buffer more
> robustly.", which was sent to mesa-dev yesterday and is still awaiting
> review.
>
>  src/mesa/drivers/dri/intel/intel_context.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
> index 0afd417..4508e49 100644
> --- a/src/mesa/drivers/dri/intel/intel_context.c
> +++ b/src/mesa/drivers/dri/intel/intel_context.c
> @@ -1079,6 +1079,15 @@ intel_query_dri2_buffers(struct intel_context *intel,
>
>        attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
>        attachments[i++] = intel_bits_per_pixel(front_rb);
> +   } else if (front_rb && intel->front_buffer_dirty) {
> +      /* We have pending front buffer rendering, but we aren't querying for a
> +       * front buffer.  If the front buffer we have is a fake front buffer,
> +       * the X server is going to throw it away when it processes the query.
> +       * So before doing the query, make sure all the pending drawing has
> +       * landed in the real front buffer.
> +       */
> +      intel_flush(&intel->ctx);
> +      intel_flush_front(&intel->ctx);
>     }
>
>     if (back_rb) {
> --
> 1.8.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Looks like a right thing to do and it makes a failing piglit test pass.
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list