[virglrenderer-devel] [PATCH] vrend: Nop sends to backing iovs for readonly textures.

Dave Airlie airlied at gmail.com
Wed Mar 28 02:06:04 UTC 2018


On 27 March 2018 at 23:00, Jakob Bornecrantz <jakob at collabora.com> wrote:
> As I have only done testing on the gles-backend with this patch
> the code is only enabled on it. Further testing might show that
> it is possible to run this code on all backends.

Looks good, one comment below.

> +   /*
> +    * When we detect that we are reading back to the same iovs that are
> +    * attached to the resource and we know that the resource can not
> +    * be rendered to (as this function is only called then), we do not
> +    * need to do anything more.
> +    */
> +   if (same_iov) {
> +      return 0;
> +   }
> +
> +   /* Fallback to getteximage, will probably fail on GLES. */
> +   return vrend_transfer_send_getteximage(ctx, res, iov, num_iovs, info);

I think I'd prefer to have a return value and if check in the caller,
rather than duplicating
the getteximage tail call.

Dave.

> +}
> +
>  static int vrend_renderer_transfer_send_iov(struct vrend_context *ctx,
>                                              struct vrend_resource *res,
>                                              struct iovec *iov, int num_iovs,
> @@ -5419,6 +5452,8 @@ static int vrend_renderer_transfer_send_iov(struct vrend_context *ctx,
>        if (can_readpixels) {
>           return vrend_transfer_send_readpixels(ctx, res,
>                                                 iov, num_iovs, info);
> +      } else if (vrend_state.use_gles) {
> +         return vrend_transfer_send_readonly(ctx, res, iov, num_iovs, info);
>        }
>
>        return vrend_transfer_send_getteximage(ctx, res,
> --
> 2.14.1
>
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel


More information about the virglrenderer-devel mailing list