diff options
Diffstat (limited to 'lib/mesa/src/gallium/winsys/sw')
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/dri/Makefile.am | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.h | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/dri/meson.build | 27 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/hgl/meson.build | 29 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/kms-dri/Makefile.am | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 210 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/kms-dri/meson.build | 28 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/null/Makefile.am | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/null/meson.build | 27 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/wrapper/Makefile.am | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/wrapper/meson.build | 27 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c | 6 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/xlib/Makefile.am | 2 | ||||
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/xlib/meson.build | 27 |
14 files changed, 332 insertions, 61 deletions
diff --git a/lib/mesa/src/gallium/winsys/sw/dri/Makefile.am b/lib/mesa/src/gallium/winsys/sw/dri/Makefile.am index a7d325383..ecf63d17d 100644 --- a/lib/mesa/src/gallium/winsys/sw/dri/Makefile.am +++ b/lib/mesa/src/gallium/winsys/sw/dri/Makefile.am @@ -30,4 +30,4 @@ noinst_LTLIBRARIES = libswdri.la libswdri_la_SOURCES = $(C_SOURCES) -EXTRA_DIST = SConscript +EXTRA_DIST = SConscript meson.build diff --git a/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.h b/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.h index 329ac06a0..47e3777d4 100644 --- a/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.h +++ b/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.h @@ -33,6 +33,6 @@ struct sw_winsys; -struct sw_winsys *dri_create_sw_winsys(struct drisw_loader_funcs *lf); +struct sw_winsys *dri_create_sw_winsys(const struct drisw_loader_funcs *lf); #endif diff --git a/lib/mesa/src/gallium/winsys/sw/dri/meson.build b/lib/mesa/src/gallium/winsys/sw/dri/meson.build new file mode 100644 index 000000000..0de62226b --- /dev/null +++ b/lib/mesa/src/gallium/winsys/sw/dri/meson.build @@ -0,0 +1,27 @@ +# Copyright © 2017 Dylan Baker +# Copyright © 2018 Intel Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +libswdri = static_library( + 'swdri', + files('dri_sw_winsys.c', 'dri_sw_winsys.h'), + c_args : c_vis_args, + include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux], +) diff --git a/lib/mesa/src/gallium/winsys/sw/hgl/meson.build b/lib/mesa/src/gallium/winsys/sw/hgl/meson.build new file mode 100644 index 000000000..8901096bd --- /dev/null +++ b/lib/mesa/src/gallium/winsys/sw/hgl/meson.build @@ -0,0 +1,29 @@ +# Copyright © 2017 Dylan Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +libswhgl = static_library( + 'swhgl', + files('hgl_sw_winsys.c'), + c_args : c_vis_args, + include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux, + include_directories('../../../state_trackers/hgl') + ], + build_by_default : false, +) diff --git a/lib/mesa/src/gallium/winsys/sw/kms-dri/Makefile.am b/lib/mesa/src/gallium/winsys/sw/kms-dri/Makefile.am index 816255328..022f3c508 100644 --- a/lib/mesa/src/gallium/winsys/sw/kms-dri/Makefile.am +++ b/lib/mesa/src/gallium/winsys/sw/kms-dri/Makefile.am @@ -31,3 +31,5 @@ AM_CFLAGS = \ noinst_LTLIBRARIES = libswkmsdri.la libswkmsdri_la_SOURCES = $(C_SOURCES) + +EXTRA_DIST = meson.build diff --git a/lib/mesa/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/lib/mesa/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c index 22e1c936a..9564d9424 100644 --- a/lib/mesa/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c +++ b/lib/mesa/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c @@ -59,20 +59,31 @@ #define DEBUG_PRINT(msg, ...) #endif +struct kms_sw_displaytarget; -struct kms_sw_displaytarget +struct kms_sw_plane { - enum pipe_format format; unsigned width; unsigned height; unsigned stride; + unsigned offset; + struct kms_sw_displaytarget *dt; + struct list_head link; +}; + +struct kms_sw_displaytarget +{ + enum pipe_format format; unsigned size; uint32_t handle; void *mapped; + void *ro_mapped; int ref_count; + int map_count; struct list_head link; + struct list_head planes; }; struct kms_sw_winsys @@ -83,10 +94,16 @@ struct kms_sw_winsys struct list_head bo_list; }; -static inline struct kms_sw_displaytarget * -kms_sw_displaytarget( struct sw_displaytarget *dt ) +static inline struct kms_sw_plane * +kms_sw_plane( struct sw_displaytarget *dt ) +{ + return (struct kms_sw_plane *)dt; +} + +static inline struct sw_displaytarget * +sw_displaytarget( struct kms_sw_plane *pl) { - return (struct kms_sw_displaytarget *)dt; + return (struct sw_displaytarget *)pl; } static inline struct kms_sw_winsys * @@ -105,6 +122,39 @@ kms_sw_is_displaytarget_format_supported( struct sw_winsys *ws, return TRUE; } +static struct kms_sw_plane *get_plane(struct kms_sw_displaytarget *kms_sw_dt, + enum pipe_format format, + unsigned width, unsigned height, + unsigned stride, unsigned offset) +{ + struct kms_sw_plane *plane = NULL; + + if (offset + util_format_get_2d_size(format, stride, height) > + kms_sw_dt->size) { + DEBUG_PRINT("KMS-DEBUG: plane too big. format: %d stride: %d height: %d " + "offset: %d size:%d\n", format, stride, height, offset, + kms_sw_dt->size); + return NULL; + } + + LIST_FOR_EACH_ENTRY(plane, &kms_sw_dt->planes, link) { + if (plane->offset == offset) + return plane; + } + + plane = CALLOC_STRUCT(kms_sw_plane); + if (!plane) + return NULL; + + plane->width = width; + plane->height = height; + plane->stride = stride; + plane->offset = offset; + plane->dt = kms_sw_dt; + list_add(&plane->link, &kms_sw_dt->planes); + return plane; +} + static struct sw_displaytarget * kms_sw_displaytarget_create(struct sw_winsys *ws, unsigned tex_usage, @@ -124,11 +174,12 @@ kms_sw_displaytarget_create(struct sw_winsys *ws, if (!kms_sw_dt) goto no_dt; + list_inithead(&kms_sw_dt->planes); kms_sw_dt->ref_count = 1; + kms_sw_dt->mapped = MAP_FAILED; + kms_sw_dt->ro_mapped = MAP_FAILED; kms_sw_dt->format = format; - kms_sw_dt->width = width; - kms_sw_dt->height = height; memset(&create_req, 0, sizeof(create_req)); create_req.bpp = 32; @@ -138,16 +189,19 @@ kms_sw_displaytarget_create(struct sw_winsys *ws, if (ret) goto free_bo; - kms_sw_dt->stride = create_req.pitch; kms_sw_dt->size = create_req.size; kms_sw_dt->handle = create_req.handle; + struct kms_sw_plane *plane = get_plane(kms_sw_dt, format, width, height, + create_req.pitch, 0); + if (!plane) + goto free_bo; list_add(&kms_sw_dt->link, &kms_sw->bo_list); DEBUG_PRINT("KMS-DEBUG: created buffer %u (size %u)\n", kms_sw_dt->handle, kms_sw_dt->size); - *stride = kms_sw_dt->stride; - return (struct sw_displaytarget *)kms_sw_dt; + *stride = create_req.pitch; + return sw_displaytarget(plane); free_bo: memset(&destroy_req, 0, sizeof destroy_req); @@ -163,13 +217,18 @@ kms_sw_displaytarget_destroy(struct sw_winsys *ws, struct sw_displaytarget *dt) { struct kms_sw_winsys *kms_sw = kms_sw_winsys(ws); - struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt); + struct kms_sw_plane *plane = kms_sw_plane(dt); + struct kms_sw_displaytarget *kms_sw_dt = plane->dt; struct drm_mode_destroy_dumb destroy_req; kms_sw_dt->ref_count --; if (kms_sw_dt->ref_count > 0) return; + if (kms_sw_dt->map_count > 0) { + DEBUG_PRINT("KMS-DEBUG: leaked map buffer %u\n", kms_sw_dt->handle); + } + memset(&destroy_req, 0, sizeof destroy_req); destroy_req.handle = kms_sw_dt->handle; drmIoctl(kms_sw->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_req); @@ -178,6 +237,11 @@ kms_sw_displaytarget_destroy(struct sw_winsys *ws, DEBUG_PRINT("KMS-DEBUG: destroyed buffer %u\n", kms_sw_dt->handle); + struct kms_sw_plane *tmp; + LIST_FOR_EACH_ENTRY_SAFE(plane, tmp, &kms_sw_dt->planes, link) { + FREE(plane); + } + FREE(kms_sw_dt); } @@ -187,7 +251,8 @@ kms_sw_displaytarget_map(struct sw_winsys *ws, unsigned flags) { struct kms_sw_winsys *kms_sw = kms_sw_winsys(ws); - struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt); + struct kms_sw_plane *plane = kms_sw_plane(dt); + struct kms_sw_displaytarget *kms_sw_dt = plane->dt; struct drm_mode_map_dumb map_req; int prot, ret; @@ -198,16 +263,21 @@ kms_sw_displaytarget_map(struct sw_winsys *ws, return NULL; prot = (flags == PIPE_TRANSFER_READ) ? PROT_READ : (PROT_READ | PROT_WRITE); - kms_sw_dt->mapped = mmap(0, kms_sw_dt->size, prot, MAP_SHARED, - kms_sw->fd, map_req.offset); - - if (kms_sw_dt->mapped == MAP_FAILED) - return NULL; + void **ptr = (flags == PIPE_TRANSFER_READ) ? &kms_sw_dt->ro_mapped : &kms_sw_dt->mapped; + if (*ptr == MAP_FAILED) { + void *tmp = mmap(0, kms_sw_dt->size, prot, MAP_SHARED, + kms_sw->fd, map_req.offset); + if (tmp == MAP_FAILED) + return NULL; + *ptr = tmp; + } DEBUG_PRINT("KMS-DEBUG: mapped buffer %u (size %u) at %p\n", - kms_sw_dt->handle, kms_sw_dt->size, kms_sw_dt->mapped); + kms_sw_dt->handle, kms_sw_dt->size, *ptr); + + kms_sw_dt->map_count++; - return kms_sw_dt->mapped; + return *ptr + plane->offset; } static struct kms_sw_displaytarget * @@ -230,10 +300,11 @@ kms_sw_displaytarget_find_and_ref(struct kms_sw_winsys *kms_sw, return NULL; } -static struct kms_sw_displaytarget * +static struct kms_sw_plane * kms_sw_displaytarget_add_from_prime(struct kms_sw_winsys *kms_sw, int fd, + enum pipe_format format, unsigned width, unsigned height, - unsigned stride) + unsigned stride, unsigned offset) { uint32_t handle = -1; struct kms_sw_displaytarget * kms_sw_dt; @@ -245,42 +316,70 @@ kms_sw_displaytarget_add_from_prime(struct kms_sw_winsys *kms_sw, int fd, return NULL; kms_sw_dt = kms_sw_displaytarget_find_and_ref(kms_sw, handle); - if (kms_sw_dt) - return kms_sw_dt; + struct kms_sw_plane *plane = NULL; + if (kms_sw_dt) { + plane = get_plane(kms_sw_dt, format, width, height, stride, offset); + if (!plane) + kms_sw_dt->ref_count --; + return plane; + } kms_sw_dt = CALLOC_STRUCT(kms_sw_displaytarget); if (!kms_sw_dt) return NULL; + list_inithead(&kms_sw_dt->planes); off_t lseek_ret = lseek(fd, 0, SEEK_END); if (lseek_ret == -1) { FREE(kms_sw_dt); return NULL; } + kms_sw_dt->mapped = MAP_FAILED; + kms_sw_dt->ro_mapped = MAP_FAILED; kms_sw_dt->size = lseek_ret; kms_sw_dt->ref_count = 1; kms_sw_dt->handle = handle; - kms_sw_dt->width = width; - kms_sw_dt->height = height; - kms_sw_dt->stride = stride; lseek(fd, 0, SEEK_SET); + plane = get_plane(kms_sw_dt, format, width, height, stride, offset); + if (!plane) { + FREE(kms_sw_dt); + return NULL; + } list_add(&kms_sw_dt->link, &kms_sw->bo_list); - return kms_sw_dt; + return plane; } static void kms_sw_displaytarget_unmap(struct sw_winsys *ws, struct sw_displaytarget *dt) { - struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt); + struct kms_sw_plane *plane = kms_sw_plane(dt); + struct kms_sw_displaytarget *kms_sw_dt = plane->dt; + + if (!kms_sw_dt->map_count) { + DEBUG_PRINT("KMS-DEBUG: ignore duplicated unmap %u", kms_sw_dt->handle); + return; + } + kms_sw_dt->map_count--; + if (kms_sw_dt->map_count) { + DEBUG_PRINT("KMS-DEBUG: ignore unmap for busy buffer %u", kms_sw_dt->handle); + return; + } DEBUG_PRINT("KMS-DEBUG: unmapped buffer %u (was %p)\n", kms_sw_dt->handle, kms_sw_dt->mapped); + DEBUG_PRINT("KMS-DEBUG: unmapped buffer %u (was %p)\n", kms_sw_dt->handle, kms_sw_dt->ro_mapped); - munmap(kms_sw_dt->mapped, kms_sw_dt->size); - kms_sw_dt->mapped = NULL; + if (kms_sw_dt->mapped != MAP_FAILED) { + munmap(kms_sw_dt->mapped, kms_sw_dt->size); + kms_sw_dt->mapped = MAP_FAILED; + } + if (kms_sw_dt->ro_mapped != MAP_FAILED) { + munmap(kms_sw_dt->ro_mapped, kms_sw_dt->size); + kms_sw_dt->ro_mapped = MAP_FAILED; + } } static struct sw_displaytarget * @@ -291,30 +390,34 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws, { struct kms_sw_winsys *kms_sw = kms_sw_winsys(ws); struct kms_sw_displaytarget *kms_sw_dt; + struct kms_sw_plane *kms_sw_pl; - assert(whandle->type == DRM_API_HANDLE_TYPE_KMS || - whandle->type == DRM_API_HANDLE_TYPE_FD); - if (whandle->offset != 0) { - DEBUG_PRINT("KMS-DEBUG: attempt to import unsupported winsys offset %d\n", - whandle->offset); - return NULL; - } + assert(whandle->type == WINSYS_HANDLE_TYPE_KMS || + whandle->type == WINSYS_HANDLE_TYPE_FD); switch(whandle->type) { - case DRM_API_HANDLE_TYPE_FD: - kms_sw_dt = kms_sw_displaytarget_add_from_prime(kms_sw, whandle->handle, + case WINSYS_HANDLE_TYPE_FD: + kms_sw_pl = kms_sw_displaytarget_add_from_prime(kms_sw, whandle->handle, + templ->format, templ->width0, templ->height0, - whandle->stride); - if (kms_sw_dt) - *stride = kms_sw_dt->stride; - return (struct sw_displaytarget *)kms_sw_dt; - case DRM_API_HANDLE_TYPE_KMS: + whandle->stride, + whandle->offset); + if (kms_sw_pl) + *stride = kms_sw_pl->stride; + return sw_displaytarget(kms_sw_pl); + case WINSYS_HANDLE_TYPE_KMS: kms_sw_dt = kms_sw_displaytarget_find_and_ref(kms_sw, whandle->handle); if (kms_sw_dt) { - *stride = kms_sw_dt->stride; - return (struct sw_displaytarget *)kms_sw_dt; + struct kms_sw_plane *plane; + LIST_FOR_EACH_ENTRY(plane, &kms_sw_dt->planes, link) { + if (whandle->offset == plane->offset) { + *stride = plane->stride; + return sw_displaytarget(plane); + } + } + kms_sw_dt->ref_count --; } /* fallthrough */ default: @@ -331,19 +434,20 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys, struct winsys_handle *whandle) { struct kms_sw_winsys *kms_sw = kms_sw_winsys(winsys); - struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt); + struct kms_sw_plane *plane = kms_sw_plane(dt); + struct kms_sw_displaytarget *kms_sw_dt = plane->dt; switch(whandle->type) { - case DRM_API_HANDLE_TYPE_KMS: + case WINSYS_HANDLE_TYPE_KMS: whandle->handle = kms_sw_dt->handle; - whandle->stride = kms_sw_dt->stride; - whandle->offset = 0; + whandle->stride = plane->stride; + whandle->offset = plane->offset; return TRUE; - case DRM_API_HANDLE_TYPE_FD: + case WINSYS_HANDLE_TYPE_FD: if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle, DRM_CLOEXEC, (int*)&whandle->handle)) { - whandle->stride = kms_sw_dt->stride; - whandle->offset = 0; + whandle->stride = plane->stride; + whandle->offset = plane->offset; return TRUE; } /* fallthrough */ diff --git a/lib/mesa/src/gallium/winsys/sw/kms-dri/meson.build b/lib/mesa/src/gallium/winsys/sw/kms-dri/meson.build new file mode 100644 index 000000000..9c46d6e54 --- /dev/null +++ b/lib/mesa/src/gallium/winsys/sw/kms-dri/meson.build @@ -0,0 +1,28 @@ +# Copyright © 2017-2018 Intel Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + + +libswkmsdri = static_library( + 'swkmsdri', + files('kms_dri_sw_winsys.c', 'kms_dri_sw_winsys.h'), + c_args : c_vis_args, + include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux], + dependencies : dep_libdrm, +) diff --git a/lib/mesa/src/gallium/winsys/sw/null/Makefile.am b/lib/mesa/src/gallium/winsys/sw/null/Makefile.am index 3da568442..c20518919 100644 --- a/lib/mesa/src/gallium/winsys/sw/null/Makefile.am +++ b/lib/mesa/src/gallium/winsys/sw/null/Makefile.am @@ -30,4 +30,4 @@ noinst_LTLIBRARIES = libws_null.la libws_null_la_SOURCES = $(C_SOURCES) -EXTRA_DIST = SConscript +EXTRA_DIST = SConscript meson.build diff --git a/lib/mesa/src/gallium/winsys/sw/null/meson.build b/lib/mesa/src/gallium/winsys/sw/null/meson.build new file mode 100644 index 000000000..08b0ff7e8 --- /dev/null +++ b/lib/mesa/src/gallium/winsys/sw/null/meson.build @@ -0,0 +1,27 @@ +# Copyright © 2017 Dylan Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +libws_null = static_library( + 'ws_null', + files('null_sw_winsys.c', 'null_sw_winsys.h'), + c_args : c_vis_args, + include_directories : [inc_gallium, inc_src, inc_gallium_aux, inc_include], + build_by_default : false, +) diff --git a/lib/mesa/src/gallium/winsys/sw/wrapper/Makefile.am b/lib/mesa/src/gallium/winsys/sw/wrapper/Makefile.am index 7a9f1ce6e..7cd03a4c2 100644 --- a/lib/mesa/src/gallium/winsys/sw/wrapper/Makefile.am +++ b/lib/mesa/src/gallium/winsys/sw/wrapper/Makefile.am @@ -30,4 +30,4 @@ noinst_LTLIBRARIES = libwsw.la libwsw_la_SOURCES = $(C_SOURCES) -EXTRA_DIST = SConscript +EXTRA_DIST = SConscript meson.build diff --git a/lib/mesa/src/gallium/winsys/sw/wrapper/meson.build b/lib/mesa/src/gallium/winsys/sw/wrapper/meson.build new file mode 100644 index 000000000..4672261f2 --- /dev/null +++ b/lib/mesa/src/gallium/winsys/sw/wrapper/meson.build @@ -0,0 +1,27 @@ +# Copyright © 2017 Dylan Baker + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +libwsw = static_library( + 'wsw', + files('wrapper_sw_winsys.c', 'wrapper_sw_winsys.h'), + c_args : c_vis_args, + include_directories : [inc_gallium, inc_include, inc_src, inc_gallium_aux], + build_by_default : false, +) diff --git a/lib/mesa/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c b/lib/mesa/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c index 47cf7f028..31b00e873 100644 --- a/lib/mesa/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c +++ b/lib/mesa/src/gallium/winsys/sw/wrapper/wrapper_sw_winsys.c @@ -92,7 +92,7 @@ wsw_is_dt_format_supported(struct sw_winsys *ws, struct wrapper_sw_winsys *wsw = wrapper_sw_winsys(ws); return wsw->screen->is_format_supported(wsw->screen, format, - PIPE_TEXTURE_2D, 0, + PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET); } @@ -186,7 +186,7 @@ wsw_dt_from_handle(struct sw_winsys *ws, struct pipe_resource *tex; tex = wsw->screen->resource_from_handle(wsw->screen, templ, whandle, - PIPE_HANDLE_USAGE_READ_WRITE); + PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE); if (!tex) return NULL; @@ -203,7 +203,7 @@ wsw_dt_get_handle(struct sw_winsys *ws, struct pipe_resource *tex = wdt->tex; return wsw->screen->resource_get_handle(wsw->screen, NULL, tex, whandle, - PIPE_HANDLE_USAGE_READ_WRITE); + PIPE_HANDLE_USAGE_FRAMEBUFFER_WRITE); } static void * diff --git a/lib/mesa/src/gallium/winsys/sw/xlib/Makefile.am b/lib/mesa/src/gallium/winsys/sw/xlib/Makefile.am index c7ed33bc4..e518dda82 100644 --- a/lib/mesa/src/gallium/winsys/sw/xlib/Makefile.am +++ b/lib/mesa/src/gallium/winsys/sw/xlib/Makefile.am @@ -31,4 +31,4 @@ noinst_LTLIBRARIES = libws_xlib.la libws_xlib_la_SOURCES = $(C_SOURCES) -EXTRA_DIST = SConscript +EXTRA_DIST = SConscript meson.build diff --git a/lib/mesa/src/gallium/winsys/sw/xlib/meson.build b/lib/mesa/src/gallium/winsys/sw/xlib/meson.build new file mode 100644 index 000000000..c7cb0ffe9 --- /dev/null +++ b/lib/mesa/src/gallium/winsys/sw/xlib/meson.build @@ -0,0 +1,27 @@ +# Copyright © 2017 Intel Corporation + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +libws_xlib = static_library( + 'ws_xlib', + files('xlib_sw_winsys.c'), + c_args : c_vis_args, + include_directories : inc_common, + dependencies : [dep_x11, dep_xext, dep_xcb], +) |