[PATCH xserver 3/6] dri3: Switch get_drawable_modifiers to using stdint.
We were mixing stdint and CARD* types, causing compiler warnings on 32-bit. Just switch over to stdint, which is what we'd like the server to be using long term, anyway. Signed-off-by: Eric Anholt--- dri3/dri3.h| 6 +++--- dri3/dri3_screen.c | 4 ++-- glamor/glamor.c| 4 ++-- glamor/glamor.h| 8 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dri3/dri3.h b/dri3/dri3.h index fc76908e1878..db3f9cd23ca6 100644 --- a/dri3/dri3.h +++ b/dri3/dri3.h @@ -80,9 +80,9 @@ typedef int (*dri3_get_modifiers_proc) (ScreenPtr screen, CARD64 **modifiers); typedef int (*dri3_get_drawable_modifiers_proc) (DrawablePtr draw, - CARD32 format, - CARD32 *num_modifiers, - CARD64 **modifiers); + uint32_t format, + uint32_t *num_modifiers, + uint64_t **modifiers); typedef struct dri3_screen_info { uint32_tversion; diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c index 59abe6ed9082..80db961308a5 100644 --- a/dri3/dri3_screen.c +++ b/dri3/dri3_screen.c @@ -224,8 +224,8 @@ dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr drawable, const dri3_screen_info_rec *info = ds->info; int i, j; int ret; -CARD32 num_drawable_mods; -CARD64 *drawable_mods; +uint32_tnum_drawable_mods; +uint64_t *drawable_mods; CARD64 *intersect_mods = NULL; CARD64 *screen_mods = NULL; CARD32 format; diff --git a/glamor/glamor.c b/glamor/glamor.c index acc7de9403ac..86935ed98697 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -803,8 +803,8 @@ glamor_set_drawable_modifiers_func(ScreenPtr screen, } _X_EXPORT Bool -glamor_get_drawable_modifiers(DrawablePtr draw, CARD32 format, - CARD32 *num_modifiers, uint64_t **modifiers) +glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) { struct glamor_screen_private *glamor_priv = glamor_get_screen_private(draw->pScreen); diff --git a/glamor/glamor.h b/glamor/glamor.h index 5d065909936e..b3c6d22b4c24 100644 --- a/glamor/glamor.h +++ b/glamor/glamor.h @@ -61,8 +61,8 @@ typedef enum glamor_pixmap_type { } glamor_pixmap_type_t; typedef Bool (*GetDrawableModifiersFuncPtr) (DrawablePtr draw, - CARD32 format, - CARD32 *num_modifiers, + uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers); #define GLAMOR_EGL_EXTERNAL_BUFFER 3 @@ -323,8 +323,8 @@ extern _X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen, uint64_t **modifiers); extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw, -CARD32 format, -CARD32 *num_modifiers, +uint32_t format, +uint32_t *num_modifiers, uint64_t **modifiers); extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen, -- 2.17.0 ___ 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/6] randr: Fix a compiler warning on 32-bit.
Signed-off-by: Eric Anholt--- randr/rrprovider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randr/rrprovider.c b/randr/rrprovider.c index e4bc2bf6a786..c430f74770c2 100644 --- a/randr/rrprovider.c +++ b/randr/rrprovider.c @@ -276,7 +276,7 @@ RRInitPrimeSyncProps(ScreenPtr pScreen) Atom syncProp = MakeAtom(syncStr, strlen(syncStr), TRUE); int defaultVal = TRUE; -int validVals[2] = {FALSE, TRUE}; +INT32 validVals[2] = {FALSE, TRUE}; int i; for (i = 0; i < pScrPriv->numOutputs; i++) { -- 2.17.0 ___ 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 5/6] dri3: Switch fds_from_pixmap to stdint types.
Again, this was causing 32-bit build warnings due to mixing CARD* and stdint. Signed-off-by: Eric Anholt--- dri3/dri3.h| 6 +++--- dri3/dri3_priv.h | 4 ++-- dri3/dri3_screen.c | 10 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dri3/dri3.h b/dri3/dri3.h index 30433dc4f50b..02d3b03eecf0 100644 --- a/dri3/dri3.h +++ b/dri3/dri3.h @@ -66,9 +66,9 @@ typedef int (*dri3_fd_from_pixmap_proc) (ScreenPtr screen, typedef int (*dri3_fds_from_pixmap_proc) (ScreenPtr screen, PixmapPtr pixmap, int *fds, - CARD32 *strides, - CARD32 *offsets, - CARD64 *modifier); + uint32_t *strides, + uint32_t *offsets, + uint64_t *modifier); typedef int (*dri3_get_formats_proc) (ScreenPtr screen, CARD32 *num_formats, diff --git a/dri3/dri3_priv.h b/dri3/dri3_priv.h index 168b87cbb4b3..b087a9529e07 100644 --- a/dri3/dri3_priv.h +++ b/dri3/dri3_priv.h @@ -90,8 +90,8 @@ dri3_fd_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size); int dri3_fds_from_pixmap(PixmapPtr pixmap, int *fds, - CARD32 *strides, CARD32 *offsets, - CARD64 *modifier); + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier); int dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr drawable, diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c index a900f261da46..b98259753780 100644 --- a/dri3/dri3_screen.c +++ b/dri3/dri3_screen.c @@ -82,8 +82,8 @@ dri3_pixmap_from_fds(PixmapPtr *ppixmap, ScreenPtr screen, int dri3_fds_from_pixmap(PixmapPtr pixmap, int *fds, - CARD32 *strides, CARD32 *offsets, - CARD64 *modifier) + uint32_t *strides, uint32_t *offsets, + uint64_t *modifier) { ScreenPtr screen = pixmap->drawable.pScreen; dri3_screen_priv_ptrds = dri3_screen_priv(screen); @@ -118,9 +118,9 @@ dri3_fd_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) ScreenPtr screen = pixmap->drawable.pScreen; dri3_screen_priv_ptrds = dri3_screen_priv(screen); const dri3_screen_info_rec *info = ds->info; -CARD32 strides[4]; -CARD32 offsets[4]; -CARD64 modifier; +uint32_tstrides[4]; +uint32_toffsets[4]; +uint64_tmodifier; int fds[4]; int num_fds; -- 2.17.0 ___ 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 6/6] xwayland: Fix a 32-bit build warning.
Signed-off-by: Eric Anholt--- hw/xwayland/xwayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index f7e2ce931258..87d9ba22c22f 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -975,7 +975,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) else if (strcmp(argv[i], "-listen") == 0) { if (xwl_screen->listen_fd_count == ARRAY_SIZE(xwl_screen->listen_fds)) -FatalError("Too many -listen arguments given, max is %ld\n", +FatalError("Too many -listen arguments given, max is %zu\n", ARRAY_SIZE(xwl_screen->listen_fds)); xwl_screen->listen_fds[xwl_screen->listen_fd_count++] = -- 2.17.0 ___ 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/6] dix: Fix a warning about GetTimeInMillis return value in XFont2.
Signed-off-by: Eric Anholt--- dix/dixfonts.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index cca92ed2791c..0ea8678bbe03 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -2015,6 +2015,11 @@ _remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handle RemoveFontWakeup(fpe); } +static uint32_t wrap_time_in_millis(void) +{ +return GetTimeInMillis(); +} + static const xfont2_client_funcs_rec xfont2_client_funcs = { .version = XFONT2_CLIENT_FUNCS_VERSION, .client_auth_generation = _client_auth_generation, @@ -2025,7 +2030,7 @@ static const xfont2_client_funcs_rec xfont2_client_funcs = { .get_client_resolutions = get_client_resolutions, .get_default_point_size = get_default_point_size, .get_new_font_client_id = get_new_font_client_id, -.get_time_in_millis = GetTimeInMillis, +.get_time_in_millis = wrap_time_in_millis, .init_fs_handlers = _init_fs_handlers, .register_fpe_funcs = register_fpe_funcs, .remove_fs_handlers = _remove_fs_handlers, -- 2.17.0 ___ 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 4/6] dri3: Switch get_modifiers to using stdint.
We were mixing stdint and CARD* types, causing compiler warnings on 32-bit. Just switch over to stdint, which is what we'd like the server to be using long term, anyway. --- dri3/dri3.h | 6 +++--- dri3/dri3_screen.c| 4 ++-- glamor/glamor.h | 4 ++-- glamor/glamor_egl.c | 4 ++-- hw/xwayland/xwayland-glamor-gbm.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dri3/dri3.h b/dri3/dri3.h index db3f9cd23ca6..30433dc4f50b 100644 --- a/dri3/dri3.h +++ b/dri3/dri3.h @@ -75,9 +75,9 @@ typedef int (*dri3_get_formats_proc) (ScreenPtr screen, CARD32 **formats); typedef int (*dri3_get_modifiers_proc) (ScreenPtr screen, -CARD32 format, -CARD32 *num_modifiers, -CARD64 **modifiers); +uint32_t format, +uint32_t *num_modifiers, +uint64_t **modifiers); typedef int (*dri3_get_drawable_modifiers_proc) (DrawablePtr draw, uint32_t format, diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c index 80db961308a5..a900f261da46 100644 --- a/dri3/dri3_screen.c +++ b/dri3/dri3_screen.c @@ -160,8 +160,8 @@ cache_formats_and_modifiers(ScreenPtr screen) const dri3_screen_info_rec *info = ds->info; CARD32 num_formats; CARD32 *formats; -CARD32 num_modifiers; -CARD64 *modifiers; +uint32_tnum_modifiers; +uint64_t *modifiers; int i; if (ds->formats_cached) diff --git a/glamor/glamor.h b/glamor/glamor.h index b3c6d22b4c24..06e11506f2ad 100644 --- a/glamor/glamor.h +++ b/glamor/glamor.h @@ -318,8 +318,8 @@ extern _X_EXPORT Bool glamor_get_formats(ScreenPtr screen, CARD32 **formats); extern _X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen, - CARD32 format, - CARD32 *num_modifiers, + uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers); extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw, diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index c38b02e2b8a6..123e9f28d496 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -629,8 +629,8 @@ glamor_get_formats(ScreenPtr screen, } _X_EXPORT Bool -glamor_get_modifiers(ScreenPtr screen, CARD32 format, - CARD32 *num_modifiers, uint64_t **modifiers) +glamor_get_modifiers(ScreenPtr screen, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) { #ifdef GLAMOR_HAS_EGL_QUERY_DMABUF struct glamor_egl_screen_private *glamor_egl; diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c index 4f7062599d04..29325adacb10 100644 --- a/hw/xwayland/xwayland-glamor-gbm.c +++ b/hw/xwayland/xwayland-glamor-gbm.c @@ -546,8 +546,8 @@ glamor_get_formats(ScreenPtr screen, } _X_EXPORT Bool -glamor_get_modifiers(ScreenPtr screen, CARD32 format, - CARD32 *num_modifiers, uint64_t **modifiers) +glamor_get_modifiers(ScreenPtr screen, uint32_t format, + uint32_t *num_modifiers, uint64_t **modifiers) { struct xwl_screen *xwl_screen = xwl_screen_get(screen); struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); -- 2.17.0 ___ 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 4/4] man: Fix automake seddery
On 05/ 7/18 02:21 PM, Adam Jackson wrote: > Because this is an automakefile, things inside @@ get expanded, which > means your sed ends up saying s|/var/log|/var/log| and your manual pages > still have @logdir@ in them. Fix this by hiding the @s inside a trivial > character range, which keeps the pattern preserved all the way into the > Makefile. I guess that's why we used __ until meson made us change to @... Reviewed-by: Alan Coopersmith-- -Alan Coopersmith- alan.coopersm...@oracle.com Oracle Solaris Engineering - https://blogs.oracle.com/alanc ___ 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/4] present: Fix swapping of PresentCompleteNotify events
On 05/ 7/18 02:21 PM, Adam Jackson wrote: > The code would fall through to the PresentIdleNotify case, and nothing > good would come of it. > > Signed-off-by: Adam Jackson> --- > present/present_event.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/present/present_event.c b/present/present_event.c > index c222dd5ffe..9aebfdfced 100644 > --- a/present/present_event.c > +++ b/present/present_event.c > @@ -91,6 +91,7 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) > swapl(>serial); > swapll(>ust); > swapll(>msc); > +break; > } > case PresentIdleNotify: > { > @@ -99,6 +100,7 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) > swapl(>window); > swapl(>serial); > swapl(>idle_fence); > +break; > } > } > } > Reviewed-by: Alan Coopersmith -- -Alan Coopersmith- alan.coopersm...@oracle.com Oracle Solaris Engineering - https://blogs.oracle.com/alanc ___ 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 app/xrandr] Fix checking for valid argument of --dpi
Hello, can you review my patch below? On Thursday 12 April 2018 20:52:21 Pali Rohár wrote: > Function strtod() sets strtod_error to the pointer of the first invalid > character and therefore it does not have to be first character from input. > When input is valid then it points to nul byte. Conversion error is > indicated by setted errno. Zero-length argument and zero DPI is invalid > too. > > Update also error message about invalid argument. > > Signed-off-by: Pali Rohár> --- > xrandr.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/xrandr.c b/xrandr.c > index 7f1e867..1960bbf 100644 > --- a/xrandr.c > +++ b/xrandr.c > @@ -3115,9 +3115,10 @@ main (int argc, char **argv) > } > if (!strcmp ("--dpi", argv[i])) { > char *strtod_error; > - if (++i >= argc) argerr ("%s requires an argument\n", argv[i-1]); > + if (++i >= argc || !argv[i][0]) argerr ("%s requires an > argument\n", argv[i-1]); > + errno = 0; > dpi = strtod(argv[i], _error); > - if (argv[i] == strtod_error) > + if (*strtod_error || errno || dpi == 0) > { > dpi = 0.0; > dpi_output_name = argv[i]; > @@ -3567,7 +3568,7 @@ main (int argc, char **argv) > XRROutputInfo *output_info; > XRRModeInfo *mode_info; > if (!dpi_output) > - fatal ("Cannot find output %s\n", dpi_output_name); > + fatal ("%s is not valid DPI nor valid output\n", > dpi_output_name); > output_info = dpi_output->output_info; > mode_info = dpi_output->mode_info; > if (output_info && mode_info && output_info->mm_height) -- Pali Rohár pali.ro...@gmail.com signature.asc Description: PGP signature ___ 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 app/xdpyinfo v4] Use XRANDR 1.2 extension for reporting dimensions and resolution per output
XServer with enabled XRANDR 1.2 extension does not provide correct dimensions from DisplayWidthMM() and DisplayHeightMM() calls anymore. Values are calculated from fixed DPI 96. Therefore when XRANDR 1.2 extension is enabled, present and user requested for it, instead use XRRGetScreenResources() and XRRGetOutputInfo() calls to get correct dimensions and resolution information. Core dimensions from DisplayWidthMM() and DisplayHeightMM() are still reported. Otherwise when XRANDR 1.2 extension is enabled, present and user did not request for it (which is default), show note that printed dimension does not have to be correct and instruct user to run xdpyinfo with -ext RANDR. Also update manual page and add information that xdpyinfo does not provide correct information about DPI. Signed-off-by: Pali Rohár--- Changes since v3: * Always show core x screen output Changes since v2: * Fixed dimensions calculation when rotation is active * Show XRANDR output only when explicitly requested * Update manpage Changes since v1: * Fixed detection of presence of XRANDR 1.2 * Fixed resolution calculation when dimensions are zero --- Makefile.am | 2 + configure.ac | 12 ++ man/xdpyinfo.man | 7 +++ xdpyinfo.c | 129 ++- 4 files changed, 140 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index 2f21dda..496094e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,6 +35,7 @@ AM_CFLAGS = \ $(DPY_XCOMPOSITE_CFLAGS) \ $(DPY_XINERAMA_CFLAGS) \ $(DPY_DMX_CFLAGS) \ + $(DPY_XRANDR_CFLAGS) \ $(DPY_XTST_CFLAGS) xdpyinfo_LDADD = \ @@ -49,6 +50,7 @@ xdpyinfo_LDADD = \ $(DPY_XCOMPOSITE_LIBS) \ $(DPY_XINERAMA_LIBS) \ $(DPY_DMX_LIBS) \ + $(DPY_XRANDR_LIBS) \ $(DPY_XTST_LIBS) xdpyinfo_SOURCES = \ diff --git a/configure.ac b/configure.ac index 73dce26..4473faa 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,18 @@ else echo "without dmx" fi +AC_ARG_WITH(xrandr, AS_HELP_STRING([--without-xrandr],[Disable xrandr 1.2 support.]), + [USE_XRANDR="$withval"], [USE_XRANDR="yes"]) +if test "x$USE_XRANDR" != "xno" ; then + PKG_CHECK_MODULES(DPY_XRANDR, xrandr >= 1.2, + [SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $DPY_XRANDR_CFLAGS $DPY_X11_CFLAGS" + AC_CHECK_HEADERS([X11/extensions/Xrandr.h],,,[#include ]) + CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"]) +else + echo "without xrandr 1.2" +fi + PKG_CHECK_MODULES(DPY_XTST, xtst, [SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $DPY_XTST_CFLAGS $DPY_X11_CFLAGS" diff --git a/man/xdpyinfo.man b/man/xdpyinfo.man index c3d5c6d..5df44ea 100644 --- a/man/xdpyinfo.man +++ b/man/xdpyinfo.man @@ -51,6 +51,13 @@ Detailed information about a particular extension is displayed with the \fBall\fP, information about all extensions supported by both \fIxdpyinfo\fP and the server is displayed. .PP +Do not use this utility for determining dimensions of monitor when XRANDR 1.2+ +extension is enabled for X screen, because it does not provide them. For +determining physical dimensions or DPI of particular monitor use either +.IR xrandr (__appmansuffix__) +utility or call xdpyinfo with parameter \fB\-ext RANDR\fP (supported since +xdpyinfo version 1.3.3). +.PP If \fB-version\fP is specified, xdpyinfo prints its version and exits, without contacting the X server. .SH ENVIRONMENT diff --git a/xdpyinfo.c b/xdpyinfo.c index 152e32c..8d24b40 100644 --- a/xdpyinfo.c +++ b/xdpyinfo.c @@ -76,6 +76,10 @@ in this Software without prior written authorization from The Open Group. # define DMX # endif +# if HAVE_X11_EXTENSIONS_XRANDR_H +# define XRANDR +# endif + #endif #ifdef WIN32 @@ -137,6 +141,9 @@ in this Software without prior written authorization from The Open Group. #ifdef DMX #include #endif +#ifdef XRANDR +#include +#endif #include #include #include @@ -442,6 +449,10 @@ print_visual_info(XVisualInfo *vip) vip->bits_per_rgb); } +#ifdef XRANDR +static Bool print_xrandr = False; +#endif + static void print_screen_info(Display *dpy, int scr) { @@ -455,6 +466,14 @@ print_screen_info(Display *dpy, int scr) double xres, yres; int ndepths = 0, *depths = NULL; unsigned int width, height; +Bool has_xrandr = False; +#ifdef XRANDR +int event_base, error_base; +int major, minor; +XRRScreenResources *res; +XRROutputInfo *output; +XRRCrtcInfo *crtc; +#endif /* * there are 2.54 centimeters to an inch; so there are 25.4 millimeters. @@ -464,18 +483,93 @@ print_screen_info(Display *dpy, int scr) * = N * 25.4 pixels / M inch */ -xres = double) DisplayWidth(dpy,scr)) * 25.4) / - ((double) DisplayWidthMM(dpy,scr))); -yres = double) DisplayHeight(dpy,scr)) * 25.4) / -
Re: [PATCH app/xdpyinfo v3] Use XRANDR 1.2 extension for reporting dimensions and resolution per output
On Wednesday 18 April 2018 15:45:20 Giuseppe Bilotta wrote: > On Wed, Apr 18, 2018 at 3:33 PM, Pali Rohárwrote: > > On Thursday 12 April 2018 16:34:15 Adam Jackson wrote: > >> This should print the RANDR data in a separate stanza after the main > >> output, like the other extensions do. Again: the purpose of the core of > >> xdpyinfo is to tell you what the connection block says. Don't make it > >> print something else. > > > > This patch does not change anything in the output when command line > > option for RANDR is not used. Therefore you would get same output as > > before (without applying patch). > > > > And when RANDR is explicitly requested then it outputs correct dimension > > information. Yes, it hides what is reported by connection block, but the > > main problem is that this tools is not already used like you said. Users > > and also scripts expects that they would get correct monitor/output > > dimension from xdpyinfo and not something which do not match with their > > physical monitor device. > > > > As Giuseppe said, this seems like a good compromise. When no parameter > > is specified then xdpyinfo reports exactly same data as without this > > patch. And with this patch which adds support for optional RANDR > > parameter, then it reports dimensions for each monitor/output correctly. > > So users would see what they are already expecting and want. > > > No, in the RANDR case you are still replacing the core output, which > is not what I suggested. Instead, the RANDR information should be > provided _separately_ and _in addition to_ the core output. So instead > of defining a useless print_none_info, put the RANDR code in > print_randr_info and add _that_ to the known_extensions array. Ok. I will put both core and randr information into output. But still I think that those dimension information should be at one place and not separated to different parts. It is also hard to find them when reading output or parse. -- Pali Rohár pali.ro...@gmail.com signature.asc Description: PGP signature ___ 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 3/4] glx: Be sure to set an error for ghost contexts
Otherwise the caller is going to return garbage memory for the error value. Signed-off-by: Adam Jackson--- glx/glxcmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 6785e9db38..54d452e587 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -137,8 +137,10 @@ validGlxContext(ClientPtr client, XID id, int access_mode, __GLXcontext ** context, int *err) { /* no ghost contexts */ -if (id & SERVER_BIT) +if (id & SERVER_BIT) { +*err = __glXError(GLXBadContext); return FALSE; +} *err = dixLookupResourceByType((void **) context, id, __glXContextRes, client, access_mode); -- 2.17.0 ___ 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 4/4] man: Fix automake seddery
Because this is an automakefile, things inside @@ get expanded, which means your sed ends up saying s|/var/log|/var/log| and your manual pages still have @logdir@ in them. Fix this by hiding the @s inside a trivial character range, which keeps the pattern preserved all the way into the Makefile. Signed-off-by: Adam Jackson--- manpages.am | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/manpages.am b/manpages.am index 8a36b0c1c0..15056905c2 100644 --- a/manpages.am +++ b/manpages.am @@ -34,21 +34,21 @@ MAN_SUBSTS += -e 's|@vendorversion@|"$(PACKAGE_STRING)" "$(XORG_MAN_PAGE)"|' \ # Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS # 's|/,|/, |g' will add a space to help font path formatting -MAN_SUBSTS += -e 's|@logdir@|$(logdir)|g' \ - -e 's|@datadir@|$(datadir)|g' \ - -e 's|@mandir@|$(mandir)|g' \ - -e 's|@sysconfdir@|$(sysconfdir)|g' \ - -e 's|@xconfigdir@|$(XCONFIGDIR)|g' \ - -e 's|@xkbdir@|$(XKB_BASE_DIRECTORY)|g' \ - -e 's|@XKB_DFLT_RULES@|$(XKB_DFLT_RULES)|g' \ - -e 's|@XKB_DFLT_MODEL@|$(XKB_DFLT_MODEL)|g' \ - -e 's|@XKB_DFLT_LAYOUT@|$(XKB_DFLT_LAYOUT)|g' \ - -e 's|@XKB_DFLT_VARIANT@|$(XKB_DFLT_VARIANT)|g' \ - -e 's|@XKB_DFLT_OPTIONS@|$(XKB_DFLT_OPTIONS)|g' \ - -e 's|@bundle_id_prefix@|$(BUNDLE_ID_PREFIX)|g' \ - -e 's|@modulepath@|$(DEFAULT_MODULE_PATH)|g' \ - -e 's|@suid_wrapper_dir@|$(SUID_WRAPPER_DIR)|g' \ - -e 's|@default_font_path@|$(COMPILEDDEFAULTFONTPATH)|g' \ +MAN_SUBSTS += -e 's|[@]logdir[@]|$(logdir)|g' \ + -e 's|[@]datadir[@]|$(datadir)|g' \ + -e 's|[@]mandir[@]|$(mandir)|g' \ + -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ + -e 's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' \ + -e 's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' \ + -e 's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' \ + -e 's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' \ + -e 's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' \ + -e 's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' \ + -e 's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' \ + -e 's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' \ + -e 's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' \ + -e 's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' \ + -e 's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' \ -e '\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g' .man.$(APP_MAN_SUFFIX): -- 2.17.0 ___ 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/4] xwayland: Don't create a "fake" crtc for Present
We probably don't want a fake crtc to be visible to clients, and we definitely don't want to generate events every time we create such a fake (which would happen as a side effect from RRCrtcCreate hitting RRTellChanged). As it happens we're not actually using that crtc for anything because xwayland doesn't store any state on the crtc object, so it suffices to use the real crtc for the screen. Signed-off-by: Adam Jackson--- hw/xwayland/xwayland-present.c | 21 - hw/xwayland/xwayland.h | 1 - 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c index ae9f47ebae..b5ae80dcf0 100644 --- a/hw/xwayland/xwayland-present.c +++ b/hw/xwayland/xwayland-present.c @@ -51,14 +51,10 @@ xwl_present_window_get_priv(WindowPtr window) struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window); if (xwl_present_window == NULL) { -ScreenPtr screen = window->drawable.pScreen; - xwl_present_window = calloc (1, sizeof (struct xwl_present_window)); if (!xwl_present_window) return NULL; -xwl_present_window->crtc_fake = RRCrtcCreate(screen, - xwl_present_window); xwl_present_window->window = window; xwl_present_window->msc = 1; xwl_present_window->ust = GetTimeInMicros(); @@ -131,8 +127,6 @@ xwl_present_cleanup(WindowPtr window) if (xwl_window && xwl_window->present_window == window) xwl_window->present_window = NULL; -RRCrtcDestroy(xwl_present_window->crtc_fake); - if (xwl_present_window->frame_callback) { wl_callback_destroy(xwl_present_window->frame_callback); xwl_present_window->frame_callback = NULL; @@ -306,10 +300,13 @@ static RRCrtcPtr xwl_present_get_crtc(WindowPtr present_window) { struct xwl_present_window *xwl_present_window = xwl_present_window_get_priv(present_window); +rrScrPrivPtr rr_private; + if (xwl_present_window == NULL) return NULL; -return xwl_present_window->crtc_fake; +rr_private = rrGetScrPriv(present_window->drawable.pScreen); +return rr_private->crtcs[0]; } static int @@ -342,9 +339,6 @@ xwl_present_queue_vblank(WindowPtr present_window, if (!xwl_window) return BadMatch; -if (xwl_present_window->crtc_fake != crtc) -return BadRequest; - if (xwl_window->present_window && xwl_window->present_window != present_window) return BadMatch; @@ -454,13 +448,6 @@ xwl_present_flip(WindowPtr present_window, if (!xwl_window) return FALSE; -/* - * Make sure the client doesn't try to flip to another crtc - * than the one created for 'xwl_window'. - */ -if (xwl_present_window->crtc_fake != crtc) -return FALSE; - present_box = RegionExtents(_window->winSize); damage_box = RegionExtents(damage); diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index ce290d4909..25112e2cb8 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -182,7 +182,6 @@ struct xwl_present_window { WindowPtr window; struct xorg_list link; -RRCrtcPtr crtc_fake; uint64_t msc; uint64_t ust; -- 2.17.0 ___ 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/4] present: Fix swapping of PresentCompleteNotify events
The code would fall through to the PresentIdleNotify case, and nothing good would come of it. Signed-off-by: Adam Jackson--- present/present_event.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/present/present_event.c b/present/present_event.c index c222dd5ffe..9aebfdfced 100644 --- a/present/present_event.c +++ b/present/present_event.c @@ -91,6 +91,7 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) swapl(>serial); swapll(>ust); swapll(>msc); +break; } case PresentIdleNotify: { @@ -99,6 +100,7 @@ present_event_swap(xGenericEvent *from, xGenericEvent *to) swapl(>window); swapl(>serial); swapl(>idle_fence); +break; } } } -- 2.17.0 ___ 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 0/4] Final cleanups and polish
1/4 is the only vaguely contentious one, the rest should all be obviously correct. - ajax ___ 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: [RFC xserver] xwayland: persistent window struct on present
On Fri, 2018-05-04 at 03:07 +0200, Roman Gilg wrote: > Instead of reusing xwl_window introduce a persistent window struct for every > window, that asks for Present flips. > > This struct saves all relevant data and is only freed on window destroy. > > Signed-off-by: Roman GilgMerged, thanks: remote: I: patch #220276 updated using rev cf838f5ca81e0c967902b74fb1971bc6fac5c601. remote: I: 1 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/xserver c9afd8cb5e..cf838f5ca8 master -> master - ajax ___ 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 and improve ms_kernel_msc_to_crtc_msc()
On Sun, 2018-05-06 at 07:34 +0200, Mario Kleiner wrote: > The old 32-Bit wraparound handling didn't actually work, > due to some integer casting bug, and the mapping was ill > equipped to deal with input from the new true 64-bit > GetCrtcSequence/QueueCrtcSequence api's introduced in Linux > 4.15. > > For 32-Bit truncated input from pageflip events and old vblank > events and old drmWaitVblank ioctl, implement new wraparound > handling, which also allows to deal with wraparound in the other > direction, e.g., if a 32-Bit truncated sequence value is passed > in, whose true 64-Bit in-kernel hw value is within 2^30 counts > of the previous processed value, but whose 32-bit truncated > sequence value happens to lie just above or below a 2^32 > boundary, iow. one of the two values 'sequence' vs. 'msc_prev' > lies above a 2^32 border, the other one below it. > > The method is directly translated from Mesa's proven implementation > of the INTEL_swap_events extension, where a true underlying > 64-Bit wide swapbuffers count (SBC) needs to get reconstructed > from a 32-Bit LSB truncated SBC transported over the X11 protocol > wire. Same conditions apply, ie. successive true 64-Bit SBC > values are close to each other, but don't always get received > in strictly monotonically increasing order. See Mesa commit > cc5ddd584d17abd422ae4d8e83805969485740d9 ("glx: Handle > out-of-sequence swap completion events correctly. (v2)") for > explanation. > > Additionally add a separate path for true 64-bit msc input > originating from Linux 4.15+ drmCrtcGetSequence/QueueSequence > ioctl's and corresponding 64-bit vblank events. True 64-bit > msc's don't need remapping and must be passed through. > > As a reliability bonus, they are also used here to update the > tracking values msc_prev and ms_high with perfect 64-Bit ground > truth as baseline for mapping msc from pageflip completion events, > because pageflip events are always 32-bit wide, even when the new > kernel api's are used. Because each pageflip(-event) is always > preceeded close in time (and vblank count) by a drmCrtcQueueSequence > queued event or drmCrtcGetSequence query as part of DRI2 or DRI3+Present > swap scheduling, we can be certain that each pageflip event will get > its truncated 32-bit msc remapped reliably to the true 64-bit msc of > flip completion whenever the sequence api is available, ie. on Linux > 4.15 or later. > > Note: In principle at least the 32-bit mapping path could also > be backported to earlier server branches, as this seems to be > broken for at least server 1.16 to 1.19. A tiny nit: > int > ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc) > { > +ScreenPtr screen = crtc->randr_crtc->pScreen; > +ScrnInfoPtr scrn = xf86ScreenToScrn(screen); > +modesettingPtr ms = modesettingPTR(scrn); This could almost certainly be: modesettingPtr ms = modesettingPTR(crtc->scrn); But it hardly matters. The rest looks good, merged, thanks: remote: I: patch #220897 updated using rev c9afd8cb5ec975b189ab7b678e1f997d6a2ba5ee. remote: I: 1 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/xserver 73f0ed2d92..c9afd8cb5e master -> master - ajax ___ 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: Remove ms_crtc_msc_to_kernel_msc().
On Fri, 2018-05-04 at 14:14 +0200, Mario Kleiner wrote: > The function is ported from intel-ddx uxa backend around > 2013, where its stated purpose was to apply a vblank_offset > to msc values to correct for problems with those kernel > provided msc values. Some (somewhat magic and puzzling to > myself) heuristic tried to guess if provided values were > unreasonable and tried to adapt the corrective vblank_offset > to account for that. > > Except: It wasn't applied to kernel provided msc values, > but the values delivered by clients via DRI2 or Present, > so valid client targetmsc values, e.g., requesting a vblank > event > 1000 vblanks in the future, triggered the offset > correction in arbitrarily wrong ways, leading to wrong msc > values being returned and thereby vblank events queued to > the kernel for the wrong time. This causes glXSwapBuffersMscOML > and glXWaitForMscOML to swap / return immediately whenever a > swap/wait in > 1000 vblanks is requested. > > The original code was also written to only deal with 32 bit mscs, > but server 1.20 modesetting ddx can now use new Linux 4.15+ kernel > vblank api to process true 64 bit msc's, which may confuse the > heuristic even more due to 32 bit integer truncation/wrapping. > > This code caused various problems in the intel-ddx in the > past since year 2013, and was removed there in 2015 by Chris > Wilson in commit 42ebe2ef9646be5c4586868cf332b4cd79bb4618: > > "uxa: Remove the filtering of bogus Present MSC values > > If the intention was to filter the return values from the kernel, the > filtering would have been applied to the kernel values and not to the > incoming values from Present. This filtering introduces crazy integer > promotion and truncation bugs all because Present feeds garbage into its > vblank requests. > > " > > Indeed, i found a Mesa bug yesterday which can cause Mesa's > PresentPixmap request to spuriously feed garbage targetMSC's > into the driver under some conditions. However, while other > video drivers seem to cope relatively well with that, modesetting > ddx causes KDE-5's plasmashell to lock up badly quite frequently, > and my suspicion is that the code removed in this commit is one > major source of the extra fragility. > > Also my own tests fail for any swap scheduled more than 1000 > vblanks into the future, which is not uncommon for some scientific > applications. > > Iow. modesetting's swap scheduling seems to be more robust without > this function afaics. > > Signed-off-by: Mario Kleiner> Cc: Chris Wilson > Cc: Keith Packard > Cc: Adam Jackson Fixing things by deleting them! The best kind of patch. Merged, thanks: remote: I: patch #220463 updated using rev 73f0ed2d928afc692ed057eb3d7627328a6e5b12. remote: I: 1 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/xserver f5ded22e14..73f0ed2d92 master -> master - ajax ___ 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] meson: Set XCONFIGFILE to 'xorg.conf' instead of '/etc/xorg.conf'
On Sat, 2018-05-05 at 00:48 +0200, Thierry Reding wrote: > On Fri, May 04, 2018 at 10:48:17AM -0700, Aaron Plattner wrote: > > The autoconf build hard-codes XCONFIGFILE to just 'xorg.conf': > > > > XF86CONFIGFILE="xorg.conf" > > AC_DEFINE_DIR(XCONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) > > > > Later, the X server passes that into DoSubstitution() which expands the > > path: > > > > DoSubstitution(template="/etc/X11/%X", ..., XConfigFile="xorg.conf") > > > > This returns "/etc/X11/xorg.conf". > > > > The Meson build, on the other hand, sets XCONFIGFILE to > > join_paths(get_option('sysconfdir'), 'xorg.conf'). If sysconfdir is /etc, > > this > > results in '/etc/xorg.conf', resulting in DoSubstitution returning > > '/etc/X11/etc/xorg.conf'. > > > > Fix this by just hard-coding XCONFIGFILE to 'xorg.conf'. > > > > Signed-off-by: Aaron Plattner> > --- > > include/meson.build | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > Reviewed-by: Thierry Reding Merged, thanks: remote: I: patch #220676 updated using rev f5ded22e14e2e15390eff8e01ce32de496ae0e86. remote: I: 1 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/xserver 1a3e4a2f67..f5ded22e14 master -> master - ajax ___ 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] meson: Define DEFAULT_LIBRARY_PATH as join_paths(get_option('prefix'), get_option('libdir'))
On Sat, 2018-05-05 at 00:45 +0200, Thierry Reding wrote: > On Fri, May 04, 2018 at 03:09:22PM -0700, Aaron Plattner wrote: > > 'libdir' defaults to 'lib', so running X -showDefaultLibPath just prints > > 'lib' > > instead of '/usr/lib' or '/usr/local/lib'. Use joint_paths() to get the > > correct > > full path. > > > > Signed-off-by: Aaron Plattner> > --- > > The NVIDIA driver installer noticed this meson vs. autoconf difference: > > > > WARNING: You appear to be using a modular X.Org release, but the X library > > installation path, 'lib', reported by `/usr/bin/X -showDefaultLibPath` does > > not exist. > > Please check your X.Org installation. > > > > include/meson.build | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Reviewed-by: Thierry Reding Merged, thanks: remote: I: patch #220766 updated using rev 1a3e4a2f6722048c5c7c4c1a9d6748e68a895a3e. remote: I: 1 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/xserver 1dcd784a67..1a3e4a2f67 master -> master - ajax ___ 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] dri2: Sync i965_pci_ids.h from mesa
On Fri, 2018-05-04 at 09:46 -0700, Anuj Phogat wrote: > On Thu, May 3, 2018 at 2:51 PM, Kenneth Graunkewrote: > > On Thursday, May 3, 2018 11:29:11 AM PDT Anuj Phogat wrote: > > > Copied from Mesa with no modifications. > > > > > > Gives us Cofeelake platform names updates and sync on Kaby Lake, > > > Ice Lake PCI IDs. > > > > > > Signed-off-by: Anuj Phogat > > > Cc: Kenneth Graunke > > > Cc: Adam Jackson > > > --- > > > hw/xfree86/dri2/pci_ids/i965_pci_ids.h | 13 +++-- > > > 1 file changed, 11 insertions(+), 2 deletions(-) > > > > Acked-by: Kenneth Graunke > > I don't have the push access. Can you or Adam do it for me? > Thanks. Merged, thanks: remote: I: patch #220981 updated using rev 1dcd784a677c58e77c368a676fd9dbd3159db94f. remote: I: 1 patch(es) updated to state Accepted. To ssh://git.freedesktop.org/git/xorg/xserver 4191b59bd5..1dcd784a67 master -> master - ajax ___ 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 and improve ms_kernel_msc_to_crtc_msc()
On Mon, May 7, 2018 at 10:58 AM, Mike Lothianwrote: > Hi > > This doesn't seem to apply cleanly to master or 1.19.6, am I missing > something? > > Cheers > > Mike > Hi Mike, it needs the previous patch "[PATCH xserver] modesetting: Remove ms_crtc_msc_to_kernel_msc()." applied to master first. That one should also apply to 1.19, but this one is for 1.20 only. -mario > On Sun, 6 May 2018 at 06:35 Mario Kleiner > wrote: >> >> The old 32-Bit wraparound handling didn't actually work, >> due to some integer casting bug, and the mapping was ill >> equipped to deal with input from the new true 64-bit >> GetCrtcSequence/QueueCrtcSequence api's introduced in Linux >> 4.15. >> >> For 32-Bit truncated input from pageflip events and old vblank >> events and old drmWaitVblank ioctl, implement new wraparound >> handling, which also allows to deal with wraparound in the other >> direction, e.g., if a 32-Bit truncated sequence value is passed >> in, whose true 64-Bit in-kernel hw value is within 2^30 counts >> of the previous processed value, but whose 32-bit truncated >> sequence value happens to lie just above or below a 2^32 >> boundary, iow. one of the two values 'sequence' vs. 'msc_prev' >> lies above a 2^32 border, the other one below it. >> >> The method is directly translated from Mesa's proven implementation >> of the INTEL_swap_events extension, where a true underlying >> 64-Bit wide swapbuffers count (SBC) needs to get reconstructed >> from a 32-Bit LSB truncated SBC transported over the X11 protocol >> wire. Same conditions apply, ie. successive true 64-Bit SBC >> values are close to each other, but don't always get received >> in strictly monotonically increasing order. See Mesa commit >> cc5ddd584d17abd422ae4d8e83805969485740d9 ("glx: Handle >> out-of-sequence swap completion events correctly. (v2)") for >> explanation. >> >> Additionally add a separate path for true 64-bit msc input >> originating from Linux 4.15+ drmCrtcGetSequence/QueueSequence >> ioctl's and corresponding 64-bit vblank events. True 64-bit >> msc's don't need remapping and must be passed through. >> >> As a reliability bonus, they are also used here to update the >> tracking values msc_prev and ms_high with perfect 64-Bit ground >> truth as baseline for mapping msc from pageflip completion events, >> because pageflip events are always 32-bit wide, even when the new >> kernel api's are used. Because each pageflip(-event) is always >> preceeded close in time (and vblank count) by a drmCrtcQueueSequence >> queued event or drmCrtcGetSequence query as part of DRI2 or DRI3+Present >> swap scheduling, we can be certain that each pageflip event will get >> its truncated 32-bit msc remapped reliably to the true 64-bit msc of >> flip completion whenever the sequence api is available, ie. on Linux >> 4.15 or later. >> >> Note: In principle at least the 32-bit mapping path could also >> be backported to earlier server branches, as this seems to be >> broken for at least server 1.16 to 1.19. >> >> Signed-off-by: Mario Kleiner >> Cc: Adam Jackson >> Cc: Keith Packard >> Cc: Michel Dänzer >> --- >> hw/xfree86/drivers/modesetting/driver.h | 2 +- >> hw/xfree86/drivers/modesetting/vblank.c | 66 >> ++--- >> 2 files changed, 54 insertions(+), 14 deletions(-) >> >> diff --git a/hw/xfree86/drivers/modesetting/driver.h >> b/hw/xfree86/drivers/modesetting/driver.h >> index 3a81d4d..55f3400 100644 >> --- a/hw/xfree86/drivers/modesetting/driver.h >> +++ b/hw/xfree86/drivers/modesetting/driver.h >> @@ -149,7 +149,7 @@ xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr >> pDraw); >> >> int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); >> >> -uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence); >> +uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence, >> Bool is64bit); >> >> >> Bool ms_dri2_screen_init(ScreenPtr screen); >> diff --git a/hw/xfree86/drivers/modesetting/vblank.c >> b/hw/xfree86/drivers/modesetting/vblank.c >> index d1a6fc1..561229f 100644 >> --- a/hw/xfree86/drivers/modesetting/vblank.c >> +++ b/hw/xfree86/drivers/modesetting/vblank.c >> @@ -239,7 +239,7 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, >> drm_flags, msc, _queued, >> seq); >> if (ret == 0) { >> if (msc_queued) >> -*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, >> kernel_queued); >> +*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, >> kernel_queued, TRUE); >> ms->has_queue_sequence = TRUE; >> return TRUE; >> } >> @@ -262,7 +262,7 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, >> ret = drmWaitVBlank(ms->fd, ); >> if (ret == 0) { >> if (msc_queued) >>
Re: [PATCH xserver] modesetting: Fix and improve ms_kernel_msc_to_crtc_msc()
From f1a0beaaa72db8e09228dac124090e5ccd0c5129 Mon Sep 17 00:00:00 2001 From: Mario KleinerDate: Mon, 7 May 2018 10:14:14 +0100 Subject: [PATCH] modesetting: Fix and improve ms_kernel_msc_to_crtc_msc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old 32-Bit wraparound handling didn't actually work, due to some integer casting bug, and the mapping was ill equipped to deal with input from the new true 64-bit GetCrtcSequence/QueueCrtcSequence api's introduced in Linux 4.15. For 32-Bit truncated input from pageflip events and old vblank events and old drmWaitVblank ioctl, implement new wraparound handling, which also allows to deal with wraparound in the other direction, e.g., if a 32-Bit truncated sequence value is passed in, whose true 64-Bit in-kernel hw value is within 2^30 counts of the previous processed value, but whose 32-bit truncated sequence value happens to lie just above or below a 2^32 boundary, iow. one of the two values 'sequence' vs. 'msc_prev' lies above a 2^32 border, the other one below it. The method is directly translated from Mesa's proven implementation of the INTEL_swap_events extension, where a true underlying 64-Bit wide swapbuffers count (SBC) needs to get reconstructed from a 32-Bit LSB truncated SBC transported over the X11 protocol wire. Same conditions apply, ie. successive true 64-Bit SBC values are close to each other, but don't always get received in strictly monotonically increasing order. See Mesa commit cc5ddd584d17abd422ae4d8e83805969485740d9 ("glx: Handle out-of-sequence swap completion events correctly. (v2)") for explanation. Additionally add a separate path for true 64-bit msc input originating from Linux 4.15+ drmCrtcGetSequence/QueueSequence ioctl's and corresponding 64-bit vblank events. True 64-bit msc's don't need remapping and must be passed through. As a reliability bonus, they are also used here to update the tracking values msc_prev and ms_high with perfect 64-Bit ground truth as baseline for mapping msc from pageflip completion events, because pageflip events are always 32-bit wide, even when the new kernel api's are used. Because each pageflip(-event) is always preceeded close in time (and vblank count) by a drmCrtcQueueSequence queued event or drmCrtcGetSequence query as part of DRI2 or DRI3+Present swap scheduling, we can be certain that each pageflip event will get its truncated 32-bit msc remapped reliably to the true 64-bit msc of flip completion whenever the sequence api is available, ie. on Linux 4.15 or later. Note: In principle at least the 32-bit mapping path could also be backported to earlier server branches, as this seems to be broken for at least server 1.16 to 1.19. Signed-off-by: Mario Kleiner Cc: Adam Jackson Cc: Keith Packard Cc: Michel Dänzer --- hw/xfree86/drivers/modesetting/driver.h | 3 +- hw/xfree86/drivers/modesetting/vblank.c | 67 +++-- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index b2a4e52f8..11a69fb27 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -150,8 +150,7 @@ xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw); int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); uint64_t ms_crtc_msc_to_kernel_msc(xf86CrtcPtr crtc, uint64_t expect); -uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence); - +uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence, Bool is64bit); Bool ms_dri2_screen_init(ScreenPtr screen); void ms_dri2_close_screen(ScreenPtr screen); diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c index ae3018b4b..353dcdeae 100644 --- a/hw/xfree86/drivers/modesetting/vblank.c +++ b/hw/xfree86/drivers/modesetting/vblank.c @@ -242,7 +242,7 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, kernel, _queued, seq); if (ret == 0) { if (msc_queued) -*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, kernel_queued); +*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, kernel_queued, TRUE); ms->has_queue_sequence = TRUE; return TRUE; } @@ -266,7 +266,7 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, ret = drmWaitVBlank(ms->fd, ); if (ret == 0) { if (msc_queued) -*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence); +*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, vbl.reply.sequence, FALSE); return TRUE; } check: @@ -279,30 +279,60 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, } /** - * Convert a
Re: [PATCH xserver] modesetting: Fix and improve ms_kernel_msc_to_crtc_msc()
Hi This doesn't seem to apply cleanly to master or 1.19.6, am I missing something? Cheers Mike On Sun, 6 May 2018 at 06:35 Mario Kleinerwrote: > The old 32-Bit wraparound handling didn't actually work, > due to some integer casting bug, and the mapping was ill > equipped to deal with input from the new true 64-bit > GetCrtcSequence/QueueCrtcSequence api's introduced in Linux > 4.15. > > For 32-Bit truncated input from pageflip events and old vblank > events and old drmWaitVblank ioctl, implement new wraparound > handling, which also allows to deal with wraparound in the other > direction, e.g., if a 32-Bit truncated sequence value is passed > in, whose true 64-Bit in-kernel hw value is within 2^30 counts > of the previous processed value, but whose 32-bit truncated > sequence value happens to lie just above or below a 2^32 > boundary, iow. one of the two values 'sequence' vs. 'msc_prev' > lies above a 2^32 border, the other one below it. > > The method is directly translated from Mesa's proven implementation > of the INTEL_swap_events extension, where a true underlying > 64-Bit wide swapbuffers count (SBC) needs to get reconstructed > from a 32-Bit LSB truncated SBC transported over the X11 protocol > wire. Same conditions apply, ie. successive true 64-Bit SBC > values are close to each other, but don't always get received > in strictly monotonically increasing order. See Mesa commit > cc5ddd584d17abd422ae4d8e83805969485740d9 ("glx: Handle > out-of-sequence swap completion events correctly. (v2)") for > explanation. > > Additionally add a separate path for true 64-bit msc input > originating from Linux 4.15+ drmCrtcGetSequence/QueueSequence > ioctl's and corresponding 64-bit vblank events. True 64-bit > msc's don't need remapping and must be passed through. > > As a reliability bonus, they are also used here to update the > tracking values msc_prev and ms_high with perfect 64-Bit ground > truth as baseline for mapping msc from pageflip completion events, > because pageflip events are always 32-bit wide, even when the new > kernel api's are used. Because each pageflip(-event) is always > preceeded close in time (and vblank count) by a drmCrtcQueueSequence > queued event or drmCrtcGetSequence query as part of DRI2 or DRI3+Present > swap scheduling, we can be certain that each pageflip event will get > its truncated 32-bit msc remapped reliably to the true 64-bit msc of > flip completion whenever the sequence api is available, ie. on Linux > 4.15 or later. > > Note: In principle at least the 32-bit mapping path could also > be backported to earlier server branches, as this seems to be > broken for at least server 1.16 to 1.19. > > Signed-off-by: Mario Kleiner > Cc: Adam Jackson > Cc: Keith Packard > Cc: Michel Dänzer > --- > hw/xfree86/drivers/modesetting/driver.h | 2 +- > hw/xfree86/drivers/modesetting/vblank.c | 66 > ++--- > 2 files changed, 54 insertions(+), 14 deletions(-) > > diff --git a/hw/xfree86/drivers/modesetting/driver.h > b/hw/xfree86/drivers/modesetting/driver.h > index 3a81d4d..55f3400 100644 > --- a/hw/xfree86/drivers/modesetting/driver.h > +++ b/hw/xfree86/drivers/modesetting/driver.h > @@ -149,7 +149,7 @@ xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr > pDraw); > > int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); > > -uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence); > +uint64_t ms_kernel_msc_to_crtc_msc(xf86CrtcPtr crtc, uint64_t sequence, > Bool is64bit); > > > Bool ms_dri2_screen_init(ScreenPtr screen); > diff --git a/hw/xfree86/drivers/modesetting/vblank.c > b/hw/xfree86/drivers/modesetting/vblank.c > index d1a6fc1..561229f 100644 > --- a/hw/xfree86/drivers/modesetting/vblank.c > +++ b/hw/xfree86/drivers/modesetting/vblank.c > @@ -239,7 +239,7 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, > drm_flags, msc, _queued, > seq); > if (ret == 0) { > if (msc_queued) > -*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, > kernel_queued); > +*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, > kernel_queued, TRUE); > ms->has_queue_sequence = TRUE; > return TRUE; > } > @@ -262,7 +262,7 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag flags, > ret = drmWaitVBlank(ms->fd, ); > if (ret == 0) { > if (msc_queued) > -*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, > vbl.reply.sequence); > +*msc_queued = ms_kernel_msc_to_crtc_msc(crtc, > vbl.reply.sequence, FALSE); > return TRUE; > } > check: > @@ -275,28 +275,59 @@ ms_queue_vblank(xf86CrtcPtr crtc, ms_queue_flag > flags, > } > > /** > - * Convert a 32-bit kernel MSC sequence number to a 64-bit local