[PATCH 5/9] dri2: Fixes to swap scheduling.

2012-02-15 Thread Mario Kleiner
Fix some small off-by-one errors and a mismatch
between 32 bit kernel interfaces for vblank count
and 64 bit dri2 interfaces for target_msc et al.

Return corrected target_msc to swap scheduling in
x-server.

A revised version of the patch discussed here:
http://lists.freedesktop.org/archives/nouveau/2011-September/009143.html

Signed-off-by: Mario Kleiner mario.klei...@tuebingen.mpg.de
---
 src/nouveau_dri2.c |   23 +--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 8608678..719b3bb 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -387,11 +387,22 @@ nouveau_dri2_schedule_swap(ClientPtr client, DrawablePtr 
draw,
if (ret)
goto fail;
 
+   /* Truncate to match kernel interfaces; means occasional 
overflow
+* misses, but that's generally not a big deal.
+*/
+   *target_msc = 0x;
+   divisor = 0x;
+   remainder = 0x;
+
/* Calculate a swap target if we don't have one */
if (current_msc = *target_msc  divisor)
*target_msc = current_msc + divisor
- (current_msc - remainder) % divisor;
 
+   /* Avoid underflow of unsigned value below */
+   if (*target_msc == 0)
+   *target_msc = 1;
+
/* Request a vblank event one frame before the target */
ret = nouveau_wait_vblank(draw, DRM_VBLANK_ABSOLUTE |
  DRM_VBLANK_EVENT,
@@ -399,7 +410,8 @@ nouveau_dri2_schedule_swap(ClientPtr client, DrawablePtr 
draw,
  expect_msc, NULL, s);
if (ret)
goto fail;
-   s-frame = (unsigned int) expect_msc  0x;
+   s-frame = 1 + ((unsigned int) expect_msc  0x);
+   *target_msc = 1 + expect_msc;
} else {
/* We can't/don't want to sync to vblank, just swap. */
nouveau_dri2_finish_swap(draw, 0, 0, 0, s);
@@ -420,6 +432,13 @@ nouveau_dri2_schedule_wait(ClientPtr client, DrawablePtr 
draw,
CARD64 current_msc;
int ret;
 
+   /* Truncate to match kernel interfaces; means occasional overflow
+* misses, but that's generally not a big deal.
+*/
+   target_msc = 0x;
+   divisor = 0x;
+   remainder = 0x;
+
if (!can_sync_to_vblank(draw)) {
DRI2WaitMSCComplete(client, draw, target_msc, 0, 0);
return TRUE;
@@ -439,7 +458,7 @@ nouveau_dri2_schedule_wait(ClientPtr client, DrawablePtr 
draw,
goto fail;
 
/* Calculate a wait target if we don't have one */
-   if (current_msc  target_msc  divisor)
+   if (current_msc = target_msc  divisor)
target_msc = current_msc + divisor
- (current_msc - remainder) % divisor;
 
-- 
1.7.5.4

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


Re: [PULL] DRI2 fixes and extensions

2011-09-21 Thread Keith Packard
On Fri, 5 Nov 2010 11:25:00 +0200, Pauli Nieminen 
ext-pauli.niemi...@nokia.com wrote:

 Pauli Nieminen (5):
   DRI2: Avoid call to NULL pointer
   DRI2: Add error message when working around driver bug
   DRI2: Add ReuseBufferNotify hook
   DRI2: Expose API to set drawable swap limit.
   DRI2: Allow DDX to validate swap_limit changes

I've cherry picked a subset of these changes over:

   DRI2: Add ReuseBufferNotify hook
   DRI2: Expose API to set drawable swap limit.
   DRI2: Allow DDX to validate swap_limit changes

The first patch had already been applied separately, the second patch
was just adding an error message, which doesn't seem that useful to me.

   2f47433..871d657  master - master

-- 
keith.pack...@intel.com


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

[PULL xserver] DRI2 fixes

2011-04-14 Thread Ville Syrjälä
The following changes since commit b2997431fd426ab318bc5dfd2cd43956d733ebec:

  Send events that were missing from RRSelectInput (2011-04-13 19:04:32 -0700)

are available in the git repository at:
  git://gitorious.org/vsyrjala/xserver.git dri2_fixes

Ville Syrjälä (2):
  dri2: Handle calloc() failure
  dri2: Pass out_count by value to update_dri2_drawable_buffers()

 hw/xfree86/dri2/dri2.c |   22 +-
 1 files changed, 13 insertions(+), 9 deletions(-)

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


Re: [PULL] DRI2 fixes and extensions

2010-12-06 Thread Jesse Barnes
On Wed, 24 Nov 2010 11:21:18 -0800
Keith Packard kei...@keithp.com wrote:

 On Fri, 5 Nov 2010 11:25:00 +0200, Pauli Nieminen 
 ext-pauli.niemi...@nokia.com wrote:
 
  Pauli Nieminen (5):
DRI2: Avoid call to NULL pointer
DRI2: Add error message when working around driver bug
DRI2: Add ReuseBufferNotify hook
DRI2: Expose API to set drawable swap limit.
DRI2: Allow DDX to validate swap_limit changes
 
 I'm hoping to see Jesse review the rest of these. If I don't hear from
 him in the next week, I'll go ahead and merge them as I don't see
 anything obviously wrong.

I think I looked at all of them and replied with reviewed-by lines; the
only one I wanted extra eyes on was the one dealing with buffer
lifetimes; that code has changed a bit and I think Kristian understands
it best.

-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


DRI2 fixes and extensions

2010-11-26 Thread Pauli
I updated the last patch based Jesse's wish. i also added the review tags that
he gave to last two patches. I'm reposting the last patch ecause it has changed.

I also updated the branch holding the patches.

Sorry for the delay to handle the changes.

The following changes since commit a52efb096e166e325deb3d6b502671f339a4fa15:
  Keith Packard (1):
Merge remote branch 'sthibaul/master-iopl'

are available in the git repository at:

  ssh://people/~suokko/xserver.git dri2_patches

Pauli Nieminen (5):
  DRI2: Avoid call to NULL pointer
  DRI2: Add error message when working around driver bug
  DRI2: Add ReuseBufferNotify hook
  DRI2: Expose API to set drawable swap limit.
  DRI2: Allow DDX to validate swap_limit changes

 hw/xfree86/dri2/dri2.c |   57 +++
 hw/xfree86/dri2/dri2.h |   31 +-
 2 files changed, 82 insertions(+), 6 deletions(-)


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


Re: [PULL] DRI2 fixes and extensions

2010-11-24 Thread Keith Packard
On Fri, 5 Nov 2010 11:25:00 +0200, Pauli Nieminen 
ext-pauli.niemi...@nokia.com wrote:

 Pauli Nieminen (5):
   DRI2: Avoid call to NULL pointer
   DRI2: Add error message when working around driver bug
   DRI2: Add ReuseBufferNotify hook
   DRI2: Expose API to set drawable swap limit.
   DRI2: Allow DDX to validate swap_limit changes

I'm hoping to see Jesse review the rest of these. If I don't hear from
him in the next week, I'll go ahead and merge them as I don't see
anything obviously wrong.

-- 
keith.pack...@intel.com


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

[PULL] DRI2 fixes and extensions

2010-11-05 Thread Pauli Nieminen
The following changes since commit a52efb096e166e325deb3d6b502671f339a4fa15:
  Keith Packard (1):
Merge remote branch 'sthibaul/master-iopl'

are available in the git repository at:

  ssh://people/~suokko/xserver.git dri2_patches

Pauli Nieminen (5):
  DRI2: Avoid call to NULL pointer
  DRI2: Add error message when working around driver bug
  DRI2: Add ReuseBufferNotify hook
  DRI2: Expose API to set drawable swap limit.
  DRI2: Allow DDX to validate swap_limit changes

 hw/xfree86/dri2/dri2.c |   63 
 hw/xfree86/dri2/dri2.h |   31 ++-
 2 files changed, 88 insertions(+), 6 deletions(-)
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: DRI2 fixes for 1.8-branch

2010-06-11 Thread Jesse Barnes
On Fri, 11 Jun 2010 11:23:53 +1000
Peter Hutterer peter.hutte...@who-t.net wrote:

 I've got a few DRI2 cherry-picks for 1.8 on 
 git://people.freedesktop.org/~whot/xserver.git server-1.8-branch
 
 Cherry-picking them was more complicated than I hoped for since we had one
 of the patches reverted, then others on top, etc. And I don't know what I'm
 doing when it comes to DRI2.
 
 So, please have a look at these and check if they're correct. If they are,
 I'll merge them into 1.8, if not I'll just leave them.

Kristian is probably the best person to look at this; hope we can get
it into 1.8.x.

-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


DRI2 fixes for 1.8-branch

2010-06-10 Thread Peter Hutterer
I've got a few DRI2 cherry-picks for 1.8 on 
git://people.freedesktop.org/~whot/xserver.git server-1.8-branch

Cherry-picking them was more complicated than I hoped for since we had one
of the patches reverted, then others on top, etc. And I don't know what I'm
doing when it comes to DRI2.

So, please have a look at these and check if they're correct. If they are,
I'll merge them into 1.8, if not I'll just leave them.

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


Re: DRI2 fixes

2010-05-21 Thread Jesse Barnes
On Fri, 21 May 2010 14:05:41 +1000
Peter Hutterer peter.hutte...@who-t.net wrote:

 On Thu, May 20, 2010 at 09:19:03AM -0700, Jesse Barnes wrote:
  On Mon, 29 Mar 2010 10:04:28 -0700
  Jesse Barnes jbar...@virtuousgeek.org wrote:
  
   On Mon, 22 Mar 2010 15:03:30 -0700
   Jesse Barnes jbar...@virtuousgeek.org wrote:
   
This is a collection of fixes from my personal server tree targeting the
1.8 release.  They're mostly small fixes, but they fix a few important
(i.e. common) cases with the new protocol code.

Please review; I'll make any necessary changes, add the Reviewed-by
tags, and push to Keith.
   
   Ok, just updated my tree (master branch at
   git://people.freedesktop.org/~jbarnes/xserver) with the reviewed-by
   tags after some testing.
   
   Please pull it, hopefully into 1.8 since it fixes some ugly bugs (e.g.
   handling MSC counts in the past w/o hanging), or into 1.8.1 if you've
   already done with 1.8.
  
  Peter, can you pull these fixes into 1.8.x?  It seems they got lost
  after hitting master; they're really needed in 1.8.x too.
 
 pushed, thanks. please double-check that I have merged the right commits, a
 pull request would have been a bit easier given that I know little to
 nothing of the DRI2 parts.

Ok checking now; I figured the commits hadn't changed since Keith
pulled them into something very similar to 1.8.  Hope you didn't have
to deal with any conflicts...

Commits look good, thanks.

-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


DRI2 fixes resend

2010-05-07 Thread Kristian Høgsberg
I'm resending the patch series to fix the XID confusion in DRI2.  Patches
2, 3 and 4 have already been review and/or tested, but the first patch
needs review again.  Patch 1 is the one that fixes the resource count
in dix/resource.c.  Keith pointed out that the other recent resource
functions also didn't maintain the count and that 
LookupClientResourceComplex() and FreeClientNeverRetainResources()
didn't check the count before and after doing their callback so as to
be reentrancy save.

I updated the patch to fix these issues, but now it's an even bigger
change to a subtle core subsystem that otherwise hasn't changed much
for a long time... in other words, please help review!

Kristian

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


[git pull] GLX DRI2 fixes

2010-04-06 Thread Jesse Barnes
The following changes since commit 3083c5d0c4386cdd7083b7a83ac72fdad2f1e61e:
  Michel Dänzer (1):
Xext: Fix cursor reference counting hazard.

are available in the git repository at:

  git://people.freedesktop.org/~jbarnes/xserver master

This series has been posted  reviewed.  I've been testing locally for
awhile now; it fixes several bugs in the new DRI2 feature code and
fixes up our extension reporting.

Jesse Barnes (10):
  DRI2: fixup handling of last_swap_target
  DRI2: make target_sbc signed
  DRI2: fix swapbuffers handling of SBC and target MSC
  DRI2: drawable lifetime fixes
  DRI2: handle swap_interval of 0 correctly
  DRI2: advertise lowest supported DRI2 protocol version
  DRI2: throttle swaps at submission time too
  DRI2: handle swapsPending better
  DRI2: prevent swap wakes from waking MSC waiters
  GLX/DRI2: expose swap control extensions if DDX support is present

Mario Kleiner (2):
  DRI2: Fix glitches in DRI2SwapComplete() and DRI2WakeupClient()
  DRI2WaitSbc(): Fixes for correct semantic of glXWaitForSbcOML()

 glx/glxdri2.c   |   23 ++
 hw/xfree86/dri2/dri2.c  |  174 +--
 hw/xfree86/dri2/dri2.h  |6 ++
 hw/xfree86/dri2/dri2ext.c   |   11 ++-
 include/protocol-versions.h |4 -
 5 files changed, 143 insertions(+), 75 deletions(-)

-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: DRI2 fixes

2010-03-29 Thread Jesse Barnes
On Mon, 22 Mar 2010 15:03:30 -0700
Jesse Barnes jbar...@virtuousgeek.org wrote:

 This is a collection of fixes from my personal server tree targeting the
 1.8 release.  They're mostly small fixes, but they fix a few important
 (i.e. common) cases with the new protocol code.
 
 Please review; I'll make any necessary changes, add the Reviewed-by
 tags, and push to Keith.

Ok, just updated my tree (master branch at
git://people.freedesktop.org/~jbarnes/xserver) with the reviewed-by
tags after some testing.

Please pull it, hopefully into 1.8 since it fixes some ugly bugs (e.g.
handling MSC counts in the past w/o hanging), or into 1.8.1 if you've
already done with 1.8.

Thanks,
-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: DRI2 fixes

2010-03-24 Thread Mario Kleiner

On Mar 22, 2010, at 11:03 PM, Jesse Barnes wrote:

This is a collection of fixes from my personal server tree  
targeting the

1.8 release.  They're mostly small fixes, but they fix a few important
(i.e. common) cases with the new protocol code.

Please review; I'll make any necessary changes, add the Reviewed-by
tags, and push to Keith.



Hi Jesse,

done. You can add a reviewed-by from me on all relevant patches if  
you like -- i pulled them from your xserver-tree and checked on that.  
I didn't test any of them (no suitable hardware) but did a paper +  
pencil + brain review and looks good to me.


thanks,
-mario

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


DRI2 fixes

2010-03-22 Thread Jesse Barnes
This is a collection of fixes from my personal server tree targeting the
1.8 release.  They're mostly small fixes, but they fix a few important
(i.e. common) cases with the new protocol code.

Please review; I'll make any necessary changes, add the Reviewed-by
tags, and push to Keith.

Thanks,
Jesse

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


[PATCH xserver/dri2] Fixes and Improvements for DRI 2.2 protocol bits

2010-02-20 Thread Mario Kleiner
Hi,

the patch series against the xserver i just sent out contains bug  
fixes and adds missing functionality for the new DRI2 2.2 protocol  
requests. It should improve the handling of the SGI_swap_interval and  
OML_video_sync GLX extensions.

Jesse Barnes already had a positive look at the patches. Due to lack  
of suitable hardware i wasn't able to test any of these, not even if  
they compile.

Could somebody please test these and apply them if appropriate?

Thanks,
mario

*
Mario Kleiner
Max Planck Institute for Biological Cybernetics
Spemannstr. 38
72076 Tuebingen
Germany

e-mail: mario.klei...@tuebingen.mpg.de
office: +49 (0)7071/601-1623
fax:+49 (0)7071/601-616
www:http://www.kyb.tuebingen.mpg.de/~kleinerm
*
For a successful technology, reality must take precedence
over public relations, for Nature cannot be fooled.
(Richard Feynman)

___
xorg-devel mailing list
xorg-devel@lists.x.org
http://lists.x.org/mailman/listinfo/xorg-devel