[PATCH xf86-video-amdgpu 3/9] Rename Option "NoAccel" to "Accel"
From: Michel DänzerRemoves the need for a double negation when forcing acceleration on. Note that this change is backwards compatible, as the option parser automagically handles the 'No' prefix. (ported from radeon commit cc615d06db0332fc6e673b55632bcc7bf957b44b) Signed-off-by: Michel Dänzer --- man/amdgpu.man | 7 +++ src/amdgpu_drv.h | 2 +- src/amdgpu_kms.c | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/man/amdgpu.man b/man/amdgpu.man index 3373b63..4e95ead 100644 --- a/man/amdgpu.man +++ b/man/amdgpu.man @@ -44,12 +44,11 @@ are supported: Selects software cursor. The default is .B off. .TP -.BI "Option \*qNoAccel\*q \*q" boolean \*q +.BI "Option \*qAccel\*q \*q" boolean \*q Enables or disables all hardware acceleration. .br -The default is to -.B enable -hardware acceleration. +The default is +.B on. .TP .BI "Option \*qZaphodHeads\*q \*q" string \*q diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h index 4797693..9acd202 100644 --- a/src/amdgpu_drv.h +++ b/src/amdgpu_drv.h @@ -133,7 +133,7 @@ struct _SyncFence; #endif typedef enum { - OPTION_NOACCEL, + OPTION_ACCEL, OPTION_SW_CURSOR, OPTION_PAGE_FLIP, #ifdef RENDER diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 054d478..084f625 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -60,7 +60,7 @@ extern SymTabRec AMDGPUChipsets[]; static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen); const OptionInfoRec AMDGPUOptions_KMS[] = { - {OPTION_NOACCEL, "NoAccel", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_ACCEL, "Accel", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_PAGE_FLIP, "EnablePageFlip", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_SUBPIXEL_ORDER, "SubPixelOrder", OPTV_ANYSTR, {0}, FALSE}, @@ -562,7 +562,7 @@ static Bool AMDGPUPreInitAccel_KMS(ScrnInfoPtr pScrn) { AMDGPUInfoPtr info = AMDGPUPTR(pScrn); - if (!xf86ReturnOptValBool(info->Options, OPTION_NOACCEL, false)) { + if (xf86ReturnOptValBool(info->Options, OPTION_ACCEL, TRUE)) { AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); Bool use_glamor = TRUE; #ifdef HAVE_GBM_BO_USE_LINEAR -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 4/9] PRIME: Don't advertise offload capabilities when acceleration is disabled
From: Michel DänzerXorg tends to crash if the user tries to actually use the offload capabilities with acceleration disabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200 (ported from radeon commit c74de9fec13fac2c836bb2a07ae6f90e1d61e667) Signed-off-by: Michel Dänzer --- src/amdgpu_kms.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 084f625..2efdbf5 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -668,14 +668,18 @@ static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn) pScrn->capabilities = 0; ret = drmGetCap(pAMDGPUEnt->fd, DRM_CAP_PRIME, ); if (ret == 0) { - if (value & DRM_PRIME_CAP_EXPORT) - pScrn->capabilities |= - RR_Capability_SourceOutput | - RR_Capability_SinkOffload; - if (value & DRM_PRIME_CAP_IMPORT) - pScrn->capabilities |= - RR_Capability_SourceOffload | - RR_Capability_SinkOutput; + AMDGPUInfoPtr info = AMDGPUPTR(pScrn); + + if (value & DRM_PRIME_CAP_EXPORT) { + pScrn->capabilities |= RR_Capability_SourceOutput; + if (info->use_glamor && info->dri2.available) + pScrn->capabilities |= RR_Capability_SinkOffload; + } + if (value & DRM_PRIME_CAP_IMPORT) { + pScrn->capabilities |= RR_Capability_SinkOutput; + if (info->use_glamor && info->dri2.available) + pScrn->capabilities |= RR_Capability_SourceOffload; + } } #endif } -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 1/9] Fixes ported from radeon
These are the remaining fixes from radeon which hadn't been ported to xf86-video-amdgpu yet. Once these are applied, we can cut a release. [PATCH xf86-video-amdgpu 1/9] dri2: Handle PRIME for source buffer as [PATCH xf86-video-amdgpu 2/9] Use own thunk function instead of [PATCH xf86-video-amdgpu 3/9] Rename Option "NoAccel" to "Accel" [PATCH xf86-video-amdgpu 4/9] PRIME: Don't advertise offload [PATCH xf86-video-amdgpu 5/9] Prefer drmModeSetCursor2 over [PATCH xf86-video-amdgpu 6/9] Skip disabled CRTCs in [PATCH xf86-video-amdgpu 7/9] Do not link amdgpu_drv.so against [PATCH xf86-video-amdgpu 8/9] Call xf86CrtcRotate from initial [PATCH xf86-video-amdgpu 9/9] Handle failures in setting a CRTC to a ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 6/9] Skip disabled CRTCs in amdgpu_scanout_(do_)update
From: Michel DänzerThe vblank / page flip ioctls don't work as expected for a disabled CRTC. (ported from radeon commit acc11877423ecd81a6e0a7f38466f80e43efee20) Signed-off-by: Michel Dänzer --- src/amdgpu_kms.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index 2efdbf5..3993591 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -257,7 +257,8 @@ amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id) GCPtr gc; BoxRec extents; - if (drmmode_crtc->dpms_mode != DPMSModeOn || + if (!xf86_crtc->enabled || + drmmode_crtc->dpms_mode != DPMSModeOn || !drmmode_crtc->scanout[scanout_id].pixmap) return FALSE; @@ -323,7 +324,8 @@ amdgpu_scanout_update(xf86CrtcPtr xf86_crtc) DrawablePtr pDraw; BoxRec extents; - if (drmmode_crtc->scanout_update_pending || + if (!xf86_crtc->enabled || + drmmode_crtc->scanout_update_pending || !drmmode_crtc->scanout[0].pixmap || drmmode_crtc->dpms_mode != DPMSModeOn) return; -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 1/9] dri2: Handle PRIME for source buffer as well in amdgpu_dri2_copy_region2
From: Michel DänzerBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77810 (ported from radeon commit c84230d686c078aac1dc98d82153f8b02521b2e1) Signed-off-by: Michel Dänzer --- src/amdgpu_dri2.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c index 0feca59..230e8ba 100644 --- a/src/amdgpu_dri2.c +++ b/src/amdgpu_dri2.c @@ -333,7 +333,14 @@ amdgpu_dri2_copy_region2(ScreenPtr pScreen, dst_drawable = _private->pixmap->drawable; if (src_private->attachment == DRI2BufferFrontLeft) { - src_drawable = drawable; +#ifdef USE_DRI2_PRIME + if (drawable->pScreen != pScreen) { + src_drawable = DRI2UpdatePrime(drawable, src_buffer); + if (!src_drawable) + return; + } else +#endif + src_drawable = drawable; } if (dst_private->attachment == DRI2BufferFrontLeft) { #ifdef USE_DRI2_PRIME -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 9/9] Handle failures in setting a CRTC to a DRM mode properly
From: Stephen Chandler PaulThis fixes a bug where running the card out of PPLL's when hotplugging another monitor would result in all of the displays going blank and failing to work properly until X was restarted or the user switched to another VT. [Michel Dänzer: Pass errno instead of -ret to strerror()] Signed-off-by: Stephen Chandler Paul (ported from radeon commit 7186a8713ba004de4991f21c1a9fc4abc62aeff4) Signed-off-by: Michel Dänzer --- src/drmmode_display.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 66528f0..2761513 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -699,14 +699,15 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, amdgpu_glamor_finish(pScrn); } } - ret = - drmModeSetCrtc(pAMDGPUEnt->fd, - drmmode_crtc->mode_crtc->crtc_id, fb_id, x, - y, output_ids, output_count, ); - if (ret) + if (drmModeSetCrtc(pAMDGPUEnt->fd, + drmmode_crtc->mode_crtc->crtc_id, + fb_id, x, y, output_ids, + output_count, ) != 0) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, - "failed to set mode: %s", strerror(-ret)); - else + "failed to set mode: %s\n", strerror(errno)); + ret = FALSE; + goto done; + } else ret = TRUE; if (crtc->scrn->pScreen) -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: [PATCH xf86-video-amdgpu 1/9] Fixes ported from radeon
On Wed, Nov 11, 2015 at 4:30 AM, Michel Dänzerwrote: > These are the remaining fixes from radeon which hadn't been ported to > xf86-video-amdgpu yet. > > Once these are applied, we can cut a release. For the series: Reviewed-by: Alex Deucher > > [PATCH xf86-video-amdgpu 1/9] dri2: Handle PRIME for source buffer as > [PATCH xf86-video-amdgpu 2/9] Use own thunk function instead of > [PATCH xf86-video-amdgpu 3/9] Rename Option "NoAccel" to "Accel" > [PATCH xf86-video-amdgpu 4/9] PRIME: Don't advertise offload > [PATCH xf86-video-amdgpu 5/9] Prefer drmModeSetCursor2 over > [PATCH xf86-video-amdgpu 6/9] Skip disabled CRTCs in > [PATCH xf86-video-amdgpu 7/9] Do not link amdgpu_drv.so against > [PATCH xf86-video-amdgpu 8/9] Call xf86CrtcRotate from initial > [PATCH xf86-video-amdgpu 9/9] Handle failures in setting a CRTC to a > ___ > xorg-driver-ati mailing list > xorg-driver-ati@lists.x.org > http://lists.x.org/mailman/listinfo/xorg-driver-ati ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[ANNOUNCE] xf86-video-rendition 4.2.6
Just a few accumulated build fixes. Adam Jackson (4): Remove mibstore.h Fix build against xserver 1.17 Remove dependency on xf86PciInfo.h rendition 4.2.6 git tag: xf86-video-rendition-4.2.6 http://xorg.freedesktop.org/archive/individual/driver/xf86-video-rendition-4.2.6.tar.bz2 MD5: 405dd1acba9c2e43d7aa67b631762495 xf86-video-rendition-4.2.6.tar.bz2 SHA1: b0c097890320be53ca678bd6f18de4c39e2409e8 xf86-video-rendition-4.2.6.tar.bz2 SHA256: 660ecf21f65a4d6002c1b603d62c314f8e9624d208db5b346850b0df9dc2f9a8 xf86-video-rendition-4.2.6.tar.bz2 PGP: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-rendition-4.2.6.tar.bz2.sig http://xorg.freedesktop.org/archive/individual/driver/xf86-video-rendition-4.2.6.tar.gz MD5: 6702345c506bd1339dbc6a8d7235ca6e xf86-video-rendition-4.2.6.tar.gz SHA1: b7dfcd9a780902f7eeb08ab94f0963ddb15aafb2 xf86-video-rendition-4.2.6.tar.gz SHA256: 0da3dadfb18f335f53e88f33a6cfb5aa63d6775a63c01d60acd9953158d8c879 xf86-video-rendition-4.2.6.tar.gz PGP: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-rendition-4.2.6.tar.gz.sig - ajax signature.asc Description: This is a digitally signed message part ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s
Re: Problem with oversized twm titlebutton height
Hi Frank, Thank you! That did it... I'm not sure I would have figured this out on my own! I had "LANG=en_US.UTF-8" set in my environment, which I picked up from the default Ubuntu login setup. If I run "env LANG=C twm" or "env LANG=en_US twm" the titlebuttons are scaled properly. Overcome by curiosity, I started twm under a debugger to see what it was doing with the fonts, and I found this comment in util.c: /* * The following functions are sensible to 'use_fontset'. * When 'use_fontset' is True, * - XFontSet-related internationalized functions are used * so as multibyte languages can be displayed. * When 'use_fontset' is False, * - XFontStruct-related conventional functions are used * so as 8-bit characters can be displayed even when * locale is not set properly. */ void GetFont(MyFont *font) { ... When "use_fontset" is true, the ascent and descent values are determined by the "max" ascent and descent of all the fonts in the set. For example, in the case I was looking at, the "fixed" font was an alias for 17 fonts, which included an "-arabic-newspaper-*" font that has an ascent==24 and descent==11. When "use_fontset" is false, twm does a straight-up by-name lookup of the font, which has an ascent==8 and descent==2. Finally, as you observed, the locale controls the setting of "use_fontset": loc = setlocale(LC_ALL, ""); if (!loc || !strcmp(loc, "C") || !strcmp(loc, "POSIX") || !XSupportsLocale()) { use_fontset = False; } else { use_fontset = True; } Cheers, John D. Frank Steiner wrote: John DelSignore wrote Hi, I'm using twm on an Ubuntu 14.04 system, and for some reason depending on the TitleFont I pick, the titlebuttons are much bigger than the TitleFont. Below, I used the font "fixed" for the TitleFont, and the titlebutton is much bigger than height of the font. Why is that happening? Check your LC_CTYPE settings. When I use en_US.UTF-8 I get the same huge titlebuttons while en_US works fine. Maybe it somehow depends of the font you use, if it can handle utf8 encoding or not (just a guess). cu, Frank ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s
Re: [PATCH:xf86-video-modesetting] Fix build when XSERVER_PLATFORM_BUS is not defined.
On Mon, Nov 09, 2015 at 03:43:44PM -0500, Adam Jackson wrote: > On Fri, 2015-11-06 at 10:30 +0100, Thomas Klausner wrote: > > From: Jared McNeill> > It's not wrong, but this driver lives in-server now. Thanks for the information. I have attached anew patch against the xserver. Thomas >From 12382b00672f811516f6bded90651bc3257d5954 Mon Sep 17 00:00:00 2001 From: Jared McNeill Date: Wed, 11 Nov 2015 13:30:25 +0100 Subject: [PATCH:xserver 2/2] Fix build when XSERVER_PLATFORM_BUS is not defined. Signed-off-by: Thomas Klausner --- hw/xfree86/drivers/modesetting/driver.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 80abcdf..e66d278 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -90,6 +90,10 @@ static const struct pci_id_match ms_device_match[] = { }; #endif +#ifndef XSERVER_PLATFORM_BUS +struct xf86_platform_device; +#endif + #ifdef XSERVER_PLATFORM_BUS static Bool ms_platform_probe(DriverPtr driver, int entity_num, int flags, -- 2.6.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xf86-video-amdgpu 7/9] Do not link amdgpu_drv.so against libpciaccess
From: Emil VelikovNot used directly. Signed-off-by: Emil Velikov (ported from radeon commit fcb32231a38f9461d12720cbf72f63502197a711) Signed-off-by: Michel Dänzer --- configure.ac| 3 --- src/Makefile.am | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index e350ef6..9765d0b 100644 --- a/configure.ac +++ b/configure.ac @@ -186,9 +186,6 @@ AC_CHECK_HEADERS([dri3.h], [], [], CPPFLAGS="$SAVE_CPPFLAGS" -PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) -XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" - # Checks for headers/macros for byte swapping # Known variants: # bswap_16, bswap_32, bswap_64 (glibc) diff --git a/src/Makefile.am b/src/Makefile.am index 6c8d1de..4efef9e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,7 +26,7 @@ # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -amdgpu_drv_la_LIBADD = $(PCIACCESS_LIBS) $(LIBDRM_AMDGPU_LIBS) $(GBM_LIBS) +amdgpu_drv_la_LIBADD = $(LIBDRM_AMDGPU_LIBS) $(GBM_LIBS) AMDGPU_KMS_SRCS=amdgpu_bo_helper.c amdgpu_dri2.c amdgpu_dri3.c amdgpu_drm_queue.c \ amdgpu_kms.c amdgpu_present.c amdgpu_sync.c drmmode_display.c -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 2/9] Use own thunk function instead of shadowUpdatePackedWeak
From: Adam JacksonI plan to delete the Weak functions from a future server. Signed-off-by: Adam Jackson (ported from radeon commit 851b2cf8714618843725f6d067915375485ade9d) Signed-off-by: Michel Dänzer --- src/amdgpu_kms.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c index fd89ba2..054d478 100644 --- a/src/amdgpu_kms.c +++ b/src/amdgpu_kms.c @@ -157,6 +157,12 @@ static void *amdgpuShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, return ((uint8_t *) info->front_buffer->cpu_ptr + row * stride + offset); } +static void +amdgpuUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) +{ + shadowUpdatePacked(pScreen, pBuf); +} + static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); @@ -176,7 +182,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen) if (info->shadow_fb) { pixmap = pScreen->GetScreenPixmap(pScreen); - if (!shadowAdd(pScreen, pixmap, shadowUpdatePackedWeak(), + if (!shadowAdd(pScreen, pixmap, amdgpuUpdatePacked, amdgpuShadowWindow, 0, NULL)) return FALSE; } -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[PATCH xf86-video-amdgpu 5/9] Prefer drmModeSetCursor2 over drmModeSetCursor
From: Michel DänzerThe former includes information about the position of the hotspot within the cursor image. Copied from xf86-video-modesetting. (ported from radeon commit c9f8f642fd495937400618a4fc25ecae3ffc) Signed-off-by: Michel Dänzer --- src/drmmode_display.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 9632180..4d5a3a3 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -801,12 +801,29 @@ static void drmmode_show_cursor(xf86CrtcPtr crtc) AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; uint32_t bo_handle; + static Bool use_set_cursor2 = TRUE; if (!amdgpu_bo_get_handle(drmmode_crtc->cursor_buffer, _handle)) { ErrorF("failed to get BO handle for cursor\n"); return; } + if (use_set_cursor2) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + CursorPtr cursor = xf86_config->cursor; + int ret; + + ret = drmModeSetCursor2(pAMDGPUEnt->fd, + drmmode_crtc->mode_crtc->crtc_id, + bo_handle, + info->cursor_w, info->cursor_h, + cursor->bits->xhot, cursor->bits->yhot); + if (ret == -EINVAL) + use_set_cursor2 = FALSE; + else + return; + } + drmModeSetCursor(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, bo_handle, info->cursor_w, info->cursor_h); } -- 2.6.2 ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: [PATCH 0/8] Fixes ported from xf86-video-amdgpu
On Wed, Nov 11, 2015 at 2:15 AM, Michel Dänzerwrote: > These are the remaining fixes from xf86-video-amdgpu which hadn't been > ported to radeon yet. > > Once these are applied, we can cut a release. For the series: Reviewed-by: Alex Deucher > > [PATCH 1/8] dri2: Avoid calculation with undefined msc value > [PATCH 2/8] Simplify pick best crtc to fold two loops into one > [PATCH 3/8] Clean up allocation in RADEONInitVideo() > [PATCH 4/8] Simplify drmmode_set_mode_major() and avoid leaking > [PATCH 5/8] Don't advertise rotation support without hardware > [PATCH 6/8] Eliminate redundant data parameter from > [PATCH 7/8] Properly handle drmModeAddFB failure in > [PATCH 8/8] Clean up radeon_dri2_create_buffer2() > ___ > xorg-driver-ati mailing list > xorg-driver-ati@lists.x.org > http://lists.x.org/mailman/listinfo/xorg-driver-ati ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
Re: [PATCH 1/2] glamor: Restore ScreenRec hooks during CloseScreen
On Tue, Nov 10, 2015 at 3:41 AM, Michel Dänzerwrote: > From: Michel Dänzer > > Signed-off-by: Michel Dänzer For the series: Reviewed-by: > --- > src/radeon.h | 12 > src/radeon_glamor.c | 20 > src/radeon_glamor.h | 2 ++ > src/radeon_glamor_wrappers.c | 5 - > src/radeon_kms.c | 2 ++ > 5 files changed, 32 insertions(+), 9 deletions(-) > > diff --git a/src/radeon.h b/src/radeon.h > index e2fd41c..0ee6adc 100644 > --- a/src/radeon.h > +++ b/src/radeon.h > @@ -157,6 +157,10 @@ typedef enum { > } RADEONOpts; > > > +#if XF86_CRTC_VERSION >= 5 > +#define RADEON_PIXMAP_SHARING 1 > +#endif > + > #define RADEON_VSYNC_TIMEOUT 2 /* Maximum wait for VSYNC (in usecs) */ > > /* Buffer are aligned on 4096 byte boundaries */ > @@ -561,6 +565,10 @@ typedef struct { > AddTrapsProcPtr SavedAddTraps; > UnrealizeGlyphProcPtr SavedUnrealizeGlyph; > #endif > +#ifdef RADEON_PIXMAP_SHARING > + SharePixmapBackingProcPtr SavedSharePixmapBacking; > + SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking; > +#endif > } glamor; > #endif /* USE_GLAMOR */ > } RADEONInfoRec, *RADEONInfoPtr; > @@ -623,10 +631,6 @@ extern RADEONEntPtr RADEONEntPriv(ScrnInfoPtr pScrn); > > drmVBlankSeqType radeon_populate_vbl_request_type(xf86CrtcPtr crtc); > > -#if XF86_CRTC_VERSION >= 5 > -#define RADEON_PIXMAP_SHARING 1 > -#endif > - > static inline struct radeon_surface *radeon_get_pixmap_surface(PixmapPtr > pPix) > { > #ifdef USE_GLAMOR > diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c > index fdd5aea..8fb3a1e 100644 > --- a/src/radeon_glamor.c > +++ b/src/radeon_glamor.c > @@ -368,10 +368,14 @@ radeon_glamor_init(ScreenPtr screen) > ps->UnrealizeGlyph = SavedUnrealizeGlyph; > #endif > > + info->glamor.SavedCreatePixmap = screen->CreatePixmap; > screen->CreatePixmap = radeon_glamor_create_pixmap; > + info->glamor.SavedDestroyPixmap = screen->DestroyPixmap; > screen->DestroyPixmap = radeon_glamor_destroy_pixmap; > #ifdef RADEON_PIXMAP_SHARING > + info->glamor.SavedSharePixmapBacking = screen->SharePixmapBacking; > screen->SharePixmapBacking = radeon_glamor_share_pixmap_backing; > + info->glamor.SavedSetSharedPixmapBacking = > screen->SetSharedPixmapBacking; > screen->SetSharedPixmapBacking = > radeon_glamor_set_shared_pixmap_backing; > #endif > > @@ -380,6 +384,22 @@ radeon_glamor_init(ScreenPtr screen) > return TRUE; > } > > +void > +radeon_glamor_fini(ScreenPtr screen) > +{ > + RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(screen)); > + > + if (!info->use_glamor) > + return; > + > + screen->CreatePixmap = info->glamor.SavedCreatePixmap; > + screen->DestroyPixmap = info->glamor.SavedDestroyPixmap; > +#ifdef RADEON_PIXMAP_SHARING > + screen->SharePixmapBacking = info->glamor.SavedSharePixmapBacking; > + screen->SetSharedPixmapBacking = > info->glamor.SavedSetSharedPixmapBacking; > +#endif > +} > + > XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr pScreen, int num_adapt) > { > return glamor_xv_init(pScreen, num_adapt); > diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h > index 246336b..75129f8 100644 > --- a/src/radeon_glamor.h > +++ b/src/radeon_glamor.h > @@ -64,6 +64,7 @@ struct radeon_pixmap; > > Bool radeon_glamor_pre_init(ScrnInfoPtr scrn); > Bool radeon_glamor_init(ScreenPtr screen); > +void radeon_glamor_fini(ScreenPtr screen); > void radeon_glamor_screen_init(ScreenPtr screen); > Bool radeon_glamor_create_screen_resources(ScreenPtr screen); > void radeon_glamor_free_screen(int scrnIndex, int flags); > @@ -77,6 +78,7 @@ XF86VideoAdaptorPtr radeon_glamor_xv_init(ScreenPtr > pScreen, int num_adapt); > > static inline Bool radeon_glamor_pre_init(ScrnInfoPtr scrn) { return FALSE; } > static inline Bool radeon_glamor_init(ScreenPtr screen) { return FALSE; } > +static inline void radeon_glamor_fini(ScreenPtr screen) { } > static inline Bool radeon_glamor_create_screen_resources(ScreenPtr screen) { > return FALSE; } > static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { } > > diff --git a/src/radeon_glamor_wrappers.c b/src/radeon_glamor_wrappers.c > index ec81560..cd02b06 100644 > --- a/src/radeon_glamor_wrappers.c > +++ b/src/radeon_glamor_wrappers.c > @@ -917,8 +917,6 @@ radeon_glamor_close_screen(CLOSE_SCREEN_ARGS_DECL) > pScreen->CloseScreen = info->glamor.SavedCloseScreen; > pScreen->GetImage = info->glamor.SavedGetImage; > pScreen->GetSpans = info->glamor.SavedGetSpans; > - pScreen->CreatePixmap = info->glamor.SavedCreatePixmap; > - pScreen->DestroyPixmap = info->glamor.SavedDestroyPixmap; > pScreen->CopyWindow = info->glamor.SavedCopyWindow; >
Re: [PATCH xf86-input-libinput 3/3] Split mixed pointer/keyboard devices into two separate X devices
Peter Huttererwrites: > + while (o) { > + iopts = input_option_new(iopts, > + xf86OptionName(o), > + xf86OptionValue(o)); > + o = xf86NextOption(o); > + } Everything else was quite clear until I got to this, but I waded through and this looks fine too :-) Reviewed-by: Keith Packard -- -keith signature.asc Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 08/20] hw/kdrive: Use NotifyFd interface for kdrive/linux APM monitoring
Replace the block/wakeup handlers with a NotifyFd callback Signed-off-by: Keith Packard--- hw/kdrive/linux/linux.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c index 73a8169..a52bdef 100644 --- a/hw/kdrive/linux/linux.c +++ b/hw/kdrive/linux/linux.c @@ -169,19 +169,12 @@ LinuxSetSwitchMode(int mode) } } -static void -LinuxApmBlock(void *blockData, OSTimePtr pTimeout, void *pReadmask) -{ -} - static Bool LinuxApmRunning; static void -LinuxApmWakeup(void *blockData, int result, void *pReadmask) +LinuxApmNotify(int fd, int mask, void *blockData) { -fd_set *readmask = (fd_set *) pReadmask; - -if (result > 0 && LinuxApmFd >= 0 && FD_ISSET(LinuxApmFd, readmask)) { +if (LinuxApmFd >= 0) { apm_event_t event; Bool running = LinuxApmRunning; int cmd = APM_IOC_SUSPEND; @@ -242,8 +235,7 @@ LinuxEnable(void) if (LinuxApmFd >= 0) { LinuxApmRunning = TRUE; fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK); -RegisterBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); -AddEnabledDevice(LinuxApmFd); +SetNotifyFd(LinuxApmFd, LinuxApmNotify, X_NOTIFY_READ, NULL); } /* @@ -273,8 +265,7 @@ LinuxDisable(void) } enabled = FALSE; if (LinuxApmFd >= 0) { -RemoveBlockAndWakeupHandlers(LinuxApmBlock, LinuxApmWakeup, 0); -RemoveEnabledDevice(LinuxApmFd); +RemoveNotifyFd(LinuxApmFd); close(LinuxApmFd); LinuxApmFd = -1; } -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 03/20] os: Implement support for NotifyFd X_NOTIFY_WRITE
This adds the ability to be notified when a file descriptor is available for writing. Signed-off-by: Keith Packard--- os/WaitFor.c| 30 -- os/connection.c | 40 +++- os/io.c | 8 os/osdep.h | 5 - 4 files changed, 59 insertions(+), 24 deletions(-) diff --git a/os/WaitFor.c b/os/WaitFor.c index 12b21bb..b579e1b 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -156,6 +156,7 @@ WaitForSomething(int *pClientsReady) fd_set devicesReadable; CARD32 now = 0; Bool someReady = FALSE; +Bool someNotifyWriteReady = FALSE; FD_ZERO(); FD_ZERO(); @@ -213,9 +214,10 @@ WaitForSomething(int *pClientsReady) /* keep this check close to select() call to minimize race */ if (dispatchException) i = -1; -else if (AnyClientsWriteBlocked) { -XFD_COPYSET(, ); -i = Select(MaxClients, , , NULL, wt); +else if (AnyWritesPending) { +XFD_COPYSET(, ); +XFD_ORSET(, , ); +i = Select(MaxClients, , , NULL, wt); } else { i = Select(MaxClients, , NULL, NULL, wt); @@ -291,12 +293,20 @@ WaitForSomething(int *pClientsReady) } if (someReady) XFD_ORSET(, , ); -if (AnyClientsWriteBlocked && XFD_ANYSET()) { -NewOutputPending = TRUE; -XFD_ORSET(, , ); -XFD_UNSET(, ); -if (!XFD_ANYSET()) -AnyClientsWriteBlocked = FALSE; +if (AnyWritesPending) { +XFD_ANDSET(, , ); +if (XFD_ANYSET()) { +NewOutputPending = TRUE; +XFD_ORSET(, , ); +XFD_UNSET(, ); +if (!XFD_ANYSET() && NumNotifyWriteFd == 0) +AnyWritesPending = FALSE; +} +if (NumNotifyWriteFd != 0) { +XFD_ANDSET(_set, , ); +if (XFD_ANYSET(_set)) +someNotifyWriteReady = TRUE; +} } XFD_ANDSET(, , ); @@ -307,7 +317,7 @@ WaitForSomething(int *pClientsReady) (void *) ); XFD_ANDSET(_set, , ); -if (XFD_ANYSET(_set)) +if (XFD_ANYSET(_set) || someNotifyWriteReady) HandleNotifyFds(); if (XFD_ANYSET() || XFD_ANYSET()) diff --git a/os/connection.c b/os/connection.c index 4f2e989..4da01a6 100644 --- a/os/connection.c +++ b/os/connection.c @@ -124,15 +124,18 @@ static int lastfdesc; /* maximum file descriptor */ fd_set WellKnownConnections;/* Listener mask */ fd_set EnabledDevices; /* mask for input devices that are on */ fd_set NotifyReadFds; /* mask for other file descriptors */ +fd_set NotifyWriteFds; /* mask for other write file descriptors */ fd_set AllSockets; /* select on this */ fd_set AllClients; /* available clients */ fd_set LastSelectMask; /* mask returned from last select call */ +fd_set LastSelectWriteMask; /* mask returned from last select call */ fd_set ClientsWithInput;/* clients with FULL requests in buffer */ fd_set ClientsWriteBlocked; /* clients who cannot receive output */ fd_set OutputPending; /* clients with reply/event data ready to go */ int MaxClients = 0; +int NumNotifyWriteFd; /* Number of NotifyFd members with write set */ Bool NewOutputPending; /* not yet attempted to write some new output */ -Bool AnyClientsWriteBlocked;/* true if some client blocked on write */ +Bool AnyWritesPending; /* true if some client blocked on write or NotifyFd with write */ Bool NoListenAll; /* Don't establish any listening sockets */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ @@ -969,8 +972,8 @@ CloseDownFileDescriptor(OsCommPtr oc) FD_CLR(connection, ); } FD_CLR(connection, ); -if (!XFD_ANYSET()) -AnyClientsWriteBlocked = FALSE; +if (!XFD_ANYSET() && NumNotifyWriteFd == 0) +AnyWritesPending = FALSE; FD_CLR(connection, ); } @@ -1112,6 +1115,7 @@ InitNotifyFds(void) RemoveNotifyFd(s->fd); xorg_list_init(_fds); +NumNotifyWriteFd = 0; been_here = 1; } @@ -1153,6 +1157,20 @@ SetNotifyFd(int fd, NotifyFdProcPtr notify, int mask, void *data) FD_CLR(fd, ); } } + +if (changes & X_NOTIFY_WRITE) { +if (mask & X_NOTIFY_WRITE) { +FD_SET(fd, ); +if (!NumNotifyWriteFd++) +AnyWritesPending = TRUE; +} else { +FD_CLR(fd, ); +if (!--NumNotifyWriteFd) +if (!XFD_ANYSET()) +AnyWritesPending = FALSE; +}
[PATCH xserver 20/20] mi: Remove miPointerRec from API
This moves the definition of miPionterRec from mipointrst.h to mipointer.c so that it is no longer visible in the API, allowing it to be changed while the API/ABI is frozen. Signed-off-by: Keith Packard--- mi/mipointer.c | 12 mi/mipointrst.h | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mi/mipointer.c b/mi/mipointer.c index ada1ab5..9c788aa 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -65,6 +65,18 @@ in this Software without prior written authorization from The Open Group. #include "inpututils.h" #include "eventstr.h" +typedef struct { +ScreenPtr pScreen; /* current screen */ +ScreenPtr pSpriteScreen;/* screen containing current sprite */ +CursorPtr pCursor; /* current cursor */ +CursorPtr pSpriteCursor;/* cursor on screen */ +BoxRec limits; /* current constraints */ +Bool confined; /* pointer can't change screens */ +int x, y; /* hot spot location */ +int devx, devy; /* sprite position */ +Bool generateEvent; /* generate an event during warping? */ +} miPointerRec, *miPointerPtr; + DevPrivateKeyRec miPointerScreenKeyRec; #define GetScreenPrivate(s) ((miPointerScreenPtr) \ diff --git a/mi/mipointrst.h b/mi/mipointrst.h index 104e45c..4319b12 100644 --- a/mi/mipointrst.h +++ b/mi/mipointrst.h @@ -35,18 +35,6 @@ in this Software without prior written authorization from The Open Group. #include "scrnintstr.h" typedef struct { -ScreenPtr pScreen; /* current screen */ -ScreenPtr pSpriteScreen;/* screen containing current sprite */ -CursorPtr pCursor; /* current cursor */ -CursorPtr pSpriteCursor;/* cursor on screen */ -BoxRec limits; /* current constraints */ -Bool confined; /* pointer can't change screens */ -int x, y; /* hot spot location */ -int devx, devy; /* sprite position */ -Bool generateEvent; /* generate an event during warping? */ -} miPointerRec, *miPointerPtr; - -typedef struct { miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */ miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */ CloseScreenProcPtr CloseScreen; -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 12/20] hw/xwayland: Use NotifyFd handler to monitor wayland socket
Replace the block/wakeup handler with a NotifyFd callback instead. Signed-off-by: Keith Packard--- hw/xwayland/xwayland.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index e31becf..bea2164 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -115,6 +115,8 @@ xwl_close_screen(ScreenPtr screen) _screen->seat_list, link) xwl_seat_destroy(xwl_seat); +RemoveNotifyFd(xwl_screen->wayland_fd); + wl_display_disconnect(xwl_screen->display); screen->CloseScreen = xwl_screen->CloseScreen; @@ -428,17 +430,11 @@ static const struct wl_registry_listener registry_listener = { }; static void -wakeup_handler(void *data, int err, void *read_mask) +socket_handler(int fd, int ready, void *data) { struct xwl_screen *xwl_screen = data; int ret; -if (err < 0) -return; - -if (!FD_ISSET(xwl_screen->wayland_fd, (fd_set *) read_mask)) -return; - ret = wl_display_read_events(xwl_screen->display); if (ret == -1) FatalError("failed to dispatch Wayland events: %s\n", strerror(errno)); @@ -451,7 +447,12 @@ wakeup_handler(void *data, int err, void *read_mask) } static void -block_handler(void *data, struct timeval **tv, void *read_mask) +wakeup_handler(void *data, int err) +{ +} + +static void +block_handler(void *data) { struct xwl_screen *xwl_screen = data; int ret; @@ -626,7 +627,7 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) #endif xwl_screen->wayland_fd = wl_display_get_fd(xwl_screen->display); -AddGeneralSocket(xwl_screen->wayland_fd); +SetNotifyFd(xwl_screen->wayland_fd, socket_handler, X_NOTIFY_READ, xwl_screen); RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, xwl_screen); pScreen->SaveScreen = xwl_save_screen; -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 01/20] Remove non-smart scheduler. Don't require setitimer.
This allows the server to call GetTimeInMillis() after each request is processed to avoid needing setitimer. -dumbSched now turns off the setitimer. Signed-off-by: Keith Packard--- configure.ac| 2 +- dix/dispatch.c | 17 ++--- include/dix-config.h.in | 3 +++ include/dixstruct.h | 6 +- os/WaitFor.c| 14 -- os/io.c | 13 ++--- os/utils.c | 38 -- 7 files changed, 45 insertions(+), 48 deletions(-) diff --git a/configure.ac b/configure.ac index 14a5bb8..2e38efa 100644 --- a/configure.ac +++ b/configure.ac @@ -218,7 +218,7 @@ AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \ getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \ - mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext]) + mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext setitimer]) AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include ]]) diff --git a/dix/dispatch.c b/dix/dispatch.c index 2c20124..53032dc 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -222,11 +222,11 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL5 #define SMART_SCHEDULE_MAX_SLICE 15 -#if defined(WIN32) && !defined(__CYGWIN__) -Bool SmartScheduleDisable = TRUE; -#else -Bool SmartScheduleDisable = FALSE; +#ifdef HAVE_SETITIMER +#define SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE HAVE_SETITIMER +Bool SmartScheduleSignalEnable = SMART_SCHEDULE_DEFAULT_SIGNAL_ENABLE; #endif + long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -358,7 +358,7 @@ Dispatch(void) nready = WaitForSomething(clientReady); -if (nready && !SmartScheduleDisable) { +if (nready) { clientReady[0] = SmartScheduleClient(clientReady, nready); nready = 1; } @@ -386,8 +386,8 @@ Dispatch(void) ProcessInputEvents(); FlushIfCriticalOutputPending(); -if (!SmartScheduleDisable && -(SmartScheduleTime - start_tick) >= SmartScheduleSlice) { +if ((SmartScheduleTime - start_tick) >= SmartScheduleSlice) +{ /* Penalize clients which consume ticks */ if (client->smart_priority > SMART_MIN_PRIORITY) client->smart_priority--; @@ -431,6 +431,9 @@ Dispatch(void) (*client->requestVector[client->majorOp]) (client); XaceHookAuditEnd(client, result); } +if (!SmartScheduleSignalEnable) +SmartScheduleTime = GetTimeInMillis(); + #ifdef XSERVER_DTRACE if (XSERVER_REQUEST_DONE_ENABLED()) XSERVER_REQUEST_DONE(LookupMajorName(client->majorOp), diff --git a/include/dix-config.h.in b/include/dix-config.h.in index 112ab95..940d2b7 100644 --- a/include/dix-config.h.in +++ b/include/dix-config.h.in @@ -518,4 +518,7 @@ /* Define if no local socket credentials interface exists */ #undef NO_LOCAL_CLIENT_CRED +/* Have setitimer support */ +#undef HAVE_SETITIMER + #endif /* _DIX_CONFIG_H_ */ diff --git a/include/dixstruct.h b/include/dixstruct.h index 7575066..8e70ae1 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -130,7 +130,11 @@ extern long SmartScheduleTime; extern long SmartScheduleInterval; extern long SmartScheduleSlice; extern long SmartScheduleMaxSlice; -extern Bool SmartScheduleDisable; +#if HAVE_SETITIMER +extern Bool SmartScheduleSignalEnable; +#else +#define SmartScheduleSignalEnable FALSE +#endif extern void SmartScheduleStartTimer(void); extern void SmartScheduleStopTimer(void); diff --git a/os/WaitFor.c b/os/WaitFor.c index 993c14e..7325430 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -175,16 +175,10 @@ WaitForSomething(int *pClientsReady) if (workQueue) ProcessWorkQueue(); if (XFD_ANYSET()) { -if (!SmartScheduleDisable) { -someReady = TRUE; -waittime.tv_sec = 0; -waittime.tv_usec = 0; -wt = -} -else { -XFD_COPYSET(, ); -break; -} +someReady = TRUE; +waittime.tv_sec = 0; +waittime.tv_usec = 0; +wt = } if (someReady) { XFD_COPYSET(, ); diff --git a/os/io.c b/os/io.c index 96a243d..864f44a 100644 --- a/os/io.c +++ b/os/io.c @@ -462,23 +462,14 @@ ReadRequestFromClient(ClientPtr client) ) FD_SET(fd,
[PATCH xserver 18/20] Remove readmask from screen block/wakeup handler
With no users of the interface needing the readmask anymore, we can remove it from the argument passed to these functions. Signed-off-by: Keith Packard--- composite/compalloc.c | 4 ++-- dix/dixutils.c | 14 ++ exa/exa.c | 10 -- glamor/glamor.c | 4 ++-- hw/kdrive/src/kdrive.h | 6 ++ hw/kdrive/src/kinput.c | 4 ++-- hw/xfree86/common/xf86VGAarbiter.c | 10 -- hw/xfree86/common/xf86VGAarbiterPriv.h | 6 ++ hw/xfree86/dri/dri.c| 12 hw/xfree86/dri/dri.h| 7 ++- hw/xfree86/drivers/modesetting/driver.c | 4 ++-- hw/xfree86/modes/xf86Rotate.c | 5 ++--- include/scrnintstr.h| 11 +++ mi/misprite.c | 8 +++- 14 files changed, 44 insertions(+), 61 deletions(-) diff --git a/composite/compalloc.c b/composite/compalloc.c index 8daded0..e6a203f 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -55,13 +55,13 @@ compScreenUpdate(ScreenPtr pScreen) } static void -compBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask) +compBlockHandler(ScreenPtr pScreen, void *pTimeout) { CompScreenPtr cs = GetCompScreen(pScreen); pScreen->BlockHandler = cs->BlockHandler; compScreenUpdate(pScreen); -(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); +(*pScreen->BlockHandler) (pScreen, pTimeout); /* Next damage will restore the block handler */ cs->BlockHandler = NULL; diff --git a/dix/dixutils.c b/dix/dixutils.c index 205550e..6951b39 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -384,11 +384,11 @@ BlockHandler(void *pTimeout, void *pReadmask) ++inHandler; for (i = 0; i < screenInfo.numScreens; i++) -(*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], -pTimeout, pReadmask); +(*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], timeout); + for (i = 0; i < screenInfo.numGPUScreens; i++) -(*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], - pTimeout, pReadmask); +(*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], timeout); + for (i = 0; i < numHandlers; i++) if (!handlers[i].deleted) (*handlers[i].BlockHandler) (handlers[i].blockData, @@ -423,11 +423,9 @@ WakeupHandler(int result, void *pReadmask) (*handlers[i].WakeupHandler) (handlers[i].blockData, result, pReadmask); for (i = 0; i < screenInfo.numScreens; i++) -(*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], - result, pReadmask); +(*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], result); for (i = 0; i < screenInfo.numGPUScreens; i++) -(*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], -result, pReadmask); +(*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], result); if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { diff --git a/exa/exa.c b/exa/exa.c index 51d36f3..7266b71 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -702,8 +702,7 @@ exaCreateScreenResources(ScreenPtr pScreen) } static void -ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, -void *pReadmask) +ExaBlockHandler(ScreenPtr pScreen, void *pTimeout) { ExaScreenPriv(pScreen); @@ -712,7 +711,7 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); unwrap(pExaScr, pScreen, BlockHandler); -(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); +(*pScreen->BlockHandler) (pScreen, pTimeout); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); /* The rest only applies to classic EXA */ @@ -732,13 +731,12 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout, } static void -ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, - void *pReadmask) +ExaWakeupHandler(ScreenPtr pScreen, int result) { ExaScreenPriv(pScreen); unwrap(pExaScr, pScreen, WakeupHandler); -(*pScreen->WakeupHandler) (pScreen, result, pReadmask); +(*pScreen->WakeupHandler) (pScreen, result); wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); if (result == 0 && pExaScr->numOffscreenAvailable > 1) { diff --git a/glamor/glamor.c b/glamor/glamor.c index d4a0236..ce64d76 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -232,12 +232,12 @@ glamor_block_handler(ScreenPtr screen) } static void -_glamor_block_handler(ScreenPtr screen,
[PATCH xserver 05/20] dix: Switch to the libXfont2 API (v2)
This new libXfont API eliminates exposing internal X server symbols to the font library, replacing those with a struct full of the entire API needed to use that library. v2: Use libXfont2 instead of libXfont_2 Signed-off-by: Keith Packard--- Xext/xf86bigfont.c | 4 +- configure.ac | 2 +- dix/dispatch.c | 4 +- dix/dixfonts.c | 323 + dix/main.c | 4 +- glamor/glamor_font.c | 6 +- hw/dmx/dmxfont.c | 9 +- hw/dmx/dmxscrinit.c| 4 +- hw/xfree86/sdksyms.sh | 1 - hw/xnest/Font.c| 7 +- hw/xnest/Init.c| 3 +- include/dixfont.h | 18 +-- include/dixfontstr.h | 1 + include/dixfontstubs.h | 43 --- mi/miglblt.c | 6 +- miext/damage/damage.c | 4 +- os/utils.c | 4 +- 17 files changed, 231 insertions(+), 212 deletions(-) delete mode 100644 include/dixfontstubs.h diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 95b5371..682d84f 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -439,7 +439,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) #ifdef HAS_SHM if (pDesc && !badSysCall) { *(CARD32 *) (pCI + nCharInfos) = signature; -if (!FontSetPrivate(pFont, FontShmdescIndex, pDesc)) { +if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) { shmdealloc(pDesc); return BadAlloc; } @@ -723,7 +723,7 @@ XFree86BigfontExtensionInit(void) + (unsigned int) (65536.0 / (RAND_MAX + 1.0) * rand()); /* fprintf(stderr, "signature = 0x%08X\n", signature); */ -FontShmdescIndex = AllocateFontPrivateIndex(); +FontShmdescIndex = xfont2_allocate_font_private_index(); #if !defined(CSRG_BASED) && !defined(__CYGWIN__) pagesize = SHMLBA; diff --git a/configure.ac b/configure.ac index 2e38efa..be25b78 100644 --- a/configure.ac +++ b/configure.ac @@ -809,7 +809,7 @@ LIBEGL="egl" LIBGBM="gbm >= 10.2.0" LIBGL="gl >= 7.1.0" LIBXEXT="xext >= 1.0.99.4" -LIBXFONT="xfont >= 1.4.2" +LIBXFONT="xfont2 >= 2.0.0" LIBXI="xi >= 1.2.99.1" LIBXTST="xtst >= 1.0.99.2" LIBPCIACCESS="pciaccess >= 0.12.901" diff --git a/dix/dispatch.c b/dix/dispatch.c index 53032dc..08661f8 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -108,7 +108,7 @@ int ProcInitialConnection(); #include "windowstr.h" #include -#include +#include #include "dixfontstr.h" #include "gcstruct.h" #include "selection.h" @@ -1289,7 +1289,7 @@ ProcQueryTextExtents(ClientPtr client) return BadLength; length--; } -if (!QueryTextExtents(pFont, length, (unsigned char *) [1], )) +if (!xfont2_query_text_extents(pFont, length, (unsigned char *) [1], )) return BadAlloc; reply = (xQueryTextExtentsReply) { .type = X_Reply, diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 19db141..d217d12 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -65,6 +65,7 @@ Equipment Corporation. #include "closestr.h" #include "dixfont.h" #include "xace.h" +#include #ifdef XF86BIGFONT #include "xf86bigfontsrv.h" @@ -75,7 +76,7 @@ extern FontPtr defaultFont; static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0; static int num_fpes = 0; -static FPEFunctions *fpe_functions = (FPEFunctions *) 0; +static xfont2_fpe_funcs_rec const **fpe_functions; static int num_fpe_types = 0; static unsigned char *font_path_string; @@ -83,7 +84,7 @@ static unsigned char *font_path_string; static int num_slept_fpes = 0; static int size_slept_fpes = 0; static FontPathElementPtr *slept_fpes = (FontPathElementPtr *) 0; -static FontPatternCachePtr patternCache; +static xfont2_pattern_cache_ptr patternCache; static int FontToXError(int err) @@ -108,18 +109,18 @@ static int LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, unsigned char *data) { -if (fpe_functions[pfont->fpe->type].load_glyphs) -return (*fpe_functions[pfont->fpe->type].load_glyphs) +if (fpe_functions[pfont->fpe->type]->load_glyphs) +return (*fpe_functions[pfont->fpe->type]->load_glyphs) (client, pfont, 0, nchars, item_size, data); else return Successful; } void -dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, - FontEncoding fontEncoding, - unsigned long *glyphcount,/* RETURN */ - CharInfoPtr *glyphs) /* RETURN */ +GetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, + FontEncoding fontEncoding, + unsigned long *glyphcount,/* RETURN */ + CharInfoPtr *glyphs) /* RETURN */ { (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs); } @@ -206,7 +207,7 @@ FontWakeup(void *data, int count, void *LastSelectMask) /* wake up any fpe's
[PATCH xserver 10/20] kdrive/ephyr: Use NotifyFd for XCB connection input [v2]
Eliminates polling every 20ms for device input. v2: rename ephyrPoll to ephyrXcbNotify and fix the API so it can be used directly for SetNotifyFd. Thanks to Daniel MartinSigned-off-by: Keith Packard Cc: Daniel Martin --- hw/kdrive/ephyr/ephyr.c | 6 -- hw/kdrive/ephyr/ephyr.h | 3 --- hw/kdrive/ephyr/hostx.c | 6 ++ hw/kdrive/ephyr/hostx.h | 2 ++ hw/kdrive/ephyr/os.c| 1 - 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index cb1c16e..896bac5 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -1182,8 +1182,8 @@ ephyrProcessConfigureNotify(xcb_generic_event_t *xev) #endif /* RANDR */ } -void -ephyrPoll(void) +static void +ephyrXcbNotify(int fd, int ready, void *data) { xcb_connection_t *conn = hostx_get_xcbconn(); @@ -1334,6 +1334,7 @@ static Status MouseEnable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = TRUE; +SetNotifyFd(hostx_get_fd(), ephyrXcbNotify, X_NOTIFY_READ, NULL); return Success; } @@ -1341,6 +1342,7 @@ static void MouseDisable(KdPointerInfo * pi) { ((EphyrPointerPrivate *) pi->driverPrivate)->enabled = FALSE; +RemoveNotifyFd(hostx_get_fd()); return; } diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h index 18bfe11..f5015f6 100644 --- a/hw/kdrive/ephyr/ephyr.h +++ b/hw/kdrive/ephyr/ephyr.h @@ -168,9 +168,6 @@ Bool Bool ephyrCreateColormap(ColormapPtr pmap); -void - ephyrPoll(void); - #ifdef RANDR Bool ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations); diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 3991c51..49516bb 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -1113,6 +1113,12 @@ hostx_get_screen(void) } int +hostx_get_fd(void) +{ +return xcb_get_file_descriptor(HostX.conn); +} + +int hostx_get_window(int a_screen_number) { EphyrScrPriv *scrpriv; diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index 9299e8d..d416dae 100644 --- a/hw/kdrive/ephyr/hostx.h +++ b/hw/kdrive/ephyr/hostx.h @@ -198,4 +198,6 @@ int hostx_has_dri(void); int hostx_has_glx(void); #endif /* XF86DRI */ +int hostx_get_fd(void); + #endif /*_XLIBS_STUFF_H_*/ diff --git a/hw/kdrive/ephyr/os.c b/hw/kdrive/ephyr/os.c index 0dbcbb8..b481d0a 100644 --- a/hw/kdrive/ephyr/os.c +++ b/hw/kdrive/ephyr/os.c @@ -45,5 +45,4 @@ EphyrInit(void) KdOsFuncs EphyrOsFuncs = { .Init = EphyrInit, -.pollEvents = ephyrPoll, }; -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 07/20] config: Use NotifyFd interface for udev
This uses the NotifyFd interface to monitor the udev file descriptor rather than adding another block/wakeup handler Signed-off-by: Keith Packard--- config/udev.c | 45 - 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/config/udev.c b/config/udev.c index 28c2658..08a954b 100644 --- a/config/udev.c +++ b/config/udev.c @@ -332,41 +332,30 @@ device_removed(struct udev_device *device) } static void -wakeup_handler(void *data, int err, void *read_mask) +socket_handler(int fd, int ready, void *data) { -int udev_fd = udev_monitor_get_fd(udev_monitor); struct udev_device *udev_device; const char *action; -if (err < 0) +udev_device = udev_monitor_receive_device(udev_monitor); +if (!udev_device) return; - -if (FD_ISSET(udev_fd, (fd_set *) read_mask)) { -udev_device = udev_monitor_receive_device(udev_monitor); -if (!udev_device) -return; -action = udev_device_get_action(udev_device); -if (action) { -if (!strcmp(action, "add")) { +action = udev_device_get_action(udev_device); +if (action) { +if (!strcmp(action, "add")) { +device_removed(udev_device); +device_added(udev_device); +} else if (!strcmp(action, "change")) { +/* ignore change for the drm devices */ +if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { device_removed(udev_device); device_added(udev_device); -} else if (!strcmp(action, "change")) { -/* ignore change for the drm devices */ -if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { -device_removed(udev_device); -device_added(udev_device); -} } -else if (!strcmp(action, "remove")) -device_removed(udev_device); } -udev_device_unref(udev_device); +else if (!strcmp(action, "remove")) +device_removed(udev_device); } -} - -static void -block_handler(void *data, struct timeval **tv, void *read_mask) -{ +udev_device_unref(udev_device); } int @@ -441,8 +430,7 @@ config_udev_init(void) } udev_enumerate_unref(enumerate); -RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); -AddGeneralSocket(udev_monitor_get_fd(udev_monitor)); +SetNotifyFd(udev_monitor_get_fd(udev_monitor), socket_handler, X_NOTIFY_READ, NULL); return 1; } @@ -457,8 +445,7 @@ config_udev_fini(void) udev = udev_monitor_get_udev(udev_monitor); -RemoveGeneralSocket(udev_monitor_get_fd(udev_monitor)); -RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, NULL); +RemoveNotifyFd(udev_monitor_get_fd(udev_monitor)); udev_monitor_unref(udev_monitor); udev_monitor = NULL; udev_unref(udev); -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 02/20] os: Add NotifyFd interfaces
This provides a callback-based interface to monitor file descriptors beyond the usual client and device interfaces. Modules within the server using file descriptors for reading and/or writing can call Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); mask can be any combination of X_NOTIFY_READ and X_NOTIFY_WRITE. When 'fd' becomes readable or writable, the notify_fd function will be called with the 'fd', the ready conditions and 'data' values as arguments, When the module no longer needs to monitor the fd, it will call void RemoveNotifyFd(int fd); RemoveNotifyFd may be called from the notify function. Signed-off-by: Keith Packard--- include/os.h| 13 os/WaitFor.c| 4 +++ os/connection.c | 93 + os/osdep.h | 5 os/osinit.c | 1 + 5 files changed, 116 insertions(+) diff --git a/include/os.h b/include/os.h index 9937f2e..aed2e2f 100644 --- a/include/os.h +++ b/include/os.h @@ -154,6 +154,19 @@ extern _X_EXPORT void AddEnabledDevice(int /*fd */ ); extern _X_EXPORT void RemoveEnabledDevice(int /*fd */ ); +typedef void (*NotifyFdProcPtr)(int fd, int ready, void *data); + +#define X_NOTIFY_NONE 0 +#define X_NOTIFY_READ 1 +#define X_NOTIFY_WRITE 2 + +extern _X_EXPORT Bool SetNotifyFd(int fd, NotifyFdProcPtr notify_fd, int mask, void *data); + +static inline void RemoveNotifyFd(int fd) +{ +(void) SetNotifyFd(fd, NULL, X_NOTIFY_NONE, NULL); +} + extern _X_EXPORT int OnlyListenToOneClient(ClientPtr /*client */ ); extern _X_EXPORT void ListenToAllClients(void); diff --git a/os/WaitFor.c b/os/WaitFor.c index 7325430..12b21bb 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -306,6 +306,10 @@ WaitForSomething(int *pClientsReady) QueueWorkProc(EstablishNewConnections, NULL, (void *) ); +XFD_ANDSET(_set, , ); +if (XFD_ANYSET(_set)) +HandleNotifyFds(); + if (XFD_ANYSET() || XFD_ANYSET()) break; /* check here for DDXes that queue events during Block/Wakeup */ diff --git a/os/connection.c b/os/connection.c index 3d33c41..4f2e989 100644 --- a/os/connection.c +++ b/os/connection.c @@ -123,6 +123,7 @@ static int lastfdesc; /* maximum file descriptor */ fd_set WellKnownConnections;/* Listener mask */ fd_set EnabledDevices; /* mask for input devices that are on */ +fd_set NotifyReadFds; /* mask for other file descriptors */ fd_set AllSockets; /* select on this */ fd_set AllClients; /* available clients */ fd_set LastSelectMask; /* mask returned from last select call */ @@ -1090,6 +1091,98 @@ RemoveEnabledDevice(int fd) RemoveGeneralSocket(fd); } +struct notify_fd { +struct xorg_list list; +int fd; +int mask; +NotifyFdProcPtr notify; +void *data; +}; + +static struct xorg_list notify_fds; + +void +InitNotifyFds(void) +{ +struct notify_fd *s, *next; +static int been_here; + +if (been_here) +xorg_list_for_each_entry_safe(s, next, _fds, list) +RemoveNotifyFd(s->fd); + +xorg_list_init(_fds); +been_here = 1; +} + +/* + * SetNotifyFd + *Registers a callback to be invoked when the specified + *file descriptor becomes readable. + */ + +Bool +SetNotifyFd(int fd, NotifyFdProcPtr notify, int mask, void *data) +{ +struct notify_fd *n; +int changes; + +xorg_list_for_each_entry(n, _fds, list) +if (n->fd == fd) +break; + +if (>list == _fds) { +if (mask == 0) +return TRUE; + +n = calloc(1, sizeof (struct notify_fd)); +if (!n) +return FALSE; +n->fd = fd; +xorg_list_add(>list, _fds); +} + +changes = n->mask ^ mask; + +if (changes & X_NOTIFY_READ) { +if (mask & X_NOTIFY_READ) { +FD_SET(fd, ); +AddGeneralSocket(fd); +} else { +RemoveGeneralSocket(fd); +FD_CLR(fd, ); +} +} +if (mask == 0) { +xorg_list_del(>list); +free(n); +} else { +n->mask = mask; +n->data = data; +n->notify = notify; +} + +return TRUE; +} + +/* + * HandlNotifyFds + *A WorkProc to be called when any of the registered + *file descriptors are readable. + */ + +void +HandleNotifyFds(void) +{ +struct notify_fd *s, *next; + +xorg_list_for_each_entry_safe(s, next, _fds, list) { +if (FD_ISSET(s->fd, )) { +s->notify(s->fd, X_NOTIFY_READ, s->data); +} +} +} + /* * OnlyListenToOneClient: *Only accept requests from one client. Continue to handle new diff --git a/os/osdep.h b/os/osdep.h index 86263a5..2bfc783 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -159,6 +159,10
[PATCH xserver 09/20] hw/kdrive: Use NotifyFd for kdrive input devices
This switches the kdrive code to use FD notification for input devices, rather than the block and wakeup handlers. Signed-off-by: Keith Packard--- hw/kdrive/src/kinput.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 4bb9315..da4f84a 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -153,7 +153,16 @@ KdNonBlockFd(int fd) } static void -KdAddFd(int fd) +KdNotifyFd(int fd, int ready, void *data) +{ +int i = (int) (intptr_t) data; +OsBlockSIGIO(); +(*kdInputFds[i].read)(fd, kdInputFds[i].closure); +OsReleaseSIGIO(); +} + +static void +KdAddFd(int fd, int i) { struct sigaction act; sigset_t set; @@ -162,6 +171,7 @@ KdAddFd(int fd) fcntl(fd, F_SETOWN, getpid()); KdNonBlockFd(fd); AddEnabledDevice(fd); +SetNotifyFd(fd, KdNotifyFd, X_NOTIFY_READ, (void *) (intptr_t) i); memset(, '\0', sizeof act); act.sa_handler = KdSigio; sigemptyset(_mask); @@ -181,6 +191,7 @@ KdRemoveFd(int fd) kdnFds--; RemoveEnabledDevice(fd); +RemoveNotifyFd(fd); flags = fcntl(fd, F_GETFL); flags &= ~(FASYNC | NOBLOCK); fcntl(fd, F_SETFL, flags); @@ -202,9 +213,9 @@ KdRegisterFd(int fd, void (*read) (int fd, void *closure), void *closure) kdInputFds[kdNumInputFds].enable = 0; kdInputFds[kdNumInputFds].disable = 0; kdInputFds[kdNumInputFds].closure = closure; -kdNumInputFds++; if (kdInputEnabled) -KdAddFd(fd); +KdAddFd(fd, kdNumInputFds); +kdNumInputFds++; return TRUE; } @@ -1933,19 +1944,8 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask) void KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, void *readmask) { -int result = (int) lresult; -fd_set *pReadmask = (fd_set *) readmask; -int i; KdPointerInfo *pi; -if (kdInputEnabled && result > 0) { -for (i = 0; i < kdNumInputFds; i++) -if (FD_ISSET(kdInputFds[i].fd, pReadmask)) { -OsBlockSIGIO(); -(*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); -OsReleaseSIGIO(); -} -} for (pi = kdPointers; pi; pi = pi->next) { if (pi->timeoutPending) { if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) { -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 13/20] Xext/xselinux: Use NotifyFd interface
Replace block/wakeup handlers with SetNotifyFd. Much nicer now. Signed-off-by: Keith Packard--- Xext/xselinux_hooks.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Xext/xselinux_hooks.c b/Xext/xselinux_hooks.c index d9f2f68..2d85928 100644 --- a/Xext/xselinux_hooks.c +++ b/Xext/xselinux_hooks.c @@ -810,15 +810,9 @@ SELinuxResourceState(CallbackListPtr *pcbl, void *unused, void *calldata) static int netlink_fd; static void -SELinuxBlockHandler(void *data, struct timeval **tv, void *read_mask) +SELinuxNetlinkNotify(int fd, int ready, void *data) { -} - -static void -SELinuxWakeupHandler(void *data, int num_fds, void *read_mask) -{ -if (num_fds > 0 && FD_ISSET(netlink_fd, (fd_set *) read_mask)) -avc_netlink_check_nb(); +avc_netlink_check_nb(); } void @@ -844,9 +838,7 @@ SELinuxFlaskReset(void) /* Tear down SELinux stuff */ audit_close(audit_fd); avc_netlink_release_fd(); -RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, - NULL); -RemoveGeneralSocket(netlink_fd); +RemoveNotifyFd(netlink_fd); avc_destroy(); } @@ -918,9 +910,7 @@ SELinuxFlaskInit(void) FatalError("SELinux: Failed to create atom\n"); netlink_fd = avc_netlink_acquire_fd(); -AddGeneralSocket(netlink_fd); -RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler, - NULL); +SetNotifyFd(netlink_fd, SELinuxNetlinkNotify, X_NOTIFY_READ, NULL); /* Register callbacks */ ret &= AddCallback(, SELinuxClientState, NULL); -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 04/20] dix: Move InitFonts up above screen initialization
Font initialization was split into two stages, the first was to set up font privates with a call to ResetFontPrivateIndex, then much later the call to InitFonts to set up all of the FPEs. Doing the full font initialization before initializing the video drivers means that we can move the call to ResetFontPrivateIndex inside InitFonts. Signed-off-by: Keith Packard--- dix/dixfonts.c | 2 ++ dix/main.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 300bf04..19db141 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1809,6 +1809,8 @@ InitFonts(void) { patternCache = MakeFontPatternCache(); +ResetFontPrivateIndex(); + register_fpe_functions(); } diff --git a/dix/main.c b/dix/main.c index 5495676..661ab03 100644 --- a/dix/main.c +++ b/dix/main.c @@ -199,7 +199,7 @@ dix_main(int argc, char *argv[], char *envp[]) InitEvents(); InitGlyphCaching(); dixResetRegistry(); -ResetFontPrivateIndex(); +InitFonts(); InitCallbackManager(); InitOutput(, argc, argv); @@ -232,7 +232,6 @@ dix_main(int argc, char *argv[], char *envp[]) FatalError("failed to create root window"); } -InitFonts(); if (SetDefaultFontPath(defaultFontPath) != Success) { ErrorF("[dix] failed to set default font path '%s'", defaultFontPath); -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 14/20] os/xdmcp: Replace xdmcp block/wakeup handlers with timer and NotifyFd
This removes the block and wakeup handlers and replaces them with a combination of a NotifyFd callback and timers. Signed-off-by: Keith Packard--- os/xdmcp.c | 114 +++-- 1 file changed, 36 insertions(+), 78 deletions(-) diff --git a/os/xdmcp.c b/os/xdmcp.c index 5bdcbe9..dbf43ef 100644 --- a/os/xdmcp.c +++ b/os/xdmcp.c @@ -82,10 +82,10 @@ static struct sockaddr_in req_sockaddr; #endif static int req_socklen; static CARD32 SessionID; -static CARD32 timeOutTime; static int timeOutRtx; static CARD16 DisplayNumber; static xdmcp_states XDM_INIT_STATE = XDM_OFF; +static OsTimerPtr xdmcp_timer; #ifdef HASXDMAUTH static char *xdmAuthCookie; @@ -197,13 +197,9 @@ static void send_packet(void); static void timeout(void); -static void XdmcpBlockHandler(void *data , - struct timeval**wt, - void *LastSelectMask); +static void XdmcpSocketNotify(int fd, int ready, void *data); -static void XdmcpWakeupHandler(void *data, - int i, - void *LastSelectMask); +static CARD32 XdmcpTimerNotify(OsTimerPtr timer, CARD32 time, void *arg); /* * Register the Manufacturer display ID @@ -579,6 +575,21 @@ XdmcpRegisterDisplayClass(const char *name, int length) DisplayClass.data[i] = (CARD8) name[i]; } +static void +xdmcp_start(void) +{ +timeOutRtx = 0; +get_xdmcp_sock(); +if (xdmcpSocket >= 0) +SetNotifyFd(xdmcpSocket, XdmcpSocketNotify, X_NOTIFY_READ, NULL); +#if defined(IPv6) && defined(AF_INET6) +if (xdmcpSocket6 >= 0) +SetNotifyFd(xdmcpSocket6, XdmcpSocketNotify, X_NOTIFY_READ, NULL); +#endif +xdmcp_timer = TimerSet(NULL, 0, 0, XdmcpTimerNotify, NULL); +send_packet(); +} + /* * initialize XDMCP; create the socket, compute the display * number, set up the state machine @@ -597,12 +608,8 @@ XdmcpInit(void) XdmcpRegisterDisplayClass(defaultDisplayClass, strlen(defaultDisplayClass)); AccessUsingXdmcp(); -RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (void *) 0); -timeOutRtx = 0; DisplayNumber = (CARD16) atoi(display); -get_xdmcp_sock(); -send_packet(); +xdmcp_start(); } } @@ -610,12 +617,8 @@ void XdmcpReset(void) { state = XDM_INIT_STATE; -if (state != XDM_OFF) { -RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler, - (void *) 0); -timeOutRtx = 0; -send_packet(); -} +if (state != XDM_OFF) +xdmcp_start(); } /* @@ -630,7 +633,7 @@ XdmcpOpenDisplay(int sock) if (state != XDM_AWAIT_MANAGE_RESPONSE) return; state = XDM_RUN_SESSION; -timeOutTime = GetTimeInMillis() + XDM_DEF_DORMANCY * 1000; +TimerSet(xdmcp_timer, 0, XDM_DEF_DORMANCY * 1000, XdmcpTimerNotify, NULL); sessionSocket = sock; } @@ -648,69 +651,24 @@ XdmcpCloseDisplay(int sock) isItTimeToYield = TRUE; } -/* - * called before going to sleep, this routine - * may modify the timeout value about to be sent - * to select; in this way XDMCP can do appropriate things - * dynamically while starting up - */ - - /*ARGSUSED*/ static void -XdmcpBlockHandler(void *data, /* unused */ - struct timeval **wt, void *pReadmask) +static void +XdmcpSocketNotify(int fd, int ready, void *data) { -fd_set *last_select_mask = (fd_set *) pReadmask; -CARD32 millisToGo; - if (state == XDM_OFF) return; -FD_SET(xdmcpSocket, last_select_mask); -#if defined(IPv6) && defined(AF_INET6) -if (xdmcpSocket6 >= 0) -FD_SET(xdmcpSocket6, last_select_mask); -#endif -if (timeOutTime == 0) -return; -millisToGo = timeOutTime - GetTimeInMillis(); -if ((int) millisToGo < 0) -millisToGo = 0; -AdjustWaitForDelay(wt, millisToGo); +receive_packet(fd); } -/* - * called after select returns; this routine will - * recognise when XDMCP packets await and - * process them appropriately - */ - - /*ARGSUSED*/ static void -XdmcpWakeupHandler(void *data,/* unused */ - int i, void *pReadmask) +static CARD32 +XdmcpTimerNotify(OsTimerPtr timer, CARD32 time, void *arg) { -fd_set *last_select_mask = (fd_set *) pReadmask; - -if (state == XDM_OFF) -return; -if (i > 0) { -if (FD_ISSET(xdmcpSocket, last_select_mask)) { -receive_packet(xdmcpSocket); -FD_CLR(xdmcpSocket, last_select_mask); -} -#if defined(IPv6) && defined(AF_INET6) -if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, last_select_mask)) { -receive_packet(xdmcpSocket6); -FD_CLR(xdmcpSocket6, last_select_mask); -}
[PATCH xserver 06/20] config: Use NotifyFd for dbus interface
This uses the NotifyFd interface to monitor the dbus socket rather than a block/wakeup handler. Signed-off-by: Keith Packard--- config/dbus-core.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/config/dbus-core.c b/config/dbus-core.c index 8351ea4..3c85ad7 100644 --- a/config/dbus-core.c +++ b/config/dbus-core.c @@ -48,11 +48,11 @@ static struct dbus_core_info bus_info; static CARD32 reconnect_timer(OsTimerPtr timer, CARD32 time, void *arg); static void -wakeup_handler(void *data, int num_fds, void *read_mask) +socket_handler(int fd, int ready, void *data) { struct dbus_core_info *info = data; -if (info->connection && num_fds > 0 && FD_ISSET(info->fd, (fd_set *) read_mask)) { +if (info->connection) { do { dbus_connection_read_write_dispatch(info->connection, 0); } while (info->connection && @@ -62,11 +62,6 @@ wakeup_handler(void *data, int num_fds, void *read_mask) } } -static void -block_handler(void *data, struct timeval **tv, void *read_mask) -{ -} - /** * Disconnect (if we haven't already been forcefully disconnected), clean up * after ourselves, and call all registered disconnect hooks. @@ -87,9 +82,8 @@ teardown(void) if (bus_info.connection) dbus_connection_unref(bus_info.connection); -RemoveBlockAndWakeupHandlers(block_handler, wakeup_handler, _info); if (bus_info.fd != -1) -RemoveGeneralSocket(bus_info.fd); +RemoveNotifyFd(bus_info.fd); bus_info.fd = -1; bus_info.connection = NULL; @@ -162,9 +156,7 @@ connect_to_bus(void) } dbus_error_free(); -AddGeneralSocket(bus_info.fd); - -RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, _info); +SetNotifyFd(bus_info.fd, socket_handler, X_NOTIFY_READ, _info); for (hook = bus_info.hooks; hook; hook = hook->next) { if (hook->connect) -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 16/20] hw/xfree86: Use NotifyFd for device and other input fd wakeups
Remove code in xf86Wakeup for dealing with device and other input and switch to using the new NotifyFd interface. Signed-off-by: Keith Packard--- hw/xfree86/common/xf86Events.c | 67 -- 1 file changed, 26 insertions(+), 41 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 6570f0b..b27d545 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -101,8 +101,6 @@ Bool VTSwitchEnabled = TRUE;/* Allows run-time disabling for switches when using the DRI automatic full screen mode.*/ -extern fd_set EnabledDevices; - #ifdef XF86PM extern void (*xf86OSPMClose) (void); #endif @@ -247,45 +245,6 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) void xf86Wakeup(void *blockData, int err, void *pReadmask) { -fd_set *LastSelectMask = (fd_set *) pReadmask; -fd_set devicesWithInput; -InputInfoPtr pInfo; - -if (err >= 0) { - -XFD_ANDSET(, LastSelectMask, ); -if (XFD_ANYSET()) { -pInfo = xf86InputDevs; -while (pInfo) { -if (pInfo->read_input && pInfo->fd >= 0 && -(FD_ISSET(pInfo->fd, ) != 0)) { -OsBlockSIGIO(); - -/* - * Remove the descriptior from the set because more than one - * device may share the same file descriptor. - */ -FD_CLR(pInfo->fd, ); - -pInfo->read_input(pInfo); -OsReleaseSIGIO(); -} -pInfo = pInfo->next; -} -} -} - -if (err >= 0) { /* we don't want the handlers called if select() */ -IHPtr ih, ih_tmp; /* returned with an error condition, do we? */ - -nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) { -if (ih->enabled && ih->fd >= 0 && ih->ihproc && -(FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) { -ih->ihproc(ih->fd, ih->data); -} -} -} - if (xf86VTSwitchPending()) xf86VTSwitch(); } @@ -305,6 +264,15 @@ xf86SigioReadInput(int fd, void *closure) errno = errno_save; } +static void +xf86NotifyReadInput(int fd, int ready, void *closure) +{ +InputInfoPtr pInfo = closure; +OsBlockSIGIO(); +pInfo->read_input(pInfo); +OsReleaseSIGIO(); +} + /* * xf86AddEnabledDevice -- * @@ -314,6 +282,7 @@ xf86AddEnabledDevice(InputInfoPtr pInfo) { if (!xf86InstallSIGIOHandler(pInfo->fd, xf86SigioReadInput, pInfo)) { AddEnabledDevice(pInfo->fd); +SetNotifyFd(pInfo->fd, xf86NotifyReadInput, X_NOTIFY_READ, pInfo); } } @@ -326,6 +295,7 @@ xf86RemoveEnabledDevice(InputInfoPtr pInfo) { if (!xf86RemoveSIGIOHandler(pInfo->fd)) { RemoveEnabledDevice(pInfo->fd); +RemoveNotifyFd(pInfo->fd); } } @@ -635,6 +605,16 @@ xf86VTSwitch(void) /* Input handler registration */ +static void +xf86InputHandlerNotify(int fd, int ready, void *data) +{ +IHPtr ih = data; + +if (ih->enabled && ih->fd >= 0 && ih->ihproc) { +ih->ihproc(ih->fd, ih->data); +} +} + static void * addInputHandler(int fd, InputHandlerProc proc, void *data) { @@ -652,6 +632,11 @@ addInputHandler(int fd, InputHandlerProc proc, void *data) ih->data = data; ih->enabled = TRUE; +if (!SetNotifyFd(fd, xf86InputHandlerNotify, X_NOTIFY_READ, ih)) { +free(ih); +return NULL; +} + ih->next = InputHandlers; InputHandlers = ih; -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xserver 19/20] Remove fd_set from Block/Wakeup handler API
This removes the last uses of fd_set from the server interfaces outside of the OS layer itself. Signed-off-by: Keith Packard--- Xext/sleepuntil.c | 17 +++-- Xext/sync.c | 12 ++-- dix/dixfonts.c | 7 +++ dix/dixutils.c | 23 +++ hw/dmx/dmxsync.c| 4 ++-- hw/dmx/input/dmxinputinit.c | 4 ++-- hw/kdrive/ephyr/ephyr.c | 4 ++-- hw/vfb/InitOutput.c | 4 ++-- hw/xfree86/common/xf86Events.c | 2 +- hw/xfree86/common/xf86Init.c| 2 +- hw/xfree86/common/xf86Priv.h| 2 +- hw/xfree86/dri/dri.c| 4 ++-- hw/xfree86/dri/dri.h| 6 ++ hw/xnest/Handlers.c | 4 ++-- hw/xnest/Handlers.h | 5 ++--- hw/xwayland/xwayland.c | 2 +- include/dix.h | 26 +- miext/rootless/rootlessScreen.c | 4 ++-- miext/shadow/shadow.c | 4 ++-- os/WaitFor.c| 4 ++-- 20 files changed, 66 insertions(+), 74 deletions(-) diff --git a/Xext/sleepuntil.c b/Xext/sleepuntil.c index 993c028..68a7a9b 100644 --- a/Xext/sleepuntil.c +++ b/Xext/sleepuntil.c @@ -63,14 +63,11 @@ static void ClientAwaken(ClientPtr /* client */ , static int SertafiedDelete(void * /* value */ , XID /* id */ ); -static void SertafiedBlockHandler(void */* data */ , - OSTimePtr /* wt */ , - void */* LastSelectMask */ -); -static void SertafiedWakeupHandler(void * /* data */ , - int /* i */ , - void * /* LastSelectMask */ -); +static void SertafiedBlockHandler(void *data, + void *timeout); + +static void SertafiedWakeupHandler(void *data, + int i); int ClientSleepUntil(ClientPtr client, @@ -154,7 +151,7 @@ SertafiedDelete(void *value, XID id) } static void -SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) +SertafiedBlockHandler(void *data, void *wt) { SertafiedPtr pReq, pNext; unsigned long delay; @@ -186,7 +183,7 @@ SertafiedBlockHandler(void *data, OSTimePtr wt, void *LastSelectMask) } static void -SertafiedWakeupHandler(void *data, int i, void *LastSelectMask) +SertafiedWakeupHandler(void *data, int i) { SertafiedPtr pReq, pNext; TimeStamp now; diff --git a/Xext/sync.c b/Xext/sync.c index 4140561..a86fc52 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -2571,8 +2571,8 @@ static XSyncValue *pnext_time; *** Server Block Handler *** code inspired by multibuffer extension (now deprecated) */ - /*ARGSUSED*/ static void -ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask) +/*ARGSUSED*/ static void +ServertimeBlockHandler(void *env, void *wt) { XSyncValue delay; unsigned long timeout; @@ -2597,8 +2597,8 @@ ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask) /* *** Wakeup Handler */ - /*ARGSUSED*/ static void -ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask) +/*ARGSUSED*/ static void +ServertimeWakeupHandler(void *env, int rc) { if (pnext_time) { GetTime(); @@ -2673,7 +2673,7 @@ IdleTimeQueryValue(void *pCounter, CARD64 * pValue_return) } static void -IdleTimeBlockHandler(void *pCounter, struct timeval **wt, void *LastSelectMask) +IdleTimeBlockHandler(void *pCounter, void *wt) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); @@ -2766,7 +2766,7 @@ IdleTimeCheckBrackets(SyncCounter *counter, XSyncValue idle, XSyncValue *less, X } static void -IdleTimeWakeupHandler(void *pCounter, int rc, void *LastSelectMask) +IdleTimeWakeupHandler(void *pCounter, int rc) { SyncCounter *counter = pCounter; IdleCounterPriv *priv = SysCounterGetPrivate(counter); diff --git a/dix/dixfonts.c b/dix/dixfonts.c index d217d12..cca92ed 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -197,7 +197,7 @@ RemoveFontWakeup(FontPathElementPtr fpe) } static void -FontWakeup(void *data, int count, void *LastSelectMask) +FontWakeup(void *data, int count) { int i; FontPathElementPtr fpe; @@ -1918,8 +1918,7 @@ _client_auth_generation(ClientPtr client) static int fs_handlers_installed = 0; static unsigned int last_server_gen; -static void -fs_block_handler(void *blockData, OSTimePtr timeout, void *readmask) +static void fs_block_handler(void *blockData, void *timeout) { FontBlockHandlerProcPtr block_handler = blockData; @@ -2004,7 +2003,7 @@ _init_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler) static void _remove_fs_handlers(FontPathElementPtr fpe, FontBlockHandlerProcPtr block_handler, - Bool all) +Bool all) {
[ANNOUNCE] xf86-video-ati 7.6.0
The xf86-video-ati 7.6.0 release supports xserver versions 1.8-1.18. New features in this release: * DRI3 and Present extension support, allowing more efficient and secure OpenGL compositing * Option "TearFree" [0] to eliminate tearing (currently only effective for non-rotated outputs) * Option "ShadowPrimary" [0] which may deliver better performance for some 2D use cases, at the potential expense of other use cases (only available with glamor) * DisplayPort 1.2 MST support * Implemented support for Xorg -background none with glamor and fixed it to work better with EXA * The contents of newly allocated buffers are always initialized before scanout, reducing intermittent artifacts [0] Enabling Option "TearFree" or Option "ShadowPrimary" currently disables DRI page flipping. Plus support for a few more Bonaire and Oland GPUs, and lots of other small improvements and fixes. Thanks to everybody who contributed to this release! Adam Jackson (1): Remove dead accelDFS flag Alex Deucher (3): radeon: bump version post release add new bonaire pci id add new OLAND pci id Dave Airlie (6): radeon: stop caching mode resources radeon: move output name creation to its own function radeon: add support for DP 1.2 display hotplug (v2) radeon: adopt for new X server dirty tracking APIs. radeon: cleanup the entity rec radeon: move radeon_pixmap forward declaration into other block David Heidelberger (2): radeon/vdpau: don't report VDPAU for < r300 Handle tiling in radeon_set_shared_pixmap_backing Emil Velikov (1): Do not link radeon_drv.so against libpciaccess Jerome Glisse (2): Avoid leaking memory on output. Proper leak fix, previous leak fix was bogus. Mario Kleiner (6): present: Move check for async flips present: Fix present notify timestamps and counts. Allow/Fix use of multiple ZaphodHead outputs per x-screen. (v2) Don't set TILE_SPLIT flags if surface.tile_split == 0. Fix inconsistent default eg_tile_split in evergreen_accel.c Make selection between DRI2 and DRI3 consistent with other drivers. (v2) Michel Dänzer (78): Remove duplicate OPTION_PAGE_FLIP entry PRIME: Don't advertise offload capabilities when acceleration is disabled Prefer drmModeSetCursor2 over drmModeSetCursor Require at least xserver 1.8 Move xorg_list backwards compatibility to new radeon_list.h header Add DRM event queue helpers v2 DRI2: Simplify blit fallback handling for scheduled swaps DRI2: Remove superfluous assignments to *_info->frame DRI2: Move radeon_dri2_flip_event_handler DRI2: Use helper functions for DRM event queue management v3 DRI2: Split out helper for getting UST and MSC of a specific CRTC Move #include "radeon_glamor.h" from radeon.h to where it's needed Fold radeon_glamor_flush into radeon_cs_flush_indirect Add support for SYNC extension fences v2 Add support for the Present extension v2 Add DRI3 support v2 Simplify includes in radeon_{dri3,present}.c Add xorg_list_for_each_entry_safe fallback in radeon_list.h Initialize boolean variable before calling xf86GetOptValBool DRI3: Use open hook instead of open_client Always include misync.h before other misync headers glamor: Add glamor_fd_from_pixmap define for standalone glamor tree dri3: Use screen->CreatePixmap instead of fbCreatePixmap directly EXA: Return NULL from radeon_get_pixmap_bo if there is no driver private configure.ac: Check for misyncshm.h again Adapt radeon_sync.c for misyncshm.h vs misync.h as well Make radeon_do_pageflip take a BO handle directly Present: Add radeon_present_get_pixmap_handle helper glamor: Avoid generating GEM flink names for BOs shared via DRI3 v2 glamor: Handle GLAMOR_* flags removed from xserver Increase robustness against DRM page flip ioctl failures v3 Simplify radeon_do_pageflip() error handling slightly more Move radeon_drm_handler/abort_proc fields to drmmode_flipdata_rec Move get_pixmap_handle helper to radeon_bo_helper.c DRI2: Use radeon_get_pixmap_handle Only enable SYNC extension fences and the Present extension along with DRI3 Add radeon_get_pixmap_tiling_flags helper present: Don't flip between BOs with different tiling parameters Rename scanout_pixmap_x field to prime_pixmap_x Split out struct drmmode_scanout for rotation shadow buffer information Add RADEON_CREATE_PIXMAP_SCANOUT flag glamor: Remove unused function radeon_glamor_pixmap_is_offscreen glamor: Add radeon_pixmap parameter to radeon_glamor_create_textured_pixmap glamor: Add wrappers for the X server rendering hooks glamor: Add Option "ShadowPrimary" v2 glamor: Remove the stride member of struct radeon_pixmap Add Option "TearFree" v4
Re: [PATCH xserver 1/5] glamor: Handle GL_OUT_OF_MEMORY when allocating texture images.
Eric Anholtwrites: > I think it's a safe enough assumption that we're not generating non-OOM > errors. And, now that we're logging errors, we should get reports of > them sooner than we used to. Would it be sensible to wrap the glGetError call like this? GLenum glamor_check_gl_oom() { GLenum last_oom = GL_NO_ERROR; GLenum error; while ((error = glGetError()) != GL_NO_ERROR) { if (error == GL_OUT_OF_MEMORY) last_oom = error; } return last_oom; } I admit I haven't looked at the Mesa glGetError() implementation, so I don't know if there's a queue of errors, or just a bitfield. -- -keith signature.asc Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xf86-input-libinput 3/3] Split mixed pointer/keyboard devices into two separate X devices
On Thu, Nov 12, 2015 at 10:27:05AM +1000, Peter Hutterer wrote: > The server struggles with devices that are both, the protocol (especially XI2) > requires a fairly strict separation of pointer vs keyboard devices. Though the > server has a couple of hacks to route events correctly, mixed > devices still experience bugs like [1]. > > Instead of advertising the device as a single mixed device, split the device > into two X devices, one with only a pointer/touch component, one with only a > keyboard component. This ensures that the device is effectively attached to > both the VCP and the VCK, something the XI2 protocol doesn't really allow. > > This patch drops the keyboard capability on a mixed device, duplicates the > input options and attributes and queues a NewInputDeviceRequest call. The new > device only has the keyboard capability but is otherwise unchanged. This > wacom driver has used this approach for years. > > Note that (unlike the wacom driver) we leave the device as-is otherwise. > libinput allows us to add the same device node twice as two separate devices, > so we do that and merely filter out the events based on our capabilities. That > means both devices handle all events, but only pass on the right ones to the > server. I'm withdrawing the patch. The above is true for the non-logind case, but if logind handles the fds we try to use the same fd twice and that fails to add the second device, and would cause dropped events otherwise. Cheers, Peter > > Since the device is effectively duplicate, expecially the "config_info" > InputOption it will be removed as the original device is removed. > > The WorkProc is necessary to avoid inconsistent state, the server doesn't > handle a NewInputDeviceRequest during PreInit well. > > [1] https://bugs.freedesktop.org/show_bug.cgi?id=49950 > > Signed-off-by: Peter Hutterer> --- > src/xf86libinput.c | 109 > ++--- > 1 file changed, 103 insertions(+), 6 deletions(-) > > diff --git a/src/xf86libinput.c b/src/xf86libinput.c > index 3c00879..b27721f 100644 > --- a/src/xf86libinput.c > +++ b/src/xf86libinput.c > @@ -676,6 +676,9 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct > libinput_event_pointer *ev > ValuatorMask *mask = driver_data->valuators; > double x, y; > > + if ((driver_data->capabilities & CAP_POINTER) == 0) > + return; > + > x = libinput_event_pointer_get_dx(event); > y = libinput_event_pointer_get_dy(event); > > @@ -713,6 +716,9 @@ xf86libinput_handle_absmotion(InputInfoPtr pInfo, struct > libinput_event_pointer > return; > } > > + if ((driver_data->capabilities & CAP_POINTER) == 0) > + return; > + > x = libinput_event_pointer_get_absolute_x_transformed(event, > TOUCH_AXIS_MAX); > y = libinput_event_pointer_get_absolute_y_transformed(event, > TOUCH_AXIS_MAX); > > @@ -731,6 +737,9 @@ xf86libinput_handle_button(InputInfoPtr pInfo, struct > libinput_event_pointer *ev > int button; > int is_press; > > + if ((driver_data->capabilities & CAP_POINTER) == 0) > + return; > + > button = btn_linux2xorg(libinput_event_pointer_get_button(event)); > is_press = (libinput_event_pointer_get_button_state(event) == > LIBINPUT_BUTTON_STATE_PRESSED); > > @@ -745,9 +754,13 @@ static void > xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard > *event) > { > DeviceIntPtr dev = pInfo->dev; > + struct xf86libinput *driver_data = pInfo->private; > int is_press; > int key = libinput_event_keyboard_get_key(event); > > + if ((driver_data->capabilities & CAP_KEYBOARD) == 0) > + return; > + > key += XORG_KEYCODE_OFFSET; > > is_press = (libinput_event_keyboard_get_key_state(event) == > LIBINPUT_KEY_STATE_PRESSED); > @@ -764,6 +777,9 @@ xf86libinput_handle_axis(InputInfoPtr pInfo, struct > libinput_event_pointer *even > enum libinput_pointer_axis axis; > enum libinput_pointer_axis_source source; > > + if ((driver_data->capabilities & CAP_POINTER) == 0) > + return; > + > valuator_mask_zero(mask); > > source = libinput_event_pointer_get_axis_source(event); > @@ -822,6 +838,9 @@ xf86libinput_handle_touch(InputInfoPtr pInfo, > static unsigned int next_touchid; > static unsigned int touchids[TOUCH_MAX_SLOTS] = {0}; > > + if ((driver_data->capabilities & CAP_TOUCH) == 0) > + return; > + > slot = libinput_event_touch_get_slot(event); > > switch (event_type) { > @@ -1504,6 +1523,72 @@ xf86libinput_get_type_name(struct libinput_device > *device, > return type_name; > } > > +struct xf86libinput_hotplug_info { > + InputAttributes *attrs; > + InputOption *input_options; > +}; > + > +static Bool > +xf86libinput_hotplug_device(ClientPtr client, pointer closure) >
[PATCH xserver 15/20] render: Use OsTimer for animated cursor timing
This replaces the block/wakeup handlers with an OsTimer. This also avoids problems with performing rendering during the wakeup handler. Signed-off-by: Keith Packard--- render/animcur.c | 57 +--- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/render/animcur.c b/render/animcur.c index 825ae1f..52e6b8b 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -59,15 +59,14 @@ typedef struct _AnimCur { typedef struct _AnimScrPriv { CloseScreenProcPtr CloseScreen; - -ScreenBlockHandlerProcPtr BlockHandler; - CursorLimitsProcPtr CursorLimits; DisplayCursorProcPtr DisplayCursor; SetCursorPositionProcPtr SetCursorPosition; RealizeCursorProcPtr RealizeCursor; UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; +OsTimerPtr timer; +Bool timer_set; } AnimCurScreenRec, *AnimCurScreenPtr; static unsigned char empty[4]; @@ -129,28 +128,23 @@ AnimCurCursorLimits(DeviceIntPtr pDev, } /* - * This has to be a screen block handler instead of a generic - * block handler so that it is well ordered with respect to the DRI - * block handler responsible for releasing the hardware to DRI clients + * The cursor animation timer has expired, go display any relevant cursor changes + * and compute a new timeout value */ -static void -AnimCurScreenBlockHandler(ScreenPtr pScreen, - void *pTimeout, void *pReadmask) +static CARD32 +AnimCurTimerNotify(OsTimerPtr timer, CARD32 now, void *arg) { +ScreenPtr pScreen = arg; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; Bool activeDevice = FALSE; -CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ - -Unwrap(as, pScreen, BlockHandler); +CARD32 soonest = ~0; /* earliest time to wakeup again */ for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { -if (!activeDevice) { -now = GetTimeInMillis(); +if (!activeDevice) activeDevice = TRUE; -} if ((INT32) (now - dev->spriteInfo->anim.time) >= 0) { AnimCurPtr ac = GetAnimCur(dev->spriteInfo->anim.pCursor); @@ -180,13 +174,11 @@ AnimCurScreenBlockHandler(ScreenPtr pScreen, } if (activeDevice) -AdjustWaitForDelay(pTimeout, soonest - now); - -(*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); -if (activeDevice) -Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); +TimerSet(as->timer, TimerAbsolute, soonest, AnimCurTimerNotify, pScreen); else -as->BlockHandler = NULL; +as->timer_set = FALSE; + +return 0; } static Bool @@ -212,8 +204,11 @@ AnimCurDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) pDev->spriteInfo->anim.pCursor = pCursor; pDev->spriteInfo->anim.pScreen = pScreen; -if (!as->BlockHandler) -Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); +if (!as->timer_set) { +TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, + AnimCurTimerNotify, pScreen); +as->timer_set = TRUE; +} } } else @@ -239,8 +234,11 @@ AnimCurSetCursorPosition(DeviceIntPtr pDev, if (pDev->spriteInfo->anim.pCursor) { pDev->spriteInfo->anim.pScreen = pScreen; -if (!as->BlockHandler) -Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); +if (!as->timer_set) { +TimerSet(as->timer, TimerAbsolute, pDev->spriteInfo->anim.time, + AnimCurTimerNotify, pScreen); +as->timer_set = TRUE; +} } ret = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent); Wrap(as, pScreen, SetCursorPosition, AnimCurSetCursorPosition); @@ -316,9 +314,14 @@ AnimCurInit(ScreenPtr pScreen) as = (AnimCurScreenPtr) malloc(sizeof(AnimCurScreenRec)); if (!as) return FALSE; -Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); +as->timer = TimerSet(NULL, TimerAbsolute, 0, AnimCurTimerNotify, pScreen); +if (!as->timer) { +free(as); +return FALSE; +} +as->timer_set = FALSE; -as->BlockHandler = NULL; +Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); -- 2.6.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH evdev] Only map x and y to axes 0 and 1
Peter Huttererwrites: > The Logitech G600 has one device with all axes north of ABS_MISC. The current > code assigns ABS_MISC as first axis to map to axis 0, i.e. x. On button press, > one node sends the BTN_LEFT but the other node sends an ABS_MISC with a 1 0 > value. ABS_MISC is mapped to axis 0, this moves the pointer to (0, y) on > every button click. > > Avoid this by simply mapping any axis other than x/y to at least axis 3, and > make sure we only override the MT 0/1 axes when we actually have MT axes. > > https://bugs.freedesktop.org/show_bug.cgi?id=92856 > > Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard (who was surprised that "if (mapping == i) i++;" already existed in the code for no good reason until now). -- -keith signature.asc Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[ANNOUNCE] xf86-video-ati 7.6.1
This is a brown paper bag release fixing a double-free bug in the 7.6.0 release. I could swear I'd tested this appropriately yesterday, but apparently not. :( Michel Dänzer (3): Post 7.6.0 release version bump Remove duplicate free(output_ids) call Set version for 7.6.1 release git tag: xf86-video-ati-7.6.1 http://xorg.freedesktop.org/archive/individual/driver/xf86-video-ati-7.6.1.tar.bz2 MD5: ede86cd3d1b1d8882f0aea61d9e924ed xf86-video-ati-7.6.1.tar.bz2 SHA1: b517c7fc8e7df0fb0ece0c9a5446b092ec944479 xf86-video-ati-7.6.1.tar.bz2 SHA256: 2516d9eeb8da8bcd3a01365ed1314919777910fa904ab268af342b5693e1d34c xf86-video-ati-7.6.1.tar.bz2 PGP: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-ati-7.6.1.tar.bz2.sig http://xorg.freedesktop.org/archive/individual/driver/xf86-video-ati-7.6.1.tar.gz MD5: ec8caffd5ab97243c08baf22e0320409 xf86-video-ati-7.6.1.tar.gz SHA1: 06363ec94ca6e8d79989413e40addf1b4b3e6905 xf86-video-ati-7.6.1.tar.gz SHA256: 21a3dcd8e69094643c3d7f0cf0552fba99d856a33c2139950a7e91c049773a88 xf86-video-ati-7.6.1.tar.gz PGP: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-ati-7.6.1.tar.gz.sig -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s
[PATCH xf86-input-libinput 2/3] Copy the device capabilities to the X driver struct
And use those copied caps instead of the direct device capability calls. No functional changes at this point, this is preparation work for selectively disabling capabilities on a device. Signed-off-by: Peter Hutterer--- src/xf86libinput.c | 34 ++ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index be0ec5d..3c00879 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -66,6 +66,10 @@ */ #define TOUCH_AXIS_MAX 0x +#define CAP_KEYBOARD 0x1 +#define CAP_POINTER0x2 +#define CAP_TOUCH 0x4 + struct xf86libinput_driver { struct libinput *libinput; int device_enabled_count; @@ -77,6 +81,7 @@ static struct xf86libinput_driver driver_context; struct xf86libinput { char *path; struct libinput_device *device; + uint32_t capabilities; struct { int vdist; @@ -612,16 +617,16 @@ xf86libinput_init(DeviceIntPtr dev) dev->public.on = FALSE; - if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) + if (driver_data->capabilities & CAP_KEYBOARD) xf86libinput_init_keyboard(pInfo); - if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) { + if (driver_data->capabilities & CAP_POINTER) { if (libinput_device_config_calibration_has_matrix(device) && !libinput_device_config_accel_is_available(device)) xf86libinput_init_pointer_absolute(pInfo); else xf86libinput_init_pointer(pInfo); } - if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) + if (driver_data->capabilities & CAP_TOUCH) xf86libinput_init_touch(pInfo); LibinputApplyConfig(dev); @@ -1474,25 +1479,24 @@ xf86libinput_parse_options(InputInfoPtr pInfo, xf86libinput_parse_buttonmap_option(pInfo, options->btnmap, sizeof(options->btnmap)); - if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) { + if (driver_data->capabilities & CAP_POINTER) { xf86libinput_parse_draglock_option(pInfo, driver_data); options->horiz_scrolling_enabled = xf86libinput_parse_horiz_scroll_option(pInfo); } } static const char* -xf86libinput_get_type_name(struct libinput_device *device) +xf86libinput_get_type_name(struct libinput_device *device, + struct xf86libinput *driver_data) { const char *type_name; /* now pick an actual type */ if (libinput_device_config_tap_get_finger_count(device) > 0) type_name = XI_TOUCHPAD; - else if (libinput_device_has_capability(device, - LIBINPUT_DEVICE_CAP_TOUCH)) + else if (driver_data->capabilities & CAP_TOUCH) type_name = XI_TOUCHSCREEN; - else if (libinput_device_has_capability(device, - LIBINPUT_DEVICE_CAP_POINTER)) + else if (driver_data->capabilities & CAP_POINTER) type_name = XI_MOUSE; else type_name = XI_KEYBOARD; @@ -1570,13 +1574,20 @@ xf86libinput_pre_init(InputDriverPtr drv, driver_data->path = path; driver_data->device = device; + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER)) + driver_data->capabilities |= CAP_POINTER; + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD)) + driver_data->capabilities |= CAP_KEYBOARD; + if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) + driver_data->capabilities |= CAP_TOUCH; + /* Disable acceleration in the server, libinput does it for us */ pInfo->options = xf86ReplaceIntOption(pInfo->options, "AccelerationProfile", -1); pInfo->options = xf86ReplaceStrOption(pInfo->options, "AccelerationScheme", "none"); xf86libinput_parse_options(pInfo, driver_data, device); - pInfo->type_name = xf86libinput_get_type_name(device); + pInfo->type_name = xf86libinput_get_type_name(device, driver_data); return Success; fail: @@ -2848,8 +2859,7 @@ LibinputInitDragLockProperty(DeviceIntPtr dev, size_t sz; int dl_values[MAX_BUTTONS + 1]; - if (!libinput_device_has_capability(driver_data->device, - LIBINPUT_DEVICE_CAP_POINTER)) + if ((driver_data->capabilities & CAP_POINTER) == 0) return; switch (draglock_get_mode(_data->draglock)) { -- 2.4.3 ___ xorg-devel@lists.x.org: X.Org development Archives:
[PATCH xf86-input-libinput 1/3] Split type_name detection out into a helper function
No functional changes Signed-off-by: Peter Hutterer--- src/xf86libinput.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index 95e2d20..be0ec5d 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -1480,6 +1480,26 @@ xf86libinput_parse_options(InputInfoPtr pInfo, } } +static const char* +xf86libinput_get_type_name(struct libinput_device *device) +{ + const char *type_name; + + /* now pick an actual type */ + if (libinput_device_config_tap_get_finger_count(device) > 0) + type_name = XI_TOUCHPAD; + else if (libinput_device_has_capability(device, + LIBINPUT_DEVICE_CAP_TOUCH)) + type_name = XI_TOUCHSCREEN; + else if (libinput_device_has_capability(device, + LIBINPUT_DEVICE_CAP_POINTER)) + type_name = XI_MOUSE; + else + type_name = XI_KEYBOARD; + + return type_name; +} + static int xf86libinput_pre_init(InputDriverPtr drv, InputInfoPtr pInfo, @@ -1556,17 +1576,7 @@ xf86libinput_pre_init(InputDriverPtr drv, xf86libinput_parse_options(pInfo, driver_data, device); - /* now pick an actual type */ - if (libinput_device_config_tap_get_finger_count(device) > 0) - pInfo->type_name = XI_TOUCHPAD; - else if (libinput_device_has_capability(device, - LIBINPUT_DEVICE_CAP_TOUCH)) - pInfo->type_name = XI_TOUCHSCREEN; - else if (libinput_device_has_capability(device, - LIBINPUT_DEVICE_CAP_POINTER)) - pInfo->type_name = XI_MOUSE; - else - pInfo->type_name = XI_KEYBOARD; + pInfo->type_name = xf86libinput_get_type_name(device); return Success; fail: -- 2.4.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH xf86-input-libinput 3/3] Split mixed pointer/keyboard devices into two separate X devices
The server struggles with devices that are both, the protocol (especially XI2) requires a fairly strict separation of pointer vs keyboard devices. Though the server has a couple of hacks to route events correctly, mixed devices still experience bugs like [1]. Instead of advertising the device as a single mixed device, split the device into two X devices, one with only a pointer/touch component, one with only a keyboard component. This ensures that the device is effectively attached to both the VCP and the VCK, something the XI2 protocol doesn't really allow. This patch drops the keyboard capability on a mixed device, duplicates the input options and attributes and queues a NewInputDeviceRequest call. The new device only has the keyboard capability but is otherwise unchanged. This wacom driver has used this approach for years. Note that (unlike the wacom driver) we leave the device as-is otherwise. libinput allows us to add the same device node twice as two separate devices, so we do that and merely filter out the events based on our capabilities. That means both devices handle all events, but only pass on the right ones to the server. Since the device is effectively duplicate, expecially the "config_info" InputOption it will be removed as the original device is removed. The WorkProc is necessary to avoid inconsistent state, the server doesn't handle a NewInputDeviceRequest during PreInit well. [1] https://bugs.freedesktop.org/show_bug.cgi?id=49950 Signed-off-by: Peter Hutterer--- src/xf86libinput.c | 109 ++--- 1 file changed, 103 insertions(+), 6 deletions(-) diff --git a/src/xf86libinput.c b/src/xf86libinput.c index 3c00879..b27721f 100644 --- a/src/xf86libinput.c +++ b/src/xf86libinput.c @@ -676,6 +676,9 @@ xf86libinput_handle_motion(InputInfoPtr pInfo, struct libinput_event_pointer *ev ValuatorMask *mask = driver_data->valuators; double x, y; + if ((driver_data->capabilities & CAP_POINTER) == 0) + return; + x = libinput_event_pointer_get_dx(event); y = libinput_event_pointer_get_dy(event); @@ -713,6 +716,9 @@ xf86libinput_handle_absmotion(InputInfoPtr pInfo, struct libinput_event_pointer return; } + if ((driver_data->capabilities & CAP_POINTER) == 0) + return; + x = libinput_event_pointer_get_absolute_x_transformed(event, TOUCH_AXIS_MAX); y = libinput_event_pointer_get_absolute_y_transformed(event, TOUCH_AXIS_MAX); @@ -731,6 +737,9 @@ xf86libinput_handle_button(InputInfoPtr pInfo, struct libinput_event_pointer *ev int button; int is_press; + if ((driver_data->capabilities & CAP_POINTER) == 0) + return; + button = btn_linux2xorg(libinput_event_pointer_get_button(event)); is_press = (libinput_event_pointer_get_button_state(event) == LIBINPUT_BUTTON_STATE_PRESSED); @@ -745,9 +754,13 @@ static void xf86libinput_handle_key(InputInfoPtr pInfo, struct libinput_event_keyboard *event) { DeviceIntPtr dev = pInfo->dev; + struct xf86libinput *driver_data = pInfo->private; int is_press; int key = libinput_event_keyboard_get_key(event); + if ((driver_data->capabilities & CAP_KEYBOARD) == 0) + return; + key += XORG_KEYCODE_OFFSET; is_press = (libinput_event_keyboard_get_key_state(event) == LIBINPUT_KEY_STATE_PRESSED); @@ -764,6 +777,9 @@ xf86libinput_handle_axis(InputInfoPtr pInfo, struct libinput_event_pointer *even enum libinput_pointer_axis axis; enum libinput_pointer_axis_source source; + if ((driver_data->capabilities & CAP_POINTER) == 0) + return; + valuator_mask_zero(mask); source = libinput_event_pointer_get_axis_source(event); @@ -822,6 +838,9 @@ xf86libinput_handle_touch(InputInfoPtr pInfo, static unsigned int next_touchid; static unsigned int touchids[TOUCH_MAX_SLOTS] = {0}; + if ((driver_data->capabilities & CAP_TOUCH) == 0) + return; + slot = libinput_event_touch_get_slot(event); switch (event_type) { @@ -1504,6 +1523,72 @@ xf86libinput_get_type_name(struct libinput_device *device, return type_name; } +struct xf86libinput_hotplug_info { + InputAttributes *attrs; + InputOption *input_options; +}; + +static Bool +xf86libinput_hotplug_device(ClientPtr client, pointer closure) +{ + struct xf86libinput_hotplug_info *hotplug = closure; + DeviceIntPtr unused; + + NewInputDeviceRequest(hotplug->input_options, + hotplug->attrs, + ); + + input_option_free_list(>input_options); + FreeInputAttributes(hotplug->attrs); + free(hotplug); + + return TRUE; +} + +static void +xf86libinput_create_keyboard_subdevice(InputInfoPtr pInfo) +{ + struct
Re: List display device names
On Wed, 11 Nov 2015 22:06:12 + Emil Velikovwrote: > Hi Tom, > > On 11 November 2015 at 13:31, Tom Deseyn wrote: > > Hi all, > > > > To configure X I need to know the display device names (e.g. DFP-0). I get > > these by looking at the Xorg.log. Is there a way to list these display > > device names which is more suitable for automation? I looked at xrandr, but > > I haven't found an option which outputs these names. > > > Have a look in /sys/class/drm/. If you have two GPUs there might be a > bit of an issue - the numbers (names) will work but are not > persistent, as the boot order of drm modules may change. Hi, I'm not sure /sys actually works for X and xorg.conf. The names used vary by the video DDX in use. E.g. modesetting driver uses different names than intel driver. The names used by the DRM kernel system is yet another thing. I have a vague recollection that DFP names might even be an NVIDIA proprietary driver invention that no-one else uses? Sorry, but I'm not aware of any better way than looking at X log or xrandr output. If you are configuring the kernel command line for video=, then looking in /sys provides the right names. I suppose if you wrote your own RandR app, you'd get the names "for sure". Thanks, pq signature.asc Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 10/11 v2] glamor: Delay making pixmaps shareable until we need to.
Michel Dänzerwrites: > On 11.11.2015 06:41, Eric Anholt wrote: >> If a pixmap isn't getting exported as a dmabuf, then we don't need to >> make an EGLImage/GBM bo for it. This should reduce normal pixmap >> allocation overhead, and also lets the driver choose non-scanout >> formats which may be much higher performance. >> >> On Raspberry Pi, where scanout isn't usable as a texture source, this >> improves x11perf -copypixwin100 from about 4300/sec to 5780/sec under >> xcompmgr -a, because we no longer need to upload our x11perf window to >> a tiled temporary in order to render it to the screen. >> >> v2: Just use pixmap->usage_hint instead of a new field. Drop the >> changes that started storing gbm_bos in the pixmap priv due to >> lifetime issues. >> >> Signed-off-by: Eric Anholt >> Reviewed-by: Michel Dänzer > > This is slightly misleading, since my R-b was based on the v1 patch > without pixmap_priv->usage_shared, but you made more extensive changes > to the patch. Sorry about that. I'd fixed it to mention (v1) in the branch I re-pushed, but I sent out before I amended that in. >> @@ -526,12 +495,12 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap, >> >> screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL); >> >> -ret = glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo); >> -gbm_bo_destroy(bo); >> +if (!glamor_egl_create_textured_pixmap_from_gbm_bo(pixmap, bo)) { >> +gbm_bo_destroy(bo); >> +return FALSE; >> +} > > I think this needs to call gbm_bo_destroy also when > glamor_egl_create_textured_pixmap_from_gbm_bo succeeded, as before. > > With that fixed, > > Reviewed-by: Michel Dänzer You're right. Thanks! signature.asc Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
List display device names
Hi all, To configure X I need to know the display device names (e.g. DFP-0). I get these by looking at the Xorg.log. Is there a way to list these display device names which is more suitable for automation? I looked at xrandr, but I haven't found an option which outputs these names. Thanks, Tom ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH evdev] Only map x and y to axes 0 and 1
The Logitech G600 has one device with all axes north of ABS_MISC. The current code assigns ABS_MISC as first axis to map to axis 0, i.e. x. On button press, one node sends the BTN_LEFT but the other node sends an ABS_MISC with a 1 0 value. ABS_MISC is mapped to axis 0, this moves the pointer to (0, y) on every button click. Avoid this by simply mapping any axis other than x/y to at least axis 3, and make sure we only override the MT 0/1 axes when we actually have MT axes. https://bugs.freedesktop.org/show_bug.cgi?id=92856 Signed-off-by: Peter Hutterer--- src/evdev.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 17d9d61..3176660 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1377,7 +1377,7 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int num_scroll_axes) } atoms = malloc((pEvdev->num_vals + num_mt_axes) * sizeof(Atom)); -i = 0; +i = 2; for (axis = ABS_X; i < MAX_VALUATORS && axis <= ABS_MAX; axis++) { int j; pEvdev->abs_axis_map[axis] = -1; @@ -1385,9 +1385,14 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int num_scroll_axes) is_blacklisted_axis(axis)) continue; -mapping = i; +if (axis == ABS_X) +mapping = 0; +else if (axis == ABS_Y) +mapping = 1; +else +mapping = i; -for (j = 0; j < ArrayLength(mt_axis_mappings); j++) +for (j = 0; !pEvdev->fake_mt && j < ArrayLength(mt_axis_mappings); j++) { if (mt_axis_mappings[j].code == axis) mt_axis_mappings[j].mapping = mapping; -- 2.4.3 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Multiple GPU with multiple monitor support?
Hi Everyone, I have a machine with dedicated nvidia+integrated intel VGAs and three monitors. Two of them are connected to nvidia and one to intel. For those who are aware of the problems with such configuration, I will leave the issues for later and firstly ask the question: *Is such setup feasible under Linux? *I can tell that it works perfectly well on Windows 10. If it IS feasible, then I will ask you to kindly help me out with the configuration process, preferably on Ubuntu. Fedora 23 and Ubuntu 14.04/15.10 detects my hardware configuration and enables all three monitors, but I get the following issues: http://ubuntuforums.org/showthread.php?t=2302481 http://forums.fedoraforum.org/showthread.php?t=307528 Thanks. Best Wishes, Gin ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: %(user_address)s
Re: List display device names
Hi Tom, On 11 November 2015 at 13:31, Tom Deseynwrote: > Hi all, > > To configure X I need to know the display device names (e.g. DFP-0). I get > these by looking at the Xorg.log. Is there a way to list these display > device names which is more suitable for automation? I looked at xrandr, but > I haven't found an option which outputs these names. > Have a look in /sys/class/drm/. If you have two GPUs there might be a bit of an issue - the numbers (names) will work but are not persistent, as the boot order of drm modules may change. -Emil ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
please do not use in xdmcp.xml
Hello Xorg developers, While furthering Debian's multiarch capabilities I ran into the issue that an xdmcp.txt generated from xdmcp.xml (in libxdmcp) would be dependent on the version of xorg-sgml-doctools. Due to the implementation of multiarch, the difference in file content breaks the installation of libxdmcp. I am therefore proposing to drop the use of in xdmcp.xml (see attached patch). Despite being motivated by a technical constraint in Debian, this change makes sense conceptually as well. The value of is independent of the version of libxdmcp. I would not expect the version of a different tool to show up in the header of the documentation for libxdmcp. I hope that this makes sense to you as well. Please Cc me in your replies. Helmut --- libxdmcp-1.1.2.orig/doc/xdmcp.xml +++ libxdmcp-1.1.2/doc/xdmcp.xml @@ -23,7 +23,7 @@ X Display Manager Control Protocol X.Org Standard - X Version 11, Release + X Version 11 Version 1.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver 1/5] glamor: Handle GL_OUT_OF_MEMORY when allocating texture images.
Keith Packardwrites: > Eric Anholt writes: > >> +if (glGetError() == GL_OUT_OF_MEMORY) { > > It seems like you'll need to call this in a loop in case multiple error > bits are set? > > And, don't you need to call this (repeatedly) before the function which > might generate an error in case there was an existing error pending? I think it's a safe enough assumption that we're not generating non-OOM errors. And, now that we're logging errors, we should get reports of them sooner than we used to. There's a chance that you've triggered a GL_OOM earlier and we just pick it up now, but if that happens then you're already a long way down the undefined results path and there's not much we can sensibly do at this point. signature.asc Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel