Skip to content
Commits on Source (11)
  • David Seifert's avatar
    Always use `-fno-common` in CI · 3aa754c3
    David Seifert authored and Matt Turner's avatar Matt Turner committed
    * This prevents issues from creeping back in at a later stage.
    3aa754c3
  • Pekka Paalanen's avatar
    randr: auto-bind of GPU is a config change · bfb36a58
    Pekka Paalanen authored and Michel Dänzer's avatar Michel Dänzer committed
    When a GPU is auto-bound adding more outputs to a screen, that needs to count
    as a configuration change on that screen so that a WM listening for
    RRScreenChangeNotify gets notified and handles it as a hotplug. This is
    particularly for cases where the outputs are already connected. Otherwise
    nothing might happen.
    
    Issue #909 describes a real world case where plugging in a DisplayLink dock
    with a monitor already connected is sometimes left inactive by GNOME. That
    issue is a race, and requires adding a sleep(5); as the first thing in
    NewGPUDeviceRequest() to reproduce reliably. With the sleep, the monitor in the
    dock will never activate automatically. Add this fix over the sleep, and the
    issue is gone.
    
    This fix was originally developed on a branch replicating Ubuntu 19.04 patch
    set based on xserver 1.20.4. Testing on master branch was impossible due to
    #910.
    
    Closes: #909
    
    
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    Reviewed-by: default avatarMichel Dänzer <mdaenzer@redhat.com>
    bfb36a58
  • Michel Dänzer's avatar
    modesetting: Fix build with glamor disabled · 0cb9fa79
    Michel Dänzer authored
    
    
    Fixes: cb1b1e18 "modesetting: Indirect the glamor API through
                         LoaderSymbol"
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    0cb9fa79
  • Michel Dänzer's avatar
    modesetting: Remove local variable only used with glamor enabled · 49553049
    Michel Dänzer authored
    
    
    Resulted in a build failure with -Werror:
    
    ../hw/xfree86/drivers/modesetting/drmmode_display.c: In function ‘drmmode_crtc_set_mode’:
    ../hw/xfree86/drivers/modesetting/drmmode_display.c:759:15: error: unused variable ‘screen’ [-Werror=unused-variable]
      759 |     ScreenPtr screen = crtc->scrn->pScreen;
          |               ^~~~~~
    
    Fixes: c66c548e "modesetting: Call glamor_finish from
                         drmmode_crtc_set_mode"
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    49553049
  • Michel Dänzer's avatar
    gitlab-ci: Drop "-build-and-test" job name suffix · 72ccd7f5
    Michel Dänzer authored
    
    
    It's long and kind of redundant.
    
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    72ccd7f5
  • Michel Dänzer's avatar
    gitlab-ci: Add meson build job with glamor disabled · 1310346d
    Michel Dänzer authored
    
    
    To prevent breakage with glamor disabled from creeping in again.
    
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    1310346d
  • Michel Dänzer's avatar
    Revert "xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook" · 7b33c2d3
    Michel Dänzer authored
    
    
    This reverts commit 9e85aa9c.
    
    To be replaced with a better solution.
    
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    7b33c2d3
  • Michel Dänzer's avatar
    xwayland: Split up xwl_screen_post_damage into two phases · f88d9b1f
    Michel Dänzer authored
    
    
    The first phase sets the new surface properties for all damaged
    windows, then the second phase commits all surface updates.
    
    This is preparatory for the next change, there should be no observable
    change in behaviour (other than the order of Wayland protocol
    requests).
    
    Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
    f88d9b1f
  • Michel Dänzer's avatar
    xwayland: Call glamor_block_handler from xwl_screen_post_damage · a542224e
    Michel Dänzer authored
    In between the two phases introduced by the previous change. This makes
    sure all pending drawing to the new buffers is flushed before they're
    committed to the Wayland server.
    a542224e
  • Zoltán Böszörményi's avatar
    Fix modesetting device matching through kmsdev device path · 42aaf372
    Zoltán Böszörményi authored and Adam Jackson's avatar Adam Jackson committed
    
    
    xf86platformProbeDev didn't check the device path, fix it.
    
    This is a problem when trying to set up a non-PCI device via
    explicit xorg.conf.d configuration.
    
    An USB DisplayLink device, being non-PCI was always set up
    as a GPU device assigned to screen 0 instead of a regular
    framebuffer, potentially having its own dedicated screen,
    despite such configuration as below. Only the relevant parts
    of the configuration are quoted, it's part of a larger context
    with an Intel chip that has 3 outputs:
    * DP1 connected to an LCD panel,
    * VGA1 connected to an external monitor,
    * HDMI1 unconnected and having no user visible connector
    
    Section "ServerFlags"
            Option          "AutoBindGPU" "false"
    EndSection
    
    ...
    
    Section "Device"
            Identifier      "Intel2"
            Driver          "intel"
            BusID           "PCI:0:2:0"
            Screen          2
            Option          "Monitor-HDMI1" "HDMI1"
            Option          "ZaphodHeads" "HDMI1"
    EndSection
    
    Section "Device"
            Identifier      "UDL"
            Driver          "modesetting"
            Option          "kmsdev" "/dev/dri/card0"
            #BusID          "usb:0:1.2:1.0"
            Option          "Monitor-DVI-I-1" "DVI-I-1"
            Option          "ShadowFB" "on"
            Option          "DoubleShadow" "on"
    EndSection
    
    ...
    
    Section "Screen"
            Identifier      "SCREEN2"
            Option          "AutoServerLayout" "on"
            Device          "UDL"
            GPUDevice       "Intel2"
            Monitor         "Monitor-DVI-I-1"
            SubSection      "Display"
                    Modes   "1024x768"
                    Depth   24
            EndSubSection
    EndSection
    
    Section "ServerLayout"
            Identifier      "LAYOUT"
            Option          "AutoServerLayout" "on"
            Screen          0 "SCREEN"
            Screen          1 "SCREEN1" RightOf "SCREEN"
            Screen          2 "SCREEN2" RightOf "SCREEN1"
    EndSection
    
    On the particular machine I was trying to set up an UDL device,
    I found the following structure was being used to match
    the device to a platform device while I was debugging the issue:
    
    xf86_platform_devices[0] == Intel, /dev/dri/card1, primary platform device
    xf86_platform_devices[1] == UDL, /dev/dri/card0
    
    devList[0] == "Intel0", ZaphodHeads: DP1
    devList[1] == "Intel1", ZaphodHeads: VGA1
    devList[2] == "UDL"
    devList[3] == "Intel2", ZaphodHeads: HDMI1 (intended GPU device to UDL)
    
    When xf86platformProbeDev() matched the UDL device, the BusID
    check failed in both cases of:
    * BusID "usb:0:1.2:1.0" was specified
    * Option "kmsdev" "/dev/dri/card0" was specified
    
    As a result, xf86platformProbeDev() went on to call probeSingleDevice()
    with xf86_platform_devices[0] and devList[2], resulting in the
    UDL device being set up as a GPU device assigned to the first screen
    instead of as a framebuffer on the third screen as the configuration
    specified.
    
    Checking Option "kmsdev" in code code may be a layering violation.
    But the modesetting driver is actually part of the Xorg sources
    instead of being an external driver, so he "kmsdev" path knowledge
    may be used here.
    
    Signed-off-by: default avatarBöszörményi Zoltán <zboszor@pr.hu>
    42aaf372
  • Adam Jackson's avatar
    meson: Add support for libunwind · ee9f6e20
    Adam Jackson authored
    ee9f6e20
......@@ -64,24 +64,30 @@ debian-testing:
after_script:
- ccache --show-stats
autotools-build-and-test:
autotools:
extends: .common-build-and-test
script:
- mkdir build/
- cd build/
- ../autogen.sh --prefix=/usr
- ../autogen.sh --prefix=/usr CFLAGS="-fno-common"
- make -j4 distcheck
- PIGLIT_DIR=/root/piglit XTEST_DIR=/root/xts make -j4 check
- cd ..
- .gitlab-ci/manpages-check
meson-build-and-test:
meson:
extends: .common-build-and-test
variables:
PIGLIT_DIR: /root/piglit
XTEST_DIR: /root/xts
script:
- meson -Dprefix=/usr -Dxephyr=true -Dwerror=true build/
- meson -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true $MESON_EXTRA_OPTIONS build/
- ninja -j4 -C build/ install
- ninja -j4 -C build/ test
- .gitlab-ci/manpages-check
meson-noglamor:
extends: meson
variables:
MESON_EXTRA_OPTIONS: >
-Dglamor=false
......@@ -536,12 +536,20 @@ xf86platformProbeDev(DriverPtr drvp)
/* find the main device or any device specificed in xorg.conf */
for (i = 0; i < numDevs; i++) {
const char *devpath;
/* skip inactive devices */
if (!devList[i]->active)
continue;
/* This is specific to modesetting. */
devpath = xf86FindOptionValue(devList[i]->options, "kmsdev");
for (j = 0; j < xf86_num_platform_devices; j++) {
if (devList[i]->busID && *devList[i]->busID) {
if (devpath && *devpath) {
if (strcmp(xf86_platform_devices[j].attribs->path, devpath) == 0)
break;
} else if (devList[i]->busID && *devList[i]->busID) {
if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID))
break;
}
......
......@@ -743,9 +743,17 @@ FreeRec(ScrnInfoPtr pScrn)
}
static void
bind_glamor_api(void *mod, modesettingPtr ms)
#ifdef GLAMOR_HAS_GBM
static Bool
load_glamor(ScrnInfoPtr pScrn)
{
void *mod = xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME);
modesettingPtr ms = modesettingPTR(pScrn);
if (!mod)
return FALSE;
ms->glamor.back_pixmap_from_fd = LoaderSymbolFromModule(mod, "glamor_back_pixmap_from_fd");
ms->glamor.block_handler = LoaderSymbolFromModule(mod, "glamor_block_handler");
ms->glamor.clear_pixmap = LoaderSymbolFromModule(mod, "glamor_clear_pixmap");
......@@ -763,8 +771,12 @@ bind_glamor_api(void *mod, modesettingPtr ms)
ms->glamor.supports_pixmap_import_export = LoaderSymbolFromModule(mod, "glamor_supports_pixmap_import_export");
ms->glamor.xv_init = LoaderSymbolFromModule(mod, "glamor_xv_init");
ms->glamor.egl_get_driver_name = LoaderSymbolFromModule(mod, "glamor_egl_get_driver_name");
return TRUE;
}
#endif
static void
try_enable_glamor(ScrnInfoPtr pScrn)
{
......@@ -773,7 +785,6 @@ 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;
......@@ -788,9 +799,7 @@ try_enable_glamor(ScrnInfoPtr pScrn)
return;
}
mod = xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME);
if (mod) {
bind_glamor_api(mod, ms);
if (load_glamor(pScrn)) {
if (ms->glamor.egl_init(pScrn, ms->fd)) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n");
ms->drmmode.glamor = TRUE;
......
......@@ -132,6 +132,7 @@ typedef struct _modesettingRec {
void (*UpdatePacked)(ScreenPtr, shadowBufPtr);
} shadow;
#ifdef GLAMOR_HAS_GBM
/* glamor API */
struct {
Bool (*back_pixmap_from_fd)(PixmapPtr, int, CARD16, CARD16, CARD16,
......@@ -157,7 +158,7 @@ typedef struct _modesettingRec {
XF86VideoAdaptorPtr (*xv_init)(ScreenPtr, int);
const char *(*egl_get_driver_name)(ScreenPtr);
} glamor;
#endif
} modesettingRec, *modesettingPtr;
#define glamor_finish(screen) ms->glamor.finish(screen)
......
......@@ -756,7 +756,6 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
drmmode_ptr drmmode = drmmode_crtc->drmmode;
ScreenPtr screen = crtc->scrn->pScreen;
drmModeModeInfo kmode;
int output_count = 0;
uint32_t *output_ids = NULL;
......@@ -770,7 +769,7 @@ drmmode_crtc_set_mode(xf86CrtcPtr crtc, Bool test_only)
#ifdef GLAMOR_HAS_GBM
/* Make sure any pending drawing will be visible in a new scanout buffer */
if (drmmode->glamor)
glamor_finish(screen);
glamor_finish(crtc->scrn->pScreen);
#endif
if (ms->atomic_modeset) {
......
......@@ -49,7 +49,6 @@
#include "xwayland-glamor.h"
#include "xwayland-pixmap.h"
#include "xwayland-screen.h"
#include "xwayland-window.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h"
......@@ -920,14 +919,6 @@ xwl_glamor_gbm_has_wl_interfaces(struct xwl_screen *xwl_screen)
return TRUE;
}
static void
xwl_glamor_gbm_post_damage(struct xwl_window *xwl_window, PixmapPtr pixmap,
RegionPtr region)
{
/* Make sure any pending drawing to the pixmap is flushed to the kernel */
glamor_block_handler(xwl_window->xwl_screen->screen);
}
static Bool
xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen)
{
......@@ -1120,6 +1111,5 @@ xwl_glamor_init_gbm(struct xwl_screen *xwl_screen)
xwl_screen->gbm_backend.init_egl = xwl_glamor_gbm_init_egl;
xwl_screen->gbm_backend.init_screen = xwl_glamor_gbm_init_screen;
xwl_screen->gbm_backend.get_wl_buffer_for_pixmap = xwl_glamor_gbm_get_wl_buffer_for_pixmap;
xwl_screen->gbm_backend.post_damage = xwl_glamor_gbm_post_damage;
xwl_screen->gbm_backend.is_available = TRUE;
}
......@@ -124,7 +124,8 @@ xwl_glamor_post_damage(struct xwl_window *xwl_window,
{
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region);
if (xwl_screen->egl_backend->post_damage)
xwl_screen->egl_backend->post_damage(xwl_window, pixmap, region);
}
Bool
......
......@@ -70,8 +70,10 @@ struct xwl_egl_backend {
Bool *created);
/* Called by Xwayland to perform any pre-wl_surface damage routines
* that are required by the backend to make sure any pending drawing
* operations to the pixmap will be visible to the Wayland server.
* that are required by the backend. If your backend is poorly
* designed and lacks the ability to render directly to a surface,
* you should implement blitting from the glamor pixmap to the wayland
* pixmap here. Otherwise, this callback is optional.
*/
void (*post_damage)(struct xwl_window *xwl_window,
PixmapPtr pixmap, RegionPtr region);
......
......@@ -29,6 +29,10 @@
#include <unistd.h>
#include <errno.h>
#ifdef XWL_HAS_GLAMOR
#include <glamor.h>
#endif
#include <X11/Xatom.h>
#include <micmap.h>
#include <misyncshm.h>
......@@ -273,6 +277,9 @@ static void
xwl_screen_post_damage(struct xwl_screen *xwl_screen)
{
struct xwl_window *xwl_window, *next_xwl_window;
struct xorg_list commit_window_list;
xorg_list_init(&commit_window_list);
xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
&xwl_screen->damage_window_list, link_damage) {
......@@ -290,6 +297,24 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
#endif
xwl_window_post_damage(xwl_window);
xorg_list_del(&xwl_window->link_damage);
xorg_list_append(&xwl_window->link_damage, &commit_window_list);
}
if (xorg_list_is_empty(&commit_window_list))
return;
#ifdef XWL_HAS_GLAMOR
if (xwl_screen->glamor &&
xwl_screen->egl_backend == &xwl_screen->gbm_backend) {
glamor_block_handler(xwl_screen->screen);
}
#endif
xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
&commit_window_list, link_damage) {
wl_surface_commit(xwl_window->surface);
xorg_list_del(&xwl_window->link_damage);
}
}
......
......@@ -808,10 +808,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
}
xwl_window_create_frame_callback(xwl_window);
wl_surface_commit(xwl_window->surface);
DamageEmpty(window_get_damage(xwl_window->window));
xorg_list_del(&xwl_window->link_damage);
}
Bool
......
......@@ -233,6 +233,7 @@ conf_data.set('XvExtension', build_xv)
conf_data.set('XvMCExtension', build_xvmc)
conf_data.set('HAVE_SHA1_IN_' + sha1.to_upper(), '1', description: 'Use @0@ SHA1 functions'.format(sha1))
conf_data.set('HAVE_LIBUNWIND', get_option('libunwind'))
conf_data.set('HAVE_APM', build_apm or build_acpi)
conf_data.set('HAVE_ACPI', build_acpi)
......
......@@ -639,6 +639,10 @@ if host_machine.system() == 'windows'
common_dep += socket_dep
endif
if get_option('libunwind')
common_dep += dependency('libunwind', required: true)
endif
glx_inc = include_directories('glx')
top_dir_inc = include_directories('.')
......
......@@ -121,3 +121,6 @@ option('sparkle-feed-url', type: 'string',
description: 'Feed URL for autoupdating with the Sparkle Framework (default: disabled)')
option('xpbproxy', type: 'boolean', value: false,
description: 'Build a standalone X pasteboard proxy')
option('libunwind', type: 'boolean', value: false,
description: 'Use libunwind for backtrace reporting')
/*
* Copyright © 2012 Red Hat Inc.
* Copyright 2019 DisplayLink (UK) Ltd.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
......@@ -501,6 +502,9 @@ RRProviderAutoConfigGpuScreen(ScreenPtr pScreen, ScreenPtr masterScreen)
(master_provider->capabilities & RR_Capability_SourceOutput)) {
pScrPriv->rrProviderSetOutputSource(pScreen, provider, master_provider);
RRInitPrimeSyncProps(pScreen);
masterPriv->configChanged = TRUE;
RRSetChanged(masterScreen);
}
if ((provider->capabilities & RR_Capability_SourceOffload) &&
......