Commit 1e25fe5b authored by Rocky Automation's avatar Rocky Automation 📺
Browse files

import xorg-x11-server-1.20.11-6.el9

parent 02dd8fe3
From c2eb1e2eac99ef0b8e6cf47ab0a94371cf47e939 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 23 Jul 2019 11:54:15 -0400
Subject: [PATCH xserver 02/11] xfree86: Link fb statically
There's no real benefit to leaving this loadable, virtually every driver
is going to load it.
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
(cherry picked from commit c1703cdf3b0d6663fcac68598eefe324ae4e1e71)
---
hw/xfree86/Makefile.am | 1 +
hw/xfree86/dixmods/Makefile.am | 8 +-------
hw/xfree86/dixmods/meson.build | 14 --------------
hw/xfree86/drivers/modesetting/meson.build | 1 -
hw/xfree86/loader/loadmod.c | 1 +
hw/xfree86/meson.build | 1 +
hw/xfree86/sdksyms.sh | 6 +++---
test/Makefile.am | 1 +
8 files changed, 8 insertions(+), 25 deletions(-)
diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am
index 9aeaea1a6..1d494cd0f 100644
--- a/hw/xfree86/Makefile.am
+++ b/hw/xfree86/Makefile.am
@@ -75,6 +75,7 @@ LOCAL_LIBS = \
$(DRI2_LIB) \
$(DRI3_LIB) \
$(GLXVND_LIB) \
+ $(top_builddir)/fb/libfb.la \
$(top_builddir)/miext/sync/libsync.la \
$(top_builddir)/mi/libmi.la \
$(top_builddir)/os/libos.la \
diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am
index 856659f98..a1f97056a 100644
--- a/hw/xfree86/dixmods/Makefile.am
+++ b/hw/xfree86/dixmods/Makefile.am
@@ -4,8 +4,7 @@ if GLX
GLXMODS = libglx.la
endif
-module_LTLIBRARIES = libfb.la \
- libwfb.la \
+module_LTLIBRARIES = libwfb.la \
libshadow.la
extsmoduledir = $(moduledir)/extensions
@@ -17,11 +16,6 @@ AM_CPPFLAGS = @XORG_INCS@ \
-I$(top_srcdir)/miext/shadow \
-I$(top_srcdir)/glx
-libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
-libfb_la_LIBADD = $(top_builddir)/fb/libfb.la
-libfb_la_SOURCES = fbmodule.c
-libfb_la_CFLAGS = $(AM_CFLAGS)
-
libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG)
libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la
libwfb_la_SOURCES = fbmodule.c
diff --git a/hw/xfree86/dixmods/meson.build b/hw/xfree86/dixmods/meson.build
index 0562b630f..e4ac02228 100644
--- a/hw/xfree86/dixmods/meson.build
+++ b/hw/xfree86/dixmods/meson.build
@@ -1,17 +1,3 @@
-fb = shared_module(
- 'fb',
- 'fbmodule.c',
-
- include_directories: [inc, xorg_inc],
- c_args: xorg_c_args,
- dependencies: common_dep,
- link_whole: libxserver_fb,
- link_with: e,
-
- install: true,
- install_dir: module_dir,
-)
-
shared_module(
'wfb',
'fbmodule.c',
diff --git a/hw/xfree86/drivers/modesetting/meson.build b/hw/xfree86/drivers/modesetting/meson.build
index 5e13f1a53..02852a716 100644
--- a/hw/xfree86/drivers/modesetting/meson.build
+++ b/hw/xfree86/drivers/modesetting/meson.build
@@ -30,7 +30,6 @@ shared_module(
xorg_build_root = join_paths(meson.build_root(), 'hw', 'xfree86')
symbol_test_args = []
symbol_test_args += join_paths(xorg_build_root, 'libxorgserver.so')
-symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libfb.so')
symbol_test_args += join_paths(xorg_build_root, 'dixmods', 'libshadow.so')
if gbm_dep.found()
symbol_test_args += join_paths(xorg_build_root, 'glamor_egl', 'libglamoregl.so')
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index a6356bd8f..f0983b2f8 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -621,6 +621,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent)
static const char *compiled_in_modules[] = {
"ddc",
+ "fb",
"i2c",
"ramdac",
"dbe",
diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build
index cacf56d4c..c80964ea4 100644
--- a/hw/xfree86/meson.build
+++ b/hw/xfree86/meson.build
@@ -61,6 +61,7 @@ xorg_link = [
xorg_os_support,
xorg_parser,
xorg_ramdac,
+ libxserver_fb,
libxserver_xext_vidmode,
libxserver_main,
libxserver_config,
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index 7897aae22..2ebc4c019 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -21,13 +21,13 @@ cat > sdksyms.c << EOF
#include "picturestr.h"
-/* fb/Makefile.am -- module */
-/*
+/* fb/Makefile.am */
#include "fb.h"
#include "fbrop.h"
#include "fboverlay.h"
-#include "wfbrename.h"
#include "fbpict.h"
+/* wfb is still a module
+#include "wfbrename.h"
*/
diff --git a/test/Makefile.am b/test/Makefile.am
index 12ac327a3..ce07c3551 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -146,6 +146,7 @@ tests_LDADD += \
$(top_builddir)/hw/xfree86/i2c/libi2c.la \
$(top_builddir)/hw/xfree86/xkb/libxorgxkb.la \
$(top_builddir)/Xext/libXvidmode.la \
+ $(top_builddir)/fb/libfb.la \
$(XSERVER_LIBS) \
$(XORG_LIBS)
--
2.33.1
From e763a4fa114ba6c0abddf2b43a7297b8b9054855 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 8 Oct 2019 13:29:22 -0400
Subject: [PATCH xserver 04/11] loader: Move LoaderSymbolFromModule() to public
API
Bare LoaderSymbol() isn't really a great API, this is more of a direct
map to dlsym like you want.
Gitlab: https://gitlab.freedesktop.org/xorg/xserver/issues/692
(cherry picked from commit 8760fab0a15805bdd12bb8f12bb1c665fde86cc2)
---
hw/xfree86/common/xf86Module.h | 1 +
hw/xfree86/loader/loader.h | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h
index 00aa84ae2..fab8842c4 100644
--- a/hw/xfree86/common/xf86Module.h
+++ b/hw/xfree86/common/xf86Module.h
@@ -156,6 +156,7 @@ extern _X_EXPORT void *LoadSubModule(void *, const char *, const char **,
extern _X_EXPORT void UnloadSubModule(void *);
extern _X_EXPORT void UnloadModule(void *);
extern _X_EXPORT void *LoaderSymbol(const char *);
+extern _X_EXPORT void *LoaderSymbolFromModule(void *, const char *);
extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int);
extern _X_EXPORT Bool LoaderShouldIgnoreABI(void);
extern _X_EXPORT int LoaderGetABIVersion(const char *abiclass);
diff --git a/hw/xfree86/loader/loader.h b/hw/xfree86/loader/loader.h
index 5a2fe6c60..4e83730a2 100644
--- a/hw/xfree86/loader/loader.h
+++ b/hw/xfree86/loader/loader.h
@@ -72,6 +72,5 @@ extern unsigned long LoaderOptions;
/* Internal Functions */
void *LoaderOpen(const char *, int *);
-void *LoaderSymbolFromModule(void *, const char *);
#endif /* _LOADER_H */
--
2.33.1
From b01ca791b9ba62e25e3533ba35f8e825f02f0f80 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Mon, 18 Nov 2019 16:43:50 -0500
Subject: [PATCH xserver 05/11] loader: Make LoaderSymbolFromModule take a
ModuleDescPtr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The thing you get back from xf86LoadSubModule is a ModuleDescPtr, not a
dlsym handle. We don't expose ModuleDescPtr to the drivers, so change
LoaderSymbolFromModule to cast its void * argument to a ModuleDescPtr.
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
(cherry picked from commit ab61c16ef07fde6eb7110c63c344c54eb2a2d117)
---
hw/xfree86/loader/loader.c | 3 ++-
hw/xfree86/loader/loadmod.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
index 503c47e3a..2580e93d9 100644
--- a/hw/xfree86/loader/loader.c
+++ b/hw/xfree86/loader/loader.c
@@ -135,7 +135,8 @@ LoaderSymbol(const char *name)
void *
LoaderSymbolFromModule(void *handle, const char *name)
{
- return dlsym(handle, name);
+ ModuleDescPtr mod = handle;
+ return dlsym(mod->handle, name);
}
void
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
index a93a76aa9..81a3a1dd9 100644
--- a/hw/xfree86/loader/loadmod.c
+++ b/hw/xfree86/loader/loadmod.c
@@ -776,7 +776,7 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
*errmaj = LDR_NOMEM;
goto LoadModule_fail;
}
- initdata = LoaderSymbolFromModule(ret->handle, p);
+ initdata = LoaderSymbolFromModule(ret, p);
if (initdata) {
ModuleSetupProc setup;
ModuleTearDownProc teardown;
--
2.33.1
From 13d3bc7a05eb7500c8987358c68c20a4bfe18079 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 8 Oct 2019 12:52:28 -0400
Subject: [PATCH xserver 06/11] modesetting: Indirect the shadow API through
LoaderSymbol
Prerequisite for building all of xserver with -z now.
Gitlab: https://gitlab.freedesktop.org/xorg/xserver/issues/692
(cherry picked from commit 45f35a0c6666c5f35df482948e0c8e91167429ef)
---
hw/xfree86/drivers/modesetting/driver.c | 34 +++++++++++--------------
hw/xfree86/drivers/modesetting/driver.h | 12 ++++++++-
2 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index ec4189a2c..a385e7ee2 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -50,7 +50,6 @@
#include "xf86Crtc.h"
#include "miscstruct.h"
#include "dixstruct.h"
-#include "shadow.h"
#include "xf86xv.h"
#include <X11/extensions/Xv.h>
#include <xorg-config.h>
@@ -60,7 +59,6 @@
#ifdef XSERVER_LIBPCIACCESS
#include <pciaccess.h>
#endif
-
#include "driver.h"
static void AdjustFrame(ScrnInfoPtr pScrn, int x, int y);
@@ -1084,9 +1082,16 @@ PreInit(ScrnInfoPtr pScrn, int flags)
}
if (ms->drmmode.shadow_enable) {
- if (!xf86LoadSubModule(pScrn, "shadow")) {
+ void *mod = xf86LoadSubModule(pScrn, "shadow");
+
+ if (!mod)
return FALSE;
- }
+
+ ms->shadow.Setup = LoaderSymbolFromModule(mod, "shadowSetup");
+ ms->shadow.Add = LoaderSymbolFromModule(mod, "shadowAdd");
+ ms->shadow.Remove = LoaderSymbolFromModule(mod, "shadowRemove");
+ ms->shadow.Update32to24 = LoaderSymbolFromModule(mod, "shadowUpdate32to24");
+ ms->shadow.UpdatePacked = LoaderSymbolFromModule(mod, "shadowUpdatePacked");
}
return TRUE;
@@ -1191,9 +1196,9 @@ msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
} while (0);
if (use_3224)
- shadowUpdate32to24(pScreen, pBuf);
+ ms->shadow.Update32to24(pScreen, pBuf);
else
- shadowUpdatePacked(pScreen, pBuf);
+ ms->shadow.UpdatePacked(pScreen, pBuf);
}
static Bool
@@ -1380,8 +1385,8 @@ CreateScreenResources(ScreenPtr pScreen)
FatalError("Couldn't adjust screen pixmap\n");
if (ms->drmmode.shadow_enable) {
- if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, msShadowWindow,
- 0, 0))
+ if (!ms->shadow.Add(pScreen, rootPixmap, msUpdatePacked, msShadowWindow,
+ 0, 0))
return FALSE;
}
@@ -1415,15 +1420,6 @@ CreateScreenResources(ScreenPtr pScreen)
return ret;
}
-static Bool
-msShadowInit(ScreenPtr pScreen)
-{
- if (!shadowSetup(pScreen)) {
- return FALSE;
- }
- return TRUE;
-}
-
static Bool
msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle)
{
@@ -1643,7 +1639,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
- if (ms->drmmode.shadow_enable && !msShadowInit(pScreen)) {
+ if (ms->drmmode.shadow_enable && !ms->shadow.Setup(pScreen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "shadow fb init failed\n");
return FALSE;
}
@@ -1887,7 +1883,7 @@ CloseScreen(ScreenPtr pScreen)
}
if (ms->drmmode.shadow_enable) {
- shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen));
+ ms->shadow.Remove(pScreen, pScreen->GetScreenPixmap(pScreen));
free(ms->drmmode.shadow_fb);
ms->drmmode.shadow_fb = NULL;
free(ms->drmmode.shadow_fb2);
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index a99f37871..394a20fc1 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -33,7 +33,7 @@
#include <xf86Crtc.h>
#include <damage.h>
#include <X11/extensions/dpmsconst.h>
-
+#include <shadow.h>
#ifdef GLAMOR_HAS_GBM
#define GLAMOR_FOR_XORG 1
#include "glamor.h"
@@ -122,6 +122,16 @@ typedef struct _modesettingRec {
Bool kms_has_modifiers;
+ /* shadow API */
+ struct {
+ Bool (*Setup)(ScreenPtr);
+ Bool (*Add)(ScreenPtr, PixmapPtr, ShadowUpdateProc, ShadowWindowProc,
+ int, void *);
+ void (*Remove)(ScreenPtr, PixmapPtr);
+ void (*Update32to24)(ScreenPtr, shadowBufPtr);
+ void (*UpdatePacked)(ScreenPtr, shadowBufPtr);
+ } shadow;
+
} modesettingRec, *modesettingPtr;
#define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
--
2.33.1
From 94612044171975466f605d5f01769d1c2b9acc5d Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 8 Oct 2019 13:11:09 -0400
Subject: [PATCH xserver 07/11] modesetting: Indirect the glamor API through
LoaderSymbol
Prerequisite for building all of xserver with -z now.
Gitlab: https://gitlab.freedesktop.org/xorg/xserver/issues/692
(cherry picked from commit dd63f717fe8636315343f421f4f2ee299258f079)
---
hw/xfree86/drivers/modesetting/dri2.c | 10 ++--
hw/xfree86/drivers/modesetting/driver.c | 49 ++++++++++++++-----
hw/xfree86/drivers/modesetting/driver.h | 24 +++++++++
.../drivers/modesetting/drmmode_display.c | 17 ++++---
hw/xfree86/drivers/modesetting/pageflip.c | 4 +-
hw/xfree86/drivers/modesetting/present.c | 4 +-
6 files changed, 82 insertions(+), 26 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c
index d89904b53..724d9d34c 100644
--- a/hw/xfree86/drivers/modesetting/dri2.c
+++ b/hw/xfree86/drivers/modesetting/dri2.c
@@ -123,6 +123,7 @@ ms_dri2_create_buffer2(ScreenPtr screen, DrawablePtr drawable,
unsigned int attachment, unsigned int format)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ modesettingPtr ms = modesettingPTR(scrn);
DRI2Buffer2Ptr buffer;
PixmapPtr pixmap;
CARD32 size;
@@ -200,7 +201,7 @@ ms_dri2_create_buffer2(ScreenPtr screen, DrawablePtr drawable,
*/
buffer->flags = 0;
- buffer->name = glamor_name_from_pixmap(pixmap, &pitch, &size);
+ buffer->name = ms->glamor.name_from_pixmap(pixmap, &pitch, &size);
buffer->pitch = pitch;
if (buffer->name == -1) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
@@ -509,11 +510,12 @@ update_front(DrawablePtr draw, DRI2BufferPtr front)
ScreenPtr screen = draw->pScreen;
PixmapPtr pixmap = get_drawable_pixmap(draw);
ms_dri2_buffer_private_ptr priv = front->driverPrivate;
+ modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
CARD32 size;
CARD16 pitch;
int name;
- name = glamor_name_from_pixmap(pixmap, &pitch, &size);
+ name = ms->glamor.name_from_pixmap(pixmap, &pitch, &size);
if (name < 0)
return FALSE;
@@ -617,7 +619,7 @@ ms_dri2_exchange_buffers(DrawablePtr draw, DRI2BufferPtr front,
*front_pix = *back_pix;
*back_pix = tmp_pix;
- glamor_egl_exchange_buffers(front_priv->pixmap, back_priv->pixmap);
+ ms->glamor.egl_exchange_buffers(front_priv->pixmap, back_priv->pixmap);
/* Post damage on the front buffer so that listeners, such
* as DisplayLink know take a copy and shove it over the USB.
@@ -1036,7 +1038,7 @@ ms_dri2_screen_init(ScreenPtr screen)
DRI2InfoRec info;
const char *driver_names[2] = { NULL, NULL };
- if (!glamor_supports_pixmap_import_export(screen)) {
+ if (!ms->glamor.supports_pixmap_import_export(screen)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
"DRI2: glamor lacks support for pixmap import/export\n");
}
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index a385e7ee2..4f4db67b7 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -615,7 +615,7 @@ redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty, int *timeout)
* the shared pixmap, but not all).
*/
if (ms->drmmode.glamor)
- glamor_finish(screen);
+ ms->glamor.finish(screen);
#endif
/* Ensure the slave processes the damage immediately */
if (timeout)
@@ -743,6 +743,26 @@ FreeRec(ScrnInfoPtr pScrn)
}
+static void
+bind_glamor_api(void *mod, modesettingPtr ms)
+{
+ ms->glamor.back_pixmap_from_fd = LoaderSymbolFromModule(mod, "glamor_back_pixmap_from_fd");
+ ms->glamor.block_handler = LoaderSymbolFromModule(mod, "glamor_block_handler");
+ ms->glamor.egl_create_textured_pixmap = LoaderSymbolFromModule(mod, "glamor_egl_create_textured_pixmap");
+ ms->glamor.egl_create_textured_pixmap_from_gbm_bo = LoaderSymbolFromModule(mod, "glamor_egl_create_textured_pixmap_from_gbm_bo");
+ ms->glamor.egl_exchange_buffers = LoaderSymbolFromModule(mod, "glamor_egl_exchange_buffers");
+ ms->glamor.egl_get_gbm_device = LoaderSymbolFromModule(mod, "glamor_egl_get_gbm_device");
+ ms->glamor.egl_init = LoaderSymbolFromModule(mod, "glamor_egl_init");
+ ms->glamor.finish = LoaderSymbolFromModule(mod, "glamor_finish");
+ ms->glamor.gbm_bo_from_pixmap = LoaderSymbolFromModule(mod, "glamor_gbm_bo_from_pixmap");
+ ms->glamor.init = LoaderSymbolFromModule(mod, "glamor_init");
+ ms->glamor.name_from_pixmap = LoaderSymbolFromModule(mod, "glamor_name_from_pixmap");
+ ms->glamor.set_drawable_modifiers_func = LoaderSymbolFromModule(mod, "glamor_set_drawable_modifiers_func");
+ ms->glamor.shareable_fd_from_pixmap = LoaderSymbolFromModule(mod, "glamor_shareable_fd_from_pixmap");
+ ms->glamor.supports_pixmap_import_export = LoaderSymbolFromModule(mod, "glamor_supports_pixmap_import_export");
+ ms->glamor.xv_init = LoaderSymbolFromModule(mod, "glamor_xv_init");
+}
+
static void
try_enable_glamor(ScrnInfoPtr pScrn)
{
@@ -751,6 +771,7 @@ try_enable_glamor(ScrnInfoPtr pScrn)
OPTION_ACCEL_METHOD);
Bool do_glamor = (!accel_method_str ||
strcmp(accel_method_str, "glamor") == 0);
+ void *mod;
ms->drmmode.glamor = FALSE;
@@ -765,8 +786,10 @@ try_enable_glamor(ScrnInfoPtr pScrn)
return;
}
- if (xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME)) {
- if (glamor_egl_init(pScrn, ms->fd)) {
+ mod = xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME);
+ if (mod) {
+ bind_glamor_api(mod, ms);
+ if (ms->glamor.egl_init(pScrn, ms->fd)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n");
ms->drmmode.glamor = TRUE;
} else {
@@ -1424,11 +1447,12 @@ static Bool
msSharePixmapBacking(PixmapPtr ppix, ScreenPtr screen, void **handle)
{
#ifdef GLAMOR_HAS_GBM
+ modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(screen));
int ret;
CARD16 stride;
CARD32 size;
- ret = glamor_shareable_fd_from_pixmap(ppix->drawable.pScreen, ppix,
- &stride, &size);
+ ret = ms->glamor.shareable_fd_from_pixmap(ppix->drawable.pScreen, ppix,
+ &stride, &size);
if (ret == -1)
return FALSE;
@@ -1453,11 +1477,12 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle)
return drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, 0, 0);
if (ms->drmmode.reverse_prime_offload_mode) {
- ret = glamor_back_pixmap_from_fd(ppix, ihandle,
- ppix->drawable.width,
- ppix->drawable.height,
- ppix->devKind, ppix->drawable.depth,
- ppix->drawable.bitsPerPixel);
+ ret = ms->glamor.back_pixmap_from_fd(ppix, ihandle,
+ ppix->drawable.width,
+ ppix->drawable.height,
+ ppix->devKind,
+ ppix->drawable.depth,
+ ppix->drawable.bitsPerPixel);
} else {
int size = ppix->devKind * ppix->drawable.height;
ret = drmmode_SetSlaveBO(ppix, &ms->drmmode, ihandle, ppix->devKind, size);
@@ -1574,7 +1599,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
#ifdef GLAMOR_HAS_GBM
if (ms->drmmode.glamor)
- ms->drmmode.gbm = glamor_egl_get_gbm_device(pScreen);
+ ms->drmmode.gbm = ms->glamor.egl_get_gbm_device(pScreen);
#endif
/* HW dependent - FIXME */
@@ -1718,7 +1743,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
if (ms->drmmode.glamor) {
XF86VideoAdaptorPtr glamor_adaptor;
- glamor_adaptor = glamor_xv_init(pScreen, 16);
+ glamor_adaptor = ms->glamor.xv_init(pScreen, 16);
if (glamor_adaptor != NULL)
xf86XVScreenInit(pScreen, &glamor_adaptor, 1);
else
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 394a20fc1..5e4d2509a 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -132,6 +132,30 @@ typedef struct _modesettingRec {
void (*UpdatePacked)(ScreenPtr, shadowBufPtr);
} shadow;
+ /* glamor API */
+ struct {
+ Bool (*back_pixmap_from_fd)(PixmapPtr, int, CARD16, CARD16, CARD16,
+ CARD8, CARD8);
+ void (*block_handler)(ScreenPtr);
+ Bool (*egl_create_textured_pixmap)(PixmapPtr, int, int);
+ Bool (*egl_create_textured_pixmap_from_gbm_bo)(PixmapPtr,
+ struct gbm_bo *,
+ Bool);
+ void (*egl_exchange_buffers)(PixmapPtr, PixmapPtr);
+ struct gbm_device *(*egl_get_gbm_device)(ScreenPtr);
+ Bool (*egl_init)(ScrnInfoPtr, int);
+ void (*finish)(ScreenPtr);
+ struct gbm_bo *(*gbm_bo_from_pixmap)(ScreenPtr, PixmapPtr);
+ Bool (*init)(ScreenPtr, unsigned int);
+ int (*name_from_pixmap)(PixmapPtr, CARD16 *, CARD32 *);
+ void (*set_drawable_modifiers_func)(ScreenPtr,
+ GetDrawableModifiersFuncPtr);
+ int (*shareable_fd_from_pixmap)(ScreenPtr, PixmapPtr, CARD16 *,
+ CARD32 *);
+ Bool (*supports_pixmap_import_export)(ScreenPtr);
+ XF86VideoAdaptorPtr (*xv_init)(ScreenPtr, int);
+ } glamor;
+
} modesettingRec, *modesettingPtr;