aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
commitf1c2db43dcf35d2cf4715390bd2391c28e42a8c2 (patch)
tree46b537271afe0f6534231b1bd4cc4f91ae1fb446 /xorg-server/hw/xfree86
parent5e5a48ff8cd08f123601cd0625ca62a86675aac9 (diff)
downloadvcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.gz
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.bz2
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.zip
xwininfo fontconfig libX11 libXdmcp libfontenc libxcb libxcb/xcb-proto mesalib xserver xkeyboard-config mkfontscale git update 22 Feb 2015
xserver commit 3a06faf3fcdb7451125a46181f9152e8e59e9770 libxcb commit e3ec1f74637237ce500dfd0ca59f2e422da4e019 libxcb/xcb-proto commit 4c550465934164aab2449a125f75f4ca07816233 xkeyboard-config commit 26f344c93f8c6141e9233eb68088ba4fd56bc9ef libX11 commit c8e19b393defd53f046ddc2da3a16881221b3c34 libXdmcp commit 9f4cac7656b221ce2a8f97e7bd31e5e23126d001 libfontenc commit de1843aaf76015c9d99416f3122d169fe331b849 mkfontscale commit 87d628f8eec170ec13bb9feefb1ce05aed07d1d6 xwininfo commit 0c49f8f2bd56b1e77721e81030ea948386dcdf4e fontconfig commit d6d5adeb7940c0d0beb86489c2a1c2ce59e5c044 mesa commit 4359954d842caa2a9f8d4b50d70ecc789884b68b
Diffstat (limited to 'xorg-server/hw/xfree86')
-rw-r--r--xorg-server/hw/xfree86/Makefile.am2
-rw-r--r--xorg-server/hw/xfree86/Xorg.sh.in4
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2.c9
-rw-r--r--xorg-server/hw/xfree86/drivers/modesetting/driver.c2
-rw-r--r--xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.c196
-rw-r--r--xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.h4
-rw-r--r--xorg-server/hw/xfree86/drivers/modesetting/vblank.c9
-rw-r--r--xorg-server/hw/xfree86/man/Xorg.wrap.man2
-rw-r--r--xorg-server/hw/xfree86/xorg-wrapper.c10
9 files changed, 192 insertions, 46 deletions
diff --git a/xorg-server/hw/xfree86/Makefile.am b/xorg-server/hw/xfree86/Makefile.am
index d46bf0a86..27f2cc6cb 100644
--- a/xorg-server/hw/xfree86/Makefile.am
+++ b/xorg-server/hw/xfree86/Makefile.am
@@ -106,7 +106,7 @@ if INSTALL_SETUID
endif
if SUID_WRAPPER
$(MKDIR_P) $(DESTDIR)$(SUID_WRAPPER_DIR)
- mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.bin
+ mv $(DESTDIR)$(bindir)/Xorg $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg
${INSTALL} -m 755 Xorg.sh $(DESTDIR)$(bindir)/Xorg
-chown root $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap && chmod u+s $(DESTDIR)$(SUID_WRAPPER_DIR)/Xorg.wrap
endif
diff --git a/xorg-server/hw/xfree86/Xorg.sh.in b/xorg-server/hw/xfree86/Xorg.sh.in
index cef4859c8..481413523 100644
--- a/xorg-server/hw/xfree86/Xorg.sh.in
+++ b/xorg-server/hw/xfree86/Xorg.sh.in
@@ -1,11 +1,11 @@
#!/bin/sh
#
-# Execute Xorg.wrap if it exists otherwise execute Xorg.bin directly.
+# Execute Xorg.wrap if it exists otherwise execute Xorg directly.
# This allows distros to put the suid wrapper in a separate package.
basedir=@SUID_WRAPPER_DIR@
if [ -x "$basedir"/Xorg.wrap ]; then
exec "$basedir"/Xorg.wrap "$@"
else
- exec "$basedir"/Xorg.bin "$@"
+ exec "$basedir"/Xorg "$@"
fi
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c
index c8fcd6220..0c038b3d1 100644
--- a/xorg-server/hw/xfree86/dri2/dri2.c
+++ b/xorg-server/hw/xfree86/dri2/dri2.c
@@ -156,6 +156,9 @@ GetScreenPrime(ScreenPtr master, int prime_id)
DRI2ScreenPtr ds;
ds = DRI2GetScreen(slave);
+ if (ds == NULL)
+ continue;
+
if (ds->prime_id == prime_id)
return slave;
}
@@ -1573,15 +1576,15 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
if (info->version == 3 || info->numDrivers == 0) {
/* Driver too old: use the old-style driverName field */
- ds->numDrivers = 1;
- ds->driverNames = malloc(sizeof(*ds->driverNames));
+ ds->numDrivers = info->driverName ? 1 : 2;
+ ds->driverNames = malloc(ds->numDrivers * sizeof(*ds->driverNames));
if (!ds->driverNames)
goto err_out;
if (info->driverName) {
ds->driverNames[0] = info->driverName;
} else {
- ds->driverNames[0] = dri2_probe_driver_name(pScreen, info);
+ ds->driverNames[0] = ds->driverNames[1] = dri2_probe_driver_name(pScreen, info);
if (!ds->driverNames[0])
return FALSE;
}
diff --git a/xorg-server/hw/xfree86/drivers/modesetting/driver.c b/xorg-server/hw/xfree86/drivers/modesetting/driver.c
index 1ebf807e5..d52517d1a 100644
--- a/xorg-server/hw/xfree86/drivers/modesetting/driver.c
+++ b/xorg-server/hw/xfree86/drivers/modesetting/driver.c
@@ -538,6 +538,7 @@ msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask)
pScreen->BlockHandler = ms->BlockHandler;
pScreen->BlockHandler(pScreen, pTimeout, pReadmask);
+ ms->BlockHandler = pScreen->BlockHandler;
pScreen->BlockHandler = msBlockHandler;
if (pScreen->isGPU)
dispatch_slave_dirty(pScreen);
@@ -1077,6 +1078,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
if (!ms->drmmode.sw_cursor)
xf86_cursors_init(pScreen, ms->cursor_width, ms->cursor_height,
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 |
+ HARDWARE_CURSOR_UPDATE_UNHIDDEN |
HARDWARE_CURSOR_ARGB);
/* Must force it before EnterVT, so we are in control of VT and
diff --git a/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.c b/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.c
index 824500bae..1ea799b3a 100644
--- a/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -82,6 +82,17 @@ drmmode_bo_get_pitch(drmmode_bo *bo)
return bo->dumb->pitch;
}
+static Bool
+drmmode_bo_has_bo(drmmode_bo *bo)
+{
+#ifdef GLAMOR_HAS_GBM
+ if (bo->gbm)
+ return TRUE;
+#endif
+
+ return bo->dumb != NULL;
+}
+
uint32_t
drmmode_bo_get_handle(drmmode_bo *bo)
{
@@ -93,6 +104,26 @@ drmmode_bo_get_handle(drmmode_bo *bo)
return bo->dumb->handle;
}
+static void *
+drmmode_bo_map(drmmode_ptr drmmode, drmmode_bo *bo)
+{
+ int ret;
+
+#ifdef GLAMOR_HAS_GBM
+ if (bo->gbm)
+ return NULL;
+#endif
+
+ if (bo->dumb->ptr)
+ return bo->dumb->ptr;
+
+ ret = dumb_bo_map(drmmode->fd, bo->dumb);
+ if (ret)
+ return NULL;
+
+ return bo->dumb->ptr;
+}
+
static Bool
drmmode_create_bo(drmmode_ptr drmmode, drmmode_bo *bo,
unsigned width, unsigned height, unsigned bpp)
@@ -509,13 +540,122 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
static void *
drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
{
- return NULL;
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
+ int ret;
+
+ if (!drmmode_create_bo(drmmode, &drmmode_crtc->rotate_bo,
+ width, height, crtc->scrn->bitsPerPixel)) {
+ xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+ "Couldn't allocate shadow memory for rotated CRTC\n");
+ return NULL;
+ }
+
+ ret = drmModeAddFB(drmmode->fd, width, height, crtc->scrn->depth,
+ crtc->scrn->bitsPerPixel,
+ drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo),
+ drmmode_bo_get_handle(&drmmode_crtc->rotate_bo),
+ &drmmode_crtc->rotate_fb_id);
+
+ if (ret) {
+ ErrorF("failed to add rotate fb\n");
+ drmmode_bo_destroy(drmmode, &drmmode_crtc->rotate_bo);
+ return NULL;
+ }
+
+#ifdef GLAMOR_HAS_GBM
+ if (drmmode->gbm)
+ return drmmode_crtc->rotate_bo.gbm;
+#endif
+ return drmmode_crtc->rotate_bo.dumb;
+}
+
+static PixmapPtr
+drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height,
+ int depth, int bitsPerPixel, int devKind,
+ void *pPixData)
+{
+ PixmapPtr pixmap;
+
+ /* width and height of 0 means don't allocate any pixmap data */
+ pixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth, 0);
+
+ if (pixmap) {
+ if ((*pScreen->ModifyPixmapHeader)(pixmap, width, height, depth,
+ bitsPerPixel, devKind, pPixData))
+ return pixmap;
+ (*pScreen->DestroyPixmap)(pixmap);
+ }
+ return NullPixmap;
}
+static Bool
+drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo);
+
static PixmapPtr
drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
{
- return NULL;
+ ScrnInfoPtr scrn = crtc->scrn;
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
+ uint32_t rotate_pitch;
+ PixmapPtr rotate_pixmap;
+ void *pPixData = NULL;
+
+ if (!data) {
+ data = drmmode_shadow_allocate(crtc, width, height);
+ if (!data) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Couldn't allocate shadow pixmap for rotated CRTC\n");
+ return NULL;
+ }
+ }
+
+ if (!drmmode_bo_has_bo(&drmmode_crtc->rotate_bo)) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Couldn't allocate shadow pixmap for rotated CRTC\n");
+ return NULL;
+ }
+
+ pPixData = drmmode_bo_map(drmmode, &drmmode_crtc->rotate_bo);
+ rotate_pitch = drmmode_bo_get_pitch(&drmmode_crtc->rotate_bo),
+
+ rotate_pixmap = drmmode_create_pixmap_header(scrn->pScreen,
+ width, height,
+ scrn->depth,
+ scrn->bitsPerPixel,
+ rotate_pitch,
+ pPixData);
+
+ if (rotate_pixmap == NULL) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Couldn't allocate shadow pixmap for rotated CRTC\n");
+ return NULL;
+ }
+
+ drmmode_set_pixmap_bo(drmmode, rotate_pixmap, &drmmode_crtc->rotate_bo);
+
+ return rotate_pixmap;
+}
+
+static void
+drmmode_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data)
+{
+ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+ drmmode_ptr drmmode = drmmode_crtc->drmmode;
+
+ if (rotate_pixmap) {
+ drmmode_set_pixmap_bo(drmmode, rotate_pixmap, NULL);
+ rotate_pixmap->drawable.pScreen->DestroyPixmap(rotate_pixmap);
+ }
+
+ if (data) {
+ drmModeRmFB(drmmode->fd, drmmode_crtc->rotate_fb_id);
+ drmmode_crtc->rotate_fb_id = 0;
+
+ drmmode_bo_destroy(drmmode, &drmmode_crtc->rotate_bo);
+ memset(&drmmode_crtc->rotate_bo, 0, sizeof drmmode_crtc->rotate_bo);
+ }
}
static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
@@ -532,6 +672,7 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
.set_scanout_pixmap = drmmode_set_scanout_pixmap,
.shadow_allocate = drmmode_shadow_allocate,
.shadow_create = drmmode_shadow_create,
+ .shadow_destroy = drmmode_shadow_destroy,
};
static uint32_t
@@ -1123,34 +1264,32 @@ drmmode_clones_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
}
}
-Bool
-drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode)
+static Bool
+drmmode_set_pixmap_bo(drmmode_ptr drmmode, PixmapPtr pixmap, drmmode_bo *bo)
{
#ifdef GLAMOR
ScrnInfoPtr scrn = drmmode->scrn;
- ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn);
- PixmapPtr screen_pixmap;
- void *gbm_bo;
if (!drmmode->glamor)
return TRUE;
-#ifdef GLAMOR_HAS_GBM
- gbm_bo = drmmode->front_bo.gbm;
- screen_pixmap = screen->GetScreenPixmap(screen);
+ if (bo == NULL) {
+ glamor_egl_destroy_textured_pixmap(pixmap);
+ return TRUE;
+ }
- if (!glamor_egl_create_textured_pixmap_from_gbm_bo(screen_pixmap, gbm_bo)) {
+#ifdef GLAMOR_HAS_GBM
+ if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo->gbm)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed");
return FALSE;
}
- glamor_set_screen_pixmap(screen_pixmap, NULL);
#else
- if (!glamor_egl_create_textured_screen(screen,
+ if (!glamor_egl_create_textured_pixmap(pixmap,
drmmode_bo_get_handle(&drmmode->front_bo),
scrn->displayWidth *
scrn->bitsPerPixel / 8)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "glamor_egl_create_textured_screen() failed\n");
+ "glamor_egl_create_textured_pixmap() failed\n");
return FALSE;
}
#endif
@@ -1159,6 +1298,23 @@ drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode)
return TRUE;
}
+Bool
+drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode)
+{
+ ScreenPtr screen = xf86ScrnToScreen(drmmode->scrn);
+ PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
+
+ if (!drmmode_set_pixmap_bo(drmmode, screen_pixmap, &drmmode->front_bo))
+ return FALSE;
+
+#ifdef GLAMOR
+ if (drmmode->glamor)
+ glamor_set_screen_pixmap(screen_pixmap, NULL);
+#endif
+
+ return TRUE;
+}
+
static Bool
drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
{
@@ -1555,17 +1711,7 @@ drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
void *
drmmode_map_front_bo(drmmode_ptr drmmode)
{
- int ret;
-
- if (drmmode->front_bo.dumb->ptr)
- return drmmode->front_bo.dumb->ptr;
-
- ret = dumb_bo_map(drmmode->fd, drmmode->front_bo.dumb);
- if (ret)
- return NULL;
-
- return drmmode->front_bo.dumb->ptr;
-
+ return drmmode_bo_map(drmmode, &drmmode->front_bo);
}
void *
diff --git a/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.h b/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.h
index 66d0ca260..3a8959ac3 100644
--- a/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/xorg-server/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -89,10 +89,12 @@ typedef struct {
int dpms_mode;
struct dumb_bo *cursor_bo;
Bool cursor_up;
- unsigned rotate_fb_id;
uint16_t lut_r[256], lut_g[256], lut_b[256];
DamagePtr slave_damage;
+ drmmode_bo rotate_bo;
+ unsigned rotate_fb_id;
+
/**
* @{ MSC (vblank count) handling for the PRESENT extension.
*
diff --git a/xorg-server/hw/xfree86/drivers/modesetting/vblank.c b/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
index 711f6edb3..a342662a7 100644
--- a/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
+++ b/xorg-server/hw/xfree86/drivers/modesetting/vblank.c
@@ -147,20 +147,13 @@ ms_dri2_crtc_covering_drawable(DrawablePtr pDraw)
ScreenPtr pScreen = pDraw->pScreen;
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
BoxRec box, crtcbox;
- xf86CrtcPtr crtc;
box.x1 = pDraw->x;
box.y1 = pDraw->y;
box.x2 = box.x1 + pDraw->width;
box.y2 = box.y1 + pDraw->height;
- crtc = ms_covering_crtc(pScrn, &box, NULL, &crtcbox);
-
- /* Make sure the CRTC is valid and this is the real front buffer */
- if (crtc != NULL && !crtc->rotatedData)
- return crtc;
-
- return NULL;
+ return ms_covering_crtc(pScrn, &box, NULL, &crtcbox);
}
static Bool
diff --git a/xorg-server/hw/xfree86/man/Xorg.wrap.man b/xorg-server/hw/xfree86/man/Xorg.wrap.man
index 58937c74b..11090f1f4 100644
--- a/xorg-server/hw/xfree86/man/Xorg.wrap.man
+++ b/xorg-server/hw/xfree86/man/Xorg.wrap.man
@@ -33,7 +33,7 @@ Xorg.wrap \- Xorg X server binary wrapper
The Xorg X server may need root rights to function properly. To start the
Xorg X server with these rights your system is using a suid root wrapper
installed as __suid_wrapper_dir__/Xorg.wrap which will execute the real
-X server which is installed as __suid_wrapper_dir__/Xorg.bin .
+X server which is installed as __suid_wrapper_dir__/Xorg.
.PP
By default Xorg.wrap will autodetect if root rights are necessary, and
if not it will drop its elevated rights before starting the real X server.
diff --git a/xorg-server/hw/xfree86/xorg-wrapper.c b/xorg-server/hw/xfree86/xorg-wrapper.c
index 4ea47331b..22e97ad5d 100644
--- a/xorg-server/hw/xfree86/xorg-wrapper.c
+++ b/xorg-server/hw/xfree86/xorg-wrapper.c
@@ -255,18 +255,18 @@ int main(int argc, char *argv[])
}
}
- snprintf(buf, sizeof(buf), "%s/Xorg.bin", SUID_WRAPPER_DIR);
+ snprintf(buf, sizeof(buf), "%s/Xorg", SUID_WRAPPER_DIR);
/* Check if the server is executable by our real uid */
if (access(buf, X_OK) != 0) {
- fprintf(stderr, "%s: Missing execute permissions for %s/Xorg.bin: %s\n",
- progname, SUID_WRAPPER_DIR, strerror(errno));
+ fprintf(stderr, "%s: Missing execute permissions for %s: %s\n",
+ progname, buf, strerror(errno));
exit(1);
}
argv[0] = buf;
(void) execv(argv[0], argv);
- fprintf(stderr, "%s: Failed to execute %s/Xorg.bin: %s\n",
- progname, SUID_WRAPPER_DIR, strerror(errno));
+ fprintf(stderr, "%s: Failed to execute %s: %s\n",
+ progname, buf, strerror(errno));
exit(1);
}