Re: Fwd: [Bug 105287] X server requires "randrproto >= 1.6.0", but git head of randrproto is still at 1.5.0

2018-02-28 Thread Keith Packard
Alan Coopersmith  writes:

> We've had two bugs filed this morning that xserver git is broken because
> it depends on a non-existent randrproto, so while the other 20-something
> protos would be nice, putting a "You need to use xorgproto git instead"
> notice in randrproto/configure.ac is going to save multiple people multiple
> headaches.

Having the X server depend on xorgproto seems like a better fix; it will
let people know to go find different bits, and point them at the right place.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: Fwd: [Bug 105287] X server requires "randrproto >= 1.6.0", but git head of randrproto is still at 1.5.0

2018-02-28 Thread Alan Coopersmith
On 02/28/18 01:37 PM, Keith Packard wrote:
> Alan Coopersmith  writes:
> 
>> Xserver depending on specific version of xorgproto (which provides now all
>> these headers), instead of there being separate pgkconfig file & check for 
>> each
>> of the headers, would IMHO make this transition a lot clearer to everybody 
>> who
>> doesn't follow X mailing lists.
> 
> I suggested this to Adam, but neither of us has acted on it. We'll still
> need to ship the old .pc files for a while so that existing software
> will continue to compile, but I agree that having an xorgproto version
> that software can depend on will help with this transition.

We've had two bugs filed this morning that xserver git is broken because
it depends on a non-existent randrproto, so while the other 20-something
protos would be nice, putting a "You need to use xorgproto git instead"
notice in randrproto/configure.ac is going to save multiple people multiple
headaches.

-- 
-Alan Coopersmith-   alan.coopersm...@oracle.com
 Oracle Solaris Engineering - https://blogs.oracle.com/alanc



signature.asc
Description: OpenPGP digital signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: Fwd: [Bug 105287] X server requires "randrproto >= 1.6.0", but git head of randrproto is still at 1.5.0

2018-02-28 Thread Keith Packard
Alan Coopersmith  writes:

> Xserver depending on specific version of xorgproto (which provides now all
> these headers), instead of there being separate pgkconfig file & check for 
> each
> of the headers, would IMHO make this transition a lot clearer to everybody who
> doesn't follow X mailing lists.

I suggested this to Adam, but neither of us has acted on it. We'll still
need to ship the old .pc files for a while so that existing software
will continue to compile, but I agree that having an xorgproto version
that software can depend on will help with this transition.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[Bug 105217] Blank screen with only mouse pointer after 7.10 radeon driver update; display does not switch to tty7 upon lightdm start; Xorg.0.log quickly grows

2018-02-28 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=105217

--- Comment #17 from Mario Kleiner  ---
Hmm. That incorrect file actually looked good. DRI3+Present enabled, pageflip
errors gone as expected. Date also seemed to be plausible. Are you sure that
was wrong?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
xorg-driver-ati mailing list
xorg-driver-ati@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-driver-ati


Fwd: [Bug 105287] X server requires "randrproto >= 1.6.0", but git head of randrproto is still at 1.5.0

2018-02-28 Thread Alan Coopersmith
Now that we've switched to the new xorgproto repo, should we add notices to
the configure.ac of the old *proto repo like we've done for abandoned drivers
to tell people who don't follow our mailing lists to switch over to it?

-alan-


 Forwarded Message 
Subject:[Bug 105287] X server requires "randrproto >= 1.6.0", but git 
head of
randrproto is still at 1.5.0
Date:   Wed, 28 Feb 2018 11:28:54 +
From:   bugzilla-dae...@freedesktop.org
Reply-To:   bugzilla-dae...@freedesktop.org
To: xorg-t...@lists.x.org



Eero Tamminen  changed bug 105287

WhatRemoved Added
Status  RESOLVEDVERIFIED
URL     
https://lists.x.org/archives/xorg-announce/2018-February/002835.html

*Comment # 2  on bug
105287  from Eero Tamminen
 *

I see.  Thanks.

Having pointer in randrproto git to newly required xorgproto (and nothing
else), would have been helpful.

Xserver depending on specific version of xorgproto (which provides now all
these headers), instead of there being separate pgkconfig file & check for each
of the headers, would IMHO make this transition a lot clearer to everybody who
doesn't follow X mailing lists.

(Google searches on randrproto 1.6 returning hits to Keith's patches, which
update randrproto to 1.6.0 instead of xorgproto, does not help.)


You are receiving this mail because:

  * You are the assignee for the bug.
  * You are the QA Contact for the bug.

___
xorg-team mailing list
xorg-t...@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-team
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[ANNOUNCE] xserver 1.20 RC1

2018-02-28 Thread Adam Jackson
This is the first release candidate for xserver 1.20. Notable changes
since 1.19 include:

- RANDR 1.6, which enables leasing RANDR resources to a client for its
exclusive use (e.g. head mounted displays)

- Depth 30 support in glamor and the modesetting driver

- A meson-based build system, parallel to autotools

- Pageflipping support for PRIME output sinks

- OutputClass device matching for xorg.conf

- Input grab and tablet support in Xwayland

... and the usual pile of bug fixes and cleanups. The final release
will include a more complete set of release notes.

I expect to push these out roughly weekly as things stabilize. With any
luck RC3 will be the final release candidate, with the actual release
around March 20. The server is ABI-frozen until 1.21 development opens;
external modules should rebuild against this server and report any
issues.

Full changelog since 1.19.0:

Aaron Plattner (1):
  randr: Use RRTransformEqual in RRCrtcPendingTransform

Adam Jackson (196):
  configure: Enable glamor when building just Xwayland
  composite: Fix repaint of borders (v2)
  dix: Rename (and retype) PixmapPerDepth[1] to defaultStipple
  dix: Clear graphicsExposures for scratch GCs in one place
  shadowfb: Rename this particular shadow.c to shadowfb.c
  shadow: Lift 32->24 conversion from modesetting to dix
  shadow: Remove indirection stubs
  shadow: Macro cleanup
  shadow: Remove unused shadowAlloc
  Revert "damage: Make damageRegionProcessPending take a damage not a 
drawable"
  glamor: Squash unused variable warning
  Revert "tests: fix --disable-xorg build"
  dmx: Remove non-evdev hardware input drivers
  kdrive: Remove non-evdev input drivers
  composite: Remove a misleading comment
  composite: Export compIsAlternateVisual
  glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals
  glx: Move Composite's synthetic visuals to a different select group
  loader: Port from xfree86 to dix API
  loader: Remove *GetOS
  loader: Don't add internal/ to the search path
  loader: Include fewer headers from xf86Module.h
  loader: Remove unused loader error codes and dead enum
  loader: Remove silly "unspecified" version handling
  xfree86: Remove DriverRec1 compat struct
  xfree86: Fix up some bad indentation
  xfree86: Remove a stray reference to font modules
  loader: Move loader list details to internal header
  loader: Turn LoaderListDirs into LoaderListDir
  loader: Remove unused arguments from LoadModule
  loader: Remove unused path and name from ModuleDescPtr
  loader: Learn about the joy of snprintf
  dri1: Remove some dead event code
  xfree86: Bump video ABI to 24.0
  xfree86: Fix a comment about ScrnInfoRec
  xfree86: Remove max[HV]Value from ScrnInfoRec
  xfree86: Drop virtualFrom from ScrnInfoRec
  xfree86: Remove Option "BiosBase" (v2)
  xfree86: Remove memClk from ScrnInfoRec
  xfree86: Remove unused chipID/Rev from ScrnInfoRec
  xfree86: Reorganize the reserved ScrnInfoRec slots
  wfb: Add missing rename for fbGlyphs
  wfb: Hide init function decls behind FB_ACCESS_WRAPPER
  fb: Remove unused fbGetFreeCompClip macro
  fb: Remove stray references to fbHasVisualTypes
  mi: Add include guards to migc.h
  dix: Pass the whole property into deliverPropertyNotifyEvent
  dix: Add a callback chain for window property state change
  vfb: Bump default depth to 24
  dispatch: Mark swapped dispatch as _X_COLD
  sdksyms: Tighten up the symbols we add to the magic table
  xfake: Remove
  xfbdev: Remove
  kdrive: Remove now-unused linux backend
  miarc: Style cleanup for miWideArc
  miarc: Make the caller free the arc span data
  miarc: "Cache" arc span data for dashed arcs
  os: Squash missing declaration warning for timingsafe_memcmp
  test: Fix distcheck failures
  parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL)
  xinerama: Implement graphics exposures for window->pixmap copies (v4)
  Revert "sdksyms: Tighten up the symbols we add to the magic table"
  ephyr: Don't clobber bitsPerPixel when using glamor
  xfree86: Remove 24bpp pixmap format support (v2)
  fb: Remove 24bpp support (v3)
  fb: Handle ZPixmap planemask in GetImage the other way around
  glamor: Avoid software fallback for planemasked ZPixmap GetImage
  dix: Remove PRIVATE_DAMAGE
  glx: Fix MakeCurrent with no drawables
  xfree86: Clean up DPMS support
  dix: Lift DPMS to a screen hook
  dpms: Consolidate a bunch of stuff into Xext/dpms.c
  xfree86: Remove driver entity hooks and private
  glx: Remove enter/leave server API
  xephyr: Check for host XVideo support before trying to use it
  meson: Fix a typo
  meson: Factor out the AC_REPLACE_FUNCS stuff to its own library
  meson: Fix linking the dmx utilities
  meson: 

[ANNOUNCE] xserver 1.20 RC1

2018-02-28 Thread Adam Jackson
This is the first release candidate for xserver 1.20. Notable changes
since 1.19 include:

- RANDR 1.6, which enables leasing RANDR resources to a client for its
exclusive use (e.g. head mounted displays)

- Depth 30 support in glamor and the modesetting driver

- A meson-based build system, parallel to autotools

- Pageflipping support for PRIME output sinks

- OutputClass device matching for xorg.conf

- Input grab and tablet support in Xwayland

... and the usual pile of bug fixes and cleanups. The final release
will include a more complete set of release notes.

I expect to push these out roughly weekly as things stabilize. With any
luck RC3 will be the final release candidate, with the actual release
around March 20. The server is ABI-frozen until 1.21 development opens;
external modules should rebuild against this server and report any
issues.

Full changelog since 1.19.0:

Aaron Plattner (1):
  randr: Use RRTransformEqual in RRCrtcPendingTransform

Adam Jackson (196):
  configure: Enable glamor when building just Xwayland
  composite: Fix repaint of borders (v2)
  dix: Rename (and retype) PixmapPerDepth[1] to defaultStipple
  dix: Clear graphicsExposures for scratch GCs in one place
  shadowfb: Rename this particular shadow.c to shadowfb.c
  shadow: Lift 32->24 conversion from modesetting to dix
  shadow: Remove indirection stubs
  shadow: Macro cleanup
  shadow: Remove unused shadowAlloc
  Revert "damage: Make damageRegionProcessPending take a damage not a 
drawable"
  glamor: Squash unused variable warning
  Revert "tests: fix --disable-xorg build"
  dmx: Remove non-evdev hardware input drivers
  kdrive: Remove non-evdev input drivers
  composite: Remove a misleading comment
  composite: Export compIsAlternateVisual
  glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals
  glx: Move Composite's synthetic visuals to a different select group
  loader: Port from xfree86 to dix API
  loader: Remove *GetOS
  loader: Don't add internal/ to the search path
  loader: Include fewer headers from xf86Module.h
  loader: Remove unused loader error codes and dead enum
  loader: Remove silly "unspecified" version handling
  xfree86: Remove DriverRec1 compat struct
  xfree86: Fix up some bad indentation
  xfree86: Remove a stray reference to font modules
  loader: Move loader list details to internal header
  loader: Turn LoaderListDirs into LoaderListDir
  loader: Remove unused arguments from LoadModule
  loader: Remove unused path and name from ModuleDescPtr
  loader: Learn about the joy of snprintf
  dri1: Remove some dead event code
  xfree86: Bump video ABI to 24.0
  xfree86: Fix a comment about ScrnInfoRec
  xfree86: Remove max[HV]Value from ScrnInfoRec
  xfree86: Drop virtualFrom from ScrnInfoRec
  xfree86: Remove Option "BiosBase" (v2)
  xfree86: Remove memClk from ScrnInfoRec
  xfree86: Remove unused chipID/Rev from ScrnInfoRec
  xfree86: Reorganize the reserved ScrnInfoRec slots
  wfb: Add missing rename for fbGlyphs
  wfb: Hide init function decls behind FB_ACCESS_WRAPPER
  fb: Remove unused fbGetFreeCompClip macro
  fb: Remove stray references to fbHasVisualTypes
  mi: Add include guards to migc.h
  dix: Pass the whole property into deliverPropertyNotifyEvent
  dix: Add a callback chain for window property state change
  vfb: Bump default depth to 24
  dispatch: Mark swapped dispatch as _X_COLD
  sdksyms: Tighten up the symbols we add to the magic table
  xfake: Remove
  xfbdev: Remove
  kdrive: Remove now-unused linux backend
  miarc: Style cleanup for miWideArc
  miarc: Make the caller free the arc span data
  miarc: "Cache" arc span data for dashed arcs
  os: Squash missing declaration warning for timingsafe_memcmp
  test: Fix distcheck failures
  parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL)
  xinerama: Implement graphics exposures for window->pixmap copies (v4)
  Revert "sdksyms: Tighten up the symbols we add to the magic table"
  ephyr: Don't clobber bitsPerPixel when using glamor
  xfree86: Remove 24bpp pixmap format support (v2)
  fb: Remove 24bpp support (v3)
  fb: Handle ZPixmap planemask in GetImage the other way around
  glamor: Avoid software fallback for planemasked ZPixmap GetImage
  dix: Remove PRIVATE_DAMAGE
  glx: Fix MakeCurrent with no drawables
  xfree86: Clean up DPMS support
  dix: Lift DPMS to a screen hook
  dpms: Consolidate a bunch of stuff into Xext/dpms.c
  xfree86: Remove driver entity hooks and private
  glx: Remove enter/leave server API
  xephyr: Check for host XVideo support before trying to use it
  meson: Fix a typo
  meson: Factor out the AC_REPLACE_FUNCS stuff to its own library
  meson: Fix linking the dmx utilities
  meson: 

[ANNOUNCE] xserver 1.20 RC1

2018-02-28 Thread Adam Jackson
This is the first release candidate for xserver 1.20. Notable changes
since 1.19 include:

- RANDR 1.6, which enables leasing RANDR resources to a client for its
exclusive use (e.g. head mounted displays)

- Depth 30 support in glamor and the modesetting driver

- A meson-based build system, parallel to autotools

- Pageflipping support for PRIME output sinks

- OutputClass device matching for xorg.conf

- Input grab and tablet support in Xwayland

... and the usual pile of bug fixes and cleanups. The final release
will include a more complete set of release notes.

I expect to push these out roughly weekly as things stabilize. With any
luck RC3 will be the final release candidate, with the actual release
around March 20. The server is ABI-frozen until 1.21 development opens;
external modules should rebuild against this server and report any
issues.

Full changelog since 1.19.0:

Aaron Plattner (1):
  randr: Use RRTransformEqual in RRCrtcPendingTransform

Adam Jackson (196):
  configure: Enable glamor when building just Xwayland
  composite: Fix repaint of borders (v2)
  dix: Rename (and retype) PixmapPerDepth[1] to defaultStipple
  dix: Clear graphicsExposures for scratch GCs in one place
  shadowfb: Rename this particular shadow.c to shadowfb.c
  shadow: Lift 32->24 conversion from modesetting to dix
  shadow: Remove indirection stubs
  shadow: Macro cleanup
  shadow: Remove unused shadowAlloc
  Revert "damage: Make damageRegionProcessPending take a damage not a 
drawable"
  glamor: Squash unused variable warning
  Revert "tests: fix --disable-xorg build"
  dmx: Remove non-evdev hardware input drivers
  kdrive: Remove non-evdev input drivers
  composite: Remove a misleading comment
  composite: Export compIsAlternateVisual
  glx: Send GLX_VISUAL_SELECT_GROUP_SGIX attribute for visuals
  glx: Move Composite's synthetic visuals to a different select group
  loader: Port from xfree86 to dix API
  loader: Remove *GetOS
  loader: Don't add internal/ to the search path
  loader: Include fewer headers from xf86Module.h
  loader: Remove unused loader error codes and dead enum
  loader: Remove silly "unspecified" version handling
  xfree86: Remove DriverRec1 compat struct
  xfree86: Fix up some bad indentation
  xfree86: Remove a stray reference to font modules
  loader: Move loader list details to internal header
  loader: Turn LoaderListDirs into LoaderListDir
  loader: Remove unused arguments from LoadModule
  loader: Remove unused path and name from ModuleDescPtr
  loader: Learn about the joy of snprintf
  dri1: Remove some dead event code
  xfree86: Bump video ABI to 24.0
  xfree86: Fix a comment about ScrnInfoRec
  xfree86: Remove max[HV]Value from ScrnInfoRec
  xfree86: Drop virtualFrom from ScrnInfoRec
  xfree86: Remove Option "BiosBase" (v2)
  xfree86: Remove memClk from ScrnInfoRec
  xfree86: Remove unused chipID/Rev from ScrnInfoRec
  xfree86: Reorganize the reserved ScrnInfoRec slots
  wfb: Add missing rename for fbGlyphs
  wfb: Hide init function decls behind FB_ACCESS_WRAPPER
  fb: Remove unused fbGetFreeCompClip macro
  fb: Remove stray references to fbHasVisualTypes
  mi: Add include guards to migc.h
  dix: Pass the whole property into deliverPropertyNotifyEvent
  dix: Add a callback chain for window property state change
  vfb: Bump default depth to 24
  dispatch: Mark swapped dispatch as _X_COLD
  sdksyms: Tighten up the symbols we add to the magic table
  xfake: Remove
  xfbdev: Remove
  kdrive: Remove now-unused linux backend
  miarc: Style cleanup for miWideArc
  miarc: Make the caller free the arc span data
  miarc: "Cache" arc span data for dashed arcs
  os: Squash missing declaration warning for timingsafe_memcmp
  test: Fix distcheck failures
  parser: Fix crash when xf86nameCompare(s1 = x, s2 = NULL)
  xinerama: Implement graphics exposures for window->pixmap copies (v4)
  Revert "sdksyms: Tighten up the symbols we add to the magic table"
  ephyr: Don't clobber bitsPerPixel when using glamor
  xfree86: Remove 24bpp pixmap format support (v2)
  fb: Remove 24bpp support (v3)
  fb: Handle ZPixmap planemask in GetImage the other way around
  glamor: Avoid software fallback for planemasked ZPixmap GetImage
  dix: Remove PRIVATE_DAMAGE
  glx: Fix MakeCurrent with no drawables
  xfree86: Clean up DPMS support
  dix: Lift DPMS to a screen hook
  dpms: Consolidate a bunch of stuff into Xext/dpms.c
  xfree86: Remove driver entity hooks and private
  glx: Remove enter/leave server API
  xephyr: Check for host XVideo support before trying to use it
  meson: Fix a typo
  meson: Factor out the AC_REPLACE_FUNCS stuff to its own library
  meson: Fix linking the dmx utilities
  meson: 

Re: xserver 1.20 RC1 tomorrow

2018-02-28 Thread Adam Jackson
On Wed, 2018-02-28 at 00:42 +, Daniel Stone wrote:

> > 3) https://patchwork.freedesktop.org/series/30946/
> > DMA fences for DRI3. Does have at least one ABI change that looks
> > essential, in misync.
> 
> I would certainly like to see this land, but there are some open
> questions it'd be great to get more feedback: namely, should we use
> the fences to schedule in-server (and not submit blits/flips until the
> fence has passed), or should we pass the fences into the client APIs
> (e.g. GPU command-stream wait on EGL-imported fences, KMS commit
> wait). The former is more obvious, but also a behavioural change from
> how we handled implicit fences previously.

I'm going to punt this to after 1.21 then, would rather not paint
ourselves into needless corners.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v2 01/22] present: Move screen flip functionality in separate file

2018-02-28 Thread Keith Packard
Roman Gilg  writes:

> As a preperation for future flip mode alternatives move most of the
> functionality from 'present.c' into a separate file.
>
> Leave some functions needed by future other flip modes in 'present.c'.
>
> Signed-off-by: Roman Gilg 

(I can't claim to have reviewed this; I'm assuming there are no code
changes in this patch).

Acked-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: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v2 22/22] xwayland: Guard against very late vblanks

2018-02-28 Thread Roman Gilg
On Wed, Feb 28, 2018 at 6:43 PM, Michel Dänzer  wrote:
> I'm unable to reproduce the issue you described with Steam (without this
> patch series applied). I'd really like to know where the bogus target
> MSC values you're seeing are coming from. What are the values of the
> window_msc parameter and window_priv->msc_offset in
> present_window_to_crtc_msc?

You don't have to go that far. I did read out on current master high
target msc values directly for stuff->target_msc in
proc_present_pixmap. But this happened only on like two or three
occasions directly at the startup of the Steam client while hundreds
of other present_pixmap requests before and after had normal
stuff->target_msc values.

So just put a line

ErrorF("XXX %lu\n", stuff->target_msc);

in proc_present_pixmap and if you look carefully through the debug
output there should be one or two very high numbers in comparison to
all the other values.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/7] randr: Support "non-desktop" property

2018-02-28 Thread Keith Packard
Michel Dänzer  writes:

> Yeah, the duplicate line was removed by e4e3447603b5 ("Add RandR leases
> with modesetting driver support [v6]"). So it's harmless, except
> possibly when bisecting. I stumbled over it when reporting the GPU
> screen crash.

Sorry for that -- I messed up when re-arranging patches.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v2 00/22] Per window flips in Present with support for them in Xwayland

2018-02-28 Thread Michel Dänzer
On 2018-02-28 05:36 PM, Roman Gilg wrote:
> This revision provides changes requested by Michel Dänzer. In particular
> flips without copies in window flip mode are now possible and clients can
> queue flips on Xwayland.

Thanks for that.

It would be even better if queuing flips worked from the beginning. If
reordering the patches accordingly is difficult, can you split out the
xwl_present_init related parts of patch 19 to a new patch after patch
21? If even that is difficult, leaving it like this is OK.


Unfortunately, I don't have the bandwidth to look at every patch in
detail right now, but apart from the above and my followup to patch 22,
I'm fine with this landing (assuming it actually works :).


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v2 22/22] xwayland: Guard against very late vblanks

2018-02-28 Thread Michel Dänzer
On 2018-02-28 05:37 PM, Roman Gilg wrote:
> Do not allow queuing events too far into the the future. The result can be a
> presentation freeze until the msc time is reached.
> 
> At the moment clients might do this per accident, because the fake vblank code
> in Present and the xfree86 driver tolerate high 64bit msc values without
> freeze due to an erroneous 64 to 32bit conversion.
> 
> The sample client, that triggers this behavior, is the Steam client.

I'm unable to reproduce the issue you described with Steam (without this
patch series applied). I'd really like to know where the bogus target
MSC values you're seeing are coming from. What are the values of the
window_msc parameter and window_priv->msc_offset in
present_window_to_crtc_msc?


> diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
> index 27bc569..c0bc1f0 100644
> --- a/hw/xwayland/xwayland-present.c
> +++ b/hw/xwayland/xwayland-present.c
> @@ -303,6 +303,11 @@ xwl_present_queue_vblank(WindowPtr present_window,
>  if (!xwl_window)
>  return BadMatch;
>  
> +if (msc > xwl_window->present_msc + 100) {
> +ErrorF("Client queued frame too far in the future: %lu -> %lu\n", 
> xwl_window->present_msc, msc);
> +return BadRequest;
> +}

If we're going this route, let's not use an arbitrary threshold like
100, but the actual one corresponding to the fake vblank code dropping
the most significant bits.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xorgproto] Spelling and grammar fixes

2018-02-28 Thread Keith Packard
Giuseppe Bilotta  writes:

> Signed-off-by: Giuseppe Bilotta 

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: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xorgproto v8 01/14] dri3: Add modifier/multi-plane requests, bump to v1.2

2018-02-28 Thread Keith Packard
Daniel Stone  writes:

> From: Louis-Francis Ratté-Boulianne 
>
> DRI3 version 1.2 adds support for explicit format modifiers,
> including multi-planar buffers.

Thanks for the awesome writeup on synchronization. It looks good to me.

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: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH v8 00/14] DRI3 multi-plane and modifier support

2018-02-28 Thread Adam Jackson
On Wed, 2018-02-28 at 01:45 +, Daniel Stone wrote:
> Hi,
> 
> On 28 February 2018 at 01:19, Daniel Stone 
> wrote:
> > The major change is that the DRI3 protocol version has been bumped
> > from
> > 1.1 to 1.2, as there was previously a dri3proto-1.1 release, only
> > carrying a 1.0 protocol version. We bump the version to avoid this,
> > jumping straight from protocol version 1.0 to 1.2.
> 
> Wrong protocol.
> 
> Present needed to be bumped to 1.2, and DRI3 should stay at 1.1. I've
> made the changes locally.

Too late. It's fine, integers are cheap.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/7] randr: Support "non-desktop" property

2018-02-28 Thread Michel Dänzer
On 2018-02-28 05:27 PM, Adam Jackson wrote:
> On Wed, 2018-02-28 at 16:35 +0100, Michel Dänzer wrote:
>> On 2018-02-12 10:51 PM, Keith Packard wrote:
>>> Tracks changes to the non-desktop property so that when non-zero,
>>> outputs will always appear to be disconnected.
>>>
>>> Signed-off-by: Keith Packard 
>>> Reviewed-by: Adam Jackson 
>>
>> [...]
>>
>>> @@ -442,6 +465,7 @@ ProcRRGetOutputInfo(ClientPtr client)
>>>  .crtc = output->crtc ? output->crtc->id : None,
>>>  .mmWidth = output->mmWidth,
>>>  .mmHeight = output->mmHeight,
>>> +.connection = output->nonDesktop ? RR_Disconnected : 
>>> output->connection,
>>>  .connection = output->connection,
>>
>> BTW, I don't think this was intended to leave the existing connection
>> initializer line, clobbering the new one?
> 
> ... huh. That's not what's in the tree:
> 
> desoxy:~/git/xserver% git grep -A1 connection.*nonDesktop
> randr/rroutput.c:.connection = output->nonDesktop ? RR_Disconnected : 
> output->connection,
> randr/rroutput.c-.subpixelOrder = output->subpixelOrder
> --
> randr/rroutput.c:.connection = output->nonDesktop ? 
> RR_Disconnected : output->connection,
> randr/rroutput.c-.subpixelOrder = output->subpixelOrder,
> desoxy:~/git/xserver% git describe   
> xorg-server-1.19.0-641-g85ff1cdbd

Yeah, the duplicate line was removed by e4e3447603b5 ("Add RandR leases
with modesetting driver support [v6]"). So it's harmless, except
possibly when bisecting. I stumbled over it when reporting the GPU
screen crash.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[ANNOUNCE] xorgproto 2018.4

2018-02-28 Thread Adam Jackson
This release updates the specifications and protocol headers for DRI3
and Present to 1.2, and fixes several spelling and grammar errors in
the specification texts.

Adam Jackson (1):
  xorgproto 2018.4

Giuseppe Bilotta (1):
  Spelling and grammar fixes

Louis-Francis Ratté-Boulianne (2):
  dri3: Add modifier/multi-plane requests, bump to v1.2
  presentproto: PresentCompleteModeSuboptimalCopy flag

git tag: xorgproto-2018.4

https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.4.tar.bz2
MD5:  81557ca47ee66a4e54590fcdadd28114  xorgproto-2018.4.tar.bz2
SHA1: 2e4a3db312e1ce81e15515dfcac52ba0aa5a920c  xorgproto-2018.4.tar.bz2
SHA256: fee885e0512899ea5280c593fdb2735beb1693ad170c22ebcc844470eec415a0  
xorgproto-2018.4.tar.bz2
SHA512: 
2db682d10280ca58cdc04d8eb9fef30c111d4cd379de9fec86cff317865b859a576de5426447be9231d24be9762cc1d684c57383a99ad499398e8b7d62b1c03c
  xorgproto-2018.4.tar.bz2
PGP:  
https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.4.tar.bz2.sig

https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.4.tar.gz
MD5:  2763268f5bc742e337415bfedf06b845  xorgproto-2018.4.tar.gz
SHA1: a0e2d39316a99266fdbbf8020fe425b6da91409c  xorgproto-2018.4.tar.gz
SHA256: 8e48d851efea0e951bcb6cf0d537f84ba3803de95e488bd039fe59fc75ec8f7d  
xorgproto-2018.4.tar.gz
SHA512: 
f79a47fc3de04d7258769869c11e99eff7fa4a4b5925cf60f9f7579f946d7d0e737224e9a54d18e439a3586126e66e0764c0f09ed50987c781955b9b9a1e0362
  xorgproto-2018.4.tar.gz
PGP:  
https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2018.4.tar.gz.sig

- ajax
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: [PATCH xorgproto v8 02/14] presentproto: PresentCompleteModeSuboptimalCopy flag

2018-02-28 Thread Adam Jackson
On Wed, 2018-02-28 at 01:19 +, Daniel Stone wrote:
> From: Louis-Francis Ratté-Boulianne 
> 
> If the Complete event has this mode, the client is not using
> the more optimal format/modifier for the buffer allocation. The
> client must explicitely inform the server that it understands
> this mode by adding the PresentOptionSuboptimal flag when calling
> PresentPixmap.
> 
> Its main usage as of now is to allow clients to re-fetch DRI3
> format modifiers as some modifiers might allow direct scanout.
> 
> Bump presentproto version to 1.2.
> 
> Signed-off-by: Louis-Francis Ratté-Boulianne 
> Reviewed-by: Daniel Stone 

Merged:

To ssh://git.freedesktop.org/git/xorg/proto/xorgproto
   29c53a2..751cf1e  master -> master

Still need to wire xorgproto up to patchwork, it seems.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 22/22] xwayland: Guard against very late vblanks

2018-02-28 Thread Roman Gilg
Do not allow queuing events too far into the the future. The result can be a
presentation freeze until the msc time is reached.

At the moment clients might do this per accident, because the fake vblank code
in Present and the xfree86 driver tolerate high 64bit msc values without
freeze due to an erroneous 64 to 32bit conversion.

The sample client, that triggers this behavior, is the Steam client.

Signed-off-by: Roman Gilg 
---
 hw/xwayland/xwayland-present.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 27bc569..c0bc1f0 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -303,6 +303,11 @@ xwl_present_queue_vblank(WindowPtr present_window,
 if (!xwl_window)
 return BadMatch;
 
+if (msc > xwl_window->present_msc + 100) {
+ErrorF("Client queued frame too far in the future: %lu -> %lu\n", 
xwl_window->present_msc, msc);
+return BadRequest;
+}
+
 if (xwl_window->present_crtc_fake != crtc)
 return BadRequest;
 
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 21/22] xwayland: Implement queuing present vblanks

2018-02-28 Thread Roman Gilg
Queue present events to msc values. Fake msc events with a refresh rate of
about 60fps when flips are not possible. When flips are executed rely on
frame callbacks with a slow updating timer as fallback.

This is important for applications, that want to limit their framerate.

Signed-off-by: Roman Gilg 
---
 hw/xwayland/xwayland-present.c | 103 +
 hw/xwayland/xwayland.c |   1 +
 hw/xwayland/xwayland.h |   2 +
 3 files changed, 97 insertions(+), 9 deletions(-)

diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 3088f03..27bc569 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -27,6 +27,13 @@
 
 #include 
 
+/*
+ * When not flipping let Present copy with 60fps.
+ * When flipping wait on frame_callback, otherwise
+ * the surface is not visible, in this case update
+ * with long interval.
+ */
+#define TIMER_LEN_COPY  17  // ~60fps
 #define TIMER_LEN_FLIP1000  // 1fps
 
 static void
@@ -41,13 +48,23 @@ xwl_present_timer_callback(OsTimerPtr timer,
CARD32 time,
void *arg);
 
+static inline Bool
+xwl_present_has_events(struct xwl_window *xwl_window)
+{
+return !xorg_list_is_empty(_window->present_event_list) ||
+   !xorg_list_is_empty(_window->present_release_queue);
+}
+
 static void
 xwl_present_reset_timer(struct xwl_window *xwl_window)
 {
-if ( !xorg_list_is_empty(_window->present_release_queue) ) {
+if (xwl_present_has_events(xwl_window)) {
+uint32_t timer_len = xwl_window->present_window ? TIMER_LEN_FLIP :
+  TIMER_LEN_COPY;
+
 xwl_window->present_timer = TimerSet(xwl_window->present_timer,
  0,
- TIMER_LEN_FLIP,
+ timer_len,
  _present_timer_callback,
  xwl_window);
 } else {
@@ -72,6 +89,14 @@ xwl_present_cleanup(WindowPtr window)
 xwl_window->present_window = NULL;
 }
 
+/* Clear remaining events */
+xorg_list_for_each_entry_safe(event, tmp, _window->present_event_list, 
list) {
+if (event->present_window == window) {
+xorg_list_del(>list);
+free(event);
+}
+}
+
 /* Clear remaining buffer releases and inform Present about free 
ressources */
 xorg_list_for_each_entry_safe(event, tmp, 
_window->present_release_queue, list) {
 if (event->present_window == window) {
@@ -81,7 +106,7 @@ xwl_present_cleanup(WindowPtr window)
 }
 
 /* Clear timer */
-if ( xorg_list_is_empty(_window->present_release_queue) )
+if (!xwl_present_has_events(xwl_window))
 xwl_present_free_timer(xwl_window);
 }
 
@@ -122,6 +147,25 @@ static const struct wl_buffer_listener 
xwl_present_release_listener = {
 xwl_present_buffer_release
 };
 
+static void
+xwl_present_events_notify(struct xwl_window *xwl_window)
+{
+uint64_tmsc = xwl_window->present_msc;
+struct xwl_present_event*event, *tmp;
+
+xorg_list_for_each_entry_safe(event, tmp,
+  _window->present_event_list,
+  list) {
+if (event->target_msc <= msc) {
+present_wnmd_event_notify(event->present_window,
+  event->event_id,
+  xwl_window->present_ust,
+  msc);
+xwl_present_free_event(event);
+}
+}
+}
+
 CARD32
 xwl_present_timer_callback(OsTimerPtr timer,
CARD32 time,
@@ -133,9 +177,12 @@ xwl_present_timer_callback(OsTimerPtr timer,
 xwl_window->present_msc++;
 xwl_window->present_ust = GetTimeInMicros();
 
-if ( !xorg_list_is_empty(_window->present_release_queue) ) {
+xwl_present_events_notify(xwl_window);
+
+if (xwl_present_has_events(xwl_window)) {
 /* Still events, restart timer */
-return TIMER_LEN_FLIP;
+return xwl_window->present_window ? TIMER_LEN_FLIP :
+TIMER_LEN_COPY;
 } else {
 /* No more events, do not restart timer and delete it instead */
 xwl_present_free_timer(xwl_window);
@@ -161,6 +208,8 @@ xwl_present_frame_callback(void *data,
 xwl_window->present_msc++;
 xwl_window->present_ust = GetTimeInMicros();
 
+xwl_present_events_notify(xwl_window);
+
 /* we do not need the timer anymore for this frame,
  * reset it for potentially the next one
  */
@@ -248,9 +297,34 @@ xwl_present_queue_vblank(WindowPtr present_window,
  uint64_t event_id,
  uint64_t msc)
 {
-/* Not yet implemented
- */
-

[PATCH xserver v2 18/22] xwayland: Add arguments to glamor_pixmap_get_wl_buffer

2018-02-28 Thread Roman Gilg
Add arguments to give the caller more information and control
over the creation of a wl_buffer with GBM, in particular let
the caller determine the size of the buffer.

Signed-off-by: Roman Gilg 
---
 hw/xwayland/xwayland-glamor.c | 19 +++
 hw/xwayland/xwayland.c|  5 -
 hw/xwayland/xwayland.h|  5 -
 3 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 8ffb40d..ee7e11c 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -153,14 +153,25 @@ xwl_glamor_create_pixmap_for_bo(ScreenPtr screen, struct 
gbm_bo *bo, int depth)
 }
 
 struct wl_buffer *
-xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap)
+xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap,
+unsigned short width,
+unsigned short height,
+Bool *created)
 {
 struct xwl_screen *xwl_screen = xwl_screen_get(pixmap->drawable.pScreen);
 struct xwl_pixmap *xwl_pixmap = xwl_pixmap_get(pixmap);
 int prime_fd;
 
-if (xwl_pixmap->buffer)
+if (xwl_pixmap->buffer) {
+/* Buffer already exists. Return it and inform caller if interested. */
+if (created)
+*created = FALSE;
 return xwl_pixmap->buffer;
+}
+
+/* Buffer does not exist yet. Create now and inform caller if interested. 
*/
+if (created)
+*created = TRUE;
 
 prime_fd = gbm_bo_get_fd(xwl_pixmap->bo);
 if (prime_fd == -1)
@@ -168,8 +179,8 @@ xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap)
 
 xwl_pixmap->buffer =
 wl_drm_create_prime_buffer(xwl_screen->drm, prime_fd,
-   pixmap->drawable.width,
-   pixmap->drawable.height,
+   width,
+   height,

drm_format_for_depth(pixmap->drawable.depth),
0, gbm_bo_get_stride(xwl_pixmap->bo),
0, 0,
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 73bc47a..8cb 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -649,7 +649,10 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
 
 #ifdef GLAMOR_HAS_GBM
 if (xwl_screen->glamor)
-buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap);
+buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ NULL);
 else
 #endif
 buffer = xwl_shm_pixmap_get_wl_buffer(pixmap);
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index ffa0d72..783ab59 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -328,7 +328,10 @@ Bool xwl_glamor_init(struct xwl_screen *xwl_screen);
 
 Bool xwl_screen_init_glamor(struct xwl_screen *xwl_screen,
  uint32_t id, uint32_t version);
-struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap);
+struct wl_buffer *xwl_glamor_pixmap_get_wl_buffer(PixmapPtr pixmap,
+  unsigned short width,
+  unsigned short height,
+  Bool *created);
 
 void xwl_screen_release_tablet_manager(struct xwl_screen *xwl_screen);
 
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 20/22] xwayland: Add fallback timer for msc counting

2018-02-28 Thread Roman Gilg
When the compositor is not sending frame callbacks while we still wait
on buffer release events fake a continuous msc counter with a timer.

Having this timer is a prerequisite for queuing events.

Signed-off-by: Roman Gilg 
---
 hw/xwayland/xwayland-present.c | 70 ++
 hw/xwayland/xwayland.h |  3 ++
 2 files changed, 73 insertions(+)

diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
index 2798c2a..3088f03 100644
--- a/hw/xwayland/xwayland-present.c
+++ b/hw/xwayland/xwayland-present.c
@@ -27,6 +27,34 @@
 
 #include 
 
+#define TIMER_LEN_FLIP1000  // 1fps
+
+static void
+xwl_present_free_timer(struct xwl_window *xwl_window)
+{
+TimerFree(xwl_window->present_timer);
+xwl_window->present_timer = NULL;
+}
+
+static CARD32
+xwl_present_timer_callback(OsTimerPtr timer,
+   CARD32 time,
+   void *arg);
+
+static void
+xwl_present_reset_timer(struct xwl_window *xwl_window)
+{
+if ( !xorg_list_is_empty(_window->present_release_queue) ) {
+xwl_window->present_timer = TimerSet(xwl_window->present_timer,
+ 0,
+ TIMER_LEN_FLIP,
+ _present_timer_callback,
+ xwl_window);
+} else {
+xwl_present_free_timer(xwl_window);
+}
+}
+
 void
 xwl_present_cleanup(WindowPtr window)
 {
@@ -51,6 +79,10 @@ xwl_present_cleanup(WindowPtr window)
 event->abort = TRUE;
 }
 }
+
+/* Clear timer */
+if ( xorg_list_is_empty(_window->present_release_queue) )
+xwl_present_free_timer(xwl_window);
 }
 
 static void
@@ -90,6 +122,27 @@ static const struct wl_buffer_listener 
xwl_present_release_listener = {
 xwl_present_buffer_release
 };
 
+CARD32
+xwl_present_timer_callback(OsTimerPtr timer,
+   CARD32 time,
+   void *arg)
+{
+struct xwl_window *xwl_window = arg;
+
+xwl_window->present_timer_firing = TRUE;
+xwl_window->present_msc++;
+xwl_window->present_ust = GetTimeInMicros();
+
+if ( !xorg_list_is_empty(_window->present_release_queue) ) {
+/* Still events, restart timer */
+return TIMER_LEN_FLIP;
+} else {
+/* No more events, do not restart timer and delete it instead */
+xwl_present_free_timer(xwl_window);
+return 0;
+}
+}
+
 static void
 xwl_present_frame_callback(void *data,
struct wl_callback *callback,
@@ -100,8 +153,18 @@ xwl_present_frame_callback(void *data,
 wl_callback_destroy(xwl_window->present_frame_callback);
 xwl_window->present_frame_callback = NULL;
 
+if (xwl_window->present_timer_firing) {
+/* If the timer is firing, this frame callback is too late */
+return;
+}
+
 xwl_window->present_msc++;
 xwl_window->present_ust = GetTimeInMicros();
+
+/* we do not need the timer anymore for this frame,
+ * reset it for potentially the next one
+ */
+xwl_present_reset_timer(xwl_window);
 }
 
 static const struct wl_callback_listener xwl_present_frame_listener = {
@@ -307,6 +370,13 @@ xwl_present_flip(WindowPtr present_window,
 /* We can flip directly to the main surface (full screen window without 
clips) */
 wl_surface_attach(xwl_window->surface, buffer, 0, 0);
 
+if (!xwl_window->present_timer ||
+xwl_window->present_timer_firing) {
+/* Realign timer */
+xwl_window->present_timer_firing = FALSE;
+xwl_present_reset_timer(xwl_window);
+}
+
 if (!xwl_window->present_frame_callback) {
 xwl_window->present_frame_callback = 
wl_surface_frame(xwl_window->surface);
 wl_callback_add_listener(xwl_window->present_frame_callback,
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index a41c8ca..a64498a 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -124,6 +124,9 @@ struct xwl_window {
 uint64_t present_msc;
 uint64_t present_ust;
 
+OsTimerPtr present_timer;
+Bool present_timer_firing;
+
 struct wl_callback *present_frame_callback;
 struct wl_callback *present_sync_callback;
 struct xorg_list present_release_queue;
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 19/22] xwayland: Preliminary support for Present's new window flip mode

2018-02-28 Thread Roman Gilg
Introduce support for Present's window flip mode. The support is not yet
complete, but works reasonable well for the most important use case, that
is fullscreen applications.

We take a Present flip and if the xwl_window->window has the same dimensions
as the presenting window, the flip is represented by a wl_buffer and attached
to the main wl_surface of the xwl_window.

After commit we are listening for the sync callback in order to tell Present,
that the pixmap flip is not longer pending, for the frame callback in order
to update the msc counter and for the buffer release callback in order to tell
Present that the pixmap is idle again.

The following functionality is missing from this patch:
* (slowed down) flips in case the compositor is not sending frame callbacks,
* queuing events to MSC times,
* per window flips for child windows with smaller size than the xwl_window.

To make use of this functionality Xwayland must run rootless and with
Glamor/GBM.

Signed-off-by: Roman Gilg 
---
 hw/xwayland/Makefile.am|   1 +
 hw/xwayland/meson.build|   1 +
 hw/xwayland/xwayland-present.c | 365 +
 hw/xwayland/xwayland.c |  21 +++
 hw/xwayland/xwayland.h |  30 
 5 files changed, 418 insertions(+)
 create mode 100644 hw/xwayland/xwayland-present.c

diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am
index 173686e..28ee5a5 100644
--- a/hw/xwayland/Makefile.am
+++ b/hw/xwayland/Makefile.am
@@ -11,6 +11,7 @@ Xwayland_CFLAGS = \
 
 Xwayland_SOURCES = \
xwayland.c  \
+   xwayland-present.c  \
xwayland-input.c\
xwayland-cursor.c   \
xwayland-shm.c  \
diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build
index f6f7500..77da405 100644
--- a/hw/xwayland/meson.build
+++ b/hw/xwayland/meson.build
@@ -1,5 +1,6 @@
 srcs = [
 'xwayland.c',
+'xwayland-present.c',
 'xwayland-input.c',
 'xwayland-cursor.c',
 'xwayland-shm.c',
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
new file mode 100644
index 000..2798c2a
--- /dev/null
+++ b/hw/xwayland/xwayland-present.c
@@ -0,0 +1,365 @@
+/*
+ * Copyright © 2018 Roman Gilg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of the
+ * copyright holders not be used in advertising or publicity
+ * pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no
+ * representations about the suitability of this software for any
+ * purpose.  It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include "xwayland.h"
+
+#include 
+
+void
+xwl_present_cleanup(WindowPtr window)
+{
+struct xwl_window   *xwl_window = xwl_window_of_top(window);
+struct xwl_present_event*event, *tmp;
+
+if (!xwl_window)
+return;
+
+if (xwl_window->present_window == window) {
+if (xwl_window->present_frame_callback) {
+wl_callback_destroy(xwl_window->present_frame_callback);
+xwl_window->present_frame_callback = NULL;
+}
+xwl_window->present_window = NULL;
+}
+
+/* Clear remaining buffer releases and inform Present about free 
ressources */
+xorg_list_for_each_entry_safe(event, tmp, 
_window->present_release_queue, list) {
+if (event->present_window == window) {
+xorg_list_del(>list);
+event->abort = TRUE;
+}
+}
+}
+
+static void
+xwl_present_free_event(struct xwl_present_event *event)
+{
+xorg_list_del(>list);
+free(event);
+}
+
+static void
+xwl_present_buffer_release(void *data, struct wl_buffer *buffer)
+{
+struct xwl_present_event *event = data;
+
+if (!event)
+return;
+wl_buffer_set_user_data(buffer, NULL);
+
+event->buffer_released = TRUE;
+
+if (event->abort) {
+if (!event->pending)
+xwl_present_free_event(event);
+return;
+}
+
+if (!event->pending) {
+

[PATCH xserver v2 14/22] present: Add window flip mode

2018-02-28 Thread Roman Gilg
In contrast to screen flip mode this mode:
* supports flips per windows (these windows currently need to have the same
  size as their parent windows with the same pixmap),
* sends pixmap idle signals to the client only after the driver has given
  an additional event notify.

This patch only introduces the new mode as a stub. It additionally needs a
driver hook, such that it can get initialized and appropriate cleanup
functions.

Signed-off-by: Roman Gilg 
---
 present/Makefile.am|   3 +-
 present/meson.build|   1 +
 present/present.h  |   6 +
 present/present_priv.h |   9 +
 present/present_wnmd.c | 663 +
 5 files changed, 681 insertions(+), 1 deletion(-)
 create mode 100644 present/present_wnmd.c

diff --git a/present/Makefile.am b/present/Makefile.am
index 55ad295..542f4ca 100644
--- a/present/Makefile.am
+++ b/present/Makefile.am
@@ -15,6 +15,7 @@ libpresent_la_SOURCES = \
present_request.c \
present_scmd.c \
present_screen.c \
-   present_vblank.c
+   present_vblank.c \
+   present_wnmd.c
 
 sdk_HEADERS = present.h presentext.h
diff --git a/present/meson.build b/present/meson.build
index 5e1dd3c..ad4fcff 100644
--- a/present/meson.build
+++ b/present/meson.build
@@ -9,6 +9,7 @@ srcs_present = [
 'present_scmd.c',
 'present_screen.c',
 'present_vblank.c',
+'present_wnmd.c',
 ]
 
 libxserver_present = static_library('libxserver_present',
diff --git a/present/present.h b/present/present.h
index b87d5bd..553fd49 100644
--- a/present/present.h
+++ b/present/present.h
@@ -149,6 +149,12 @@ typedef struct present_wnmd_info {
  */
 extern _X_EXPORT void
 present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc);
+/*
+ * Called when 'event_id' occurs for 'window'.
+ * 'ust' and 'msc' indicate when the event actually happened
+ */
+extern _X_EXPORT void
+present_wnmd_event_notify(WindowPtr window, uint64_t event_id, uint64_t ust, 
uint64_t msc);
 
 /* 'crtc' has been turned off, so any pending events will never occur.
  */
diff --git a/present/present_priv.h b/present/present_priv.h
index a732126..900acc2 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -472,4 +472,13 @@ present_vblank_scrap(present_vblank_ptr vblank);
 void
 present_vblank_destroy(present_vblank_ptr vblank);
 
+/*
+ * present_wnmd.c
+ */
+void
+present_wnmd_set_abort_flip(WindowPtr window);
+
+void
+present_wnmd_init_mode_hooks(present_screen_priv_ptr screen_priv);
+
 #endif /*  _PRESENT_PRIV_H_ */
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
new file mode 100644
index 000..14ab721
--- /dev/null
+++ b/present/present_wnmd.c
@@ -0,0 +1,663 @@
+/*
+ * Copyright © 2018 Roman Gilg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include 
+#endif
+
+#include "present_priv.h"
+
+/*
+ * Window flip mode
+ *
+ * Provides per-window flips. Flips can be processed on windows that
+ * have the same size as their parents, which they share their pixmap with.
+ *
+ * A flip still requires a copy currently, since the original pixmap needs
+ * to be updated with the new pixmap content. Just a flip of all windows
+ * to the new pixmap is diffcult, because the original pixmap might not be
+ * controlled by the Xserver.
+ *
+ */
+
+static void
+present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t 
crtc_msc);
+
+static void
+present_wnmd_create_event_id(present_window_priv_ptr window_priv, 
present_vblank_ptr vblank)
+{
+vblank->event_id = ++window_priv->event_id;
+}
+
+static uint32_t
+present_wnmd_query_capabilities(present_screen_priv_ptr screen_priv)
+{
+return screen_priv->wnmd_info->capabilities;
+}
+
+static RRCrtcPtr
+present_wnmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window)
+{
+return 

[PATCH xserver v2 16/22] present: Add cleanups for window flip mode

2018-02-28 Thread Roman Gilg
Make sure that vblanks and windows get cleaned up correctly
in window flip mode.

Signed-off-by: Roman Gilg 
---
 present/present_screen.c | 33 -
 present/present_vblank.c |  2 ++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/present/present_screen.c b/present/present_screen.c
index b0cae0f..8ad14ad 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -109,6 +109,32 @@ present_clear_window_flip(WindowPtr window)
 }
 }
 
+static void
+present_wnmd_clear_window_flip(WindowPtr window)
+{
+present_window_priv_ptr window_priv = present_window_priv(window);
+present_vblank_ptr  vblank, tmp;
+
+if (window_priv->flip_pending) {
+present_wnmd_set_abort_flip(window);
+window_priv->flip_pending->window = NULL;
+}
+
+xorg_list_for_each_entry_safe(vblank, tmp, _priv->idle_queue, 
event_queue) {
+present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, 
vblank->idle_fence);
+/* The pixmap will be destroyed by freeing the window resources. */
+vblank->pixmap = NULL;
+present_vblank_destroy(vblank);
+}
+
+vblank = window_priv->flip_active;
+if (vblank) {
+present_pixmap_idle(vblank->pixmap, vblank->window, vblank->serial, 
vblank->idle_fence);
+present_vblank_destroy(vblank);
+}
+window_priv->flip_active = NULL;
+}
+
 /*
  * Hook the close window function to clean up our window private
  */
@@ -124,7 +150,12 @@ present_destroy_window(WindowPtr window)
 present_clear_window_notifies(window);
 present_free_events(window);
 present_free_window_vblank(window);
-present_clear_window_flip(window);
+
+if (screen_priv->wnmd_info)
+present_wnmd_clear_window_flip(window);
+else
+present_clear_window_flip(window);
+
 free(window_priv);
 }
 unwrap(screen_priv, screen, DestroyWindow);
diff --git a/present/present_vblank.c b/present/present_vblank.c
index dbfedb4..af6ebe5 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -169,6 +169,8 @@ present_vblank_destroy(present_vblank_ptr vblank)
 {
 /* Remove vblank from window and screen lists */
 xorg_list_del(>window_list);
+/* Also make sure vblank is removed from event queue (wnmd) */
+xorg_list_del(>event_queue);
 
 DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
   vblank->event_id, vblank, vblank->target_msc,
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 10/22] present: Add present_window_priv properties for window flip mode

2018-02-28 Thread Roman Gilg
For window flip mode data about flips needs to be stored per window.
Add properties to 'present_window_priv' and initialize them on creation.

Signed-off-by: Roman Gilg 
---
 present/present_priv.h   | 10 ++
 present/present_screen.c |  6 ++
 2 files changed, 16 insertions(+)

diff --git a/present/present_priv.h b/present/present_priv.h
index 84da04a..a3e59ac 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -201,12 +201,22 @@ typedef struct present_event {
 } present_event_rec;
 
 typedef struct present_window_priv {
+WindowPtr  window;
 present_event_ptr  events;
 RRCrtcPtr  crtc;/* Last reported CRTC from get_ust_msc 
*/
 uint64_t   msc_offset;
 uint64_t   msc; /* Last reported MSC from the current 
crtc */
 struct xorg_list   vblank;
 struct xorg_list   notifies;
+
+/* Used for window flips */
+uint64_t   event_id;
+struct xorg_list   exec_queue;
+struct xorg_list   flip_queue;
+struct xorg_list   idle_queue;
+
+present_vblank_ptr flip_pending;
+present_vblank_ptr flip_active;
 } present_window_priv_rec, *present_window_priv_ptr;
 
 #define PresentCrtcNeverSet ((RRCrtcPtr) 1)
diff --git a/present/present_screen.c b/present/present_screen.c
index 868eaf8..d6c9a5e 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -45,6 +45,12 @@ present_get_window_priv(WindowPtr window, Bool create)
 return NULL;
 xorg_list_init(_priv->vblank);
 xorg_list_init(_priv->notifies);
+
+xorg_list_init(_priv->exec_queue);
+xorg_list_init(_priv->flip_queue);
+xorg_list_init(_priv->idle_queue);
+
+window_priv->window = window;
 window_priv->crtc = PresentCrtcNeverSet;
 dixSetPrivate(>devPrivates, _window_private_key, 
window_priv);
 return window_priv;
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 17/22] present: Add exported init function of window flip mode

2018-02-28 Thread Roman Gilg
Allow drivers now to initialize window flip mode.

Signed-off-by: Roman Gilg 
---
 present/present.h|  2 ++
 present/present_screen.c | 23 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/present/present.h b/present/present.h
index 8b2e03f..123791d 100644
--- a/present/present.h
+++ b/present/present.h
@@ -164,6 +164,8 @@ present_event_abandon(RRCrtcPtr crtc);
 
 extern _X_EXPORT Bool
 present_screen_init(ScreenPtr screen, present_screen_info_ptr info);
+extern _X_EXPORT Bool
+present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info);
 
 typedef void (*present_complete_notify_proc)(WindowPtr window,
  CARD8 kind,
diff --git a/present/present_screen.c b/present/present_screen.c
index 8ad14ad..c7e37c5 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -239,7 +239,28 @@ present_screen_priv_init(ScreenPtr screen)
 }
 
 /*
- * Initialize a screen for use with present
+ * Initialize a screen for use with present in window flip mode (wnmd)
+ */
+int
+present_wnmd_screen_init(ScreenPtr screen, present_wnmd_info_ptr info)
+{
+if (!present_screen_register_priv_keys())
+return FALSE;
+
+if (!present_screen_priv(screen)) {
+present_screen_priv_ptr screen_priv = present_screen_priv_init(screen);
+if (!screen_priv)
+return FALSE;
+
+screen_priv->wnmd_info = info;
+present_wnmd_init_mode_hooks(screen_priv);
+}
+
+return TRUE;
+}
+
+/*
+ * Initialize a screen for use with present in default screen flip mode (scmd)
  */
 int
 present_screen_init(ScreenPtr screen, present_screen_info_ptr info)
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 15/22] present: In window flip mode report damage on flip to driver

2018-02-28 Thread Roman Gilg
Calculate damage before trying to flip and report it to the driver.
This allows drivers to optimize their rendering.

Signed-off-by: Roman Gilg 
---
 present/present.h  |  3 ++-
 present/present_wnmd.c | 24 +---
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/present/present.h b/present/present.h
index 553fd49..8b2e03f 100644
--- a/present/present.h
+++ b/present/present.h
@@ -96,7 +96,8 @@ typedef Bool (*present_wnmd_flip_ptr) (WindowPtr window,
uint64_t event_id,
uint64_t target_msc,
PixmapPtr pixmap,
-   Bool sync_flip);
+   Bool sync_flip,
+   RegionPtr damage);
 
 /* "unflip" back to the regular screen scanout buffer
  *
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 14ab721..da503af 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -341,7 +341,8 @@ present_wnmd_flip(WindowPtr window,
   uint64_t event_id,
   uint64_t target_msc,
   PixmapPtr pixmap,
-  Bool sync_flip)
+  Bool sync_flip,
+  RegionPtr damage)
 {
 ScreenPtr   screen = crtc->pScreen;
 present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -351,7 +352,8 @@ present_wnmd_flip(WindowPtr window,
 event_id,
 target_msc,
 pixmap,
-sync_flip);
+sync_flip,
+damage);
 }
 
 static void
@@ -412,12 +414,19 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t 
ust, uint64_t crtc_msc)
  */
 xorg_list_add(>event_queue, _priv->flip_queue);
 
+/* Set update region as damaged */
+if (vblank->update) {
+damage = vblank->update;
+RegionIntersect(damage, damage, >clipList);
+} else
+damage = >clipList;
+
 /* Try to flip - the vblank is now pending
  */
 window_priv->flip_pending = vblank;
 // ask the driver
 if (present_wnmd_flip(vblank->window, vblank->crtc, 
vblank->event_id,
- vblank->target_msc, vblank->pixmap, 
vblank->sync_flip)) {
+ vblank->target_msc, vblank->pixmap, 
vblank->sync_flip, damage)) {
 ScreenPtr screen = window->drawable.pScreen;
 WindowPtr toplvl_window = 
present_wnmd_toplvl_pixmap_window(vblank->window);
 PixmapPtr old_pixmap = screen->GetWindowPixmap(window);
@@ -427,14 +436,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t 
ust, uint64_t crtc_msc)
 vblank->pixmap->refcnt++;
 dixDestroyPixmap(old_pixmap, old_pixmap->drawable.id);
 
-/* Report update region as damaged
- */
-if (vblank->update) {
-damage = vblank->update;
-RegionIntersect(damage, damage, >clipList);
-} else
-damage = >clipList;
-
+/* Report damage */
 DamageDamageRegion(>window->drawable, damage);
 return;
 }
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 11/22] present: Add flip_idler vblank property

2018-02-28 Thread Roman Gilg
Introduce vblank property for flip modes, that demand explicite
allowance by the driver for vblanks to become idle.

Signed-off-by: Roman Gilg 
---
 present/present_priv.h   | 1 +
 present/present_vblank.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/present/present_priv.h b/present/present_priv.h
index a3e59ac..4685040 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -79,6 +79,7 @@ struct present_vblank {
 Boolrequeue;/* on queue, but target_msc has 
changed */
 Boolflip;   /* planning on using flip */
 Boolflip_ready; /* wants to flip, but waiting for 
previous flip or unflip */
+Boolflip_idler; /* driver explicitly permitted idling 
*/
 Boolsync_flip;  /* do flip synchronous to vblank */
 Boolabort_flip; /* aborting this flip */
 };
diff --git a/present/present_vblank.c b/present/present_vblank.c
index 0f1c3e6..00bb65c 100644
--- a/present/present_vblank.c
+++ b/present/present_vblank.c
@@ -104,6 +104,7 @@ present_vblank_create(WindowPtr window,
 vblank->msc_offset = window_priv->msc_offset;
 vblank->notifies = notifies;
 vblank->num_notifies = num_notifies;
+vblank->flip_idler = FALSE;
 
 if (pixmap != NULL &&
 !(options & PresentOptionCopy) &&
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 13/22] present: Add driver facing window flip mode hooks

2018-02-28 Thread Roman Gilg
To enable special functionality of window flips introduce for window flips
a separate set of driver facing function hooks.

Signed-off-by: Roman Gilg 
---
 present/present.h  | 43 +++
 present/present_priv.h |  1 +
 2 files changed, 44 insertions(+)

diff --git a/present/present.h b/present/present.h
index aab2e16..b87d5bd 100644
--- a/present/present.h
+++ b/present/present.h
@@ -36,6 +36,7 @@ typedef RRCrtcPtr (*present_get_crtc_ptr) (WindowPtr window);
 /* Return the current ust/msc for 'crtc'
  */
 typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, uint64_t *ust, 
uint64_t *msc);
+typedef int (*present_wnmd_get_ust_msc_ptr) (WindowPtr window, uint64_t *ust, 
uint64_t *msc);
 
 /* Queue callback on 'crtc' for time 'msc'. Call present_event_notify with 
'event_id'
  * at or after 'msc'. Return false if it didn't happen (which might occur if 
'crtc'
@@ -44,12 +45,20 @@ typedef int (*present_get_ust_msc_ptr) (RRCrtcPtr crtc, 
uint64_t *ust, uint64_t
 typedef Bool (*present_queue_vblank_ptr) (RRCrtcPtr crtc,
   uint64_t event_id,
   uint64_t msc);
+typedef Bool (*present_wnmd_queue_vblank_ptr) (WindowPtr window,
+   RRCrtcPtr crtc,
+   uint64_t event_id,
+   uint64_t msc);
 
 /* Abort pending vblank. The extension is no longer interested in
  * 'event_id' which was to be notified at 'msc'. If possible, the
  * driver is free to de-queue the notification.
  */
 typedef void (*present_abort_vblank_ptr) (RRCrtcPtr crtc, uint64_t event_id, 
uint64_t msc);
+typedef void (*present_wnmd_abort_vblank_ptr) (WindowPtr window,
+   RRCrtcPtr crtc,
+   uint64_t event_id,
+   uint64_t msc);
 
 /* Flush pending drawing on 'window' to the hardware.
  */
@@ -75,6 +84,19 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
   uint64_t target_msc,
   PixmapPtr pixmap,
   Bool sync_flip);
+/* Flip pixmap for window, return false if it didn't happen.
+ *
+ * Like present_flip_ptr, additionaly with:
+ *
+ * 'window' used for synchronization.
+ *
+ */
+typedef Bool (*present_wnmd_flip_ptr) (WindowPtr window,
+   RRCrtcPtr crtc,
+   uint64_t event_id,
+   uint64_t target_msc,
+   PixmapPtr pixmap,
+   Bool sync_flip);
 
 /* "unflip" back to the regular screen scanout buffer
  *
@@ -83,6 +105,12 @@ typedef Bool (*present_flip_ptr) (RRCrtcPtr crtc,
 typedef void (*present_unflip_ptr) (ScreenPtr screen,
 uint64_t event_id);
 
+/* Doing flips has been discontinued.
+ *
+ * Inform driver for potential cleanup on its side.
+ */
+typedef void (*present_wnmd_flips_stop_ptr) (WindowPtr window);
+
 #define PRESENT_SCREEN_INFO_VERSION0
 
 typedef struct present_screen_info {
@@ -100,6 +128,21 @@ typedef struct present_screen_info {
 
 } present_screen_info_rec, *present_screen_info_ptr;
 
+typedef struct present_wnmd_info {
+uint32_tversion;
+
+present_get_crtc_ptrget_crtc;
+present_wnmd_get_ust_msc_ptrget_ust_msc;
+present_wnmd_queue_vblank_ptr   queue_vblank;
+present_wnmd_abort_vblank_ptr   abort_vblank;
+present_flush_ptr   flush;
+uint32_tcapabilities;
+present_check_flip_ptr  check_flip;
+present_wnmd_flip_ptr   flip;
+present_wnmd_flips_stop_ptr flips_stop;
+
+} present_wnmd_info_rec, *present_wnmd_info_ptr;
+
 /*
  * Called when 'event_id' occurs. 'ust' and 'msc' indicate when the
  * event actually happened
diff --git a/present/present_priv.h b/present/present_priv.h
index 2900e9a..a732126 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -158,6 +158,7 @@ struct present_screen_priv {
 Boolflip_sync;
 
 present_screen_info_ptr info;
+present_wnmd_info_ptr   wnmd_info;
 
 /* Mode hooks */
 present_priv_query_capabilities_ptr query_capabilities;
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 12/22] present: Adapt flip mode API hooks for window flip mode

2018-02-28 Thread Roman Gilg
Flipping pixmaps per window needs additional arguments in the
flip mode API. Add these as preperation for window flip mode.

Signed-off-by: Roman Gilg 
---
 present/present_execute.c |  2 ++
 present/present_priv.h| 10 +++---
 present/present_scmd.c|  8 +---
 present/present_screen.c  |  2 +-
 present/present_vblank.c  |  2 +-
 5 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/present/present_execute.c b/present/present_execute.c
index e45e547..e0c755a 100644
--- a/present/present_execute.c
+++ b/present/present_execute.c
@@ -52,6 +52,7 @@ present_execute_wait(present_vblank_ptr vblank, uint64_t 
crtc_msc)
 vblank->requeue = FALSE;
 if (msc_is_after(vblank->target_msc, crtc_msc) &&
 Success == screen_priv->queue_vblank(screen,
+ window,
  vblank->crtc,
  vblank->event_id,
  vblank->target_msc))
@@ -77,6 +78,7 @@ present_execute_copy(present_vblank_ptr vblank, uint64_t 
crtc_msc)
 /* If present_flip failed, we may have to requeue for the target MSC */
 if (vblank->target_msc == crtc_msc + 1 &&
 Success == screen_priv->queue_vblank(screen,
+ window,
  vblank->crtc,
  vblank->event_id,
  vblank->target_msc)) {
diff --git a/present/present_priv.h b/present/present_priv.h
index 4685040..2900e9a 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -85,6 +85,7 @@ struct present_vblank {
 };
 
 typedef struct present_screen_priv present_screen_priv_rec, 
*present_screen_priv_ptr;
+typedef struct present_window_priv present_window_priv_rec, 
*present_window_priv_ptr;
 
 /*
  * Mode hooks
@@ -119,9 +120,11 @@ typedef int (*present_priv_pixmap_ptr)(WindowPtr window,
present_notify_ptr notifies,
int num_notifies);
 
-typedef void (*present_priv_create_event_id_ptr)(present_vblank_ptr vblank);
+typedef void (*present_priv_create_event_id_ptr)(present_window_priv_ptr 
window_priv,
+ present_vblank_ptr vblank);
 
 typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen,
+ WindowPtr window,
  RRCrtcPtr crtc,
  uint64_t event_id,
  uint64_t msc);
@@ -129,6 +132,7 @@ typedef void (*present_priv_flush_ptr)(WindowPtr window);
 typedef void (*present_priv_re_execute_ptr)(present_vblank_ptr vblank);
 
 typedef void (*present_priv_abort_vblank_ptr)(ScreenPtr screen,
+  WindowPtr window,
   RRCrtcPtr crtc,
   uint64_t event_id,
   uint64_t msc);
@@ -201,7 +205,7 @@ typedef struct present_event {
 int mask;
 } present_event_rec;
 
-typedef struct present_window_priv {
+struct present_window_priv {
 WindowPtr  window;
 present_event_ptr  events;
 RRCrtcPtr  crtc;/* Last reported CRTC from get_ust_msc 
*/
@@ -218,7 +222,7 @@ typedef struct present_window_priv {
 
 present_vblank_ptr flip_pending;
 present_vblank_ptr flip_active;
-} present_window_priv_rec, *present_window_priv_ptr;
+};
 
 #define PresentCrtcNeverSet ((RRCrtcPtr) 1)
 
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 282c894..935525f 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -47,7 +47,8 @@ static void
 present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
 
 static void
-present_scmd_create_event_id(present_vblank_ptr vblank)
+present_scmd_create_event_id(present_window_priv_ptr window_priv,
+ present_vblank_ptr vblank)
 {
 vblank->event_id = ++present_event_id;
 }
@@ -195,6 +196,7 @@ present_flush(WindowPtr window)
 
 static int
 present_queue_vblank(ScreenPtr screen,
+ WindowPtr window,
  RRCrtcPtr crtc,
  uint64_t event_id,
  uint64_t msc)
@@ -702,7 +704,7 @@ present_scmd_pixmap(WindowPtr window,
 xorg_list_append(>event_queue, _exec_queue);
 vblank->queued = TRUE;
 if (msc_is_after(target_msc, crtc_msc)) {
-ret = present_queue_vblank(screen, target_crtc, vblank->event_id, 
target_msc);
+ret = present_queue_vblank(screen, window, target_crtc, 
vblank->event_id, target_msc);
 if (ret == Success)
 return Success;
 
@@ -715,7 

[PATCH xserver v2 07/22] present: Move timings adjustment in common part of flip mode API

2018-02-28 Thread Roman Gilg
To reduce future code duplication refactor timings adjustment out
as a separate function.

Signed-off-by: Roman Gilg 
---
 present/present.c  | 38 ++
 present/present_priv.h |  7 +++
 present/present_scmd.c | 34 +-
 3 files changed, 50 insertions(+), 29 deletions(-)

diff --git a/present/present.c b/present/present.c
index ddd9c1c..2c8adb8 100644
--- a/present/present.c
+++ b/present/present.c
@@ -28,6 +28,17 @@
 #include 
 
 /*
+ * Returns:
+ * TRUE if the first MSC value is equal to or after the second one
+ * FALSE if the first MSC value is before the second one
+ */
+static Bool
+msc_is_equal_or_after(uint64_t test, uint64_t reference)
+{
+return (int64_t)(test - reference) >= 0;
+}
+
+/*
  * Copies the update region from a pixmap to the target drawable
  */
 void
@@ -109,6 +120,33 @@ present_set_tree_pixmap(WindowPtr window,
 TraverseTree(window, present_set_tree_pixmap_visit, );
 }
 
+void
+present_adjust_timings(uint32_t options,
+   uint64_t *crtc_msc,
+   uint64_t *target_msc,
+   uint64_t divisor,
+   uint64_t remainder)
+{
+/* Adjust target_msc to match modulus
+ */
+if (msc_is_equal_or_after(*crtc_msc, *target_msc)) {
+if (divisor != 0) {
+*target_msc = *crtc_msc - (*crtc_msc % divisor) + remainder;
+if (options & PresentOptionAsync) {
+if (msc_is_after(*crtc_msc, *target_msc))
+*target_msc += divisor;
+} else {
+if (msc_is_equal_or_after(*crtc_msc, *target_msc))
+*target_msc += divisor;
+}
+} else {
+*target_msc = *crtc_msc;
+if (!(options & PresentOptionAsync))
+(*target_msc)++;
+}
+}
+}
+
 int
 present_pixmap(WindowPtr window,
PixmapPtr pixmap,
diff --git a/present/present_priv.h b/present/present_priv.h
index 44122d5..26d6b67 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -234,6 +234,13 @@ present_set_tree_pixmap(WindowPtr window,
 PixmapPtr expected,
 PixmapPtr pixmap);
 
+void
+present_adjust_timings(uint32_t options,
+   uint64_t *crtc_msc,
+   uint64_t *target_msc,
+   uint64_t divisor,
+   uint64_t remainder);
+
 int
 present_pixmap(WindowPtr window,
PixmapPtr pixmap,
diff --git a/present/present_scmd.c b/present/present_scmd.c
index fa886f8..7ea7552 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -46,17 +46,6 @@ static struct xorg_list present_flip_queue;
 static void
 present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
 
-/*
- * Returns:
- * TRUE if the first MSC value is equal to or after the second one
- * FALSE if the first MSC value is before the second one
- */
-static Bool
-msc_is_equal_or_after(uint64_t test, uint64_t reference)
-{
-return (int64_t)(test - reference) >= 0;
-}
-
 static void
 present_scmd_create_event_id(present_vblank_ptr vblank)
 {
@@ -665,24 +654,11 @@ present_scmd_pixmap(WindowPtr window,
 window_priv->msc = crtc_msc;
 }
 
-/* Adjust target_msc to match modulus
- */
-if (msc_is_equal_or_after(crtc_msc, target_msc)) {
-if (divisor != 0) {
-target_msc = crtc_msc - (crtc_msc % divisor) + remainder;
-if (options & PresentOptionAsync) {
-if (msc_is_after(crtc_msc, target_msc))
-target_msc += divisor;
-} else {
-if (msc_is_equal_or_after(crtc_msc, target_msc))
-target_msc += divisor;
-}
-} else {
-target_msc = crtc_msc;
-if (!(options & PresentOptionAsync))
-target_msc++;
-}
-}
+present_adjust_timings(options,
+   _msc,
+   _msc,
+   divisor,
+   remainder);
 
 /*
  * Look for a matching presentation already on the list and
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 03/22] present: Move vblank functionality in seperate file

2018-02-28 Thread Roman Gilg
With the new internal flip mode API move vblank creation
and so on into a seperate file, such that it can be shared
between flip modes.

Signed-off-by: Roman Gilg 
---
 present/Makefile.am  |   3 +-
 present/meson.build  |   1 +
 present/present_priv.h   |  44 ++-
 present/present_scmd.c   | 153 
 present/present_vblank.c | 197 +++
 5 files changed, 258 insertions(+), 140 deletions(-)
 create mode 100644 present/present_vblank.c

diff --git a/present/Makefile.am b/present/Makefile.am
index 3b458fd..3d3d38d 100644
--- a/present/Makefile.am
+++ b/present/Makefile.am
@@ -13,6 +13,7 @@ libpresent_la_SOURCES = \
present_priv.h \
present_request.c \
present_scmd.c \
-   present_screen.c
+   present_screen.c \
+   present_vblank.c
 
 sdk_HEADERS = present.h presentext.h
diff --git a/present/meson.build b/present/meson.build
index bbe0de5..801e810 100644
--- a/present/meson.build
+++ b/present/meson.build
@@ -7,6 +7,7 @@ srcs_present = [
 'present_request.c',
 'present_scmd.c',
 'present_screen.c',
+'present_vblank.c',
 ]
 
 libxserver_present = static_library('libxserver_present',
diff --git a/present/present_priv.h b/present/present_priv.h
index 738c8aa..077a823 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -176,6 +176,17 @@ present_window_priv_ptr
 present_get_window_priv(WindowPtr window, Bool create);
 
 /*
+ * Returns:
+ * TRUE if the first MSC value is after the second one
+ * FALSE if the first MSC value is equal to or before the second one
+ */
+static inline Bool
+msc_is_after(uint64_t test, uint64_t reference)
+{
+return (int64_t)(test - reference) > 0;
+}
+
+/*
  * present.c
  */
 void
@@ -325,9 +336,6 @@ void
 present_abort_vblank(ScreenPtr screen, RRCrtcPtr crtc, uint64_t event_id, 
uint64_t msc);
 
 void
-present_vblank_destroy(present_vblank_ptr vblank);
-
-void
 present_flip_destroy(ScreenPtr screen);
 
 void
@@ -352,4 +360,34 @@ present_scmd_init_mode_hooks(present_screen_priv_ptr 
screen_priv);
  * present_screen.c
  */
 
+/*
+ * present_vblank.c
+ */
+void
+present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, 
uint64_t ust, uint64_t crtc_msc);
+
+present_vblank_ptr
+present_vblank_create(WindowPtr window,
+  PixmapPtr pixmap,
+  CARD32 serial,
+  RegionPtr valid,
+  RegionPtr update,
+  int16_t x_off,
+  int16_t y_off,
+  RRCrtcPtr target_crtc,
+  SyncFence *wait_fence,
+  SyncFence *idle_fence,
+  uint32_t options,
+  const uint32_t *capabilities,
+  present_notify_ptr notifies,
+  int num_notifies,
+  uint64_t *target_msc,
+  uint64_t crtc_msc);
+
+void
+present_vblank_scrap(present_vblank_ptr vblank);
+
+void
+present_vblank_destroy(present_vblank_ptr vblank);
+
 #endif /*  _PRESENT_PRIV_H_ */
diff --git a/present/present_scmd.c b/present/present_scmd.c
index f40e5ab..86b2508 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -48,17 +48,6 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, 
uint64_t crtc_msc);
 
 /*
  * Returns:
- * TRUE if the first MSC value is after the second one
- * FALSE if the first MSC value is equal to or before the second one
- */
-static Bool
-msc_is_after(uint64_t test, uint64_t reference)
-{
-return (int64_t)(test - reference) > 0;
-}
-
-/*
- * Returns:
  * TRUE if the first MSC value is equal to or after the second one
  * FALSE if the first MSC value is before the second one
  */
@@ -171,22 +160,6 @@ present_flip(RRCrtcPtr crtc,
 return (*screen_priv->info->flip) (crtc, event_id, target_msc, pixmap, 
sync_flip);
 }
 
-static void
-present_vblank_notify(present_vblank_ptr vblank, CARD8 kind, CARD8 mode, 
uint64_t ust, uint64_t crtc_msc)
-{
-int n;
-
-if (vblank->window)
-present_send_complete_notify(vblank->window, kind, mode, 
vblank->serial, ust, crtc_msc - vblank->msc_offset);
-for (n = 0; n < vblank->num_notifies; n++) {
-WindowPtr   window = vblank->notifies[n].window;
-CARD32  serial = vblank->notifies[n].serial;
-
-if (window)
-present_send_complete_notify(window, kind, mode, serial, ust, 
crtc_msc - vblank->msc_offset);
-}
-}
-
 RRCrtcPtr
 present_get_crtc(WindowPtr window)
 {
@@ -800,79 +773,26 @@ present_pixmap(WindowPtr window,
 }
 }
 
-vblank = calloc (1, sizeof (present_vblank_rec));
+vblank = present_vblank_create(window,
+   pixmap,
+   serial,
+   valid,
+   update,
+   

[PATCH xserver v2 08/22] present: Add more hooks to internal flip mode API

2018-02-28 Thread Roman Gilg
Add hooks to query caps, get crtcs, abort vblanks and destroy
a flip.

Signed-off-by: Roman Gilg 
---
 present/present.c| 28 
 present/present_priv.h   | 33 +
 present/present_scmd.c   | 38 ++
 present/present_screen.c |  6 --
 4 files changed, 71 insertions(+), 34 deletions(-)

diff --git a/present/present.c b/present/present.c
index 2c8adb8..28cac55 100644
--- a/present/present.c
+++ b/present/present.c
@@ -38,6 +38,34 @@ msc_is_equal_or_after(uint64_t test, uint64_t reference)
 return (int64_t)(test - reference) >= 0;
 }
 
+uint32_t
+present_query_capabilities(RRCrtcPtr crtc)
+{
+present_screen_priv_ptr screen_priv;
+
+if (!crtc)
+return 0;
+
+screen_priv = present_screen_priv(crtc->pScreen);
+
+if (!screen_priv)
+return 0;
+
+return screen_priv->query_capabilities(screen_priv);
+}
+
+RRCrtcPtr
+present_get_crtc(WindowPtr window)
+{
+ScreenPtr   screen = window->drawable.pScreen;
+present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+if (!screen_priv)
+return NULL;
+
+return screen_priv->get_crtc(screen_priv, window);
+}
+
 /*
  * Copies the update region from a pixmap to the target drawable
  */
diff --git a/present/present_priv.h b/present/present_priv.h
index 26d6b67..84da04a 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -83,9 +83,15 @@ struct present_vblank {
 Boolabort_flip; /* aborting this flip */
 };
 
+typedef struct present_screen_priv present_screen_priv_rec, 
*present_screen_priv_ptr;
+
 /*
  * Mode hooks
  */
+typedef uint32_t 
(*present_priv_query_capabilities_ptr)(present_screen_priv_ptr screen_priv);
+typedef RRCrtcPtr (*present_priv_get_crtc_ptr)(present_screen_priv_ptr 
screen_priv,
+   WindowPtr window);
+
 typedef Bool (*present_priv_check_flip_ptr)(RRCrtcPtr crtc,
 WindowPtr window,
 PixmapPtr pixmap,
@@ -121,7 +127,13 @@ typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr 
screen,
 typedef void (*present_priv_flush_ptr)(WindowPtr window);
 typedef void (*present_priv_re_execute_ptr)(present_vblank_ptr vblank);
 
-typedef struct present_screen_priv {
+typedef void (*present_priv_abort_vblank_ptr)(ScreenPtr screen,
+  RRCrtcPtr crtc,
+  uint64_t event_id,
+  uint64_t msc);
+typedef void (*present_priv_flip_destroy_ptr)(ScreenPtr screen);
+
+struct present_screen_priv {
 CloseScreenProcPtr  CloseScreen;
 ConfigNotifyProcPtr ConfigNotify;
 DestroyWindowProcPtrDestroyWindow;
@@ -143,6 +155,9 @@ typedef struct present_screen_priv {
 present_screen_info_ptr info;
 
 /* Mode hooks */
+present_priv_query_capabilities_ptr query_capabilities;
+present_priv_get_crtc_ptr   get_crtc;
+
 present_priv_check_flip_ptr check_flip;
 present_priv_check_flip_window_ptr  check_flip_window;
 
@@ -153,7 +168,9 @@ typedef struct present_screen_priv {
 present_priv_flush_ptr  flush;
 present_priv_re_execute_ptr re_execute;
 
-} present_screen_priv_rec, *present_screen_priv_ptr;
+present_priv_abort_vblank_ptr   abort_vblank;
+present_priv_flip_destroy_ptr   flip_destroy;
+};
 
 #define wrap(priv,real,mem,func) {\
 priv->mem = real->mem; \
@@ -219,6 +236,12 @@ msc_is_after(uint64_t test, uint64_t reference)
 /*
  * present.c
  */
+uint32_t
+present_query_capabilities(RRCrtcPtr crtc);
+
+RRCrtcPtr
+present_get_crtc(WindowPtr window);
+
 void
 present_copy_region(DrawablePtr drawable,
 PixmapPtr pixmap,
@@ -393,12 +416,6 @@ present_restore_screen_pixmap(ScreenPtr screen);
 void
 present_set_abort_flip(ScreenPtr screen);
 
-RRCrtcPtr
-present_get_crtc(WindowPtr window);
-
-uint32_t
-present_query_capabilities(RRCrtcPtr crtc);
-
 Bool
 present_init(void);
 
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 7ea7552..282c894 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -149,34 +149,18 @@ present_flip(RRCrtcPtr crtc,
 return (*screen_priv->info->flip) (crtc, event_id, target_msc, pixmap, 
sync_flip);
 }
 
-RRCrtcPtr
-present_get_crtc(WindowPtr window)
+static RRCrtcPtr
+present_scmd_get_crtc(present_screen_priv_ptr screen_priv, WindowPtr window)
 {
-ScreenPtr   screen = window->drawable.pScreen;
-present_screen_priv_ptr screen_priv = present_screen_priv(screen);
-
-if (!screen_priv)
-return NULL;
-
 if (!screen_priv->info)
 return NULL;
 
 return (*screen_priv->info->get_crtc)(window);
 }
 
-uint32_t
-present_query_capabilities(RRCrtcPtr crtc)

[PATCH xserver v2 09/22] present: Refactor present_screen_init

2018-02-28 Thread Roman Gilg
To initialize easily different flip modes, refactor
'present_screen_init'.

Signed-off-by: Roman Gilg 
---
 present/present_screen.c | 46 +-
 1 file changed, 33 insertions(+), 13 deletions(-)

diff --git a/present/present_screen.c b/present/present_screen.c
index 98f701a..868eaf8 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -170,32 +170,52 @@ present_clip_notify(WindowPtr window, int dx, int dy)
 wrap(screen_priv, screen, ClipNotify, present_clip_notify);
 }
 
+static Bool
+present_screen_register_priv_keys(void)
+{
+if (!dixRegisterPrivateKey(_screen_private_key, PRIVATE_SCREEN, 0))
+return FALSE;
+
+if (!dixRegisterPrivateKey(_window_private_key, PRIVATE_WINDOW, 0))
+return FALSE;
+
+return TRUE;
+}
+
+static present_screen_priv_ptr
+present_screen_priv_init(ScreenPtr screen)
+{
+present_screen_priv_ptr screen_priv;
+
+screen_priv = calloc(1, sizeof (present_screen_priv_rec));
+if (!screen_priv)
+return NULL;
+
+wrap(screen_priv, screen, CloseScreen, present_close_screen);
+wrap(screen_priv, screen, DestroyWindow, present_destroy_window);
+wrap(screen_priv, screen, ConfigNotify, present_config_notify);
+wrap(screen_priv, screen, ClipNotify, present_clip_notify);
+
+dixSetPrivate(>devPrivates, _screen_private_key, 
screen_priv);
+
+return screen_priv;
+}
+
 /*
  * Initialize a screen for use with present
  */
 int
 present_screen_init(ScreenPtr screen, present_screen_info_ptr info)
 {
-if (!dixRegisterPrivateKey(_screen_private_key, PRIVATE_SCREEN, 0))
-return FALSE;
-
-if (!dixRegisterPrivateKey(_window_private_key, PRIVATE_WINDOW, 0))
+if (!present_screen_register_priv_keys())
 return FALSE;
 
 if (!present_screen_priv(screen)) {
-present_screen_priv_ptr screen_priv = calloc(1, sizeof 
(present_screen_priv_rec));
+present_screen_priv_ptr screen_priv = present_screen_priv_init(screen);
 if (!screen_priv)
 return FALSE;
 
-wrap(screen_priv, screen, CloseScreen, present_close_screen);
-wrap(screen_priv, screen, DestroyWindow, present_destroy_window);
-wrap(screen_priv, screen, ConfigNotify, present_config_notify);
-wrap(screen_priv, screen, ClipNotify, present_clip_notify);
-
 screen_priv->info = info;
-
-dixSetPrivate(>devPrivates, _screen_private_key, 
screen_priv);
-
 present_scmd_init_mode_hooks(screen_priv);
 
 present_fake_screen_init(screen);
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 04/22] present: Add flip mode API hooks for several functions

2018-02-28 Thread Roman Gilg
Add 'queue_vblank', 'flush' and 're_execute' hooks, that
are supposed to be shared with other flip modes.

Signed-off-by: Roman Gilg 
---
 present/present_priv.h | 12 
 present/present_scmd.c |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/present/present_priv.h b/present/present_priv.h
index 077a823..017e204 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -97,6 +97,13 @@ typedef void (*present_priv_check_flip_window_ptr)(WindowPtr 
window);
 
 typedef void (*present_priv_create_event_id_ptr)(present_vblank_ptr vblank);
 
+typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen,
+ RRCrtcPtr crtc,
+ uint64_t event_id,
+ uint64_t msc);
+typedef void (*present_priv_flush_ptr)(WindowPtr window);
+typedef void (*present_priv_re_execute_ptr)(present_vblank_ptr vblank);
+
 typedef struct present_screen_priv {
 CloseScreenProcPtr  CloseScreen;
 ConfigNotifyProcPtr ConfigNotify;
@@ -123,6 +130,11 @@ typedef struct present_screen_priv {
 present_priv_check_flip_window_ptr  check_flip_window;
 
 present_priv_create_event_id_ptrcreate_event_id;
+
+present_priv_queue_vblank_ptr   queue_vblank;
+present_priv_flush_ptr  flush;
+present_priv_re_execute_ptr re_execute;
+
 } present_screen_priv_rec, *present_screen_priv_ptr;
 
 #define wrap(priv,real,mem,func) {\
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 86b2508..6f5e733 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -877,6 +877,9 @@ present_scmd_init_mode_hooks(present_screen_priv_ptr 
screen_priv)
 screen_priv->check_flip_window  =   _check_flip_window;
 
 screen_priv->create_event_id=   _scmd_create_event_id;
+screen_priv->queue_vblank   =   _queue_vblank;
+screen_priv->flush  =   _flush;
+screen_priv->re_execute =   _re_execute;
 }
 
 Bool
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 06/22] present: Add flip mode API hook for present_pixmap

2018-02-28 Thread Roman Gilg
Make present_pixmap a common function callable by any
flip mode.

Signed-off-by: Roman Gilg 
---
 present/present.c  | 57 ++
 present/present_priv.h | 68 +++---
 present/present_scmd.c | 54 ++-
 3 files changed, 119 insertions(+), 60 deletions(-)

diff --git a/present/present.c b/present/present.c
index ec29533..ddd9c1c 100644
--- a/present/present.c
+++ b/present/present.c
@@ -108,3 +108,60 @@ present_set_tree_pixmap(WindowPtr window,
 return;
 TraverseTree(window, present_set_tree_pixmap_visit, );
 }
+
+int
+present_pixmap(WindowPtr window,
+   PixmapPtr pixmap,
+   CARD32 serial,
+   RegionPtr valid,
+   RegionPtr update,
+   int16_t x_off,
+   int16_t y_off,
+   RRCrtcPtr target_crtc,
+   SyncFence *wait_fence,
+   SyncFence *idle_fence,
+   uint32_t options,
+   uint64_t window_msc,
+   uint64_t divisor,
+   uint64_t remainder,
+   present_notify_ptr notifies,
+   int num_notifies)
+{
+ScreenPtr   screen = window->drawable.pScreen;
+present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+return screen_priv->present_pixmap(window,
+   pixmap,
+   serial,
+   valid,
+   update,
+   x_off,
+   y_off,
+   target_crtc,
+   wait_fence,
+   idle_fence,
+   options,
+   window_msc,
+   divisor,
+   remainder,
+   notifies,
+   num_notifies);
+}
+
+int
+present_notify_msc(WindowPtr window,
+   CARD32 serial,
+   uint64_t target_msc,
+   uint64_t divisor,
+   uint64_t remainder)
+{
+return present_pixmap(window,
+  NULL,
+  serial,
+  NULL, NULL,
+  0, 0,
+  NULL,
+  NULL, NULL,
+  divisor == 0 ? PresentOptionAsync : 0,
+  target_msc, divisor, remainder, NULL, 0);
+}
diff --git a/present/present_priv.h b/present/present_priv.h
index a8e07c6..44122d5 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -95,6 +95,23 @@ typedef Bool (*present_priv_check_flip_ptr)(RRCrtcPtr crtc,
 int16_t y_off);
 typedef void (*present_priv_check_flip_window_ptr)(WindowPtr window);
 
+typedef int (*present_priv_pixmap_ptr)(WindowPtr window,
+   PixmapPtr pixmap,
+   CARD32 serial,
+   RegionPtr valid,
+   RegionPtr update,
+   int16_t x_off,
+   int16_t y_off,
+   RRCrtcPtr target_crtc,
+   SyncFence *wait_fence,
+   SyncFence *idle_fence,
+   uint32_t options,
+   uint64_t window_msc,
+   uint64_t divisor,
+   uint64_t remainder,
+   present_notify_ptr notifies,
+   int num_notifies);
+
 typedef void (*present_priv_create_event_id_ptr)(present_vblank_ptr vblank);
 
 typedef int (*present_priv_queue_vblank_ptr)(ScreenPtr screen,
@@ -129,6 +146,7 @@ typedef struct present_screen_priv {
 present_priv_check_flip_ptr check_flip;
 present_priv_check_flip_window_ptr  check_flip_window;
 
+present_priv_pixmap_ptr present_pixmap;
 present_priv_create_event_id_ptrcreate_event_id;
 
 present_priv_queue_vblank_ptr   queue_vblank;
@@ -216,6 +234,31 @@ present_set_tree_pixmap(WindowPtr window,
 PixmapPtr expected,
 PixmapPtr pixmap);
 
+int
+present_pixmap(WindowPtr window,
+   PixmapPtr pixmap,
+   CARD32 serial,
+   RegionPtr valid,
+   RegionPtr update,
+   int16_t x_off,
+   int16_t y_off,
+   RRCrtcPtr target_crtc,

[PATCH xserver v2 05/22] present: Refactor execute in separate file

2018-02-28 Thread Roman Gilg
To be shared by multiple flip modes, refactor execute functionality,
such that logical chunks can go in new separate file.

Signed-off-by: Roman Gilg 
---
 present/Makefile.am   |   1 +
 present/meson.build   |   1 +
 present/present_execute.c | 116 ++
 present/present_priv.h|  12 +
 present/present_scmd.c|  66 +++---
 5 files changed, 136 insertions(+), 60 deletions(-)
 create mode 100644 present/present_execute.c

diff --git a/present/Makefile.am b/present/Makefile.am
index 3d3d38d..55ad295 100644
--- a/present/Makefile.am
+++ b/present/Makefile.am
@@ -7,6 +7,7 @@ libpresent_la_SOURCES = \
present.h \
present.c \
present_event.c \
+   present_execute.c \
present_fake.c \
present_fence.c \
present_notify.c \
diff --git a/present/meson.build b/present/meson.build
index 801e810..5e1dd3c 100644
--- a/present/meson.build
+++ b/present/meson.build
@@ -1,6 +1,7 @@
 srcs_present = [
 'present.c',
 'present_event.c',
+'present_execute.c',
 'present_fake.c',
 'present_fence.c',
 'present_notify.c',
diff --git a/present/present_execute.c b/present/present_execute.c
new file mode 100644
index 000..e45e547
--- /dev/null
+++ b/present/present_execute.c
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2013 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  The copyright holders make no representations
+ * about the suitability of this software for any purpose.  It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include 
+#endif
+
+#include "present_priv.h"
+
+/*
+ * Called when the wait fence is triggered; just gets the current msc/ust and
+ * calls the proper execute again. That will re-check the fence and pend the
+ * request again if it's still not actually ready
+ */
+static void
+present_wait_fence_triggered(void *param)
+{
+present_vblank_ptr  vblank = param;
+ScreenPtr   screen = vblank->screen;
+present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+screen_priv->re_execute(vblank);
+}
+
+Bool
+present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc)
+{
+WindowPtr   window = vblank->window;
+ScreenPtr   screen = window->drawable.pScreen;
+present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+if (vblank->requeue) {
+vblank->requeue = FALSE;
+if (msc_is_after(vblank->target_msc, crtc_msc) &&
+Success == screen_priv->queue_vblank(screen,
+ vblank->crtc,
+ vblank->event_id,
+ vblank->target_msc))
+return TRUE;
+}
+
+if (vblank->wait_fence) {
+if (!present_fence_check_triggered(vblank->wait_fence)) {
+present_fence_set_callback(vblank->wait_fence, 
present_wait_fence_triggered, vblank);
+return TRUE;
+}
+}
+return FALSE;
+}
+
+void
+present_execute_copy(present_vblank_ptr vblank, uint64_t crtc_msc)
+{
+WindowPtr   window = vblank->window;
+ScreenPtr   screen = window->drawable.pScreen;
+present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+/* If present_flip failed, we may have to requeue for the target MSC */
+if (vblank->target_msc == crtc_msc + 1 &&
+Success == screen_priv->queue_vblank(screen,
+ vblank->crtc,
+ vblank->event_id,
+ vblank->target_msc)) {
+vblank->queued = TRUE;
+return;
+}
+
+present_copy_region(>drawable, vblank->pixmap, vblank->update, 
vblank->x_off, vblank->y_off);
+
+/* present_copy_region sticks the region into a scratch GC,
+ * which is then 

[PATCH xserver v2 01/22] present: Move screen flip functionality in separate file

2018-02-28 Thread Roman Gilg
As a preperation for future flip mode alternatives move most of the
functionality from 'present.c' into a separate file.

Leave some functions needed by future other flip modes in 'present.c'.

Signed-off-by: Roman Gilg 
---
 present/Makefile.am|   1 +
 present/meson.build|   1 +
 present/present.c  | 969 +--
 present/present_priv.h | 116 +++---
 present/present_scmd.c | 992 +
 5 files changed, 1067 insertions(+), 1012 deletions(-)
 create mode 100644 present/present_scmd.c

diff --git a/present/Makefile.am b/present/Makefile.am
index 7fea669..3b458fd 100644
--- a/present/Makefile.am
+++ b/present/Makefile.am
@@ -12,6 +12,7 @@ libpresent_la_SOURCES = \
present_notify.c \
present_priv.h \
present_request.c \
+   present_scmd.c \
present_screen.c
 
 sdk_HEADERS = present.h presentext.h
diff --git a/present/meson.build b/present/meson.build
index a4296ca..bbe0de5 100644
--- a/present/meson.build
+++ b/present/meson.build
@@ -5,6 +5,7 @@ srcs_present = [
 'present_fence.c',
 'present_notify.c',
 'present_request.c',
+'present_scmd.c',
 'present_screen.c',
 ]
 
diff --git a/present/present.c b/present/present.c
index 176e89c..ec29533 100644
--- a/present/present.c
+++ b/present/present.c
@@ -26,51 +26,11 @@
 
 #include "present_priv.h"
 #include 
-#include 
-#include 
-#ifdef MONOTONIC_CLOCK
-#include 
-#endif
-
-static uint64_t present_event_id;
-static struct xorg_list present_exec_queue;
-static struct xorg_list present_flip_queue;
-
-#if 0
-#define DebugPresent(x) ErrorF x
-#else
-#define DebugPresent(x)
-#endif
-
-static void
-present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
-
-/*
- * Returns:
- * TRUE if the first MSC value is after the second one
- * FALSE if the first MSC value is equal to or before the second one
- */
-static Bool
-msc_is_after(uint64_t test, uint64_t reference)
-{
-return (int64_t)(test - reference) > 0;
-}
-
-/*
- * Returns:
- * TRUE if the first MSC value is equal to or after the second one
- * FALSE if the first MSC value is before the second one
- */
-static Bool
-msc_is_equal_or_after(uint64_t test, uint64_t reference)
-{
-return (int64_t)(test - reference) >= 0;
-}
 
 /*
  * Copies the update region from a pixmap to the target drawable
  */
-static void
+void
 present_copy_region(DrawablePtr drawable,
 PixmapPtr pixmap,
 RegionPtr update,
@@ -103,120 +63,7 @@ present_copy_region(DrawablePtr drawable,
 FreeScratchGC(gc);
 }
 
-static inline PixmapPtr
-present_flip_pending_pixmap(ScreenPtr screen)
-{
-present_screen_priv_ptr screen_priv = present_screen_priv(screen);
-
-if (!screen_priv)
-return NULL;
-
-if (!screen_priv->flip_pending)
-return NULL;
-
-return screen_priv->flip_pending->pixmap;
-}
-
-static Bool
-present_check_flip(RRCrtcPtrcrtc,
-   WindowPtrwindow,
-   PixmapPtrpixmap,
-   Bool sync_flip,
-   RegionPtrvalid,
-   int16_t  x_off,
-   int16_t  y_off)
-{
-ScreenPtr   screen = window->drawable.pScreen;
-PixmapPtr   window_pixmap;
-WindowPtr   root = screen->root;
-present_screen_priv_ptr screen_priv = present_screen_priv(screen);
-
-if (!screen_priv)
-return FALSE;
-
-if (!screen_priv->info)
-return FALSE;
-
-if (!crtc)
-return FALSE;
-
-/* Check to see if the driver supports flips at all */
-if (!screen_priv->info->flip)
-return FALSE;
-
-/* Make sure the window hasn't been redirected with Composite */
-window_pixmap = screen->GetWindowPixmap(window);
-if (window_pixmap != screen->GetScreenPixmap(screen) &&
-window_pixmap != screen_priv->flip_pixmap &&
-window_pixmap != present_flip_pending_pixmap(screen))
-return FALSE;
-
-/* Check for full-screen window */
-if (!RegionEqual(>clipList, >winSize)) {
-return FALSE;
-}
-
-/* Source pixmap must align with window exactly */
-if (x_off || y_off) {
-return FALSE;
-}
-
-/* Make sure the area marked as valid fills the screen */
-if (valid && !RegionEqual(valid, >winSize)) {
-return FALSE;
-}
-
-/* Does the window match the pixmap exactly? */
-if (window->drawable.x != 0 || window->drawable.y != 0 ||
-#ifdef COMPOSITE
-window->drawable.x != pixmap->screen_x || window->drawable.y != 
pixmap->screen_y ||
-#endif
-window->drawable.width != pixmap->drawable.width ||
-window->drawable.height != pixmap->drawable.height) {
-return FALSE;
-}
-
-/* Ask the driver for permission */
-if (screen_priv->info->check_flip) {
-if 

[PATCH xserver v2 02/22] present: Preliminary internal flip mode API

2018-02-28 Thread Roman Gilg
Add some basic function hooks to our future present-internal flip mode API,
that will allow us to share functionality in between modes and move more code
in separate files.

Signed-off-by: Roman Gilg 
---
 present/present_priv.h   | 26 +++---
 present/present_scmd.c   | 20 ++--
 present/present_screen.c |  4 +++-
 3 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/present/present_priv.h b/present/present_priv.h
index 5abec06..738c8aa 100644
--- a/present/present_priv.h
+++ b/present/present_priv.h
@@ -83,6 +83,20 @@ struct present_vblank {
 Boolabort_flip; /* aborting this flip */
 };
 
+/*
+ * Mode hooks
+ */
+typedef Bool (*present_priv_check_flip_ptr)(RRCrtcPtr crtc,
+WindowPtr window,
+PixmapPtr pixmap,
+Bool sync_flip,
+RegionPtr valid,
+int16_t x_off,
+int16_t y_off);
+typedef void (*present_priv_check_flip_window_ptr)(WindowPtr window);
+
+typedef void (*present_priv_create_event_id_ptr)(present_vblank_ptr vblank);
+
 typedef struct present_screen_priv {
 CloseScreenProcPtr  CloseScreen;
 ConfigNotifyProcPtr ConfigNotify;
@@ -103,6 +117,12 @@ typedef struct present_screen_priv {
 Boolflip_sync;
 
 present_screen_info_ptr info;
+
+/* Mode hooks */
+present_priv_check_flip_ptr check_flip;
+present_priv_check_flip_window_ptr  check_flip_window;
+
+present_priv_create_event_id_ptrcreate_event_id;
 } present_screen_priv_rec, *present_screen_priv_ptr;
 
 #define wrap(priv,real,mem,func) {\
@@ -316,9 +336,6 @@ present_restore_screen_pixmap(ScreenPtr screen);
 void
 present_set_abort_flip(ScreenPtr screen);
 
-void
-present_check_flip_window(WindowPtr window);
-
 RRCrtcPtr
 present_get_crtc(WindowPtr window);
 
@@ -328,6 +345,9 @@ present_query_capabilities(RRCrtcPtr crtc);
 Bool
 present_init(void);
 
+void
+present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv);
+
 /*
  * present_screen.c
  */
diff --git a/present/present_scmd.c b/present/present_scmd.c
index 8b83876..f40e5ab 100644
--- a/present/present_scmd.c
+++ b/present/present_scmd.c
@@ -68,6 +68,12 @@ msc_is_equal_or_after(uint64_t test, uint64_t reference)
 return (int64_t)(test - reference) >= 0;
 }
 
+static void
+present_scmd_create_event_id(present_vblank_ptr vblank)
+{
+vblank->event_id = ++present_event_id;
+}
+
 static inline PixmapPtr
 present_flip_pending_pixmap(ScreenPtr screen)
 {
@@ -475,7 +481,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, 
uint64_t msc)
  * 'window' is being reconfigured. Check to see if it is involved
  * in flipping and clean up as necessary
  */
-void
+static void
 present_check_flip_window (WindowPtr window)
 {
 ScreenPtr   screen = window->drawable.pScreen;
@@ -804,7 +810,8 @@ present_pixmap(WindowPtr window,
 vblank->screen = screen;
 vblank->window = window;
 vblank->pixmap = pixmap;
-vblank->event_id = ++present_event_id;
+present_scmd_create_event_id(vblank);
+
 if (pixmap) {
 vblank->kind = PresentCompleteKindPixmap;
 pixmap->refcnt++;
@@ -982,6 +989,15 @@ present_vblank_destroy(present_vblank_ptr vblank)
 free(vblank);
 }
 
+void
+present_scmd_init_mode_hooks(present_screen_priv_ptr screen_priv)
+{
+screen_priv->check_flip =   _check_flip;
+screen_priv->check_flip_window  =   _check_flip_window;
+
+screen_priv->create_event_id=   _scmd_create_event_id;
+}
+
 Bool
 present_init(void)
 {
diff --git a/present/present_screen.c b/present/present_screen.c
index 9d03c8a..454cc53 100644
--- a/present/present_screen.c
+++ b/present/present_screen.c
@@ -161,7 +161,7 @@ present_clip_notify(WindowPtr window, int dx, int dy)
 ScreenPtr screen = window->drawable.pScreen;
 present_screen_priv_ptr screen_priv = present_screen_priv(screen);
 
-present_check_flip_window(window);
+screen_priv->check_flip_window(window);
 unwrap(screen_priv, screen, ClipNotify)
 if (screen->ClipNotify)
 screen->ClipNotify (window, dx, dy);
@@ -194,6 +194,8 @@ present_screen_init(ScreenPtr screen, 
present_screen_info_ptr info)
 
 dixSetPrivate(>devPrivates, _screen_private_key, 
screen_priv);
 
+present_scmd_init_mode_hooks(screen_priv);
+
 present_fake_screen_init(screen);
 }
 
-- 
2.7.4

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2 00/22] Per window flips in Present with support for them in Xwayland

2018-02-28 Thread Roman Gilg
This revision provides changes requested by Michel Dänzer. In particular
flips without copies in window flip mode are now possible and clients can
queue flips on Xwayland.


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/7] randr: Support "non-desktop" property

2018-02-28 Thread Adam Jackson
On Wed, 2018-02-28 at 16:35 +0100, Michel Dänzer wrote:
> On 2018-02-12 10:51 PM, Keith Packard wrote:
> > Tracks changes to the non-desktop property so that when non-zero,
> > outputs will always appear to be disconnected.
> > 
> > Signed-off-by: Keith Packard 
> > Reviewed-by: Adam Jackson 
> 
> [...]
> 
> > @@ -442,6 +465,7 @@ ProcRRGetOutputInfo(ClientPtr client)
> >  .crtc = output->crtc ? output->crtc->id : None,
> >  .mmWidth = output->mmWidth,
> >  .mmHeight = output->mmHeight,
> > +.connection = output->nonDesktop ? RR_Disconnected : 
> > output->connection,
> >  .connection = output->connection,
> 
> BTW, I don't think this was intended to leave the existing connection
> initializer line, clobbering the new one?

... huh. That's not what's in the tree:

desoxy:~/git/xserver% git grep -A1 connection.*nonDesktop
randr/rroutput.c:.connection = output->nonDesktop ? RR_Disconnected : 
output->connection,
randr/rroutput.c-.subpixelOrder = output->subpixelOrder
--
randr/rroutput.c:.connection = output->nonDesktop ? RR_Disconnected 
: output->connection,
randr/rroutput.c-.subpixelOrder = output->subpixelOrder,
desoxy:~/git/xserver% git describe   
xorg-server-1.19.0-641-g85ff1cdbd

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver] randr: Fix a crash on initialization with GPU screens

2018-02-28 Thread Adam Jackson
RRSetChanged (immediately above) was immune to screens with no master,
but RRTellChanged was not:

Thread 1 "X" received signal SIGSEGV, Segmentation fault.
RRTellChanged (pScreen=) at ../../randr/randr.c:576
576 mastersp = rrGetScrPriv(master);
(gdb) bt
#0  RRTellChanged (pScreen=) at ../../randr/randr.c:576
#1  0x5566f1e9 in RRNoticePropertyChange (value=0x55bfbf28, 
property=70, output=0x55bfef10) at ../../randr/rrproperty.c:153
#2  RRChangeOutputProperty (output=output@entry=0x55bfef10, 
property=, type=type@entry=19, format=format@entry=32, 
mode=, mode@entry=0, len=len@entry=1, value=0x7fffe77c, 
sendevent=1, pending=0)
at ../../randr/rrproperty.c:263
#3  0x5566dba5 in RROutputSetNonDesktop 
(output=output@entry=0x55bfef10, nonDesktop=nonDesktop@entry=0) at 
../../randr/rroutput.c:333
...

Reported-by: Michel Dänzer 
Signed-off-by: Adam Jackson 
---
 randr/randr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/randr/randr.c b/randr/randr.c
index 339ad3ece..feb54bcc8 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -602,6 +602,8 @@ RRTellChanged(ScreenPtr pScreen)
 
 if (pScreen->isGPU) {
 master = pScreen->current_master;
+if (!master)
+return;
 mastersp = rrGetScrPriv(master);
 }
 else {
-- 
2.16.2

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/7] randr: Support "non-desktop" property

2018-02-28 Thread Michel Dänzer
On 2018-02-12 10:51 PM, Keith Packard wrote:
> Tracks changes to the non-desktop property so that when non-zero,
> outputs will always appear to be disconnected.
> 
> Signed-off-by: Keith Packard 
> Reviewed-by: Adam Jackson 

[...]

> @@ -442,6 +465,7 @@ ProcRRGetOutputInfo(ClientPtr client)
>  .crtc = output->crtc ? output->crtc->id : None,
>  .mmWidth = output->mmWidth,
>  .mmHeight = output->mmHeight,
> +.connection = output->nonDesktop ? RR_Disconnected : 
> output->connection,
>  .connection = output->connection,

BTW, I don't think this was intended to leave the existing connection
initializer line, clobbering the new one?


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/7] randr: Support "non-desktop" property

2018-02-28 Thread Michel Dänzer
On 2018-02-12 10:51 PM, Keith Packard wrote:
> Tracks changes to the non-desktop property so that when non-zero,
> outputs will always appear to be disconnected.
> 
> Signed-off-by: Keith Packard 
> Reviewed-by: Adam Jackson 

This crashes on startup with a GPU screen, see below.
pScreen->current_master == NULL.


Thread 1 "X" received signal SIGSEGV, Segmentation fault.
RRTellChanged (pScreen=) at ../../randr/randr.c:576
576 mastersp = rrGetScrPriv(master);
(gdb) bt
#0  RRTellChanged (pScreen=) at ../../randr/randr.c:576
#1  0x5566f1e9 in RRNoticePropertyChange (value=0x55bfbf28, 
property=70, output=0x55bfef10) at ../../randr/rrproperty.c:153
#2  RRChangeOutputProperty (output=output@entry=0x55bfef10, 
property=, type=type@entry=19, format=format@entry=32, 
mode=, mode@entry=0, len=len@entry=1, value=0x7fffe77c, 
sendevent=1, pending=0)
at ../../randr/rrproperty.c:263
#3  0x5566dba5 in RROutputSetNonDesktop 
(output=output@entry=0x55bfef10, nonDesktop=nonDesktop@entry=0) at 
../../randr/rroutput.c:333
#4  0x5566dd7d in RROutputCreate (pScreen=pScreen@entry=0x559efb10, 
name=name@entry=0x55bc0a08 "DisplayPort-2-0", nameLength=15, 
devPrivate=devPrivate@entry=0x55bc0940) at ../../randr/rroutput.c:122
#5  0x5562d5aa in xf86RandR12CreateObjects12 (pScreen=0x559efb10) 
at ../../../../hw/xfree86/modes/xf86RandR12.c:1734
#6  xf86RandR12Init12 (pScreen=0x559efb10) at 
../../../../hw/xfree86/modes/xf86RandR12.c:2247
#7  xf86RandR12Init (pScreen=pScreen@entry=0x559efb10) at 
../../../../hw/xfree86/modes/xf86RandR12.c:895
#8  0x556200bc in xf86CrtcScreenInit 
(screen=screen@entry=0x559efb10) at 
../../../../hw/xfree86/modes/xf86Crtc.c:774
#9  0x70deaa6c in RADEONScreenInit_KMS (pScreen=0x559efb10, 
argc=, argv=) at ../../src/radeon_kms.c:2438
#10 0x555aced5 in AddGPUScreen (pfnInit=pfnInit@entry=0x555edc40 
, argc=argc@entry=4, argv=argv@entry=0x7fffeb08) at 
../../dix/dispatch.c:3966
#11 0x555ef8b7 in InitOutput 
(pScreenInfo=pScreenInfo@entry=0x559b1f60 , argc=argc@entry=4, 
argv=argv@entry=0x7fffeb08) at ../../../../hw/xfree86/common/xf86Init.c:763
#12 0x555b0f38 in dix_main (argc=4, argv=0x7fffeb08, 
envp=) at ../../dix/main.c:193
#13 0x758a3f2a in __libc_start_main (main=0x5559a3f0 , 
argc=4, argv=0x7fffeb08, init=, fini=, 
rtld_fini=, stack_end=0x7fffeaf8) at ../csu/libc-start.c:310
#14 0x5559a42a in _start ()


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: xserver 1.20 RC1 tomorrow

2018-02-28 Thread Adam Jackson
On Wed, 2018-02-28 at 00:42 +, Daniel Stone wrote:
> Hi,
> 
> On 27 February 2018 at 21:59, Adam Jackson  wrote:
> > 2) https://patchwork.freedesktop.org/series/27289/
> > DRI3 v1.2. Has some ABI changes, but none that are essential, the old
> > single-fd API can either be kept as is, or implemented in terms opf the
> > new multiple-fd API.
> 
> Perhaps I'm being dense, but I can't see that this does have driver
> ABI changes? The old single-plane hooks are still in place, and the
> core has helpers to call them if possible (single-plane, no modifier,
> driver doesn't have newer hook). We do change the helper to be
> multi-FD rather than single FD, but that's just in dri3_priv.h, so
> presumably not ABI?

D'oh, you are correct. I was grepping for dri3_pixmap_from_fd and
didn't notice they were all substring matches.

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH util/modular] xorg.modules: Replace individual proto modules with xorgproto

2018-02-28 Thread Emil Velikov
On 28 February 2018 at 13:04, Jon Turney  wrote:
> Signed-off-by: Jon Turney 
> ---
>  xorg.modules | 845 
> ++-
>  1 file changed, 143 insertions(+), 702 deletions(-)
>
> diff --git a/xorg.modules b/xorg.modules
> index b34d14d..93bc8cf 100644
> --- a/xorg.modules
> +++ b/xorg.modules
> @@ -65,35 +65,7 @@
>
>
>  

> -  
Should stay?

> +  
>  
>
>
> @@ -366,257 +338,13 @@


> +  
I'd say keep this as autotools and toggle as 2/2...

> + +checkoutdir="xorg/proto/xorgproto"/>
>  
> -  
> -
> -
>
> -
.. hence this hunk will stay as-is and drop util-macros with 2/2?

It's fairly fiddly to have the above subtleties within such a massive patch.

With the above, tweaks:
Reviewed-by: Emil Velikov 

-Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xorgproto] Spelling and grammar fixes

2018-02-28 Thread Giuseppe Bilotta
Signed-off-by: Giuseppe Bilotta 
---
 compositeproto.txt |  6 +++---
 dri2proto.txt  | 10 +-
 presentproto.txt   |  2 +-
 randrproto.txt |  8 
 renderproto.txt|  2 +-
 xv-protocol-v2.txt |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/compositeproto.txt b/compositeproto.txt
index c1d099c..010e6aa 100644
--- a/compositeproto.txt
+++ b/compositeproto.txt
@@ -35,7 +35,7 @@ both early prototypes and the final design include:
a prototype of the coordinate transformation mechanism.
 
  + Ryan Lortie for helping figure out reasonable parent clipping
-   semantics in the presense of manual redirected children.
+   semantics in the presence of manual redirected children.
 
 3. Architecture
 
@@ -86,7 +86,7 @@ the contents and to create a new name for the newly allocated 
pixmap.
 In automatic update mode, the X server is itself responsible for presenting
 the child window contents within the parent. It seems reasonable, then, for
 rendering to the parent window to be clipped so as not to interfere with any
-child window content. In an environment with a mixure of manual and
+child window content. In an environment with a mixture of manual and
 automatic updating windows, rendering to the parent in the area nominally
 occupied by a manual update window should be able to affect parent pixel
 values in those areas, but such rendering should be clipped to automatic
@@ -135,7 +135,7 @@ should be defined by the clients themselves.
 3.3 Clipping semantics redefined
 
 Version 0.4 of the protocol changes the semantics of clipping in the
-presense of manual redirect children. In version 0.3, a parent was always
+presence of manual redirect children. In version 0.3, a parent was always
 clipped to child windows, independent of the kind of redirection going on.
 With version 0.4, the parent is no longer clipped to child windows which are
 manually redirected. This means the parent can draw in the child region 
without using
diff --git a/dri2proto.txt b/dri2proto.txt
index d81b55c..f896777 100644
--- a/dri2proto.txt
+++ b/dri2proto.txt
@@ -9,7 +9,7 @@
 
 1. Introduction
 
-The DRI2 extension is designed to associate and access auxillary
+The DRI2 extension is designed to associate and access auxiliary
 rendering buffers with an X drawable.
 
 DRI2 is a essentially a helper extension to support implementation of
@@ -49,7 +49,7 @@ Stolen from OpenGL FBOs, I guess.
 
 2.2. Kernel rendering manager
 
-This specification assumes a rendering architechture, where an
+This specification assumes a rendering architecture, where an
 underlying kernel rendering manager that can provide 32 bit integer
 handles to video memory buffers.  These handles can be passed between
 processes, which, through a direct rendering driver, submit rendering
@@ -57,7 +57,7 @@ to the kernel rendering manager, targeting and/or sourcing 
from these
 buffers.  This extension provides a means to communicate about such
 buffers as associated with an X drawable.
 
-The details of how the a direct rendering driver use the buffer names
+The details of how the direct rendering driver use the buffer names
 and submit the rendering requests is outside the scope of this
 specification.  However, Appendix B does discuss implementation of
 this specification on the Graphics Execution Manager (GEM).
@@ -102,7 +102,7 @@ use DRI2CopyRegion to copy contents back and forth between 
the fake
 front buffer and the real front buffer.  When X and direct rendering
 to a front buffer is interleaved, it is the responsibility of the
 application to synchronize access using glXWaitGL and glXWaitX.  A
-DRI2 implementation of direct rendering GLX, should use these enty
+DRI2 implementation of direct rendering GLX, should use these entry
 points to copy contents back and forth to as necessary to ensure
 consistent rendering.
 
@@ -419,7 +419,7 @@ The name of this extension is "DRI2".
 
Blocks the client until the swap buffer count reaches target_sbc.  If
the swap buffer count is already greater than or equal to target_sbc
-   when the request is recieved, this request will return immediately.
+   when the request is received, this request will return immediately.
 
If target_sbc is 0, this request will block the client until all
previous DRI2SwapBuffers requests have completed.
diff --git a/presentproto.txt b/presentproto.txt
index fdaf658..a29db84 100644
--- a/presentproto.txt
+++ b/presentproto.txt
@@ -318,7 +318,7 @@ The name of this extension is "Present"
PresentCapabilityFence means that the target device can take
advantage of SyncFences in the Present operations to improve
GPU throughput. The driver must operate correctly in the
-   absense of fences, but may have reduced performance. Using
+   absence of fences, but may have reduced performance. Using
fences for drivers not advertising this capability 

Re: [PATCH util/modular] xorg.modules: Replace individual proto modules with xorgproto

2018-02-28 Thread Jeff Smith
On Wed, Feb 28, 2018 at 7:04 AM, Jon Turney  wrote:
> Signed-off-by: Jon Turney 
> ---
>  xorg.modules | 845 
> ++-
>  1 file changed, 143 insertions(+), 702 deletions(-)
>
> diff --git a/xorg.modules b/xorg.modules
> index b34d14d..93bc8cf 100644
> --- a/xorg.modules
> +++ b/xorg.modules
> @@ -65,35 +65,7 @@
>
>
>  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  
> -  

The xcb-proto package has _not_ been supplanted by xorgproto.

> -  
> -  
> -  
> -  
> -  
> -  
> -  
> +  
>  
>
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH util/modular] xorg.modules: Replace individual proto modules with xorgproto

2018-02-28 Thread Jon Turney
Signed-off-by: Jon Turney 
---
 xorg.modules | 845 ++-
 1 file changed, 143 insertions(+), 702 deletions(-)

diff --git a/xorg.modules b/xorg.modules
index b34d14d..93bc8cf 100644
--- a/xorg.modules
+++ b/xorg.modules
@@ -65,35 +65,7 @@
   
   
 
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
-  
+  
 
   
 
@@ -366,257 +338,13 @@
   -->
 
   
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-  
-
-  
-
-  
-
-
-  
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-  
-
-  
-
-  
-
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-  
-
-  
-
-  
-
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
+  
+
 
-  
-
-
   
-
-  
-
-  
-
-
-  
 
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-  
-
-
-  
-
-  
-
-
-  
+  
 
   
   
@@ -624,8 +352,7 @@
 checkoutdir="xorg/lib/libAppleWM"/>
 
   
-  
-  
+  
   
   
 
@@ -636,8 +363,7 @@
 checkoutdir="xorg/lib/libFS"/>
 
   
-  
-  
+  
   
 
   
@@ -647,7 +373,7 @@
 checkoutdir="xorg/lib/libICE"/>
 
   
-  
+  
   
 
 
@@ -668,7 +394,7 @@
 checkoutdir="xorg/lib/libSM"/>
 
   
-  
+  
   
   
 
@@ -682,12 +408,7 @@
 checkoutdir="xorg/lib/libX11"/>
 
   
-  
-  
-  
-  
-  
-  
+  
   
   
 
@@ -701,8 +422,7 @@
 checkoutdir="xorg/lib/libXScrnSaver"/>
 
   
-  
-  
+  
   
   
 
@@ -713,7 +433,7 @@
 checkoutdir="xorg/lib/libXau"/>
 
   
-  
+  
 
   
 
@@ -722,7 +442,7 @@
 checkoutdir="xorg/lib/libXaw"/>
 
   
-  
+  
   
   
   
@@ -738,7 +458,7 @@
 checkoutdir="xorg/lib/libXaw3d"/>
 
   
-  
+  
   
   
   
@@ -754,8 +474,7 @@
 checkoutdir="xorg/lib/libXcomposite"/>
 
   
-  
-  
+  
   
   
   
@@ -767,7 +486,7 @@
 checkoutdir="xorg/lib/libXcursor"/>
 
   
-  
+  
   
   
   
@@ -779,9 +498,7 @@
 checkoutdir="xorg/lib/libXdamage"/>
 
   
-  
-  
-  
+  
   
   
 
@@ -792,7 +509,7 @@
 checkoutdir="xorg/lib/libXdmcp"/>
 
   
-  
+  
 
 
   
@@ -804,8 +521,7 @@
 checkoutdir="xorg/lib/libXext"/>
 
   
-  
-  
+  
   
 
 
@@ -818,9 +534,7 @@
 checkoutdir="xorg/lib/libXfixes"/>
 
   
-  
-  
-  
+  
   
 
   
@@ -831,8 +545,7 @@
 tag="da4246c98bc51297daeec47c15181e179df94013"/>
 
   
-  
-  
+  
   
   
   
@@ -847,8 +560,7 @@
 checkoutdir="xorg/lib/libXfont"/>
 
   
-  
-  
+  
   
   
   
@@ -863,7 +575,7 @@
 checkoutdir="xorg/lib/libXft"/>
 
   
-  
+  
   
   
 
@@ -874,9 +586,7 @@
 checkoutdir="xorg/lib/libXi"/>
 
   
-  
-  
-  
+  
   
   
   
@@ -891,9 +601,7 @@
 checkoutdir="xorg/lib/libXinerama"/>
 
   
-  
-  
-  
+  
   
   
 
@@ -904,8 +612,7 @@
 checkoutdir="xorg/lib/libXmu"/>
 
   
-  
-  
+  
   
   
   
@@ -920,8 +627,7 @@
 checkoutdir="xorg/lib/libXpm"/>
 
   
-  
-  
+  
   
   
   
@@ -933,9 +639,7 @@
 checkoutdir="xorg/lib/libXrandr"/>
 
   
-  
-  
-  
+  
   
   
   
@@ -947,8 +651,7 @@
 checkoutdir="xorg/lib/libXrender"/>
 
   
-  
-  
+  
   
 
   
@@ -958,8 +661,7 @@
 checkoutdir="xorg/lib/libXRes"/>
 
   
-  
- 

[PATCH xserver v2] fixing -logfile when used with -displayfd

2018-02-28 Thread Antoine Martin
Hi,

v2 updated with the feedback from Alan: the LogSetDisplay function is
the right place for this fix.

Trivial way to reproduce the bug:
Xorg -logfile /tmp/mylog -config /etc/xpra/xorg.conf -displayfd 2

The server then moans:
Failed to rename log file "/tmp/mylog" to "/tmp/mylog": No such file or
directory

And the log file is created but immediately renamed to "/tmp/mylog.old"

This is caused by the changes to the log file handling introduced by
this commit:
https://cgit.freedesktop.org/xorg/xserver/commit/?id=edcb6426f20c3be5dd5f50b76a686754aef2f64e

And below is the trivial fix for it. We only need to rename the logfile
if the log filename contains the magic substitution string "%s".

Signed-off-by: Antoine Martin 
---
diff --git a/os/log.c b/os/log.c
index 91e55a532..a3b28ccb4 100644
--- a/os/log.c
+++ b/os/log.c
@@ -296,7 +296,7 @@ LogInit(const char *fname, const char *backup)
 void
 LogSetDisplay(void)
 {
-if (saved_log_fname) {
+if (saved_log_fname && strstr(saved_log_fname, "%s")) {
 char *logFileName;

 logFileName = LogFilePrep(saved_log_fname, saved_log_backup,
display);
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel