[Mesa-dev] [PATCH 1/4] gallium: add pipe_screen::resource_changed
Philipp Zabel
p.zabel at pengutronix.de
Mon Dec 5 10:19:09 UTC 2016
Hi Marek,
Am Freitag, den 02.12.2016, 23:10 +0100 schrieb Marek Olšák:
> Shouldn't this be in pipe_context if it does a copy? It's basically
> the opposite of flush_resource, right?
I tried this at first (actually, at first I misunderstood the meaning of
invalidate_resource and reused that, for GL_OES_EGL_image_external:
https://patchwork.freedesktop.org/patch/89097/
https://patchwork.freedesktop.org/patch/89098/
I should update these to use resource_changed instead). But for
WL_bind_wayland_display, resource_changed needs to be called in the
eglCreateImageKHR ->
dri2_create_image ->
dri2_drm_create_image_khr ->
dri2_create_image_khr ->
dri2_create_image_wayland_wl_buffer ->
dri2_from_planar
path, though. eglCreateImageKHR is called without context for the
EGL_WAYLAND_BUFFER_WL target when attaching an EGL wl_buffer to a
wl_surface.
I see resource_changed as complementary to the resource_create /
resource_from_handle functionality, which already resides in
pipe_screen.
regards
Philipp
> Marek
>
> On Fri, Dec 2, 2016 at 4:27 PM, Philipp Zabel <p.zabel at pengutronix.de> wrote:
> > Add a hook to tell drivers that an imported resource may have changed
> > and they need to update their internal derived resources.
> >
> > Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> > ---
> > src/gallium/include/pipe/p_screen.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
> > index 255647e..e21229e 100644
> > --- a/src/gallium/include/pipe/p_screen.h
> > +++ b/src/gallium/include/pipe/p_screen.h
> > @@ -224,6 +224,12 @@ struct pipe_screen {
> > struct winsys_handle *handle,
> > unsigned usage);
> >
> > + /**
> > + * Trigger recreation of derived internal resources. This can be used for
> > + * reimporting external images that can't be directly used as texture
> > + * sampler source.
> > + */
> > + void (*resource_changed)(struct pipe_screen *, struct pipe_resource *pt);
> >
> > void (*resource_destroy)(struct pipe_screen *,
> > struct pipe_resource *pt);
> > --
> > 2.10.2
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
More information about the etnaviv
mailing list