[Xcb] How can I increase the maximum request length?

paul ewing pcewing at outlook.com
Wed Jan 30 21:25:59 UTC 2019


I was able to get this to work in my application but couldn't come up with a
clean way to provide the functionality in the existing xcb functions.

It's not just the xcb_image_put request that needs to be split up. Separate
images have to be created via multiple calls to xcb_image_create and a call to
xcb_image_put has to be made for each image.

I suppose that xcb_image_put could detect if the image is too large and split
the image up internally but then you have the problem Bart mentioned where
there are multiple cookies to track each request and it's unclear what to
return.

- Paul
________________________________
From: Bart Massey <bart at cs.pdx.edu>
Sent: Wednesday, January 30, 2019 11:35 AM
To: Uli Schlachter
Cc: paul ewing; xcb at lists.freedesktop.org
Subject: Re: [Xcb] How can I increase the maximum request length?

Uli: Thanks for looking at this more closely and confirming my earlier analysis!

> Worse, it cannot (easily) support splitting up huge requests. It returns
the void cookie that is used by the request. If it generates multiple
requests, which of the cookies should be returned?

Could maybe just force all but the last cookie and return that. Return the error cookie if one of the earlier requests fails. Loses the async, but is call-compatible.

Probably better to add another entry point that returns all the cookies as needed.

On Wed, Jan 30, 2019 at 4:31 AM Uli Schlachter <psychon at znc.in<mailto:psychon at znc.in>> wrote:
Hi,

On 19.01.19 03:51, paul ewing wrote:
> Ah, I think the previous email I linked to may have simply been wrong. It
> states that BIG-REQUESTS increases the max request size to 16GB from 256KB but
> I think the maximum is actually only 16MB.

The maximum request length is determined by the X11 server. Without
BIG-REQUESTS, the X11 server can announce support for at most 256 KiB,
but it can also support less. BIG-REQUESTS only changes this so that the
X11 server *can* support bigger requests. However, the limit is still
imposed by the X11 server and any overly large requests cause the
connection to be terminated. So no, you cannot increase the limit.

Also, XCB automatically uses the BIG-REQUESTS extension to query the
maximum supported request size. So, you can just use
xcb_get_maximum_request_length() to query the limit that the X11 server
announces. Splitting huge requests into smaller chunks is something that
libxcb does not do for you.

> I'll split up the image in the application code for now and see if I can come
> up with a clean implementation before submitting a pull request to xcb.

Possibly helpful pointer:
https://gitlab.freedesktop.org/cairo/cairo/commit/51435eeb0c4d9e53d76dae8b5af279ad518a05f8

> ________________________________
> From: Bart Massey <bart at cs.pdx.edu<mailto:bart at cs.pdx.edu>>
> Sent: Friday, January 18, 2019 5:39 PM
> To: paul ewing
> Cc: xcb at lists.freedesktop.org<mailto:xcb at lists.freedesktop.org>
> Subject: Re: [Xcb] How can I increase the maximum request length?
>
> Offhand, looks like your bigger display is too big to use a single PutImage request even with BIG-REQUESTS enabled. Looks like xcb_image_put() doesn't break the request into pieces for you (maybe it should? pull requests welcome) so you'll have to put the image a piece at a time: break it into bands and use the y offset.

>From a quick look: xcb_image_put() does not break requests into smaller
chunks. It just calls xcb_put_image() with some values it got out of the
xcb_image_t*.

Worse, it cannot (easily) support splitting up huge requests. It returns
the void cookie that is used by the request. If it generates multiple
requests, which of the cookies should be returned?

https://sources.debian.org/src/xcb-util-image/0.4.0-1/image/xcb_image.c/?hl=448#L448

Cheers,
Uli
--
Homophobia - The fear that another man will treat you the way you treat
women.
_______________________________________________
Xcb mailing list
Xcb at lists.freedesktop.org<mailto:Xcb at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/xcb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xcb/attachments/20190130/484581ca/attachment-0001.html>


More information about the Xcb mailing list