On 14/09/16 02:34 PM, Nayan Deshmukh wrote: > In case of prime when rendering is done on GPU other then the > server GPU, use a seprate linear buffer for each back buffer > which will be displayed using present extension. > > v2: Use a seprate linear buffer for each back buffer (Michel) > v3: Change variable names and fix coding style (Leo and Emil) > v4: Use PIPE_BIND_SAMPLER_VIEW for back buffer in case when > a seprate linear buffer is used (Michel) > > Signed-off-by: Nayan Deshmukh <nayan26deshm...@gmail.com>
Looks mostly good to me, but Leo should probably also take a look. Acked-by: Michel Dänzer <michel.daen...@amd.com> > @@ -235,16 +240,35 @@ dri3_alloc_back_buffer(struct vl_dri3_screen *scrn) > templ.height0 = scrn->height; > templ.depth0 = 1; > templ.array_size = 1; > - buffer->texture = scrn->base.pscreen->resource_create(scrn->base.pscreen, > - &templ); > - if (!buffer->texture) > - goto unmap_shm; > > + if (scrn->is_different_gpu) { > + buffer->texture = > scrn->base.pscreen->resource_create(scrn->base.pscreen, > + &templ); > + if (!buffer->texture) > + goto unmap_shm; > + > + templ.bind |= PIPE_BIND_SCANOUT | PIPE_BIND_SHARED | > + PIPE_BIND_LINEAR; > + buffer->linear_texture = > scrn->base.pscreen->resource_create(scrn->base.pscreen, > + &templ); > + pixmap_buffer_texture = buffer->linear_texture; > + > + if (!buffer->linear_texture) > + goto no_linear_texture; > + > + } else { Bonus points for not adding the empty line at the end of the block here. :) -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev