-
-
Notifications
You must be signed in to change notification settings - Fork 405
Amlogic DRM support #1927
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
Merged
Merged
Amlogic DRM support #1927
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comment on lines
+332
to
+432
| switch (fmt) | ||
| { | ||
| case PixelFormat::NV12: | ||
| { | ||
| // Pack tightly: Y then interleaved UV | ||
| auto const y_stride = (uint32_t)w; | ||
| auto const uv_stride = (uint32_t)w; // interleaved, one byte per pixel on luma grid | ||
|
|
||
| PlaneInfo y{}; | ||
| y.bpp = 8; | ||
| y.width = w; | ||
| y.height = h; | ||
| y.stride = (int)y_stride; | ||
| y.fbPlaneIdx = 0; | ||
| y.srcBaseOffset = fb->offsets[y.fbPlaneIdx]; | ||
| y.dstBaseOffset = 0; | ||
| planes.push_back(y); | ||
|
|
||
| PlaneInfo uv{}; | ||
| uv.bpp = 16; // two 8-bit chroma bytes per 2 luma samples horizontally | ||
| uv.width = DIV_ROUND_UP(w, 2); | ||
| uv.height = DIV_ROUND_UP(h, 2); | ||
| uv.stride = (int)uv_stride; | ||
| uv.fbPlaneIdx = 1; | ||
| uv.srcBaseOffset = fb->offsets[uv.fbPlaneIdx]; | ||
| uv.dstBaseOffset = (size_t)w * (size_t)h; | ||
| planes.push_back(uv); | ||
|
|
||
| totalSize = (uint32_t)((w * h) + (w * h) / 2); | ||
| return true; | ||
| } | ||
|
|
||
| #ifdef DRM_FORMAT_NV21 | ||
| case PixelFormat::NV21: | ||
| { | ||
| // Identical plane sizes to NV12; chroma order is VU (handled by resampler) | ||
| auto const y_stride = (uint32_t)w; | ||
| auto const uv_stride = (uint32_t)w; | ||
|
|
||
| PlaneInfo y{}; | ||
| y.bpp = 8; | ||
| y.width = w; | ||
| y.height = h; | ||
| y.stride = (int)y_stride; | ||
| y.fbPlaneIdx = 0; | ||
| y.srcBaseOffset = fb->offsets[y.fbPlaneIdx]; | ||
| y.dstBaseOffset = 0; | ||
| planes.push_back(y); | ||
|
|
||
| PlaneInfo vu{}; | ||
| vu.bpp = 16; | ||
| vu.width = DIV_ROUND_UP(w, 2); | ||
| vu.height = DIV_ROUND_UP(h, 2); | ||
| vu.stride = (int)uv_stride; | ||
| vu.fbPlaneIdx = 1; | ||
| vu.srcBaseOffset = fb->offsets[vu.fbPlaneIdx]; | ||
| vu.dstBaseOffset = (size_t)w * (size_t)h; | ||
| planes.push_back(vu); | ||
|
|
||
| totalSize = (uint32_t)((w * h) + (w * h) / 2); | ||
| return true; | ||
| } | ||
| #endif | ||
|
|
||
| #ifdef DRM_FORMAT_P030 | ||
| case PixelFormat::P030: | ||
| { | ||
| // 10-bit semi-planar: Y in 16-bit words, UV packed 2x10b per 2 luma pixels => 32b per pair | ||
| auto const y_stride = (uint32_t)(w * 2); | ||
| auto const uv_stride = (uint32_t)(w * 2); // (w/2)*4 bytes == 2*w bytes | ||
|
|
||
| PlaneInfo y{}; | ||
| y.bpp = 16; | ||
| y.width = w; | ||
| y.height = h; | ||
| y.stride = (int)y_stride; | ||
| y.fbPlaneIdx = 0; | ||
| y.srcBaseOffset = fb->offsets[y.fbPlaneIdx]; | ||
| y.dstBaseOffset = 0; | ||
| planes.push_back(y); | ||
|
|
||
| PlaneInfo uv{}; | ||
| uv.bpp = 32; | ||
| uv.width = DIV_ROUND_UP(w, 2); | ||
| uv.height = DIV_ROUND_UP(h, 2); | ||
| uv.stride = (int)uv_stride; | ||
| uv.fbPlaneIdx = 1; | ||
| uv.srcBaseOffset = fb->offsets[uv.fbPlaneIdx]; | ||
| uv.dstBaseOffset = (size_t)w * (size_t)h * 2; | ||
| planes.push_back(uv); | ||
|
|
||
| totalSize = (uint32_t)((size_t)w * (size_t)h * 3); // Y(2*w*h) + UV(w*h) | ||
| return true; | ||
| } | ||
| #endif | ||
|
|
||
| default: | ||
| errorString = QString("Broadcom SAND: unsupported PixelFormat %1") | ||
| .arg(QSTRING_CSTR(pixelFormatToString(fmt))); | ||
| return false; | ||
| } |
Check notice
Code scanning / CodeQL
Long switch case Note
Switch has at least one case that is too long: .
NV21 (62 lines)
Error loading related location
Loading | return getScreenSize(getDeviceName()); | ||
| } | ||
|
|
||
| static QSize findActiveCrtcSize(int drmfd, const drmModeConnector* connector) |
Check notice
Code scanning / CodeQL
Unused static function Note
Static function findActiveCrtcSize is unreachable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
✨ Added
🔧 Changed
Amlogic grabber - Support to switch between DRM & FB-DEV for CoreElec New Order version
Web UI: Update panel title uses "Hyperion - "; skip showing the "nightly" tag in releases list
Screen grabbers: Commonized base with getDeviceName/getInputDeviceDetails; explicit constructors; improved error handling
Framebuffer grabber: Internal cleanup, consistent device naming, safer mmap usage
Logger internals: use smart pointers and clean-ups
Fixes:
🗑️ Removed
Technical
What kind of change does this PR introduce? (check at least one)
If changing the UI of web configuration, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing setups:
The PR fulfills these requirements:
Fixes: #xxx[,#xxx], where "xxx" is the issue number)If adding a new feature, the PR's description includes:
PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information: