Skip to content

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.

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.

4 participants