diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2018-02-14 08:24:25 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2018-02-15 08:26:26 +0100 |
commit | 98199b4c0aca89b70d4f0a0e37e1e27ac15a23c7 (patch) | |
tree | 97135b396bebbbd08f28f1bf0a5c0a3005314324 | |
parent | 943548ac765e5dd49d275da2b72ff07b3a64694a (diff) |
vmwgfx: Remove old XWayland and XMir drivers
Old-style XWayland and XMir aren't available anymore.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
-rw-r--r-- | vmwgfx/Makefile.am | 3 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_hosted.c | 10 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_hosted_priv.h | 40 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_xmir.c | 184 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_xwayland.c | 186 |
5 files changed, 1 insertions, 422 deletions
diff --git a/vmwgfx/Makefile.am b/vmwgfx/Makefile.am index a47a5fe..60db9e6 100644 --- a/vmwgfx/Makefile.am +++ b/vmwgfx/Makefile.am @@ -27,9 +27,6 @@ libvmwgfx_la_SOURCES = \ vmwgfx_xa_surface.c \ vmwgfx_hosted.c \ vmwgfx_hosted.h \ - vmwgfx_hosted_priv.h \ - vmwgfx_xmir.c \ - vmwgfx_xwayland.c \ vmwgfx_layout.c \ vmwgfx_rr_inlines.h \ vmwgfx_dri3.c \ diff --git a/vmwgfx/vmwgfx_hosted.c b/vmwgfx/vmwgfx_hosted.c index 9b41f3e..8fa7394 100644 --- a/vmwgfx/vmwgfx_hosted.c +++ b/vmwgfx/vmwgfx_hosted.c @@ -30,7 +30,6 @@ #endif #include "vmwgfx_hosted.h" -#include "vmwgfx_hosted_priv.h" /* * Hook up hosted environments here. @@ -46,12 +45,7 @@ const struct vmwgfx_hosted_driver * vmwgfx_hosted_detect(void) { - const struct vmwgfx_hosted_driver *tmp = vmwgfx_xmir_detect(); - - if (!tmp) - tmp = vmwgfx_xwl_detect(); - - return tmp; + return NULL; } /** @@ -66,6 +60,4 @@ vmwgfx_hosted_detect(void) void vmwgfx_hosted_modify_flags(uint32_t *flags) { - vmwgfx_xmir_modify_flags(flags); - vmwgfx_xwl_modify_flags(flags); } diff --git a/vmwgfx/vmwgfx_hosted_priv.h b/vmwgfx/vmwgfx_hosted_priv.h deleted file mode 100644 index 2668e55..0000000 --- a/vmwgfx/vmwgfx_hosted_priv.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2013 VMWare, Inc. - * All Rights Reserved. - * - * 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. - * - * Author: Thomas Hellstrom <thellstrom@vmware.com> - */ - -#ifndef _VMWGFX_HOSTED_PRIV_H_ -#define _VMWGFX_HOSTED_PRIV_H_ - -#include <stdint.h> -#include "vmwgfx_hosted.h" - -extern const struct vmwgfx_hosted_driver *vmwgfx_xmir_detect(void); -extern void vmwgfx_xmir_modify_flags(uint32_t *flags); - -extern const struct vmwgfx_hosted_driver *vmwgfx_xwl_detect(void); -extern void vmwgfx_xwl_modify_flags(uint32_t *flags); - -#endif diff --git a/vmwgfx/vmwgfx_xmir.c b/vmwgfx/vmwgfx_xmir.c deleted file mode 100644 index 89dbaf3..0000000 --- a/vmwgfx/vmwgfx_xmir.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2013 VMWare, Inc. - * All Rights Reserved. - * - * 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. - * - * Author: Thomas Hellstrom <thellstrom@vmware.com> - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "vmwgfx_hosted_priv.h" -#include <xa_tracker.h> - -#if XMIR && (XA_TRACKER_VERSION_MAJOR >= 2) && defined(HAVE_LIBDRM_2_4_38) - -#include "vmwgfx_hosted.h" -#include "vmwgfx_saa.h" -#include <xf86Crtc.h> -#include <xf86Priv.h> -#include <xmir.h> - -struct vmwgfx_hosted { - xmir_screen *xmir; - ScrnInfoPtr pScrn; - ScreenPtr pScreen; -}; - -static void -vmwgfx_xmir_copy_to_mir(xmir_window *xmir_win, RegionPtr region); - -static xmir_driver vmwgfx_xmir_driver = { - XMIR_DRIVER_VERSION, - vmwgfx_xmir_copy_to_mir -}; - -static struct vmwgfx_hosted * -vmwgfx_xmir_create(ScrnInfoPtr pScrn) -{ - struct vmwgfx_hosted *hosted; - - hosted = calloc(1, sizeof(*hosted)); - if (!hosted) - return NULL; - - hosted->xmir = xmir_screen_create(pScrn); - if (!hosted->xmir) { - free(hosted); - return NULL; - } - - hosted->pScrn = pScrn; - return hosted; -} - -static void -vmwgfx_xmir_destroy(struct vmwgfx_hosted *hosted) -{ - xmir_screen_destroy(hosted->xmir); - free(hosted); -} - -static Bool -vmwgfx_xmir_pre_init(struct vmwgfx_hosted *hosted, int flags) -{ - return xmir_screen_pre_init(hosted->pScrn, hosted->xmir, - &vmwgfx_xmir_driver); -} - -static int -vmwgfx_xmir_drm_fd(struct vmwgfx_hosted *hosted, const struct pci_device *pci) -{ - char bus_id[20]; - - snprintf(bus_id, sizeof(bus_id), "pci:%04x:%02x:%02x.%d", - pci->domain, pci->bus, pci->dev, pci->func); - return xmir_get_drm_fd(bus_id); -} - -static Bool -vmwgfx_xmir_screen_init(struct vmwgfx_hosted *hosted, ScreenPtr pScreen) -{ - if (!xmir_screen_init(pScreen, hosted->xmir)) - return FALSE; - - hosted->pScreen = pScreen; - if (!xf86SetDesiredModes(hosted->pScrn)) { - xmir_screen_close(hosted->pScreen, hosted->xmir); - hosted->pScreen = NULL; - return FALSE; - } - - return TRUE; -} - -static void -vmwgfx_xmir_screen_close(struct vmwgfx_hosted *hosted) -{ - if (hosted->pScreen) - xmir_screen_close(hosted->pScreen, hosted->xmir); - - hosted->pScreen = NULL; -} - -static void -vmwgfx_xmir_post_damage(struct vmwgfx_hosted *hosted) -{ - xmir_screen_for_each_damaged_window(hosted->xmir, vmwgfx_xmir_copy_to_mir); -} - -static int -vmwgfx_xmir_dri_auth(struct vmwgfx_hosted *hosted, ClientPtr client, - uint32_t magic) -{ - return xmir_auth_drm_magic(hosted->xmir, magic); -} - -static void -vmwgfx_xmir_copy_to_mir(xmir_window *xmir_win, RegionPtr region) -{ - DrawablePtr pDraw = (DrawablePtr) xmir_window_to_windowptr(xmir_win); - const BoxRec *dst_box = xmir_window_get_drawable_region(xmir_win); - - if (vmwgfx_saa_copy_to_surface(pDraw, xmir_window_get_fd(xmir_win), - dst_box, region)) - xmir_submit_rendering_for_window(xmir_win, region); -} - -static const struct vmwgfx_hosted_driver vmwgfx_hosted_xmir_driver = { - .create = vmwgfx_xmir_create, - .destroy = vmwgfx_xmir_destroy, - .drm_fd = vmwgfx_xmir_drm_fd, - .pre_init = vmwgfx_xmir_pre_init, - .screen_init = vmwgfx_xmir_screen_init, - .screen_close = vmwgfx_xmir_screen_close, - .post_damage = vmwgfx_xmir_post_damage, - .dri_auth = vmwgfx_xmir_dri_auth -}; - -const struct vmwgfx_hosted_driver * -vmwgfx_xmir_detect(void) -{ - return (xorgMir) ? &vmwgfx_hosted_xmir_driver : NULL; -} - -void vmwgfx_xmir_modify_flags(uint32_t *flags) -{ - if (xorgMir) - *flags |= HW_SKIP_CONSOLE; -} - -#else - -const struct vmwgfx_hosted_driver * -vmwgfx_xmir_detect(void) -{ - return NULL; -} - -void -vmwgfx_xmir_modify_flags(uint32_t *flags) -{ -} -#endif diff --git a/vmwgfx/vmwgfx_xwayland.c b/vmwgfx/vmwgfx_xwayland.c deleted file mode 100644 index 5e25666..0000000 --- a/vmwgfx/vmwgfx_xwayland.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2013 VMWare, Inc. - * All Rights Reserved. - * - * 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, sub license, 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 (including the - * next paragraph) 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 NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS 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. - * - * Author: Thomas Hellstrom <thellstrom@vmware.com> - * Author: Jakob Bornecrantz <jakob@vmware.com> - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "vmwgfx_hosted_priv.h" - -#ifdef XORG_WAYLAND - -#include "vmwgfx_hosted.h" -#include "vmwgfx_saa.h" -#include <xf86Priv.h> -#include <xwayland.h> - -struct vmwgfx_hosted { - struct xwl_screen *xwl; - ScrnInfoPtr pScrn; - ScreenPtr pScreen; -}; - -static int -vmwgfx_create_window_buffer(struct xwl_window *xwl_window, - PixmapPtr pixmap) -{ - struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(pixmap); - uint32_t name, pitch; - - if (!vmwgfx_hw_dri2_validate(pixmap, 0)) - return BadDrawable; - - /* - * Pixmaps with hw_is_hosted == TRUE are put on a flush list when - * they've seen software rendering. When vmwgfx_flush_dri2 is called - * on these pixmaps, software contents are flushed to the hardware - * surface. - */ - vpix->hw_is_hosted = TRUE; - if (_xa_surface_handle(vpix->hw, &name, &pitch) != XA_ERR_NONE) - return BadDrawable; - - return xwl_create_window_buffer_drm(xwl_window, pixmap, name); -} - -static struct xwl_driver vmwgfx_xwl_driver = { - .version = 2, - .use_drm = 1, - .create_window_buffer = vmwgfx_create_window_buffer -}; - -static struct vmwgfx_hosted * -vmwgfx_xwl_create(ScrnInfoPtr pScrn) -{ - struct vmwgfx_hosted *hosted; - - hosted = calloc(1, sizeof(*hosted)); - if (!hosted) - return NULL; - - hosted->xwl = xwl_screen_create(); - if (!hosted->xwl) { - free(hosted); - return NULL; - } - - hosted->pScrn = pScrn; - return hosted; -} - -static void -vmwgfx_xwl_destroy(struct vmwgfx_hosted *hosted) -{ - xwl_screen_destroy(hosted->xwl); - free(hosted); -} - -static Bool -vmwgfx_xwl_pre_init(struct vmwgfx_hosted *hosted, int flags) -{ - return xwl_screen_pre_init(hosted->pScrn, hosted->xwl, 0, - &vmwgfx_xwl_driver); -} - -static int -vmwgfx_xwl_drm_fd(struct vmwgfx_hosted *hosted, const struct pci_device *pci) -{ - return xwl_screen_get_drm_fd(hosted->xwl); -} - -static Bool -vmwgfx_xwl_screen_init(struct vmwgfx_hosted *hosted, ScreenPtr pScreen) -{ - if (xwl_screen_init(hosted->xwl, pScreen)) - return FALSE; - - hosted->pScreen = pScreen; - - return TRUE; -} - -static void -vmwgfx_xwl_screen_close(struct vmwgfx_hosted *hosted) -{ - if (hosted->pScreen) - xwl_screen_close(hosted->xwl); - - hosted->pScreen = NULL; -} - -static void -vmwgfx_xwl_post_damage(struct vmwgfx_hosted *hosted) -{ - vmwgfx_flush_dri2(hosted->pScreen); - xwl_screen_post_damage(hosted->xwl); -} - -static int -vmwgfx_xwl_dri_auth(struct vmwgfx_hosted *hosted, ClientPtr client, - uint32_t magic) -{ - return xwl_drm_authenticate(client, hosted->xwl, magic); -} - -static const struct vmwgfx_hosted_driver vmwgfx_hosted_xwl_driver = { - .create = vmwgfx_xwl_create, - .destroy = vmwgfx_xwl_destroy, - .drm_fd = vmwgfx_xwl_drm_fd, - .pre_init = vmwgfx_xwl_pre_init, - .screen_init = vmwgfx_xwl_screen_init, - .screen_close = vmwgfx_xwl_screen_close, - .post_damage = vmwgfx_xwl_post_damage, - .dri_auth = vmwgfx_xwl_dri_auth -}; - -const struct vmwgfx_hosted_driver * -vmwgfx_xwl_detect(void) -{ - return (xorgWayland) ? &vmwgfx_hosted_xwl_driver : NULL; -} - -void -vmwgfx_xwl_modify_flags(uint32_t *flags) -{ - if (xorgWayland) - *flags |= HW_SKIP_CONSOLE | HW_WAYLAND; -} - -#else - -const struct vmwgfx_hosted_driver * -vmwgfx_xwl_detect(void) -{ - return NULL; -} - -void -vmwgfx_xwl_modify_flags(uint32_t *flags) -{ -} -#endif |