Re: [PATCH xserver 2/2] glamor: Hide new DRI for behind Option "Debug" "dmabuf_capable"
On 28 March 2018 at 17:46, Adam Jacksonwrote: > ... for xfree86, at least for now. Things appear to work for Xwayland > but not yet for modesetting. Hopefully we can fix that before 1.20 but > in the meantime this makes testing both paths easier than a rebuild. > > Signed-off-by: Adam Jackson > --- > glamor/glamor_egl.c | 4 +++- > hw/xfree86/man/xorg.conf.man | 3 +++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c > index 2ea3efc58e..4a550932a0 100644 > --- a/glamor/glamor_egl.c > +++ b/glamor/glamor_egl.c > @@ -35,6 +35,7 @@ > #include > #include > #include > +#include > #include > #define EGL_DISPLAY_NO_X_MESA > > @@ -960,7 +961,8 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) > "EGL_EXT_image_dma_buf_import") && > epoxy_has_egl_extension(glamor_egl->display, > "EGL_EXT_image_dma_buf_import_modifiers")) > -glamor_egl->dmabuf_capable = TRUE; > +glamor_egl->dmabuf_capable = !!strstr(xf86Info.debug, > + "dmabuf_capable"); > #endif > > glamor_egl->saved_free_screen = scrn->FreeScreen; > diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man > index 46ddd0ec9c..958926243c 100644 > --- a/hw/xfree86/man/xorg.conf.man > +++ b/hw/xfree86/man/xorg.conf.man > @@ -498,6 +498,9 @@ The options recognised by this section are: > .BI "Option \*qDebug\*q \*q" string \*q > This comma-separated list provides a way to control various debugging > switches > from the config file. > +At the moment the only defined value is > +.B dmabuf_capable > +which instructs glamor to enable some unstable buffer management code. To reflect what the code does, this should be changed to something like: Adding dmabuf_capable enables multiplane BO import in glamor. The option has _no_ effect if the required EGL extensions are missing. HTH Emil ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 1/3] meson: Remove usage of pkg-config --variable=includedir
From: Thierry RedingQuerying a pkg-config variable using the --variable option produces the value of the given variable as stored in the pkg-config file and should not be used to add directories to the include search path. The reason for this is that it breaks cross-compilation, because header files are installed relative to the host sysroot. pkg-config supports a PKG_CONFIG_SYSROOT_DIR environment variable that points to this sysroot and will prepend that to the path of directories in -I or -L options in pkg-config's Cflags, Libs or Libs.private keywords. However, because no context can be inferred from variable names, as opposed to the keywords with fixed meaning, the sysroot path will not be prepended to them. The build system is responsible for doing so if necessary since it is aware of the context in which the variable is used. Adding the include directory returned by pkg-config to the include path leaks build system information into the cross-build and break with very confusing errors such as this: In file included from include/misc.h:82:0, from dix/atom.c:55: /usr/include/pthread.h:682:6: warning: '__regparm__' attribute directive ignored [-Wattributes] __cleanup_fct_attribute; ^~~ or this: In file included from include/misc.h:139:0, from dix/atom.c:55: /usr/include/stdlib.h:133:8: error: '_Float128' is not supported on this target extern _Float128 strtof128 (const char *__restrict __nptr, ^ Fix this by replacing the include directory with the appropriate xproto dependency required to add the correct include directory to the compile command for subdirectories that are missing the dependency. As detailed above, this gives pkg-config the opportunity to prepend the sysroot for all paths in -I compiler options. Signed-off-by: Thierry Reding --- meson.build| 1 - os/meson.build | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6ad98d23e10b..0582d6f9ae6b 100644 --- a/meson.build +++ b/meson.build @@ -477,7 +477,6 @@ inc = include_directories( 'randr', 'render', 'xfixes', -xproto_dep.get_pkgconfig_variable('includedir') ) glx_inc = include_directories('glx') diff --git a/os/meson.build b/os/meson.build index ff3a4615b8f2..eb8fcf55dd24 100644 --- a/os/meson.build +++ b/os/meson.build @@ -67,6 +67,9 @@ if srcs_libc.length() > 0 libxlibc = static_library('libxlibc', srcs_libc, include_directories: inc, +dependencies: [ +xproto_dep, +], ) endif -- 2.16.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 2/3] meson: Distribute more SDK headers
From: Thierry RedingInstall missing headers to the SDK directory to allow external modules to properly build against the SDK. After this commit, the list of files installed in the SDK include directory is the same as the list of files installed by the autotools-based build. Signed-off-by: Thierry Reding --- Xext/meson.build | 12 composite/meson.build | 6 ++ dbe/meson.build | 6 ++ dri3/meson.build | 6 ++ fb/meson.build| 10 ++ glx/meson.build | 6 ++ hw/xfree86/os-support/meson.build | 9 - include/meson.build | 1 + mi/meson.build| 15 +++ miext/damage/meson.build | 7 +++ miext/shadow/meson.build | 6 ++ miext/sync/meson.build| 9 + present/meson.build | 7 +++ randr/meson.build | 7 +++ render/meson.build| 9 + 15 files changed, 115 insertions(+), 1 deletion(-) diff --git a/Xext/meson.build b/Xext/meson.build index 9968f2a9e312..a7217371871d 100644 --- a/Xext/meson.build +++ b/Xext/meson.build @@ -8,12 +8,19 @@ srcs_xext = [ 'xtest.c', ] +hdrs_xext = [ +'geext.h', +'geint.h', +'syncsdk.h', +] + if build_dpms srcs_xext += 'dpms.c' endif if build_mitshm srcs_xext += 'shm.c' +hdrs_xext += ['shmint.h'] endif if build_res @@ -26,6 +33,7 @@ endif if build_xace srcs_xext += 'xace.c' +hdrs_xext += ['xace.h', 'xacestr.h'] endif if build_xf86bigfont @@ -34,6 +42,7 @@ endif if build_xinerama srcs_xext += ['panoramiX.c', 'panoramiXprocs.c', 'panoramiXSwap.c'] +hdrs_xext += ['panoramiX.h', 'panoramiXsrv.h'] endif if build_xsecurity @@ -46,6 +55,7 @@ endif if build_xv srcs_xext += ['xvmain.c', 'xvdisp.c', 'xvmc.c'] +hdrs_xext += ['xvdix.h', 'xvmcext.h'] endif libxserver_xext = static_library('libxserver_xext', @@ -59,3 +69,5 @@ libxserver_xext_vidmode = static_library('libxserver_xext_vidmode', include_directories: inc, dependencies: common_dep, ) + +install_data(hdrs_xext, install_dir: xorgsdkdir) diff --git a/composite/meson.build b/composite/meson.build index 6c4a03fb80c2..7547f0e7edce 100644 --- a/composite/meson.build +++ b/composite/meson.build @@ -6,8 +6,14 @@ srcs_composite = [ 'compwindow.c', ] +hdrs_composite = [ + 'compositeext.h', +] + libxserver_composite = static_library('libxserver_composite', srcs_composite, include_directories: inc, dependencies: common_dep, ) + +install_data(hdrs_composite, install_dir: xorgsdkdir) diff --git a/dbe/meson.build b/dbe/meson.build index e10bde19913d..76a2d3f85d2b 100644 --- a/dbe/meson.build +++ b/dbe/meson.build @@ -3,8 +3,14 @@ srcs_dbe = [ 'midbe.c', ] +hdrs_dbe = [ + 'dbestruct.h', +] + libxserver_dbe = static_library('libxserver_dbe', srcs_dbe, include_directories: inc, dependencies: common_dep, ) + +install_data(hdrs_dbe, install_dir: xorgsdkdir) diff --git a/dri3/meson.build b/dri3/meson.build index 0deec32aafbe..48ce0d9d6aa1 100644 --- a/dri3/meson.build +++ b/dri3/meson.build @@ -4,6 +4,10 @@ srcs_dri3 = [ 'dri3_screen.c', ] +hdrs_dri3 = [ + 'dri3.h', +] + libxserver_dri3 = [] if build_dri3 libxserver_dri3 = static_library('libxserver_dri3', @@ -13,3 +17,5 @@ if build_dri3 c_args: '-DHAVE_XORG_CONFIG_H' ) endif + +install_data(hdrs_dri3, install_dir: xorgsdkdir) diff --git a/fb/meson.build b/fb/meson.build index bf85141f980f..477ab047dfd6 100644 --- a/fb/meson.build +++ b/fb/meson.build @@ -28,6 +28,14 @@ srcs_fb = [ 'fbwindow.c', ] +hdrs_fb = [ + 'fb.h', + 'fboverlay.h', + 'fbpict.h', + 'fbrop.h', + 'wfbrename.h' +] + libxserver_fb = static_library('libxserver_fb', srcs_fb, include_directories: inc, @@ -45,3 +53,5 @@ libxserver_wfb = static_library('libxserver_wfb', pic: true, build_by_default: false, ) + +install_data(hdrs_fb, install_dir: xorgsdkdir) diff --git a/glx/meson.build b/glx/meson.build index 5f93a75a5143..dc7aab9625ee 100644 --- a/glx/meson.build +++ b/glx/meson.build @@ -61,6 +61,10 @@ srcs_vnd = [ 'vndservervendor.c', ] +hdrs_vnd = [ +'vndserver.h', +] + libglxvnd = '' if build_glx libglxvnd = static_library('libglxvnd', @@ -73,4 +77,6 @@ if build_glx dependency('gl', version: '>= 9.2.0'), ], ) + +install_data(hdrs_vnd, install_dir : xorgsdkdir) endif diff --git a/hw/xfree86/os-support/meson.build b/hw/xfree86/os-support/meson.build index 2b96e7e4adee..901422786586 100644 --- a/hw/xfree86/os-support/meson.build +++ b/hw/xfree86/os-support/meson.build @@ -4,6 +4,13 @@ srcs_xorg_os_support = [ 'shared/sigio.c',
[PATCH xserver 3/3] meson: Add pixman-1 to required modules in xorg-server.pc
From: Thierry Redingpixman headers will be included for builds of external modules against the xorg-server SDK. Make sure pixman is listed as a required module so that the correct CFLAGS will be added. Note that the xorg-server.pc generated by the autotools-based build has many more modules listed, but this seems to be enough to build at least some of the external drivers against an X server built with Meson (I've tested with xf86-input-libinput, xf86-video-nouveau and xf86-video-ati). Signed-off-by: Thierry Reding --- meson.build | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 0582d6f9ae6b..f9341dc9a371 100644 --- a/meson.build +++ b/meson.build @@ -624,9 +624,13 @@ if build_xorg ).stdout() ) +sdk_required_modules = [ + 'pixman-1 >= 0.27.2', +] + # XXX this isn't trying very hard, but hard enough. sdkconfig.set('PACKAGE_VERSION', meson.project_version()) -sdkconfig.set('SDK_REQUIRED_MODULES', '') +sdkconfig.set('SDK_REQUIRED_MODULES', ' '.join(sdk_required_modules)) sdkconfig.set('symbol_visibility', '-fvisibility=hidden') sdkconfig.set('XORG_DRIVER_LIBS', '') -- 2.16.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] modesetting: Fix up some XXX from removing GLAMOR_HAS_DRM_*
Hi Mario, On 29 March 2018 at 00:47, Mario Kleinerwrote: > On Thu, Mar 22, 2018 at 7:47 PM, Adam Jackson wrote: >> @@ -2244,18 +2247,19 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) >> { >> drmmode_output_private_ptr drmmode_output = output->driver_private; >> xf86CrtcPtr crtc = output->crtc; >> +modesettingPtr ms = modesettingPTR(crtc->scrn); > > --> This assignment above makes the X-Server crash, if output->crtc is > NULL, and therefore crtc->scrn is a NULL ptr deref. > output->crtc == NULL can happen from some call paths, e.g., whenever > xf86DisableUnusedFunctions() gets called and decides to dpms off an > output. Ugh. It looks like we should be able to just directly use output->scrn instead of crtc->scrn in that offending line; does that work for you? Cheers, Daniel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] modesettings: Use actual crtc position for pageflip
On 29 March 2018 at 08:42, Olivier Fourdanwrote: > Otherwise the same content is shown on all outputs. Yeah, good point. Reviewed-by: Daniel Stone ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/2] modesetting: Fix reported size when using atomic modesetting
On 29 March 2018 at 08:46, Olivier Fourdanwrote: > Looks good to me *but* this is not sufficient because > do_queue_flip_on_crtc() calls drmmode_crtc_set_fb() with (x=0,y=0) for any > CRTC regardless of its actual location... > > So, it also requires https://patchwork.freedesktop.org/series/40860/ and > with this, this patch is: > > Tested-by: Olivier Fourdan > Reviewed-by: Olivier Fourdan Reviewed-by: Daniel Stone ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 1/2] modesetting: Ignore alpha channel when importing BOs for modesetting
On 29 March 2018 at 08:43, Olivier Fourdanwrote: > Looks good to me. > > Tested-by: Olivier Fourdan > Reviewed-by: Olivier Fourdan And to me: Reviewed-by: Daniel Stone ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] modesetting: Fix page flipping under DRI 3.2.
Hi Mario, On Wed, Mar 28, 2018 at 7:42 PM, Mario Kleinerwrote: > The approach in the patch looks good to me, same as we use in weston. > I'll test in a few hours and let you know. > Can you try with Luis-Francis's series (2 patches): https://patchwork.freedesktop.org/series/40855/ Plus this one on top: https://patchwork.freedesktop.org/series/40860/ That fixes the issue for me... Cheers, Olivier ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 2/2] modesetting: Fix reported size when using atomic modesetting
On Thu, Mar 29, 2018 at 7:07 AM, Louis-Francis Ratté-Boulianne < l...@collabora.com> wrote: > The framebuffer can include multiple CRTCs in multi-monitors > setup. So we shouldn't use the buffer size but the CRTC size > instead. Rotated displays are shadowed, so we don't need to > worry about it there. > > Signed-off-by: Louis-Francis Ratté-Boulianne> --- > hw/xfree86/drivers/modesetting/drmmode_display.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c > b/hw/xfree86/drivers/modesetting/drmmode_display.c > index e010eae21..a70b4c6b4 100644 > --- a/hw/xfree86/drivers/modesetting/drmmode_display.c > +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c > @@ -562,15 +562,15 @@ drmmode_crtc_set_fb(xf86CrtcPtr crtc, > DisplayModePtr mode, uint32_t fb_id, > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_X, x > << 16); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_Y, y > << 16); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_W, > - drmmode->front_bo.width << 16); > + crtc->mode.HDisplay << 16); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_SRC_H, > - drmmode->front_bo.height << 16); > + crtc->mode.VDisplay << 16); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_X, 0); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_Y, 0); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_W, > - drmmode->front_bo.width); > + crtc->mode.HDisplay); > ret |= plane_add_prop(req, drmmode_crtc, DRMMODE_PLANE_CRTC_H, > - drmmode->front_bo.height); > + crtc->mode.VDisplay); > > if (ret == 0) > ret = drmModeAtomicCommit(ms->fd, req, flags, data); > -- > 2.14.3 > Looks good to me *but* this is not sufficient because do_queue_flip_on_crtc() calls drmmode_crtc_set_fb() with (x=0,y=0) for any CRTC regardless of its actual location... So, it also requires https://patchwork.freedesktop.org/series/40860/ and with this, this patch is: Tested-by: Olivier Fourdan Reviewed-by: Olivier Fourdan Cheers, Olivier ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 1/2] modesetting: Ignore alpha channel when importing BOs for modesetting
On Thu, Mar 29, 2018 at 7:07 AM, Louis-Francis Ratté-Boulianne < l...@collabora.com> wrote: > Fixes a regression caused by modifiers support. For some hw to > continue working even if not supporting ARGB and ARGB2101010 > formats, we assume that all imported BOs are opaque. > > Signed-off-by: Louis-Francis Ratté-Boulianne> --- > hw/xfree86/drivers/modesetting/drmmode_display.c | 20 > > 1 file changed, 20 insertions(+) > > diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c > b/hw/xfree86/drivers/modesetting/drmmode_display.c > index 47c11adce..e010eae21 100644 > --- a/hw/xfree86/drivers/modesetting/drmmode_display.c > +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c > @@ -70,12 +70,28 @@ modifiers_ptr(struct drm_format_modifier_blob *blob) > return (struct drm_format_modifier *)(((char *)blob) + > blob->modifiers_offset); > } > > +static uint32_t > +get_opaque_format(uint32_t format) > +{ > +switch (format) { > +case DRM_FORMAT_ARGB: > +return DRM_FORMAT_XRGB; > +case DRM_FORMAT_ARGB2101010: > +return DRM_FORMAT_XRGB2101010; > +default: > +return format; > +} > +} > + > Bool > drmmode_is_format_supported(ScrnInfoPtr scrn, uint32_t format, uint64_t > modifier) > { > xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); > int c, i, j; > > +/* BO are imported as opaque surface, so let's pretend there is no > alpha */ > +format = get_opaque_format(format); > + > for (c = 0; c < xf86_config->num_crtc; c++) { > xf86CrtcPtr crtc = xf86_config->crtc[c]; > drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; > @@ -123,6 +139,9 @@ get_modifiers_set(ScrnInfoPtr scrn, uint32_t format, > uint64_t **modifiers, > int c, i, j, k, count_modifiers = 0; > uint64_t *tmp, *ret = NULL; > > +/* BOs are imported as opaque surfaces, so pretend the same thing > here */ > +format = get_opaque_format(format); > + > *modifiers = NULL; > for (c = 0; c < xf86_config->num_crtc; c++) { > xf86CrtcPtr crtc = xf86_config->crtc[c]; > @@ -684,6 +703,7 @@ drmmode_bo_import(drmmode_ptr drmmode, drmmode_bo *bo, > memset(modifiers, 0, sizeof(modifiers)); > > format = gbm_bo_get_format(bo->gbm); > +format = get_opaque_format(format); > for (i = 0; i < num_fds; i++) { > handles[i] = gbm_bo_get_handle_for_plane(bo->gbm, i).u32; > strides[i] = gbm_bo_get_stride_for_plane(bo->gbm, i); > -- > 2.14.3 > > Looks good to me. Tested-by: Olivier Fourdan Reviewed-by: Olivier Fourdan ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver] modesettings: Use actual crtc position for pageflip
Otherwise the same content is shown on all outputs. Signed-off-by: Olivier Fourdan--- hw/xfree86/drivers/modesetting/pageflip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/pageflip.c b/hw/xfree86/drivers/modesetting/pageflip.c index 17a87866a..5278b1485 100644 --- a/hw/xfree86/drivers/modesetting/pageflip.c +++ b/hw/xfree86/drivers/modesetting/pageflip.c @@ -167,7 +167,7 @@ do_queue_flip_on_crtc(modesettingPtr ms, xf86CrtcPtr crtc, if (ms->atomic_modeset) { flags |= DRM_MODE_ATOMIC_NONBLOCK; -return drmmode_crtc_set_fb(crtc, NULL, ms->drmmode.fb_id, 0, 0, flags, +return drmmode_crtc_set_fb(crtc, NULL, ms->drmmode.fb_id, crtc->x, crtc->y, flags, (void *) (uintptr_t) seq); } -- 2.17.0.rc1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: X SECURITY: allowed extensions for untrusted clients
So what does it take to get this done? Should I a submit a patch adding RENDER and PRESENT to the list of allowed extensions. The other major thing we are missing is isolation of different untrusted clients. With those two changes, we could properly isolate different clients from each other. Martin Am Sonntag, den 15.10.2017, 16:46 -0700 schrieb Keith Packard: > "Uecker, Martin"writes: > > > The question is what security risks all the different extensions > > may expose. > > For things like Render and Present, they're no more serious than the > existing core protocol. I'm pretty sure we could list the extensions > which provide core-like functionality in an improved form and > separate > those from extensions which provide new functionality. > ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel