summaryrefslogtreecommitdiff
path: root/kms++/src
AgeCommit message (Collapse)Author
2026-05-11card: Add support for writeback connectorswritebackLaurent Pinchart
Enable enumeration of writeback connectors if both libdrm and the device support it. The new Card::has_writeback() method report if the card support writeback connectors. Existing code that expect all connectors to model an output may be confused by the sudden availability of new connectors. To handle this issue, - add a KMSXX_DISABLE_WRITEBACK_CONNECTORS environment variable to disable enumeration of writeback connectors, similarly to universal planes ; and - ignore writeback connectors where no specific connector is requested (Card::get_first_connected_connector(), ResourceManager::reserve_connector() if no connector name is specified, and applications that use all connected outputs). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2026-05-08kms++: Add ABGR1555, ABGR4444, XBGR1555, and XBGR4444Tomi Valkeinen
2026-05-08kms++: Update pixel formats to latest upstreamTomi Valkeinen
2026-04-30kms: Drop unused includesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2026-04-30Drop libfmtTomi Valkeinen
We can use std::format() and a custom print() wrapper with C++20. When moving to C++23, we can drop the wrapper. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2026-03-20DumbFramebuffer: Fix plane size calculations for multiplane formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-12-18fix: Resolve variable shadowing warningsTomi Valkeinen
Fix cppcheck shadowVariable and shadowArgument warnings by renaming local variables to avoid conflicts: - Rename 'ob' to 'prop' in property creation loop in card.cpp - Rename loop variable 'y_offset' to 'y_off' in conv-yuv-semiplanar.h - Rename local 'y' to 'y_val' in SMPTE pattern generator in testpat.cpp - Rename 'is_last' to 'child_is_last' in entry printing in kmsprint.cpp These changes eliminate naming conflicts while preserving functionality and improving code clarity.
2025-12-18perf: Pass parameters by const reference to avoid copiesTomi Valkeinen
Fix cppcheck performance warnings by passing function parameters by const reference instead of by value, preventing unnecessary copies: - string parameters in open_device_by_path() - set<Connector*> parameters in connector finder functions - vector parameter in FlipState constructor - range variable in kmscapture loop These changes improve performance by avoiding object copies while maintaining the same functionality.
2025-12-18fix: Replace C-style casts with C++ static/reinterpret castsTomi Valkeinen
C-style casts should be replaced with appropriate C++ cast operators for better type safety and code clarity. This change fixes cppcheck style warnings about C-style pointer casting by using: - static_cast for simple pointer type conversions - reinterpret_cast for memory buffer pointer arithmetic The changes maintain identical functionality while following modern C++ best practices for explicit casting.
2025-09-08pixelformats: Add missing RAW 16 formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-08-07plane: Add support to deal with raw fourccsTomi Valkeinen
2025-08-07framebuffer: Add support to deal with raw fourccsTomi Valkeinen
2025-04-26dmabuffb: Add missing includeTomi Valkeinen
2025-04-26dmabuffb: dup() the fdsTomi Valkeinen
Use dup() on the given fds, and take ownership of them. close() at destructor. Fixes: #46
2025-04-22Fix a few clang warningsTomi Valkeinen
2025-03-28kmstest: Support format names in addition to fourccTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: Pull in formats from pixutilsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: Switch to non-fourcc PixelFormat enumTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26Use the fourcc helpersTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: clean fourcc managementTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2025-03-26PixelFormats: New PixelFormatInfo codeTomi Valkeinen
New pixel format code, from Python pixutils library. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2023-09-12connector: Add writeback, SPI, and USB connector type stringsDave Stevenson
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2022-12-22Code formatting fixesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2022-12-18kms++: PixelFormats: Add Y21x formatsTomi Valkeinen
Add Y210, Y212, Y216 pixel formats. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
2022-12-18kms++: PixelFormats: Fix formattingTomi Valkeinen
Fix formatting for some pixel formats. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-04kmsprint: Decode bitfields for flags and type of hdmi modeDom Cobley
Decode the bitfields for the mode type and flags of Videomode Use short names for type as it allows for consise formatting (excluding the deprecated options, that are not expected to be seen) I've swapped order of flags and types as the type is expected to be shorted so can fit in a fixed size field Signed-off-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
2022-11-01kmsxx: Also report format of framebufferDom Cobley
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
2021-07-19framebuffer: Support partial flushingNoralf Trønnes
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
2020-12-03crtc: add legacy gamma setTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-12-03atomicreq: throw on non-existing propertyTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-12-01Fix clang-tidy reported issuesTomi Valkeinen
2020-10-09Bulk format of all filesTomi Valkeinen
2020-10-09dmabuffb: add constructor which takes in string fourccTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-10-02Small Property improvementsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-09-29Fix Plane::get_possible_crtcsTomi Valkeinen
Looks like RPi gives 0xff as possible_crtcs, even if there's only one crtc. The current code throws an exception in that case. Fix this by just ignoring non-existent possible crtcs. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for missing 8 -and 16-bit RGB formatsLaurent Pinchart
Add support for the RGB332, XRGB1555 and XRGB4444 formats to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for the planar YUV formatsLaurent Pinchart
Add support for the 6 planar YUV formats (YUV and YVU, combined with 420, 422 or 444 subsampling) to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for semiplanar YUV422 formats (NV16 and NV61)Laurent Pinchart
Add support for the NV16 and NV61 pixel formats to the PixelFormat class, the Python API, and the drawing utilities. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10dumbfb: Fix pitch for tri-planar formatsLaurent Pinchart
The BO pitches are unconditionally set to the frame buffer pitch, for all planes. This is correct for semiplanar YUV formats, as they subsample chroma horizontally by two but combined U and V in a single plane, cancelling each other. For fully planar YUV formats, however, the horizontal subsampling need to be taken into account to compute the pitch. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10dumbfb: Add support tri- or quadri-planar buffersLaurent Pinchart
The DumbFrameBuffer class supports up to 4 planes, as required by the DRM/KMS API, but only considers planes 0 and 1 when constructing the buffer. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10card: Rename has_has_universal_planes to has_universal_planesLaurent Pinchart
The has_has_universal_planes() method name includes a typo, fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10card: Add a method to retrieve the device minorLaurent Pinchart
The device minor number is needed to access the debugfs directory corresponding to the device. Make it available to users through a dev_minor() method on the Card object. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-05-28card: add factory function for selecting card by nameMatt Hoosier
Uses drmOpen() to do the heavy lifting.
2020-05-28card: add constructor for pre-opened FDMatt Hoosier
This is an escape hatch to let the user do whatever crazy thing he wants to obtain the DRM fd. This could be from a DRM lease, an FD passed across a Wayland protocol request, something calculated by manually walking across the set of DRI cards and selecting specific criteria, etc.
2020-05-15kmstest: allow enabling output without anything connectedTomi Valkeinen
Allow kmstest to enable an output without anything connected, if the user gives a videomode. DRM framework allows this, and is needed for testing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-11-18Allow making extframebuffer and dmabufframebuffer with modifiersMatt Hoosier
Many GPUs use bandwidth compression or tiling, and this information must be passed along to KMS when constructing the framebuffer object around the GEM handle or prime filedescriptor. Add an vector of modifiers as an optional parameter to both of these classes. Bump the minimum required version of libdrm to 2.4.17 to ensure drmModeAddFB2WithModifiers() is available. Signed-off-by: Matt Hoosier <matt.hoosier@garmin.com>
2019-11-18fbs: use std::array and .at()Tomi Valkeinen
Use std::array and .at() to get bounds checking. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-11-18fbs: check params and ensure drmModeAddFB2 is passed correctly sized arraysTomi Valkeinen
Check that parameter vectors are of the same size, and match the number of planes. Extend the vectors to 4, as drmModeAddFB2() expects to get arrays of 4 elements. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reported-by: Matt Hoosier <matt.hoosier@garmin.com>
2019-11-06kms++: modernize deprecated headersTomi Valkeinen
2019-11-06card: remove useless constsTomi Valkeinen