Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Dave Airlie
On 15 March 2018 at 03:25, Daniel Stone  wrote:
> Hi,
>
> On 14 March 2018 at 13:04, Rob Clark  wrote:
>> I'm not sure everyone wants to be updating their dri3 in a forced
>> march setting, this allows a nicer approach, esp when you want
>> to build on distro that aren't brand new.
>
> I don't have that much of an opinion on whether the dependency should
> be mandatory or not. I originally had #ifdefs and removed them when
> reviewers asked me to. If people want to add them back, fine by me.
>
> That being said, these patches need changes, per comments below. One
> thing missing entirely is making the version negotiation conditional:
> when we call query_version for DRI3/Present, we need to make the
> version we pass in conditional on whether or not we have new XCB.
> Probably also wise to ifdef the multiplane_available variables, so
> it's really obvious where any users are missing ifdefs.

I was trying to minimise the ifdeffery, we could minimise the present ones
with #ifndef #define #endif blocks at the top, the dri3 one I think we just have
to live with.

>
> I'm happy to test this tomorrow and submit a new version if that's
> easier for people.

Please do.

Dave.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Daniel Stone
Hi,

On 14 March 2018 at 13:04, Rob Clark  wrote:
> I'm not sure everyone wants to be updating their dri3 in a forced
> march setting, this allows a nicer approach, esp when you want
> to build on distro that aren't brand new.

I don't have that much of an opinion on whether the dependency should
be mandatory or not. I originally had #ifdefs and removed them when
reviewers asked me to. If people want to add them back, fine by me.

That being said, these patches need changes, per comments below. One
thing missing entirely is making the version negotiation conditional:
when we call query_version for DRI3/Present, we need to make the
version we pass in conditional on whether or not we have new XCB.
Probably also wise to ifdef the multiplane_available variables, so
it's really obvious where any users are missing ifdefs.

I'm happy to test this tomorrow and submit a new version if that's
easier for people.

> @@ -327,6 +327,7 @@ dri3_create_image_khr_pixmap_from_buffers(_EGLDisplay 
> *disp, _EGLContext *ctx,
>EGLClientBuffer buffer,
>const EGLint *attr_list)
>  {
> +#ifdef HAVE_DRI3_MODIFIERS
> struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
> struct dri2_egl_image *dri2_img;
> xcb_dri3_buffers_from_pixmap_cookie_t bp_cookie;
> @@ -376,6 +377,9 @@ dri3_create_image_khr_pixmap_from_buffers(_EGLDisplay 
> *disp, _EGLContext *ctx,
> }
>
> return _img->base;
> +#else
> +   return NULL;
> +#endif
>  }

Just ifdef out the entire function, don't return NULL.

> @@ -1272,6 +1276,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable 
> *draw, unsigned int format,
> pixmap = xcb_generate_id(draw->conn);
> if (draw->multiplanes_available &&
> buffer->modifier != DRM_FORMAT_MOD_INVALID) {
> +#ifdef HAVE_DRI3_MODIFIERS
>xcb_dri3_pixmap_from_buffers(draw->conn,
> pixmap,
> draw->drawable,
> @@ -1284,6 +1289,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable 
> *draw, unsigned int format,
> depth, buffer->cpp * 8,
> buffer->modifier,
> buffer_fds);
> +#endif
> } else {
>xcb_dri3_pixmap_from_buffer(draw->conn,
>pixmap,

This ifdef needs to wrap the branch, so that the single-buffer
xcb_dri3_pixmap_from_buffer() always gets called if we built against
old XCB, else new-server + old-XCB-Mesa never allocates a render
buffer for X11 surfaces.

> @@ -1567,7 +1575,7 @@ dri3_get_pixmap_buffer(__DRIdrawable *driDrawable, 
> unsigned int format,
>(sync_fence = xcb_generate_id(draw->conn)),
>false,
>fence_fd);
> -
> +#ifdef HAVE_DRI3_MODIFIERS
> if (draw->multiplanes_available &&
> draw->ext->image->base.version >= 15 &&
> draw->ext->image->createImageFromDmaBufs2) {
> @@ -1586,7 +1594,9 @@ dri3_get_pixmap_buffer(__DRIdrawable *driDrawable, 
> unsigned int format,
>width = bps_reply->width;
>height = bps_reply->height;
>free(bps_reply);
> -   } else {
> +   } else
> +#endif
> +   {
>xcb_dri3_buffer_from_pixmap_cookie_t bp_cookie;
>xcb_dri3_buffer_from_pixmap_reply_t *bp_reply;

Jason complained about control flow being intermingled with #ifdefs
like this. I don't have any suggestions as to how to do it better
though, which is why I did it like this in the first place.

Cheers,
Daniel
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Mathias Fröhlich
Hi,

On Wednesday, 14 March 2018 15:51:03 CET Brian Paul wrote:
> FWIW, I'd like to see this sooner rather than later too.  I spent 
> several hours yesterday trying to update our build script to 
> build/install XCB 1.13 on Fedora, Ubuntu, etc. without totally succeeding.

I did just rebuild the 1.13 srpm from koji.fedora... on fedora27.
I have put those I have into my freedesktop home directory:

/home/frohlich/xcb-1.13-rpms

Not that I want to maintain them, but to share what at this current minute 
helps for me.

IMO not just requiring the most recent version of such a system library would 
be a very good thing!

best

Mathias


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Emil Velikov
On 14 March 2018 at 14:51, Brian Paul  wrote:
> On 03/14/2018 08:40 AM, Rob Clark wrote:
>>
>> On Wed, Mar 14, 2018 at 10:29 AM, Emil Velikov 
>> wrote:
>>>
>>> On 14 March 2018 at 13:04, Rob Clark  wrote:

 From: Dave Airlie 

 I'm not sure everyone wants to be updating their dri3 in a forced
 march setting, this allows a nicer approach, esp when you want
 to build on distro that aren't brand new.

 I'm sure there are plenty of ways this patch could be cleaner,
 and I've also not built it against an updated dri3.

 For meson I've just left it alone, since if you are using meson
 you probably don't mind xcb updates, and if you are using meson
 you can fix this better than me.

 v3: just don't put a version in for dri3/present without
 modifiers, should allow building with 1.11 as well
 v4: small fix to meson build

 (feel free to supply meson followups)

>>> IIRC Matt seemed also on board with making the new xcb a hard
>>> requirement.
>>>
>>> I don't know the exact usecase he was thinking, yet gut feeling
>>> suggests that my earlier suggestion [1] should work for everyone -
>>> Dave, Matt, Marek, etc.
>>> If the concern is writing the code - I can help ;-)
>>>
>>
>> I care *significantly* less about the build against 1.12, run against
>> 1.13 case than I do about getting back to the point where I don't have
>> to carry around these patches to build mesa (otherwise it is just a
>> matter of time before I accidentally push them just because I needed
>> them to test whatever it was that I was intending to push ;-)
>>
>> If someone wants to build on top of this and make something more
>> fancy, by all means.  But I really would like to push something that
>> removes the 1.13 dependency like today(ish), whether that be this
>> patchset or reverting the patches that added the 1.13 dependency and
>> trying again later.
>
>
> FWIW, I'd like to see this sooner rather than later too.  I spent several
> hours yesterday trying to update our build script to build/install XCB 1.13
> on Fedora, Ubuntu, etc. without totally succeeding.
>
I could have save you some time, if the script is available somewhere ;-)

FTR the oibaf repo has the Ubuntu bits.. Up-to date distros like
Gentoo, Arch are fine as well - doubt they are your target audience,
though.

-Emil

[1] https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Brian Paul

On 03/14/2018 08:40 AM, Rob Clark wrote:

On Wed, Mar 14, 2018 at 10:29 AM, Emil Velikov  wrote:

On 14 March 2018 at 13:04, Rob Clark  wrote:

From: Dave Airlie 

I'm not sure everyone wants to be updating their dri3 in a forced
march setting, this allows a nicer approach, esp when you want
to build on distro that aren't brand new.

I'm sure there are plenty of ways this patch could be cleaner,
and I've also not built it against an updated dri3.

For meson I've just left it alone, since if you are using meson
you probably don't mind xcb updates, and if you are using meson
you can fix this better than me.

v3: just don't put a version in for dri3/present without
modifiers, should allow building with 1.11 as well
v4: small fix to meson build

(feel free to supply meson followups)


IIRC Matt seemed also on board with making the new xcb a hard requirement.

I don't know the exact usecase he was thinking, yet gut feeling
suggests that my earlier suggestion [1] should work for everyone -
Dave, Matt, Marek, etc.
If the concern is writing the code - I can help ;-)



I care *significantly* less about the build against 1.12, run against
1.13 case than I do about getting back to the point where I don't have
to carry around these patches to build mesa (otherwise it is just a
matter of time before I accidentally push them just because I needed
them to test whatever it was that I was intending to push ;-)

If someone wants to build on top of this and make something more
fancy, by all means.  But I really would like to push something that
removes the 1.13 dependency like today(ish), whether that be this
patchset or reverting the patches that added the 1.13 dependency and
trying again later.


FWIW, I'd like to see this sooner rather than later too.  I spent 
several hours yesterday trying to update our build script to 
build/install XCB 1.13 on Fedora, Ubuntu, etc. without totally succeeding.


-Brian


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Rob Clark
On Wed, Mar 14, 2018 at 10:29 AM, Emil Velikov  wrote:
> On 14 March 2018 at 13:04, Rob Clark  wrote:
>> From: Dave Airlie 
>>
>> I'm not sure everyone wants to be updating their dri3 in a forced
>> march setting, this allows a nicer approach, esp when you want
>> to build on distro that aren't brand new.
>>
>> I'm sure there are plenty of ways this patch could be cleaner,
>> and I've also not built it against an updated dri3.
>>
>> For meson I've just left it alone, since if you are using meson
>> you probably don't mind xcb updates, and if you are using meson
>> you can fix this better than me.
>>
>> v3: just don't put a version in for dri3/present without
>> modifiers, should allow building with 1.11 as well
>> v4: small fix to meson build
>>
>> (feel free to supply meson followups)
>>
> IIRC Matt seemed also on board with making the new xcb a hard requirement.
>
> I don't know the exact usecase he was thinking, yet gut feeling
> suggests that my earlier suggestion [1] should work for everyone -
> Dave, Matt, Marek, etc.
> If the concern is writing the code - I can help ;-)
>

I care *significantly* less about the build against 1.12, run against
1.13 case than I do about getting back to the point where I don't have
to carry around these patches to build mesa (otherwise it is just a
matter of time before I accidentally push them just because I needed
them to test whatever it was that I was intending to push ;-)

If someone wants to build on top of this and make something more
fancy, by all means.  But I really would like to push something that
removes the 1.13 dependency like today(ish), whether that be this
patchset or reverting the patches that added the 1.13 dependency and
trying again later.

BR,
-R
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] autotools+dri3: allow building against older xcb (v4)

2018-03-14 Thread Emil Velikov
On 14 March 2018 at 13:04, Rob Clark  wrote:
> From: Dave Airlie 
>
> I'm not sure everyone wants to be updating their dri3 in a forced
> march setting, this allows a nicer approach, esp when you want
> to build on distro that aren't brand new.
>
> I'm sure there are plenty of ways this patch could be cleaner,
> and I've also not built it against an updated dri3.
>
> For meson I've just left it alone, since if you are using meson
> you probably don't mind xcb updates, and if you are using meson
> you can fix this better than me.
>
> v3: just don't put a version in for dri3/present without
> modifiers, should allow building with 1.11 as well
> v4: small fix to meson build
>
> (feel free to supply meson followups)
>
IIRC Matt seemed also on board with making the new xcb a hard requirement.

I don't know the exact usecase he was thinking, yet gut feeling
suggests that my earlier suggestion [1] should work for everyone -
Dave, Matt, Marek, etc.
If the concern is writing the code - I can help ;-)

HTH
Emil

[1] https://lists.freedesktop.org/archives/mesa-dev/2018-March/188554.html
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev