Re: [ANNOUNCE] xorg-server 1.19.2

2017-03-03 Thread Jeremy Huddleston Sequoia

> On Mar 3, 2017, at 08:50, Adam Jackson  wrote:
> 
> On Thu, 2017-03-02 at 18:13 -0500, Adam Jackson wrote:
>> A collection of stability fixes here across glamor, Xwayland, input,
>> and Prime support. Also a security fix for CVE-2017-2624, a timing
>> attack which can brute-force MIT-MAGIC-COOKIE authentication. Everybody
>> is encouraged to upgrade. Thanks to all who contributed fixes!
> 
> As several people have noticed, this tarballs is missing some of
> the standard buildsystem bits, such that you need to run autoreconf
> before ./configure. This is partly my fault for driving the release
> script incorrectly, and mostly autotools' fault for being sheer
> garbage. (Seriously, dear gnu project, please sunset autotools. It is a
> net loss to humanity at this point.)

What do you propose instead of autotools?  I agree that it is utter garbage, 
and I dislike the license ... but I certainly don't like any of the 
alternatives either.  CMake, JAM, and the rest are pretty much all crap for one 
reason or another.  And hopefully you agree that it's at least leagues better 
than imake!  If there was a good alternative, I'd be happy to help with 
transitioning us away from autotools, but I just don't see any good option.

> Once I beat the release tools into submission I'll upload 1.19.3 with
> otherwise the same content. Sorry for the mess.
> 
> - ajax
> ___
> x...@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

___
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 99916] Rotating display gives garbage with Radeon RX 480

2017-03-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99916

--- Comment #8 from Hadrien  ---
Nice! Thank you for your responsiveness. I'm looking forward to test the fix.

-- 
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


Re: [ANNOUNCE] xorg-server 1.19.2

2017-03-03 Thread Adam Jackson
On Thu, 2017-03-02 at 18:13 -0500, Adam Jackson wrote:
> A collection of stability fixes here across glamor, Xwayland, input,
> and Prime support. Also a security fix for CVE-2017-2624, a timing
> attack which can brute-force MIT-MAGIC-COOKIE authentication. Everybody
> is encouraged to upgrade. Thanks to all who contributed fixes!

As several people have noticed, this tarballs is missing some of
the standard buildsystem bits, such that you need to run autoreconf
before ./configure. This is partly my fault for driving the release
script incorrectly, and mostly autotools' fault for being sheer
garbage. (Seriously, dear gnu project, please sunset autotools. It is a
net loss to humanity at this point.)

Once I beat the release tools into submission I'll upload 1.19.3 with
otherwise the same content. Sorry for the mess.

- ajax
___
xorg-announce mailing list
xorg-announce@lists.x.org
https://lists.x.org/mailman/listinfo/xorg-announce


Re: [ANNOUNCE] xorg-server 1.19.2

2017-03-03 Thread Adam Jackson
On Thu, 2017-03-02 at 18:13 -0500, Adam Jackson wrote:
> A collection of stability fixes here across glamor, Xwayland, input,
> and Prime support. Also a security fix for CVE-2017-2624, a timing
> attack which can brute-force MIT-MAGIC-COOKIE authentication. Everybody
> is encouraged to upgrade. Thanks to all who contributed fixes!

As several people have noticed, this tarballs is missing some of
the standard buildsystem bits, such that you need to run autoreconf
before ./configure. This is partly my fault for driving the release
script incorrectly, and mostly autotools' fault for being sheer
garbage. (Seriously, dear gnu project, please sunset autotools. It is a
net loss to humanity at this point.)

Once I beat the release tools into submission I'll upload 1.19.3 with
otherwise the same content. Sorry for the mess.

- 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 xserver 1/2] Revert "glamor: Remove the FBO cache."

2017-03-03 Thread Max Staudt
On 03/03/2017 09:46 AM, Michel Dänzer wrote:
> This reverts commit 950ffb8d6fd1480f305e38c571bda44f247f1de2 (and parts
> of commit 4b5326aeba539249fcded91bf7806a708eeca651).

Oh no.

Glamor's BO cache was horribly broken, and I tried to fix it before:

  https://lists.x.org/archives/xorg-devel/2016-July/050403.html

It was then decided to drop it altogether.


The thing is, at least on the Raspberry Pi (vc4) we get 3 BO caches:
 - kernel
 - Mesa
 - GLAMOR

That's quite a lot of memory kept around "just in case".


If you insist on bringing it back, please have a thorough look at my old
series.
There was a lot of broken, as well as dead (!) code that I had to fix
to make this workable on VC4. If we reintroduce a FBO cache, at least
let's do it right this time.



Max

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

Re: [PATCH xserver 2/2] glamor: Always purge the FBO cache in BlockHandler

2017-03-03 Thread Alex Deucher
On Fri, Mar 3, 2017 at 3:46 AM, Michel Dänzer  wrote:
> From: Michel Dänzer 
>
> Or if the cache watermark is reached, whichever comes earlier.
>
> This slightly simplifies the FBO cache management, and prevents it from
> potentially holding entries for a long time, while preserving the main
> benefit of the cache for bursts of drawing operations.
>
> Signed-off-by: Michel Dänzer 

Series is:
Reviewed-by: Alex Deucher 

> ---
>  glamor/glamor.c  |  6 ++
>  glamor/glamor_fbo.c  | 24 
>  glamor/glamor_priv.h |  6 --
>  3 files changed, 10 insertions(+), 26 deletions(-)
>
> diff --git a/glamor/glamor.c b/glamor/glamor.c
> index feae7a21f..1a0fc4318 100644
> --- a/glamor/glamor.c
> +++ b/glamor/glamor.c
> @@ -254,9 +254,7 @@ glamor_block_handler(ScreenPtr screen)
>  glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
>
>  glamor_make_current(glamor_priv);
> -glamor_priv->tick++;
>  glFlush();
> -glamor_fbo_expire(glamor_priv);
>  }
>
>  static void
> @@ -264,8 +262,8 @@ _glamor_block_handler(ScreenPtr screen, void *timeout)
>  {
>  glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
>
> -glamor_make_current(glamor_priv);
> -glFlush();
> +glamor_block_handler(screen);
> +glamor_fbo_expire(glamor_priv);
>
>  screen->BlockHandler = glamor_priv->saved_procs.block_handler;
>  screen->BlockHandler(screen, timeout);
> diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
> index a531f6052..c40de9bd1 100644
> --- a/glamor/glamor_fbo.c
> +++ b/glamor/glamor_fbo.c
> @@ -30,11 +30,6 @@
>
>  #include "glamor_priv.h"
>
> -#define GLAMOR_CACHE_EXPIRE_MAX 100
> -
> -#define GLAMOR_CACHE_DEFAULT0
> -#define GLAMOR_CACHE_EXACT_SIZE 1
> -
>  //#define NO_FBO_CACHE 1
>  #define FBO_CACHE_THRESHOLD  (256*1024*1024)
>
> @@ -155,9 +150,13 @@ glamor_pixmap_fbo_cache_put(glamor_screen_private 
> *glamor_priv,
>  #else
>  n_format = cache_format(fbo->format);
>
> -if (fbo->fb == 0 || fbo->external || n_format == -1
> -|| glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
> -glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX;
> +if (fbo->fb == 0 || fbo->external || n_format == -1) {
> +glamor_purge_fbo(glamor_priv, fbo);
> +return;
> +}
> +
> +glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
> +if (glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
>  glamor_fbo_expire(glamor_priv);
>  glamor_purge_fbo(glamor_priv, fbo);
>  return;
> @@ -182,9 +181,7 @@ glamor_pixmap_fbo_cache_put(glamor_screen_private 
> *glamor_priv,
>  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
>  }
>
> -glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
>  xorg_list_add(>list, cache);
> -fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX;
>  #endif
>  }
>
> @@ -281,12 +278,6 @@ glamor_fbo_expire(glamor_screen_private *glamor_priv)
>  cache = _priv->fbo_cache[i][j][k];
>  xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache,
>list) {
> -if (GLAMOR_TICK_AFTER(fbo_entry->expire, 
> glamor_priv->tick)) {
> -break;
> -}
> -
> -glamor_priv->fbo_cache_watermark -=
> -fbo_entry->width * fbo_entry->height;
>  xorg_list_del(_entry->list);
>  DEBUGF("cache %p fbo %p expired %d current %d \n", cache,
> fbo_entry, fbo_entry->expire, glamor_priv->tick);
> @@ -294,6 +285,7 @@ glamor_fbo_expire(glamor_screen_private *glamor_priv)
>  }
>  }
>
> +glamor_priv->fbo_cache_watermark = 0;
>  }
>
>  void
> diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
> index a9377ace1..ad7afec7e 100644
> --- a/glamor/glamor_priv.h
> +++ b/glamor/glamor_priv.h
> @@ -189,11 +189,7 @@ struct glamor_saved_procs {
>  #define CACHE_BUCKET_WCOUNT 4
>  #define CACHE_BUCKET_HCOUNT 4
>
> -#define GLAMOR_TICK_AFTER(t0, t1)  \
> -   (((int)(t1) - (int)(t0)) < 0)
> -
>  typedef struct glamor_screen_private {
> -unsigned int tick;
>  enum glamor_gl_flavor gl_flavor;
>  int glsl_version;
>  Bool has_pack_invert;
> @@ -328,8 +324,6 @@ enum glamor_fbo_state {
>
>  typedef struct glamor_pixmap_fbo {
>  struct xorg_list list; /**< linked list pointers when in the fbo cache */
> -/** glamor_priv->tick number when this FBO will be expired from the 
> cache. */
> -unsigned int expire;
>  GLuint tex; /**< GL texture name */
>  GLuint fb; /**< GL FBO name */
>  int width; /**< width in pixels */
> --
> 2.11.0
>
> ___
> xorg-devel@lists.x.org: 

[Bug 99916] Rotating display gives garbage with Radeon RX 480

2017-03-03 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=99916

Michel Dänzer  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #7 from Michel Dänzer  ---
Thanks for the report, fixed in Git master:

commit 03c2db3c67bf5ad3c0744add9e0bb611b6cd3df7
Author: Michel Dänzer 
Date:   Thu Mar 2 16:42:04 2017 +0900

Call drmmode_crtc_scanout_create in drmmode_crtc_shadow_allocate as well

-- 
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


[PATCH xserver 2/2] glamor: Always purge the FBO cache in BlockHandler

2017-03-03 Thread Michel Dänzer
From: Michel Dänzer 

Or if the cache watermark is reached, whichever comes earlier.

This slightly simplifies the FBO cache management, and prevents it from
potentially holding entries for a long time, while preserving the main
benefit of the cache for bursts of drawing operations.

Signed-off-by: Michel Dänzer 
---
 glamor/glamor.c  |  6 ++
 glamor/glamor_fbo.c  | 24 
 glamor/glamor_priv.h |  6 --
 3 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index feae7a21f..1a0fc4318 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -254,9 +254,7 @@ glamor_block_handler(ScreenPtr screen)
 glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
 
 glamor_make_current(glamor_priv);
-glamor_priv->tick++;
 glFlush();
-glamor_fbo_expire(glamor_priv);
 }
 
 static void
@@ -264,8 +262,8 @@ _glamor_block_handler(ScreenPtr screen, void *timeout)
 {
 glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
 
-glamor_make_current(glamor_priv);
-glFlush();
+glamor_block_handler(screen);
+glamor_fbo_expire(glamor_priv);
 
 screen->BlockHandler = glamor_priv->saved_procs.block_handler;
 screen->BlockHandler(screen, timeout);
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index a531f6052..c40de9bd1 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -30,11 +30,6 @@
 
 #include "glamor_priv.h"
 
-#define GLAMOR_CACHE_EXPIRE_MAX 100
-
-#define GLAMOR_CACHE_DEFAULT0
-#define GLAMOR_CACHE_EXACT_SIZE 1
-
 //#define NO_FBO_CACHE 1
 #define FBO_CACHE_THRESHOLD  (256*1024*1024)
 
@@ -155,9 +150,13 @@ glamor_pixmap_fbo_cache_put(glamor_screen_private 
*glamor_priv,
 #else
 n_format = cache_format(fbo->format);
 
-if (fbo->fb == 0 || fbo->external || n_format == -1
-|| glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
-glamor_priv->tick += GLAMOR_CACHE_EXPIRE_MAX;
+if (fbo->fb == 0 || fbo->external || n_format == -1) {
+glamor_purge_fbo(glamor_priv, fbo);
+return;
+}
+
+glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
+if (glamor_priv->fbo_cache_watermark >= FBO_CACHE_THRESHOLD) {
 glamor_fbo_expire(glamor_priv);
 glamor_purge_fbo(glamor_priv, fbo);
 return;
@@ -182,9 +181,7 @@ glamor_pixmap_fbo_cache_put(glamor_screen_private 
*glamor_priv,
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
 }
 
-glamor_priv->fbo_cache_watermark += fbo->width * fbo->height;
 xorg_list_add(>list, cache);
-fbo->expire = glamor_priv->tick + GLAMOR_CACHE_EXPIRE_MAX;
 #endif
 }
 
@@ -281,12 +278,6 @@ glamor_fbo_expire(glamor_screen_private *glamor_priv)
 cache = _priv->fbo_cache[i][j][k];
 xorg_list_for_each_entry_safe_reverse(fbo_entry, tmp, cache,
   list) {
-if (GLAMOR_TICK_AFTER(fbo_entry->expire, 
glamor_priv->tick)) {
-break;
-}
-
-glamor_priv->fbo_cache_watermark -=
-fbo_entry->width * fbo_entry->height;
 xorg_list_del(_entry->list);
 DEBUGF("cache %p fbo %p expired %d current %d \n", cache,
fbo_entry, fbo_entry->expire, glamor_priv->tick);
@@ -294,6 +285,7 @@ glamor_fbo_expire(glamor_screen_private *glamor_priv)
 }
 }
 
+glamor_priv->fbo_cache_watermark = 0;
 }
 
 void
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index a9377ace1..ad7afec7e 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -189,11 +189,7 @@ struct glamor_saved_procs {
 #define CACHE_BUCKET_WCOUNT 4
 #define CACHE_BUCKET_HCOUNT 4
 
-#define GLAMOR_TICK_AFTER(t0, t1)  \
-   (((int)(t1) - (int)(t0)) < 0)
-
 typedef struct glamor_screen_private {
-unsigned int tick;
 enum glamor_gl_flavor gl_flavor;
 int glsl_version;
 Bool has_pack_invert;
@@ -328,8 +324,6 @@ enum glamor_fbo_state {
 
 typedef struct glamor_pixmap_fbo {
 struct xorg_list list; /**< linked list pointers when in the fbo cache */
-/** glamor_priv->tick number when this FBO will be expired from the cache. 
*/
-unsigned int expire;
 GLuint tex; /**< GL texture name */
 GLuint fb; /**< GL FBO name */
 int width; /**< width in pixels */
-- 
2.11.0

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

[PATCH xserver 1/2] Revert "glamor: Remove the FBO cache."

2017-03-03 Thread Michel Dänzer
From: Michel Dänzer 

This reverts commit 950ffb8d6fd1480f305e38c571bda44f247f1de2 (and parts
of commit 4b5326aeba539249fcded91bf7806a708eeca651).

It halved (or worse) the performance with some x11perf tests on
radeonsi, even though radeonsi has a BO cache.

Signed-off-by: Michel Dänzer 
---

I suspect the reason why radeonsi's BO cache can't make up for the lack of
the glamor FBO cache is that the former can only return idle BOs. So
while the glamor FBO cache allows re-using the same FBO over and over
for a series of operations using temporary pixmaps of the same size, the
radeonsi BO cache has to keep using different BOs until a command stream
is flushed to the GPU and processed by it.

 glamor/glamor.c   |   5 +
 glamor/glamor_fbo.c   | 249 --
 glamor/glamor_priv.h  |  27 ++
 glamor/glamor_utils.h |  40 
 4 files changed, 315 insertions(+), 6 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index c54cf3b43..feae7a21f 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -110,6 +110,7 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int 
tex)
 ErrorF("XXX fail to create fbo.\n");
 return;
 }
+fbo->external = TRUE;
 
 glamor_pixmap_attach_fbo(pixmap, fbo);
 }
@@ -253,7 +254,9 @@ glamor_block_handler(ScreenPtr screen)
 glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
 
 glamor_make_current(glamor_priv);
+glamor_priv->tick++;
 glFlush();
+glamor_fbo_expire(glamor_priv);
 }
 
 static void
@@ -719,6 +722,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
 ps->Glyphs = glamor_composite_glyphs;
 
 glamor_init_vbo(screen);
+glamor_init_pixmap_fbo(screen);
 
 #ifdef GLAMOR_GRADIENT_SHADER
 glamor_init_gradient_shader(screen);
@@ -748,6 +752,7 @@ glamor_release_screen_priv(ScreenPtr screen)
 
 glamor_priv = glamor_get_screen_private(screen);
 glamor_fini_vbo(screen);
+glamor_fini_pixmap_fbo(screen);
 glamor_pixmap_fini(screen);
 free(glamor_priv);
 
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index 988bb585b..a531f6052 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -30,9 +30,107 @@
 
 #include "glamor_priv.h"
 
-void
-glamor_destroy_fbo(glamor_screen_private *glamor_priv,
-   glamor_pixmap_fbo *fbo)
+#define GLAMOR_CACHE_EXPIRE_MAX 100
+
+#define GLAMOR_CACHE_DEFAULT0
+#define GLAMOR_CACHE_EXACT_SIZE 1
+
+//#define NO_FBO_CACHE 1
+#define FBO_CACHE_THRESHOLD  (256*1024*1024)
+
+/* Loop from the tail to the head. */
+#define xorg_list_for_each_entry_reverse(pos, head, member) \
+for (pos = __container_of((head)->prev, pos, member);   \
+ >member != (head);\
+ pos = __container_of(pos->member.prev, pos, member))
+
+#define xorg_list_for_each_entry_safe_reverse(pos, tmp, head, member)   \
+for (pos = __container_of((head)->prev, pos, member),   \
+ tmp = __container_of(pos->member.prev, pos, member);   \
+ >member != (head);\
+ pos = tmp, tmp = __container_of(pos->member.prev, tmp, member))
+
+inline static int
+cache_wbucket(int size)
+{
+int order = __fls(size / 32);
+
+if (order >= CACHE_BUCKET_WCOUNT)
+order = CACHE_BUCKET_WCOUNT - 1;
+return order;
+}
+
+inline static int
+cache_hbucket(int size)
+{
+int order = __fls(size / 32);
+
+if (order >= CACHE_BUCKET_HCOUNT)
+order = CACHE_BUCKET_HCOUNT - 1;
+return order;
+}
+
+static int
+cache_format(GLenum format)
+{
+switch (format) {
+case GL_ALPHA:
+case GL_LUMINANCE:
+case GL_RED:
+return 2;
+case GL_RGB:
+return 1;
+case GL_RGBA:
+return 0;
+default:
+return -1;
+}
+}
+
+static glamor_pixmap_fbo *
+glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
+int w, int h, GLenum format)
+{
+struct xorg_list *cache;
+glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL;
+int n_format;
+
+#ifdef NO_FBO_CACHE
+return NULL;
+#else
+n_format = cache_format(format);
+if (n_format == -1)
+return NULL;
+cache = _priv->fbo_cache[n_format]
+[cache_wbucket(w)]
+[cache_hbucket(h)];
+
+xorg_list_for_each_entry(fbo_entry, cache, list) {
+if (fbo_entry->width == w && fbo_entry->height == h) {
+
+DEBUGF("Request w %d h %d format %x \n", w, h, format);
+DEBUGF("got cache entry %p w %d h %d fbo %d tex %d format %x\n",
+   fbo_entry, fbo_entry->width, fbo_entry->height,
+   fbo_entry->fb, fbo_entry->tex, fbo_entry->format);
+assert(format == fbo_entry->format);
+xorg_list_del(_entry->list);
+ret_fbo = fbo_entry;
+break;
+}
+