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

Nayan Deshmukh nayan26deshmukh at gmail.com
Thu Sep 8 04:13:30 UTC 2016


Hi Michel,

Sorry for the bad patch. I'll fix the coding style in the next patch.


On Thu, Sep 8, 2016 at 9:03 AM, Michel Dänzer <michel at daenzer.net> wrote:

> On 08/09/16 02:48 AM, Nayan Deshmukh wrote:
> > use a linear buffer in case of back buffer
> >
> > Signed-off-by: Nayan Deshmukh <nayan26deshmukh at gmail.com>
>
> [...]
>
> > @@ -226,8 +227,13 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
> >        goto close_fd;
> >
> >     memset(&templ, 0, sizeof(templ));
> > +   if (scrn->is_different_gpu)
> > +   templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW |
> > +                PIPE_BIND_SCANOUT | PIPE_BIND_SHARED | PIPE_BIND_LINEAR;
> > +   else
> >     templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW |
> >                  PIPE_BIND_SCANOUT | PIPE_BIND_SHARED;
>
> The indentation is wrong. Also, it would be better to make it something
> like this:
>
>    templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW |
>                 PIPE_BIND_SCANOUT | PIPE_BIND_SHARED;
>    if (scrn->is_different_gpu)
>       templ.bind |= PIPE_BIND_LINEAR;
>
>
> However, as we discussed before, for various reasons it would probably
> be better to create separate linear buffers instead of making all
> buffers linear.
>
> So should I maintain a single linear buffer and copy the back buffer to it
before
sending it via the present extension?

For this I need to have a linear buffer field in vl_dri3_buffer, right?

Regards,
Nayan.

>
> > @@ -248,6 +254,7 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn)
> >                                             usage);
> >     buffer_fd = whandle.handle;
> >     buffer->pitch = whandle.stride;
> > +
> >     xcb_dri3_pixmap_from_buffer(scrn->conn,
> >                                 (pixmap = xcb_generate_id(scrn->conn)),
> >                                 scrn->drawable,
>
> Please remove this kind of pointless whitespace-only change from patches
> before sending them for review.
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160908/073f6353/attachment.html>


More information about the mesa-dev mailing list