diff --git a/src/egl/meson.build b/src/egl/meson.build index 09c89ffb1ef..5a95cba7dc4 100644 --- a/src/egl/meson.build +++ b/src/egl/meson.build @@ -86,7 +86,6 @@ if with_dri link_for_egl += libloader incs_for_egl += inc_loader incs_for_egl += inc_loader_x11 - incs_for_egl += inc_loader_dri3 incs_for_egl += inc_gallium incs_for_egl += inc_gallium_aux incs_for_egl += inc_mesa @@ -101,7 +100,7 @@ if with_dri files_egl += files('drivers/dri2/platform_x11.c') if with_dri3 files_egl += files('drivers/dri2/platform_x11_dri3.c') - link_for_egl += [libloader_dri3_helper, libloader_x11] + link_for_egl += [libloader_x11] endif deps_for_egl += [dep_x11_xcb, dep_xcb_dri2, dep_xcb_xrandr, dep_xcb_xfixes, dep_xcb_shm] endif diff --git a/src/loader_dri3/loader_dri3_helper.c b/src/gallium/frontends/dri/loader_dri3_helper.c similarity index 100% rename from src/loader_dri3/loader_dri3_helper.c rename to src/gallium/frontends/dri/loader_dri3_helper.c diff --git a/src/loader_dri3/loader_dri3_helper.h b/src/gallium/frontends/dri/loader_dri3_helper.h similarity index 96% rename from src/loader_dri3/loader_dri3_helper.h rename to src/gallium/frontends/dri/loader_dri3_helper.h index 4f3b56d4fc5..c66d9313edf 100644 --- a/src/loader_dri3/loader_dri3_helper.h +++ b/src/gallium/frontends/dri/loader_dri3_helper.h @@ -33,6 +33,7 @@ #include #include "mesa_interface.h" +#include "util/macros.h" #include enum loader_dri3_buffer_type { @@ -188,14 +189,14 @@ struct loader_dri3_drawable { bool has_event_waiter; }; -void +PUBLIC void loader_dri3_set_swap_interval(struct loader_dri3_drawable *draw, int interval); -void +PUBLIC void loader_dri3_drawable_fini(struct loader_dri3_drawable *draw); -int +PUBLIC int loader_dri3_drawable_init(xcb_connection_t *conn, xcb_drawable_t drawable, enum loader_dri3_drawable_type type, @@ -207,48 +208,48 @@ loader_dri3_drawable_init(xcb_connection_t *conn, const struct loader_dri3_vtable *vtable, struct loader_dri3_drawable*); -bool loader_dri3_wait_for_msc(struct loader_dri3_drawable *draw, +PUBLIC bool loader_dri3_wait_for_msc(struct loader_dri3_drawable *draw, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc); -int64_t +PUBLIC int64_t loader_dri3_swap_buffers_msc(struct loader_dri3_drawable *draw, int64_t target_msc, int64_t divisor, int64_t remainder, unsigned flush_flags, const int *rects, int n_rects, bool force_copy); -int +PUBLIC int loader_dri3_wait_for_sbc(struct loader_dri3_drawable *draw, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc); -int loader_dri3_query_buffer_age(struct loader_dri3_drawable *draw); +PUBLIC int loader_dri3_query_buffer_age(struct loader_dri3_drawable *draw); -void +PUBLIC void loader_dri3_flush(struct loader_dri3_drawable *draw, unsigned flags, enum __DRI2throttleReason throttle_reason); -void +PUBLIC void loader_dri3_copy_sub_buffer(struct loader_dri3_drawable *draw, int x, int y, int width, int height, bool flush); -void +PUBLIC void loader_dri3_copy_drawable(struct loader_dri3_drawable *draw, xcb_drawable_t dest, xcb_drawable_t src); -void +PUBLIC void loader_dri3_wait_x(struct loader_dri3_drawable *draw); -void +PUBLIC void loader_dri3_wait_gl(struct loader_dri3_drawable *draw); -__DRIimage * +PUBLIC __DRIimage * loader_dri3_create_image(xcb_connection_t *c, xcb_dri3_buffer_from_pixmap_reply_t *bp_reply, unsigned int fourcc, @@ -256,14 +257,14 @@ loader_dri3_create_image(xcb_connection_t *c, void *loaderPrivate); #ifdef HAVE_DRI3_MODIFIERS -__DRIimage * +PUBLIC __DRIimage * loader_dri3_create_image_from_buffers(xcb_connection_t *c, xcb_dri3_buffers_from_pixmap_reply_t *bp_reply, unsigned int fourcc, __DRIscreen *dri_screen, void *loaderPrivate); #endif -int +PUBLIC int loader_dri3_get_buffers(__DRIdrawable *driDrawable, unsigned int format, uint32_t *stamp, @@ -271,13 +272,13 @@ loader_dri3_get_buffers(__DRIdrawable *driDrawable, uint32_t buffer_mask, struct __DRIimageList *buffers); -void +PUBLIC void loader_dri3_update_drawable_geometry(struct loader_dri3_drawable *draw); -void +PUBLIC void loader_dri3_swapbuffer_barrier(struct loader_dri3_drawable *draw); -void +PUBLIC void loader_dri3_close_screen(__DRIscreen *dri_screen); #endif diff --git a/src/gallium/frontends/dri/meson.build b/src/gallium/frontends/dri/meson.build index 09da602cfb9..ffa19e32b14 100644 --- a/src/gallium/frontends/dri/meson.build +++ b/src/gallium/frontends/dri/meson.build @@ -21,6 +21,11 @@ files_libdri = files( if with_platform_x11 deps_for_libdri += dep_xcb + if with_dri3 + deps_for_libdri += [dep_xcb_dri3, dep_xcb_present, dep_xcb_sync, + dep_xshmfence, dep_xcb_xfixes] + files_libdri += files('loader_dri3_helper.c') + endif endif if with_dri diff --git a/src/gallium/targets/dri/dri.sym.in b/src/gallium/targets/dri/dri.sym.in index ad086bc4541..0e0317ef713 100644 --- a/src/gallium/targets/dri/dri.sym.in +++ b/src/gallium/targets/dri/dri.sym.in @@ -62,6 +62,8 @@ dri_set_blob_cache_funcs; dri_get_pipe_screen; dri_get_screen_param; + dri3*; + loader_dri3*; @nouveau_drm_screen_create@ @radeon_drm_winsys_create@ @amdgpu_winsys_create@ diff --git a/src/glx/meson.build b/src/glx/meson.build index ee40c3e0f06..a1c36cf9bbc 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -115,13 +115,13 @@ libglx = static_library( 'glx', [files_libglx, glx_generated], include_directories : [inc_include, inc_src, inc_glapi, inc_loader, inc_loader_x11, - inc_loader_dri3, inc_gallium, inc_mesa, inc_st_dri, inc_gallium_aux], + inc_gallium, inc_mesa, inc_st_dri, inc_gallium_aux], c_args : [ '-DGL_LIB_NAME="lib@0@.so.@1@"'.format(gl_lib_name, gl_lib_version.split('.')[0]), ], gnu_symbol_visibility : 'hidden', link_with : [ - libloader, libloader_dri3_helper, libloader_x11, + libloader, libloader_x11, extra_libs_libglx, glx_gallium_link ], dependencies : [ diff --git a/src/loader_dri3/meson.build b/src/loader_dri3/meson.build deleted file mode 100644 index 3069cf65365..00000000000 --- a/src/loader_dri3/meson.build +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright © 2017 Intel Corporation -# SPDX-License-Identifier: MIT - -inc_loader_dri3 = include_directories('.') - -if with_platform_x11 and with_dri3 - libloader_dri3_helper = static_library( - 'loader_dri3_helper', - 'loader_dri3_helper.c', - gnu_symbol_visibility : 'hidden', - include_directories : [inc_include, inc_src, inc_loader, inc_gallium, inc_mesa, inc_st_dri], - dependencies : [ - idep_mesautil, - dep_libdrm, dep_xcb_dri3, dep_xcb_present, dep_xcb_sync, dep_xshmfence, - dep_xcb_xfixes, - ], - build_by_default : false, - ) -else - libloader_dri3_helper = [] -endif diff --git a/src/meson.build b/src/meson.build index 89d614890ca..23d32c41a04 100644 --- a/src/meson.build +++ b/src/meson.build @@ -113,11 +113,6 @@ if with_gallium if with_tests and with_shared_glapi subdir('mesa/state_tracker/tests') endif - if with_dri - if with_gallium or with_gbm or with_platform_wayland - subdir('loader_dri3') - endif - endif endif if with_glx == 'dri' subdir('glx')