Skip to content

Development/compositorclient multi client rendering#325

Merged
MFransen69 merged 26 commits intomasterfrom
development/compositorclient-multi-client-rendering
Feb 9, 2026
Merged

Development/compositorclient multi client rendering#325
MFransen69 merged 26 commits intomasterfrom
development/compositorclient-multi-client-rendering

Conversation

@bramoosterhuis
Copy link
Contributor

@bramoosterhuis bramoosterhuis commented Jan 5, 2026

This PR improves compositor client reliability and adds comprehensive testing infrastructure:

Key Changes:

  1. Connection validation - Compositor::IDisplay::Instance() now returns nullptr when the remote compositor connection fails, allowing applications to handle connection failures gracefully instead of crashing.

  2. Test infrastructure - Added complete client rendering test suite including:

    • Standalone test application with terminal controls
    • Thunder plugin wrapper for automated testing
    • Common rendering library with texture loading, text rendering, and bouncing logo demo
    • Font rendering support with included Arial font atlas
  3. Buffer lifecycle management - Improved buffer acquisition/release semantics with proper state tracking. The client now correctly signals when new frames are presented vs when the same frame is being re-composited.

  4. Enhanced error handling - Replaced fprintf debugging with proper TRACE macros for consistent logging. Added dedicated BufferInfo and BufferError trace categories for fine-grained buffer operation debugging.

  5. GBM surface integration - Proper handling of gbm_surface_lock_front_buffer() timing and orphaned buffer cleanup. Added detailed trace logging for buffer pool management.

Testing Features:

  • Interactive controls (space=pause, q=quit, arrow keys=speed control)
  • FPS counter and performance metrics
  • Multiple rendering modes (bouncing texture, text rendering)
  • Works as both standalone application and Thunder plugin

This PR works in conjunction with ThunderNanoServices PR rdkcentral/ThunderNanoServices#949 to resolve compositor synchronization issues.


@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/ThunderClientLibraries/325/rdkcentral/ThunderClientLibraries

  • Commit: 133b659

Report detail: gist'

png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, PngErrorFn, PngWarnFn);
if (!png) { fclose(fp); return result; }

png_infop info = png_create_info_struct(png);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bramoosterhuis : This code from l.45-l.72 is coming up as a good match to several components, some with nasty licenses. Where did it come from? If it is a straight copy, it may need credit depending on the source.
On the other hand, if you wrote it yourself, you can defend that this is boilerplate usage of libpng. Line 62 could then do with a longer comment so it is clear that you know what you are doing and it has to be this way. You could also refer to http://www.libpng.org/pub/png/libpng-manual.txt before line 45 and say that you are following the instructions therein.
Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mhughesacn,

This code was written independently following the official libpng documentation (http://www.libpng.org/pub/png/libpng-manual.txt, Section III.2), not copied from GPL sources. The transformation sequence is standard boilerplate for normalizing any PNG format to RGBA8.

I've added comprehensive documentation: a reference to libpng-manual.txt before line 45, an expanded comment at line 62 explaining the transformation pipeline, and inline comments for each transformation showing intent and understanding.

The similarity to other projects is expected - this is the standard approach documented in the official libpng manual for format normalization.

Happy to provide additional details if needed.

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/ThunderClientLibraries/325/rdkcentral/ThunderClientLibraries

  • Commit: 133b659

Report detail: gist'

@rdkcmf-jenkins
Copy link
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 1 file pending identification.

  • Protex Server Path: /home/blackduck/github/ThunderClientLibraries/325/rdkcentral/ThunderClientLibraries

  • Commit: b934c14

Report detail: gist'

@mhughesacn
Copy link

Thank you @bramoosterhuis : I have cleared off the match in blackduck (not in the PR), but my apologies, I missed this last night: where did ml-tv-color-small.png come from?

@bramoosterhuis
Copy link
Contributor Author

bramoosterhuis commented Jan 6, 2026

Thank you @bramoosterhuis : I have cleared off the match in blackduck (not in the PR), but my apologies, I missed this last night: where did ml-tv-color-small.png come from?

No problem @mhughesacn! To be fully transparent: I originally created ml-tv-color-small.png for the Mesa renderer tests in ThunderNanoServices and reused it here. It's a test pattern inspired by the Metrological logo designed to verify color channel rendering.

@mhughesacn
Copy link

Perfect - thank you @bramoosterhuis - cleared the downvote in the PR.

MFransen69
MFransen69 previously approved these changes Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bramoosterhuis : Sorry if I missed this last month, but where does this image come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was generated by me using the tool at https://evanw.github.io/font-texture-generator/. The generator tool itself is CC0 (public domain): https://creativecommons.org/publicdomain/zero/1.0/. The resulting PNG doesn't appear to be licensed, but if this is an issue I can create my own SDF font atlas in GIMP.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great Bram. I think it is reasonable to include the generated image under our default Apache license as a data file. Thank you!

MFransen69
MFransen69 previously approved these changes Feb 5, 2026
MFransen69
MFransen69 previously approved these changes Feb 8, 2026
@MFransen69
Copy link
Contributor

Approved but cannot merge as "Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)" is failing some builds

Use relative path for ThunderClientLibraries workflow reference

Changed from absolute repository reference (@master) to relative path
(./.github/workflows/) for the ThunderClientLibraries build template.

Problem: The previous @master reference always pulled the workflow from
the master branch, even during PR builds. This created a chicken-and-egg
situation where workflow changes (like adding build dependencies) couldn't
be tested in PRs before merging to master.

Solution: Using a relative path automatically references the workflow
from the same commit that triggered the build. This means:
- PRs test with the PR's version of the workflow template
- Pushes to master use master's version of the workflow template
- No dynamic expression workarounds needed

This allows proper testing of workflow changes (such as the libpng-dev
dependency addition) within PRs before merging.

Note: Thunder and ThunderInterfaces jobs remain with @master references
since they reference external repositories.
@bramoosterhuis
Copy link
Contributor Author

@VeithMetro FYI: I updated the workflow to use relative paths for the reusable workflow reference. This allows PRs to test with their own version of the build template instead of always using master. Now we can properly test workflow changes (like adding build dependencies) before merging.

@MFransen69 MFransen69 merged commit 956889f into master Feb 9, 2026
47 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2026
@MFransen69 MFransen69 deleted the development/compositorclient-multi-client-rendering branch February 9, 2026 15:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants