Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFX : Support large screens #2087

Merged
merged 4 commits into from
Jan 5, 2022
Merged

Conversation

matt335672
Copy link
Member

Fixes #2068

Many thanks to @trishume for supplying the greater part of this code.

There are two commits in this code. The first makes the max size for a fastpath surface update PDU potentially much bigger if the client has a large display. This approach is taken by freerdp, and has already been validated as part of #2068. An upper limit is placed on this value to prevent runaway memory allocations.

The second is a patch supplied by @trishume. This patch also depends on a change to the librfxcodec repository, as the interface between the two packages has altered. I've tested this patch on my own setup by setting the max size for the fastpath update PDU to a small value (1MB).

@metalefty
Copy link
Member

This patch also depends on a change to the librfxcodec repository, as the interface between the two packages has altered.

So the version of librfxcodec and xrdp must sync?

@matt335672
Copy link
Member Author

Yes - the package versions need to sync.

The way this works (if my understanding of git submodules is correct) is that the change gets made to librfxcodec, and then the librfxcodec commit is added in to the main project by making a commit in that repository.

@matt335672
Copy link
Member Author

I found a small memory over-allocation in the RFX encoder setup, but this is now also fixed. I've also merged in a small change to librfxcodec which calculates the maximum tile size in a more explicit manner.

Barring the as-yet-unduplicated problem that @RolKau has reported in #2068 (which we can look at later) I think this is ready for v0.9.18. More testing still welcome.

@Nexarian
Copy link
Contributor

On comment -- You've included limits.h in some of the files, yet still hard code numbers like 1024 and 16384 -- I understand those numbers aren't in limits.h, but they still feel pretty standard to me. I wonder if we should create an "XRDP_LIMITS.H" file or some sort that has all of these included so we don't need to continue to be so verbose.

@matt335672
Copy link
Member Author

Thanks.

Explicit constants from MS specs (e.g. [MS-RPBCGR]) should be in an include file which has the name name as the spec. There's also xrdp_constants.h where we can put things which don't belong there, if we feel there's a need.

Are you referring to the 16384 in this line?

result = x_tiles * y_tiles * 16384;

I can be more explicit about this value if you like. It's taken from this snippet in FreeRDP:-

https://github.com/FreeRDP/FreeRDP/blob/98348ef62aff75a26ee2824b96a8a196de63f273/libfreerdp/core/capabilities.c#L2495-L2510

essentially it's allowing 32 bits for each pixel of a 64x64 tile.

@metalefty metalefty added this to the v0.9.18 milestone Jan 5, 2022
@matt335672 matt335672 merged commit ec44055 into neutrinolabs:devel Jan 5, 2022
@matt335672 matt335672 deleted the issue2064 branch January 5, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault when writing lots of glyphs with RemoteFX codec
3 participants