[Mesa-dev] [PATCH v2] vl/dri3: handle the case of different GPU

Emil Velikov emil.l.velikov at gmail.com
Fri Sep 9 13:33:18 UTC 2016


Hi Nayan,

Just a couple of fly-by comments. As always don't read too much into them.

On 9 September 2016 at 14:17, Nayan Deshmukh <nayan26deshmukh at gmail.com> wrote:
> use a linear buffer in case of back buffer
>
You might want to mention a bit more about the implementation and/or
why doing things like X won't work/is bad idea.

> +   if (scrn->is_different_gpu) {
> +      templ.format = PIPE_FORMAT_B8G8R8X8_UNORM;
> +      templ.target = PIPE_TEXTURE_2D;
> +      templ.last_level = 0;
> +      templ.width0 = scrn->width;
> +      templ.height0 = scrn->height;
> +      templ.depth0 = 1;
> +      templ.array_size = 1;
bind == 0 here, that doesn't seem right ?

> +      buffer->texture = scrn->base.pscreen->resource_create(scrn->base.pscreen,
> +                                                            &templ);
> +      if (!buffer->texture)
> +         goto unmap_shm;
> +
With the bind fixed the above hunk is common so can be kept prior to
the conditional, no ?


> @@ -485,6 +516,17 @@ vl_dri3_flush_frontbuffer(struct pipe_screen *screen,
>              return;
>     }
>
> +   if (scrn->is_different_gpu) {
> +      u_box_origin_2d(scrn->width,
> +                      scrn->height,
> +                      &src_box);
> +      scrn->pipe->resource_copy_region(scrn->pipe,
> +                                       back->linear_buffer,
> +                                       0, 0, 0, 0,
> +                                       back->texture,
> +                                       0, &src_box);
> +
Please try to use the full width of the line.

Regards,
Emil


More information about the mesa-dev mailing list