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

RetroPlayer: Zero-copy support #14149

Merged
merged 4 commits into from Jul 7, 2018

Conversation

@garbear
Copy link
Member

commented Jul 5, 2018

Zero-copy support was added to the Game API in #13976 and to the libretro wrapper in kodi-game/game.libretro#43. This extends zero-copy support to RetroPlayer.

Zero-copy allows the core to render directly into video memory, avoiding the extra bandwidth cost incurred by an additional memory copy on the CPU.

Description

Zero-copy support is opt-in for the core by calling the RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER libretro environment command each frame. This command returns a preallocated framebuffer that the core can use to write video memory.

Motivation and Context

Needed to fully enable zero-copy after GBM rendering was added in #14079.

How Has This Been Tested?

Tested with https://github.com/kodi-game/game.libretro.vram-test, a sample add-on that renders a checkerboard pattern to a zero-copy buffer.

Screenshots (if appropriate):

VRAM Test add-on:

vram-test-addon

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

TODO

  • Fix strict aliasing warnings

@garbear garbear added this to the Leia 18.0-alpha3 milestone Jul 5, 2018

@garbear garbear force-pushed the garbear:rp-zero-copy branch from 17fa68e to b658181 Jul 5, 2018

@garbear

This comment has been minimized.

Copy link
Member Author

commented Jul 5, 2018

MMAL renderer needs some non-trivial changes to work with this change. As it's currently dead code I intend to remove it before final, so I'm accelerating #13727 to get this PR in.

@garbear garbear force-pushed the garbear:rp-zero-copy branch from b658181 to 3c3b53e Jul 5, 2018

garbear added 3 commits Jun 23, 2018
RetroPlayer: Encapsulate render buffer size calculation
This moves the render buffer size calculation to the sysmem render buffer.
Comparisons involving buffer size are now done using dimensions.

@garbear garbear force-pushed the garbear:rp-zero-copy branch from 3c3b53e to dac0164 Jul 5, 2018

@garbear

This comment has been minimized.

Copy link
Member Author

commented Jul 5, 2018

Merged #13727. jenkins build this please

@lrusak

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2018

Tested and working with GBM! Thanks so much!

@garbear garbear force-pushed the garbear:rp-zero-copy branch from dac0164 to cf5e540 Jul 6, 2018

@garbear

This comment has been minimized.

Copy link
Member Author

commented Jul 6, 2018

jenkins build this please

@garbear garbear merged commit 3adf269 into xbmc:master Jul 7, 2018

1 check passed

default You're awesome. Have a cookie
Details

@garbear garbear deleted the garbear:rp-zero-copy branch Jul 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.