Re: [PATCH xserver 01/15] dri3: annotate the dri3_screen_info data as const

2018-04-10 Thread Adam Jackson
On Mon, 2018-04-02 at 16:41 +0100, Emil Velikov wrote:
> From: Emil Velikov 
> 
> dri3_screen_info is the user provide dispatch. Something that we do
> not and should not change.

Merged 1-4, 7-9, and 11-13:

remote: E: failed to find patch for rev 
66b632bb068672f507212b00bd313b5040bf1a39.
remote: I: patch #214288 updated using rev 
877fa0c66469628748dbd01506f15ddc4f11b849.
remote: I: patch #214289 updated using rev 
9a159f37e00ed47ec8cbff7c57d8787b8f5685f5.
remote: E: failed to find patch for rev 
a83ceec868a6d544bc7775a753b67aa40d0d0efc.
remote: I: patch #214291 updated using rev 
b36a14c0b0e7e38406622eb5ff0666a8b8bc50f4.
remote: I: patch #214294 updated using rev 
150e4b12ad160b093899107ed586aa0cb258879e.
remote: I: patch #214296 updated using rev 
e2f45002fc3c53c6196935447b8fe77d0850175b.
remote: I: patch #214297 updated using rev 
ac48724639e0a6a9e421b3b4e545d8506fd6bf5d.
remote: I: patch #214298 updated using rev 
71a069fd7fbe815d386fc1b3c44cda732cff7af0.
remote: E: failed to find patch for rev 
a42992a4cca49cedd3930f5694c7a16e4f614b36.
remote: I: 7 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   c67f2eac56..a42992a4cc  master -> master

5 and 6 are cosmetic half-measures, I'd be fine with merging changes
like that but I'd prefer if we kept the whole server consistent about
it. The rest I think I've already commented on.

- 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 01/15] dri3: annotate the dri3_screen_info data as const

2018-04-04 Thread Emil Velikov
On 2 April 2018 at 20:34, Adam Jackson  wrote:
> On Mon, 2018-04-02 at 16:41 +0100, Emil Velikov wrote:
>
>> Why do we have the explicit _rec and _ptr typecasts to begin with?
>
> Convention, mostly. The typedef for the struct is because 'struct' is a
> dumb word to need to say all the time. The typedef for the pointer is
> vaguely distasteful and I've been trying to stop.
>
s/dumb/annoying/

Using _t suffix over _rec seems more indicative IMHO.
Regardless, most of the series is a must have for 1.20 - if you want
to give it a skim that'll be appreciated.

Thanks
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

Re: [PATCH xserver 01/15] dri3: annotate the dri3_screen_info data as const

2018-04-02 Thread Adam Jackson
On Mon, 2018-04-02 at 16:41 +0100, Emil Velikov wrote:

> Why do we have the explicit _rec and _ptr typecasts to begin with?

Convention, mostly. The typedef for the struct is because 'struct' is a
dumb word to need to say all the time. The typedef for the pointer is
vaguely distasteful and I've been trying to stop.

- 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 01/15] dri3: annotate the dri3_screen_info data as const

2018-04-02 Thread Emil Velikov
From: Emil Velikov 

dri3_screen_info is the user provide dispatch. Something that we do
not and should not change.

When using the _ptr typecast + const the compiler barfs at us
(rightfully so), so use the _rec one.

Fixes: 56313829886 ("dri3: Add DRI3 extension")
Cc: Keith Packard 
Cc: Adam Jackson 
Signed-off-by: Emil Velikov 
---
Why do we have the explicit _rec and _ptr typecasts to begin with?

It reminds be of Pascal with it's infamous record ... from some 20
years ago.
---
 dri3/dri3.c   |  2 +-
 dri3/dri3.h   |  2 +-
 dri3/dri3_priv.h  |  2 +-
 dri3/dri3_screen.c| 12 ++--
 glamor/glamor_egl.c   |  2 +-
 hw/xwayland/xwayland-glamor.c |  2 +-
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dri3/dri3.c b/dri3/dri3.c
index 8ac0f3ae2..ba32facd7 100644
--- a/dri3/dri3.c
+++ b/dri3/dri3.c
@@ -45,7 +45,7 @@ dri3_close_screen(ScreenPtr screen)
 }
 
 Bool
-dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info)
+dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info)
 {
 dri3_screen_generation = serverGeneration;
 
diff --git a/dri3/dri3.h b/dri3/dri3.h
index 89ad13ad9..bd17522b0 100644
--- a/dri3/dri3.h
+++ b/dri3/dri3.h
@@ -104,7 +104,7 @@ typedef struct dri3_screen_info {
 } dri3_screen_info_rec, *dri3_screen_info_ptr;
 
 extern _X_EXPORT Bool
-dri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info);
+dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info);
 
 extern _X_EXPORT int
 dri3_send_open_reply(ClientPtr client, int fd);
diff --git a/dri3/dri3_priv.h b/dri3/dri3_priv.h
index 8447680ba..cf6632ddf 100644
--- a/dri3/dri3_priv.h
+++ b/dri3/dri3_priv.h
@@ -49,7 +49,7 @@ typedef struct dri3_screen_priv {
 CARD32  num_formats;
 dri3_dmabuf_format_ptr  formats;
 
-dri3_screen_info_ptrinfo;
+const dri3_screen_info_rec *info;
 } dri3_screen_priv_rec, *dri3_screen_priv_ptr;
 
 #define wrap(priv,real,mem,func) {\
diff --git a/dri3/dri3_screen.c b/dri3/dri3_screen.c
index df40f8281..0b045c413 100644
--- a/dri3/dri3_screen.c
+++ b/dri3/dri3_screen.c
@@ -31,7 +31,7 @@
 #include 
 #include 
 
-static inline Bool has_open(dri3_screen_info_ptr info) {
+static inline Bool has_open(const dri3_screen_info_rec *info) {
 if (info == NULL)
 return FALSE;
 
@@ -43,7 +43,7 @@ int
 dri3_open(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, int *fd)
 {
 dri3_screen_priv_ptrds = dri3_screen_priv(screen);
-dri3_screen_info_ptrinfo = ds->info;
+const dri3_screen_info_rec *info = ds->info;
 int rc;
 
 if (!has_open(info))
@@ -68,7 +68,7 @@ dri3_pixmap_from_fds(PixmapPtr *ppixmap, ScreenPtr screen,
  CARD8 depth, CARD8 bpp, CARD64 modifier)
 {
 dri3_screen_priv_ptrds = dri3_screen_priv(screen);
-dri3_screen_info_ptrinfo = ds->info;
+const dri3_screen_info_rec *info = ds->info;
 PixmapPtr   pixmap;
 
 if (!info)
@@ -99,7 +99,7 @@ dri3_fds_from_pixmap(PixmapPtr pixmap, int *fds,
 {
 ScreenPtr   screen = pixmap->drawable.pScreen;
 dri3_screen_priv_ptrds = dri3_screen_priv(screen);
-dri3_screen_info_ptrinfo = ds->info;
+const dri3_screen_info_rec *info = ds->info;
 
 if (!info)
 return 0;
@@ -128,7 +128,7 @@ static int
 cache_formats_and_modifiers(ScreenPtr screen)
 {
 dri3_screen_priv_ptrds = dri3_screen_priv(screen);
-dri3_screen_info_ptrinfo = ds->info;
+const dri3_screen_info_rec *info = ds->info;
 CARD32 *formats = NULL;
 CARD64 *modifiers = NULL;
 int i;
@@ -188,7 +188,7 @@ dri3_get_supported_modifiers(ScreenPtr screen, DrawablePtr 
drawable,
  CARD64 **screen_modifiers)
 {
 dri3_screen_priv_ptrds = dri3_screen_priv(screen);
-dri3_screen_info_ptrinfo = ds->info;
+const dri3_screen_info_rec *info = ds->info;
 int i, j;
 int ret;
 CARD32  num_drawable_mods;
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 4a550932a..5992b9279 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -755,7 +755,7 @@ glamor_dri3_open_client(ClientPtr client,
 return Success;
 }
 
-static dri3_screen_info_rec glamor_dri3_info = {
+static const dri3_screen_info_rec glamor_dri3_info = {
 .version = 2,
 .open_client = glamor_dri3_open_client,
 .pixmap_from_fds = glamor_pixmap_from_fds,
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index 7e9815626..7f64483bf 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -815,7 +815,7 @@