[Mesa-dev] [PATCH 10/11] egl/wayland: Remove duplicate wl_buffer creation code

Lucas Stach l.stach at pengutronix.de
Wed Jul 12 14:32:15 UTC 2017


Am Freitag, den 07.07.2017, 16:34 +0100 schrieb Daniel Stone:
> Hi,
> 
> On 28 June 2017 at 16:35, Lucas Stach <l.stach at pengutronix.de> wrote:
> > Am Freitag, den 16.06.2017, 18:14 +0100 schrieb Daniel Stone:
> >>     if (dri2_dpy->capabilities & WL_DRM_CAPABILITY_PRIME) {
> >> +      struct wl_drm *wl_drm =
> >> +         dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm;
> >
> > This and...
> >
> >>        int stride, fd;
> >>
> >>        dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
> >>        dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_FD, &fd);
> >> -      ret = wl_drm_create_prime_buffer(dri2_surf->wl_drm_wrapper,
> >> -                                       fd, width, height, fourcc, 0, stride,
> >> -                                       0, 0, 0, 0);
> >> +      ret = wl_drm_create_prime_buffer(wl_drm, fd, width, height, fourcc, 0,
> >> +                                       stride, 0, 0, 0, 0);
> >>        close(fd);
> >>     } else {
> >> +      struct wl_drm *wl_drm =
> >> +         dri2_surf ? dri2_surf->wl_drm_wrapper : dri2_dpy->wl_drm;
> >
> > .. this can be moved out of the if/else path to get rid of even more
> > duplication.
> 
> Sure. I deliberately left them lowered though, so it couldn't be in
> scope in the dmabuf branch. Happy to change it if you feel strongly
> about it though.

No, this was just a suggestion. I'm fine with the code as-is. Though I
would really like this series to go in before the 17.2 branchpoint.

Regards,
Lucas



More information about the mesa-dev mailing list